4e9337034163188885edc409d6e46eb1511e9b9b
[openwrt.git] / toolchain / gcc / patches / 4.3.3+cs / 000-codesourcery_2009q1_203.patch
1 --- /dev/null
2 +++ b/ChangeLog.csl
3 @@ -0,0 +1,7077 @@
4 +2009-05-21 Paul Brook <paul@codesourcery.com>
5 +
6 + Issue #5545
7 + gcc/
8 + * config/arm/arm.md (ifcompare_neg_move): Disable when
9 + TARGET_NO_SINGLE_COND_EXEC.
10 +
11 +2009-05-20 Joseph Myers <joseph@codesourcery.com>
12 +
13 + Issue #5399
14 +
15 + gcc/
16 + * config/mips/mips.md (sqrt<mode>2): Condition on
17 + <sqrt_condition>.
18 +
19 +2009-05-20 Maciej W. Rozycki <macro@codesourcery.com>
20 +
21 + Issue #5448
22 + gcc/
23 + * config/mips/predicates.md (const_call_insn_operand): Correct the
24 + condition used for -call_nonpic support.
25 +
26 + * release-notes-csl.xml (Compiler performance bug fix): New.
27 +
28 +2009-05-12 Maxim Kuvyrkov <maxim@codesourcery.com>
29 +
30 + * ChangeLog.csl: Add changelog for the previous commit.
31 + gcc/
32 + * configure: Regenerate with proper autoconf version.
33 +
34 +2009-05-12 Maxim Kuvyrkov <maxim@codesourcery.com>
35 +
36 + gcc/
37 + * common.opt (feglibc): New dummy option.
38 + * opts.c (common_handle_option): Handle it.
39 + * config.gcc: Handle 'eglibc' vendor.
40 + * config/t-eglibc: Define multilibs for testing EGLIBC features.
41 + * configure.ac (--with-eglibc-configs, EGLICB_CONFIGS): New option and
42 + variable.
43 + * configure: Regenerate.
44 + * Makefile.in (EGLIBC_CONFIGS): Handle
45 +
46 +2009-05-08 Nathan Sidwell <nathan@codesourcery.com>
47 +
48 + Issue 5335
49 + gcc/
50 + * class.c (resolve_address_of_overloaded_function): Use
51 + OVL_CURRENT for error.
52 + (instantiate_type): Allow FUNCTION_DECL when ms_extensions are
53 + active. Don't copy the rhs node. Delete COMPOUND_EXPR code.
54 + * typeck.c (build_compound_expr): Check RHS has known type.
55 +
56 + gcc/testsuite/
57 + * g++.dg/ext/ms-1.C: New.
58 + * g++.old-deja/g++.other/overload11.C: Adjust.
59 +
60 + * release-notes-csl.xml: Add two notes.
61 +
62 +2009-04-22 Maxim Kuvyrkov <maxim@codesourcery.com>
63 +
64 + gcc/testsuite/
65 + * gcc.dg/tls/alias-1.c: Fix check for TLS.
66 +
67 +2009-04-22 Maxim Kuvyrkov <maxim@codesourcery.com>
68 +
69 + Issue #5106
70 + Issue #4768
71 +
72 + gcc/testsuite/
73 + * gcc.dg/falign-labels-1.c (dg-options): Don't set for m68k and fido.
74 +
75 +2009-04-21 Andrew Jenner <andrew@codesourcery.com>
76 +
77 + gcc/testsuite/
78 + * gcc.dg/pr34856.c: Handle powerpc*-*-elf.
79 +
80 +2009-04-21 Andrew Jenner <andrew@codesourcery.com>
81 +
82 + gcc/testsuite/
83 + * lib/target-supports.exp: Handle powerpc-*-elf.
84 +
85 +2009-04-21 Maxim Kuvyrkov <maxim@codesourcery.com>
86 +
87 + gcc/testsuite/
88 + * gcc.target/m68k/tls-ld.c, gcc.target/m68k/tls-le.c,
89 + * gcc.target/m68k/tls-ld-xgot-xtls.c, gcc.target/m68k/tls-gd-xgot.c,
90 + * gcc.target/m68k/tls-ie-xgot.c, gcc.target/m68k/tls-ld-xgot.c,
91 + * gcc.target/m68k/tls-ld-xtls.c, gcc.target/m68k/tls-le-xtls.c,
92 + * gcc.target/m68k/tls-gd.c, gcc.target/m68k/tls-ie.c: Remove -mcpu=5475
93 + setting, run only for *-linux-* target.
94 +
95 +2009-04-15 Daniel Jacobowitz <dan@codesourcery.com>
96 +
97 + Revert (moved to scripts):
98 +
99 + 2009-04-10 Maxim Kuvyrkov <maxim@codesourcery.com>
100 +
101 + Issue #693
102 +
103 + gcc/
104 + * config/arm/linux-eabi.h (TARGET_UNWIND_TABLES_DEFAULT): Define
105 + to true.
106 +
107 +2009-04-13 Kazu Hirata <kazu@codesourcery.com>
108 +
109 + gcc/testsuite/
110 + * gcc.dg/promote-short-3.c: XFAIL on fido.
111 +
112 +2009-04-10 Daniel Jacobowitz <dan@codesourcery.com>
113 +
114 + gcc/testsuite/
115 + * gcc.dg/promote-short-3.c: Correct XFAIL syntax.
116 +
117 +2009-04-10 Maxim Kuvyrkov <maxim@codesourcery.com>
118 +
119 + Issue #693
120 +
121 + gcc/
122 + * config/arm/linux-eabi.h (TARGET_UNWIND_TABLES_DEFAULT): Define
123 + to true.
124 +
125 +2009-04-09 Sandra Loosemore <sandra@codesourcery.com>
126 +
127 + Issue #5174
128 + Backport from mainline:
129 +
130 + gcc/
131 + * doc/invoke.texi (Optimize Options): Add cross-reference to
132 + -Q --help=optimizers examples.
133 +
134 +2009-04-09 Nathan Froyd <froydnj@codesourcery.com>
135 +
136 + gcc/testsuite/
137 + * gcc.dg/promote-short-3.c: XFAIL test for x86, m68k, sh, and mips.
138 +
139 +2009-04-09 Nathan Froyd <froydnj@codesourcery.com>
140 +
141 + Issue #5186
142 +
143 + gcc/
144 + * tree-ssa-loop-promote.c (rebuild_with_promotion_1): Load a memory
145 + reference prior to promoting it.
146 +
147 + gcc/testsuite/
148 + * gcc.dg/promote-short-9.c: New test.
149 +
150 +2009-04-08 Nathan Froyd <froydnj@codesourcery.com>
151 +
152 + Issue #5171
153 +
154 + gcc/
155 + * tree-ssa-loop-promote.c (collection_promotion_candidates):
156 + Delay allocation and initialization of new promote_info until we
157 + know we have a candidate loop index.
158 +
159 +2009-04-06 Daniel Jacobowitz <dan@codesourcery.com>
160 +
161 + Backport from upstream:
162 +
163 + gcc/
164 + 2008-04-24 Uros Bizjak <ubizjak@gmail.com>
165 +
166 + PR rtl-optimization/36006
167 + * expmed.c (store_fixed_bit_field): Copy op0 rtx before moving
168 + temp to op0 in order to avoid invalid rtx sharing.
169 +
170 + gcc/testsuite/
171 + 2008-04-24 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
172 +
173 + PR rtl-optimization/36006
174 + * gfortran.dg/pr36006-1.f90: New test.
175 + * gfortran.dg/pr36006-2.f90: Ditto.
176 +
177 +2009-04-06 Paul Brook <paul@codesourcery.com>
178 +
179 + Issue #5117
180 + Partial backport from FSF.
181 +
182 + gcc/
183 + * tree-ssa-pre.c (create_expression_by_pieces): Convert to sizetype
184 + for POINTER_PLUS_EXPR.
185 +
186 +2009-04-04 Daniel Jacobowitz <dan@codesourcery.com>
187 +
188 + gcc/
189 + * gcc.c (do_self_spec): Handle switches with arguments.
190 +
191 +2009-04-04 Daniel Jacobowitz <dan@codesourcery.com>
192 +
193 + gcc/
194 + * testsuite/gcc.dg/pr34263.c: Add -fno-unroll-loops.
195 +
196 +2009-04-04 Daniel Jacobowitz <dan@codesourcery.com>
197 +
198 + gcc/
199 + * config/arm/arm.md (insv): Do not share operands[0].
200 +
201 +2009-04-04 Sandra Loosemore <sandra@codesourcery.com>
202 +
203 + Issue #5104
204 + PR tree-optimization/39604
205 +
206 + * release-notes-csl.xml (Corruption of block-scope variables):
207 + New note.
208 +
209 + gcc/testsuite
210 + * g++.dg/tree-ssa/sink-1.C: New.
211 +
212 + gcc/
213 + * tree_ssa-sink.c (sink_code_in_bb): Do not sink statements out
214 + of a lexical block containing variable definitions.
215 +
216 +2009-03-31 Andrew Jenner <andrew@codesourcery.com>
217 +
218 + gcc/testsuite/
219 + * gcc.dg/arm-g2.c: Add dg-skip-if for MontaVista.
220 + * gcc.dg/arm-scd42-2.c: Ditto.
221 +
222 +2009-03-31 Daniel Jacobowitz <dan@codesourcery.com>
223 +
224 + gcc/
225 + * common.opt (fpromote-loop-indices): Add Optimization keyword.
226 +
227 +2009-03-31 Kazu Hirata <kazu@codesourcery.com>
228 +
229 + Issue #5105
230 + gcc/testsuite/
231 + * gcc.target/m68k/pr36134.c: Use dg-skip-if to skip the testcase
232 + if there is a conflict with -mcpu=. Use -mcpu=5208.
233 +
234 +2009-03-30 Andrew Jenner <andrew@codesourcery.com>
235 +
236 + gcc/
237 + * config.gcc: Accept montavista*-, not just montavista-.
238 + * config/mips/t-montavista-linux: Add Octeon multilibs.
239 +
240 +2009-03-25 Andrew Stubbs <ams@codesourcery.com>
241 +
242 + gcc/testsuite/
243 + * gcc.dg/pragma-isr-trapa2.c: Skip test for FPU-less architectures.
244 +
245 +2009-03-24 Andrew Stubbs <ams@codesourcery.com>
246 +
247 + Backport from upstream:
248 + gcc/testsuite/
249 + 2008-02-25 Kaz Kojima <kkojima@gcc.gnu.org>
250 + * gcc.dg/tree-ssa/ssa-pre-10.c: Use -fno-finite-math-only on
251 + sh* targets.
252 +
253 +2009-03-22 Mark Mitchell <mark@codesourcery.com>
254 +
255 + Backport:
256 +
257 + libstdc++-v3/
258 + * testsuite/25_algorithms/search_n/iterator.cc: Condition
259 + iterations for simulators.
260 + * testsuite/25_algorithms/heap/moveable.cc: Likewise.
261 + * testsuite/21_strings/basic_string/inserters_extractors/char/28277.cc
262 + Condition stream width for simulators.
263 + * testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc:
264 + Likewise.
265 + * testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc:
266 + Likewise.
267 + * testsuite/ext/vstring/inserters_extractors/char/28277.cc: Likewise.
268 +
269 +2009-03-20 Mark Mitchell <mark@codesourcery.com>
270 +
271 + Issue #4403
272 +
273 + * release-notes-csl.xsml: Document compile-time performance
274 + improvement.
275 +
276 +2009-03-19 Joseph Myers <joseph@codesourcery.com>
277 +
278 + Issue #2062
279 + Issue #4730
280 +
281 + gcc/
282 + * config/arm/t-cs-linux: Add MULTILIB_MATCHES for ARMv4T -mcpu
283 + options and for -mfpu=neon-fp16. Add armv7-a-hard multilib.
284 +
285 +2009-03-19 Daniel Gutson <dgutson@codesourcery.com>
286 +
287 + Issue #4459
288 +
289 + gcc/
290 + * config/arm/t-cs-linux: Replaced armv7 by armv7-a in MULTILIB_OPTIONS
291 + and added mfpu=neon, plus the required MULTILIB_ALIASES.
292 +
293 + * release-notes.xml: Document.
294 +
295 +2009-03-19 Andrew Stubbs <ams@codesourcery.com>
296 +
297 + gcc/
298 + * config.gcc (sh-*-*): Add support for --enable-extra-sgxx-multilibs.
299 +
300 +2009-03-18 Daniel Gutson <dgutson@codesourcery.com>
301 +
302 + Issue #4753
303 +
304 + gcc/
305 + * doc/invoke.texi: Added entries for cpus ARM Cortex-M0 and Cortex-M1.
306 +
307 +2009-03-18 Sandra Loosemore <sandra@codesourcery.com>
308 +
309 + Issue #4882
310 +
311 + * release-notes-csl.xml (Better code for accessing global variables):
312 + Copy-edit. Reference updated GCC manual discussion.
313 +
314 + Applied simultaneously to mainline:
315 + gcc/
316 + * doc/invoke.texi (Code Gen Options): Expand discussion of
317 + -fno-common.
318 +
319 +2009-03-18 Kazu Hirata <kazu@codesourcery.com>
320 +
321 + gcc/
322 + * config/sparc/sparc.c (sparc_emit_float_lib_cmp): Pass a libcall
323 + SYMBOL_REF to hard_libcall_value.
324 +
325 +2009-03-17 Sandra Loosemore <sandra@codesourcery.com>
326 +
327 + Issue #4755
328 +
329 + gcc/
330 + * config/arm/arm.c (arm_emit_fp16_const): New function.
331 + * config/arm/arm-protos.h (arm_emit_fp16_const): Declare it.
332 + * config/arm/arm.md (consttable_2): Replace logic for HFmode values
333 + with assertion that they can't appear here.
334 + (consttable_4): Add HFmode case and use the new function for it.
335 +
336 +2009-03-17 Sandra Loosemore <sandra@codesourcery.com>
337 +
338 + Issue #4755
339 +
340 + Revert:
341 +
342 + 2009-01-23 Sandra Loosemore <sandra@codesourcery.com>
343 +
344 + gcc/
345 + * config/arm/arm.c (dump_minipool): Use size of mode, not padded size,
346 + in switch that controls whether to emit padding.
347 +
348 + 2009-02-05 Sandra Loosemore <sandra@codesourcery.com>
349 +
350 + gcc/
351 + * config/arm/arm.c (struct minipool_fixup): Split mode field into
352 + value_mode and ref_mode.
353 + (add_minipool_forward_ref): Use value_mode of fixup.
354 + (add_minipool_backward_ref): Likewise.
355 + (push_minipool_fix): Pass both value_mode and ref_mode as parameters,
356 + and store them in the fixup.
357 + (note_invalid_constants): Adjust arguments to push_minipool_fix.
358 + (arm_reorg): Use ref_mode of fixup.
359 +
360 +2009-03-17 Daniel Gutson <dgutson@codesourcery.com>
361 +
362 + Issue #4753
363 +
364 + gcc/
365 + * config/arm/t-cs-eabi (MULTILIB_MATCHES): Added cortex-m0 as a synonym of march=armv6-m.
366 + * config/arm/arm-cores.def: Added core cortex-m0.
367 + * config/arm/arm-tune.md ("tune"): Aded cortexm0.
368 + * config/arm/t-arm-elf (MULTILIB_MATCHES): Added cortex-m0 as a synonym of march=armv6-m.
369 + * config/arm/t-uclinux-eabi (MULTILIB_MATCHES): Added cortex-m0 as a synonym of march=armv6-m.
370 +
371 + * release-notes.csl: Document.
372 +
373 +2009-03-16 Daniel Jacobowitz <dan@codesourcery.com>
374 +
375 + gcc/
376 + * config/arm/neon-testgen.ml: Use dg-add-options arm_neon.
377 +
378 + gcc/testsuite/
379 + * gcc/target/arm/neon/: Regenerated test cases.
380 +
381 + * gcc.target/arm/neon-dse-1.c, gcc.target/arm/neon/polytypes.c,
382 + gcc.target/arm/neon-vmla-1.c, gcc.target/arm/neon-vmls-1.c,
383 + gcc.target/arm/neon-cond-1.c, gcc.dg/torture/arm-fp16-ops-8.c,
384 + gcc.dg/torture/arm-fp16-ops-7.c, g++.dg/ext/arm-fp16/arm-fp16-ops-7.C,
385 + g++.dg/ext/arm-fp16/arm-fp16-ops-8.C, g++.dg/abi/mangle-neon.C: Use
386 + dg-add-options arm_neon.
387 +
388 + * gcc.target/arm/fp16-compile-vcvt.c, gcc.dg/torture/arm-fp16-ops-5.c,
389 + gcc.dg/torture/arm-fp16-ops-6.c, g++.dg/ext/arm-fp16/arm-fp16-ops-5.C,
390 + g++.dg/ext/arm-fp16/arm-fp16-ops-6.C: Use dg-add-options arm_neon_fp16
391 + and arm_neon_fp16_ok.
392 +
393 + * gcc.dg/vect/vect.exp, g++.dg/vect/vect.exp,
394 + gfortran.dg/vect/vect.exp: Use add_options_for_arm_neon.
395 +
396 + * lib/target-supports.exp (add_options_for_arm_neon): New.
397 + (check_effective_target_arm_neon_ok_nocache): New, from
398 + check_effective_target_arm_neon_ok. Check multiple possibilities.
399 + (check_effective_target_arm_neon_ok): Use
400 + check_effective_target_arm_neon_ok_nocache.
401 + (add_options_for_arm_neon_fp16)
402 + (check_effective_target_arm_neon_fp16_ok)
403 + check_effective_target_arm_neon_fp16_ok_nocache): New.
404 + (check_effective_target_arm_neon_hw): Use add_options_for_arm_neon.
405 +
406 +2009-03-16 Daniel Jacobowitz <dan@codesourcery.com>
407 +
408 + gcc/testsuite/
409 + * lib/target-supports.exp (check_effective_target_arm_neon_ok):
410 + Correct arm_neon.h typo.
411 +
412 +2009-03-16 Sandra Loosemore <sandra@codesourcery.com>
413 +
414 + Issue #4878
415 +
416 + * release-notes-csl.xml (VFP ABI support): New note.
417 +
418 +2008-03-15 Catherine Moore <clm@codesourcery.com>
419 +
420 + Merge from Sourcery G++ 4.2:
421 +
422 + gcc/
423 + 2008-02-11 David Ung <davidu@mips.com>
424 +
425 + * config/mips/mips.c (mips_output_division): When
426 + GENERATE_DIVIDE_TRAPS, generate the trap instrutions
427 + against zero before the actual divide. This is friendlier
428 + to out-of-order cpus like the 74k.
429 +
430 +2009-03-13 Joseph Myers <joseph@codesourcery.com>
431 +
432 + Issue #2062
433 +
434 + gcc/
435 + * config/arm/t-linux-eabi: Add MULTILIB_MATCHES for ARMv4T -mcpu
436 + options.
437 +
438 +2009-03-13 Mark Mitchell <mark@codesourcery.com>
439 +
440 + Issue #3999
441 +
442 + * release-notes-csl.xml: Document.
443 + gcc/
444 + * config/arm/neon.md (*mul<mode>3add<mode>_neon): New pattern.
445 + (*mul<mode>3neg<mode>add<mode>_neon): Likewise.
446 + gcc/testsuite
447 + * gcc.dg/target/arm/neon-vmla-1.c: New.
448 + * gcc.dg/target/arm/neon-vmls-1.c: Likewise.
449 +
450 +2009-03-13 Catherine Moore <clm@codesourcery.com>
451 +
452 + gcc/
453 + * config/i386/x-mingw32 (host-mingw32.o): Replace
454 + diagnostic.h with $(DIAGNOSTIC_H).
455 +
456 +2009-03-12 Joseph Myers <joseph@codesourcery.com>
457 +
458 + Issue #4730
459 +
460 + gcc/
461 + * config/arm/t-cs-eabi: Add MULTILIB_MATCHES for -mhard-float.
462 +
463 +2009-03-12 Joseph Myers <joseph@codesourcery.com>
464 +
465 + Issue #4730
466 + Issue #4850
467 +
468 + gcc/
469 + * config/arm/t-cs-eabi: Add VFP ABI multilib. Add
470 + MULTILIB_MATCHES for -march=armv5t and -mfpu=neon-fp16.
471 +
472 +2009-03-12 Daniel Gutson <dgutson@codesourcery.com>
473 +
474 + Issue #4459
475 +
476 + gcc/
477 + * config/arm/t-cs-eabi: Replaced Thumb2 VFP multilibs by ARM VFP3 NEON.
478 + * release-notes-csl.xml: Document.
479 +
480 +2009-03-11 Nathan Froyd <froydnj@codesourcery.com>
481 +
482 + Backport from mainline:
483 +
484 + gcc/
485 + 2009-03-10 Richard Guenther <rguenther@suse.de>
486 + Nathan Froyd <froydnj@codesourcery.com>
487 +
488 + PR middle-end/37850
489 + * libgcc2.c (__mulMODE3): Use explicit assignments to form the
490 + result.
491 + (__divMODE3): Likewise.
492 +
493 +2009-03-11 Nathan Froyd <froydnj@codesourcery.com>
494 +
495 + Backport from mainline:
496 +
497 + gcc/testsuite/
498 + 2009-03-11 Nathan Froyd <froydnj@codesourcery.com>
499 +
500 + * gcc.dg/vect/vect-82.c: Combine dg-do and
501 + dg-require-effective-target into dg-skip-if.
502 + * gcc.dg/vect/vect-83.c: Likewise.
503 +
504 +2009-03-10 Nathan Froyd <froydnj@codesourcery.com>
505 +
506 + Issue #4569
507 +
508 + * release-notes-csl.xml (Loop optimization improvements): New note.
509 +
510 +2009-03-09 Nathan Froyd <froydnj@codesourcery.com>
511 +
512 + Issue #4569
513 +
514 + gcc/
515 + * tree-ssa-loop-promote.c: New file.
516 + * common.opt (fpromote-loop-indices): New option.
517 + * timevar.def (TV_TREE_LOOP_PROMOTE): New timevar.
518 + * Makefile.in (tree-ssa-loop-promote.o): New rule.
519 + (OBJS-comon): Include it.
520 + * tree-pass.h (pass_promote_short_indices): Declare.
521 + * passes.c (init_optimization_passes): Add it.
522 + * pointer-set.h (pointer_set_n_elements, pointer_set_clear,
523 + pointer_map_n_elements, pointer_map_clear): Declare.
524 + * pointer-set.c (pointer_set_n_elements, pointer_set_clear,
525 + pointer_map_n_elements, pointer_map_clear): Define.
526 +
527 + gcc/doc/
528 + * invoke.texi (-fpromote-loop-indices): New entry.
529 +
530 + gcc/testsuite/
531 + * gcc.dg/promote-short-1.c: New file.
532 + * gcc.dg/promote-short-2.c: New file.
533 + * gcc.dg/promote-short-3.c: New file.
534 + * gcc.dg/promote-short-4.c: New file.
535 + * gcc.dg/promote-short-5.c: New file.
536 + * gcc.dg/promote-short-6.c: New file.
537 + * gcc.dg/promote-short-7.c: New file.
538 + * gcc.dg/promote-short-8.c: New file.
539 +
540 +2009-03-07 Mark Mitchell <mark@codesourcery.com>
541 +
542 + * release-notes-csl.xml: Mention use of -fno-common by default on
543 + bare--metal targets.
544 +
545 +2009-03-07 Joseph Myers <joseph@codesourcery.com>
546 +
547 + Issue #4730
548 +
549 + Merge from ARM/hard_vfp_4_4_branch:
550 +
551 + gcc/testsuite/
552 + 2009-03-06 Richard Earnshaw <rearnsha@arm.com>
553 + * lib/target-supports.exp (check_effective_target_hard_vfp_ok): Make
554 + this a linkage test.
555 + * gcc.target/arm/aapcs/aapcs.exp: New framework for testing AAPCS
556 + argument marshalling.
557 + * abitest.h: New file.
558 + * vfp1.c, vfp2.c, vfp3.c, vfp4.c, vfp5.c, vfp6.c, vfp7.c: New tests.
559 + * vfp8.c, vfp9.c, vfp10.c, vfp11.c, vfp12.c, vfp13.c, vfp14.c: New.
560 +
561 +2009-03-06 Joseph Myers <joseph@codesourcery.com>
562 +
563 + Issue #4730
564 +
565 + gcc/
566 + * doc/invoke.texi (-mfloat-abi=@var{name}): Remove statement about
567 + -mfloat-abi=hard not being supported for VFP.
568 +
569 +2009-03-06 Mark Mitchell <mark@codesourcery.com>
570 +
571 + gcc/
572 + * configure.ac (--with-specs): New option.
573 + * configure: Regenerated.
574 + * gcc.c (driver_self_specs): Include CONFIGURE_SPECS.
575 + * Makefile.in (DRIVER_DEFINES): Add -DCONFIGURE_SPECS.
576 +
577 +2009-03-05 Mark Mitchell <mark@codesourcery.com>
578 +
579 + Backport:
580 +
581 + gcc/testsuite/
582 + 2009-01-07 Janis Johnson <janis187@us.ibm.com>
583 + * g++.dg/torture/pr38586.C: Ignore a possible warning.
584 +
585 +2009-03-05 Joseph Myers <joseph@codesourcery.com>
586 +
587 + Issue #4730
588 +
589 + gcc/
590 + * config/arm/arm.c (arm_handle_pcs_attribute): New.
591 + (arm_get_pcs_model): Pass attribute arguments to
592 + arm_pcs_from_attribute.
593 + (arm_init_cumulative_args): Use base AAPCS for conversions from
594 + floating-point types to DImode.
595 + (arm_attribute_table): Add pcs attribute.
596 + (arm_handle_pcs_attribute): New.
597 + * config/arm/bpabi.h (DECLARE_LIBRARY_RENAMES): When renaming
598 + conversions from floating-point types to DImode, also declare them
599 + to use base AAPCS and declare functions they call to use base
600 + AAPCS and their RTABI names.
601 +
602 + gcc/testsuite/
603 + * gcc.target/arm/eabi1.c: Do not skip for non-base ABI variants.
604 + (PCS): Define macro to use base AAPCS.
605 + (decl_float, __aeabi_d2f, __aeabi_f2d): Use PCS macro.
606 +
607 +2009-03-05 Mark Mitchell <mark@codesourcery.com>
608 +
609 + Backport:
610 +
611 + gcc/testsuite/
612 + 2008-11-24 DJ Delorie <dj@redhat.com>
613 + * gcc.c-torture/execute/pr36321.c: Don't rely on argv[0] being set.
614 +
615 +2009-03-05 Joseph Myers <joseph@codesourcery.com>
616 +
617 + Issue #4730
618 +
619 + gcc/
620 + * config/arm/arm.c (aapcs_vfp_sub_candidate): Use V2SImode and
621 + V4SImode as representatives of all 64-bit and 128-bit vector
622 + types. Allow vector types without vector modes.
623 + (aapcs_vfp_is_call_or_return_candidate): Handle vector types
624 + without vector modes like BLKmode.
625 + (aapcs_vfp_allocate): Handle TImode for non-TARGET_NEON like
626 + BLKmode. Avoid unsupported vector modes or TImode moves for
627 + non-TARGET_NEON.
628 + (aapcs_vfp_allocate_return_reg): Likewise.
629 + (arm_vector_mode_supported_p): Only support V2SImode, V4HImode and
630 + V8QImode if TARGET_NEON || TARGET_IWMMXT.
631 +
632 +2009-03-04 Daniel Gutson <dgutson@codesourcery.com>
633 +
634 + Issue #4462
635 +
636 + gcc/
637 + * config/arm/t-cs-linux: Removed marvell-f multilibs.
638 +
639 + * release-notes-csl.xml: Document.
640 +
641 +2009-03-04 Joseph Myers <joseph@codesourcery.com>
642 +
643 + Issue #4730
644 +
645 + gcc/
646 + * config/arm/arm.c (arm_return_in_memory): Handle returning
647 + vectors of suitable size in registers also for AAPCS case.
648 +
649 +2009-03-04 Joseph Myers <joseph@codesourcery.com>
650 +
651 + Issue #3681
652 +
653 + Backport:
654 +
655 + gcc/
656 + 2009-03-03 Joseph Myers <joseph@codesourcery.com>
657 + * emit-rtl.c (adjust_address_1): Reduce offset to a signed value
658 + that fits within Pmode.
659 +
660 + gcc/testsuite/
661 + 2009-03-03 Joseph Myers <joseph@codesourcery.com>
662 + * gcc.c-torture/compile/20090303-1.c,
663 + gcc.c-torture/compile/20090303-2.c: New tests.
664 +
665 +2009-03-03 Andrew Stubbs <ams@codesourcery.com>
666 +
667 + gcc/
668 + * config/sh/t-sgxxlite-linux (MULTILIB_EXCEPTIONS): Allow big endian
669 + SH4A multilib.
670 +
671 +2009-03-01 Mark Mitchell <mark@codesourcery.com>
672 +
673 + Issue #4768
674 +
675 + * release-notes-csl.xml: Document.
676 + gcc/
677 + * final.c (shorten_branches): Do not align labels for jump tables.
678 + (final_scan_insn): Use JUMP_TABLE_DATA_P.
679 +
680 +2009-03-02 Daniel Gutson <dgutson@codesourcery.com>
681 +
682 + Issue #4462
683 +
684 + gcc/
685 + * config/arm/t-cs-eabi: Replaced marvell-f with armv5t multilibs.
686 +
687 + * release-notes-csl.xml: Document.
688 +
689 +2009-03-02 Nathan Froyd <froydnj@codesourcery.com>
690 +
691 + Issue #4344
692 +
693 + gcc/
694 + * tree.h (struct tree_type): Enlarge precision field. Rearrange
695 + fields to position things within bytes. Move packed_flag to...
696 + (struct tree_base): ...here. Decrease spare field accordingly.
697 + (TYPE_PACKED): Adjust to reflect new packed_flag location.
698 + * config/arm/arm-modes.def (XI): Define it as a real INT_MODE.
699 +
700 + gcc/testsuite/
701 + * gcc.target/arm/neon-dse-2.c: New test.
702 +
703 +2009-02-27 Daniel Gutson <dgutson@codesourcery.com>
704 +
705 + Issue #4459
706 +
707 + gcc/
708 + * config/arm/linux-eabi.h (LINK_SPEC): BE8_LINK_SPEC added.
709 + * config/arm/arm-cores.def: Comment added.
710 + * config/arm/bpapi.h (BE8_LINK_SPEC): New define.
711 + (LINK_SPEC): BE_LINK_SPEC added.
712 +
713 + * release-notes-csl.xml: Add note.
714 +
715 +2009-02-27 Joseph Myers <joseph@codesourcery.com>
716 +
717 + Issue #4730
718 +
719 + gcc/
720 + * config/arm/arm.c (aapcs_layout_arg): Handle coprocessor argument
721 + candidates after a previous argument failed to be allocated to
722 + coprocessor registers the same way as the first failing argument.
723 +
724 +2009-02-26 Joseph Myers <joseph@codesourcery.com>
725 +
726 + Issue #4730
727 +
728 + gcc/
729 + * config/arm/arm.c (arm_libcall_value, arm_init_cumulative_args):
730 + Use base ABI for conversion libfuncs between HFmode and SFmode.
731 +
732 +2009-02-26 Nathan Froyd <froydnj@codesourcery.com>
733 +
734 + Issue #4344
735 +
736 + gcc/testsuite/
737 + * gcc.target/arm/neon-dse-1.c: New test.
738 +
739 +2009-02-25 Nathan Froyd <froydnj@codesourcery.com>
740 +
741 + Issue #4344
742 +
743 + * release-notes-csl.xml (Internal compiler error with large
744 + NEON types): New note.
745 +
746 + gcc/
747 + * dse.c (struct store_info): Change positions_needed to an
748 + unsigned HOST_WIDEST_INT.
749 +
750 + Backport portions of:
751 + 2008-12-23 Jakub Jelinek <jakub@redhat.com>
752 +
753 + gcc/
754 + * dse.c (struct store_info): Change begin and end fields to
755 + HOST_WIDE_INT.
756 + (set_position_unneeded, set_all_positions_unneeded,
757 + any_positions_needed_p, all_positions_needed_p): New static inline
758 + functions.
759 + (set_usage_bits): Don't look at stores where
760 + offset + width >= MAX_OFFSET.
761 + (check_mem_read_rtx): Use all_positions_needed_p function.
762 +
763 + Backport from mainline:
764 + gcc/
765 + 2008-04-11 H.J. Lu <hongjiu.lu@intel.com>
766 +
767 + * dse.c (lowpart_bitmask): New.
768 +
769 +2009-02-26 Joseph Myers <joseph@codesourcery.com>
770 +
771 + Issue #4730
772 +
773 + Merge from ARM/hard_vfp_4_4_branch:
774 +
775 + gcc/
776 + 2009-01-13 Richard Earnshaw <rearnsha@arm.com>
777 +
778 + * doc/tm.texi (TARGET_LIBCALL_VALUE): Add missing end statement.
779 +
780 + 2008-12-09 Richard Earnshaw <rearnsha@arm.com>
781 +
782 + ARM Hard-VFP calling convention
783 + * target-def.h (TARGET_LIBCALL_VALUE): New hook.
784 + * target.h (gcc_target): Add libcall_value to table of call hooks.
785 + * targhooks.h (default_libcall_value): Default implementation.
786 + * targhooks.c (default_libcall_value): Likewise.
787 + * doc/tm.texi (TARGET_LIBCALL_VALUE): Document it.
788 + * optabs.c (expand_unop): Use it.
789 + * expr.h (hard_libcall_value): Pass the function RTX through.
790 + * calls.c (emit_library_call_value_1): Update call to
791 + hard_libcall_value.
792 + * explow.c (hard_libcall_value): Use new target hook.
793 + * testsuite/lib/target-supports.exp
794 + (check_effective_target_arm_hard_vfp_ok): New hook.
795 + (check_effective_target_arm_neon_ok): Improve test for neon
796 + availability.
797 + * testsuite/gcc.target/arm/eabi1.c: Only run test in base variant.
798 + * config/arm/arm.c: Include cgraph.h
799 + (TARGET_FUNCTION_VALUE): Override default hook.
800 + (arm_pcs_default): New variable.
801 + (arm_override_options): Don't fault hard calling convention with VFP.
802 + Add support for AAPCS variants.
803 + (arm_function_value): Make static. Handle AAPCS variants.
804 + (arm_libcall_value): New function.
805 + (arm_apply_result_size): Handle VFP registers in results.
806 + (arm_return_in_memory): Rework all AAPCS variants; handle hard-vfp
807 + conventions.
808 + (pcs_attribute_args): New variable.
809 + (arm_pcs_from_attribute): New function.
810 + (arm_get_pcs_model): New function.
811 + (aapcs_vfp_cum_init): New function.
812 + (aapcs_vfp_sub_candidate): New function.
813 + (aapcs_vfp_is_return_candidate): New function.
814 + (aapcs_vfp_is_call_candidate): New function.
815 + (aapcs_vfp_allocate): New function.
816 + (aapcs_vfp_allocate_return_reg): New function.
817 + (aapcs_vfp_advance): New function.
818 + (aapcs_cp_arg_layout): New variable.
819 + (aapcs_select_call_coproc): New function.
820 + (aapcs_select_return_coproc): New function.
821 + (aapcs_allocate_return_reg): New function.
822 + (aapcs_libcall_value): New function.
823 + (aapcs_layout_arg): New function.
824 + (arm_init_cumulative_args): Initialize AAPCS args data.
825 + (arm_function_arg): Handle AAPCS variants using new interface.
826 + (arm_arg_parital_bytes): Likewise.
827 + (arm_function_arg_advance): New function.
828 + (arm_function_ok_for_sibcall): Ensure that sibling calls agree on
829 + calling conventions.
830 + (arm_setup_incoming_varargs): Handle new AAPCS args data.
831 + * arm.h (NUM_VFP_ARG_REGS): Define.
832 + (LIBCALL_VALUE): Update.
833 + (FUNCTION_VALUE): Delete.
834 + (FUNCTION_VALUE_REGNO_P): Add VFP regs.
835 + (arm_pcs): New enum.
836 + (CUMULATIVE_ARGS): New data to support AAPCS argument marshalling.
837 + (FUNCTION_ARG_ADVANCE): Call arm_function_arg_advance.
838 + (FUNCTION_ARG_REGNO_P): Add VFP regs.
839 + * arm-protos.h (arm_function_arg_advance): Add.
840 + (aapcs_libcall_value): Add.
841 + (arm_function_value): Delete.
842 +
843 +2009-02-25 Joseph Myers <joseph@codesourcery.com>
844 +
845 + Backport from FSF:
846 +
847 + gcc/
848 + 2008-05-08 Kai Tietz <kai.tietz@onevision.com>
849 + * config/arm/arm.c (arm_return_in_memory): Add fntype argumen.
850 + * config/arm/arm.h (RETURN_IN_MEMORY): Replace RETURN_IN_MEMORY
851 + by TARGET_RETURN_IN_MEMORY.
852 + * config/arm/arm-protos.h (arm_return_in_memory): Add fntype argument.
853 +
854 + 2008-05-15 Diego Novillo <dnovillo@google.com>
855 + * config/arm/arm.c (arm_return_in_memory): Fix return type.
856 + * config/arm/arm-protos.h (arm_return_in_memory): Likewise.
857 +
858 + 2008-06-19 Chung-Lin Tang <ctang@marvell.com>
859 + * arm-protos.h (arm_return_in_memory): Remove public
860 + arm_return_in_memory() prototype.
861 + * arm.c (arm_return_in_memory): Add static prototype, add target
862 + hook macro, change definition and comments.
863 + * arm.h (TARGET_RETURN_IN_MEMORY): Remove.
864 +
865 +2009-02-24 Sandra Loosemore <sandra@codesourcery.com>
866 +
867 + Issue #2369
868 + Committed upstream at the same time.
869 +
870 + gcc/
871 + * doc/invoke.texi (Link Options): Document an easier way to pass
872 + options that take arguments to the GNU linker using -Xlinker and
873 + -Wl.
874 +
875 +2009-02-24 Andrew Stubbs <ams@codesourcery.com>
876 +
877 + gcc/
878 + * config/sh/lib1funcs.asm (ic_invalidate): icbi is not valid in a
879 + delay slot.
880 +
881 +2009-02-24 Andrew Stubbs <ams@codesourcery.com>
882 +
883 + gcc/testsuite/
884 + * gcc.target/sh/sh4a-memmovua.c: Include string.h instead of stdlib.h.
885 +
886 +2009-02-24 Andrew Stubbs <ams@codesourcery.com>
887 +
888 + gcc/testsuite/
889 + * gcc.target/sh/sh4a-bitmovua.c (y0): Rename to y_0 to avoid a clash
890 + with the built-in y0, and the subsequent warning.
891 + (y1): Likewise, rename to y_1.
892 +
893 +2009-02-21 Mark Mitchell <mark@codesourcery.com>
894 +
895 + Issue #4694
896 + Backport:
897 + libiberty/
898 + 2008-07-31 Jakub Jelinek <jakub@redhat.com>
899 + * mkstemps.c (mkstemps): Keep looping even for EISDIR.
900 + 2008-07-31 Denys Vlasenko <dvlasenk@redhat.com>
901 + * mkstemps.c (mkstemps): If open failed with errno other than
902 + EEXIST, return immediately.
903 + * make-temp-file.c: Include errno.h.
904 + (make_temp_file): If mkstemps failed, print an error message
905 + before aborting.
906 +
907 +2009-02-19 Kazu Hirata <kazu@codesourcery.com>
908 +
909 + Issue #4152
910 + * release-notes-csl.xml: Mention the bug fix below.
911 +
912 + Backport:
913 + 2008-07-30 Andrew Jenner <andrew@codesourcery.com>
914 +
915 + * config/arm/arm.c (arm_compute_static_chain_stack_bytes): New
916 + function.
917 + (arm_compute_initial_elimination_offset): Use it.
918 + (arm_compute_save_reg_mask): Include static chain save slot when
919 + calculating alignment.
920 + (arm_get_frame_offsets): Ditto.
921 + (thumb1_compute_save_reg_mask): Ensure we have a low register saved
922 + that we can use to decrement the stack when the stack decrement
923 + could be too big for an immediate value in a single insn.
924 + (thumb1_expand_prologue): Avoid using r12 for stack decrement.
925 +
926 +2009-02-19 Catherine Moore <clm@codesourcery.com>
927 +
928 + Issue #2953
929 +
930 + gcc/
931 + * debug.h (set_name): Declare.
932 + * dwarf2out.c (dwarf2out_set_name): Declare.
933 + (dwarf2_debug_hooks): Add set_name.
934 + (find_AT_string): New.
935 + (add_AT_string): Call find_AT_string.
936 + (dwarf2out_set_name): New.
937 + * cp/decl.c (grokdeclarator): Call set_name.
938 + * vmsdbgout.c (vmsdbg_debug_hooks): Add set_name_debug_nothing.
939 + * debug.c (do_nothing_debug_hooks): Likewise.
940 + * dbxout.c (dbx_debug_hooks): Likewise.
941 + * sdbout.c (sdb_debug_hooks): Likewise.
942 +
943 + * release-notes-csl.xml: Add note.
944 +
945 +2009-02-19 Kazu Hirata <kazu@codesourcery.com>
946 +
947 + Issue #4613
948 + gcc/
949 + * config/arm/arm.c (arm_rtx_costs_1): Teach that the cost of MLS
950 + is the same as its underlying multiplication.
951 + * config/arm/arm.md (two splitters): New.
952 + * config/arm/predicates.md (binary_operator): New.
953 +
954 + * release-notes-csl.xml: Add a release note fragment for this
955 + optimization.
956 +
957 +2009-02-17 Andrew Jenner <andrew@codesourcery.com>
958 + Maciej Rozycki <macro@codesourcery.com>
959 +
960 + gcc/
961 + * unwind.inc (_Unwind_RaiseException): Use return value of
962 + uw_init_context.
963 + * unwind-dw2.c (uw_init_context): Make macro an expression instead of
964 + a statement.
965 + (uw_init_context_1): Add return value.
966 + * unwind-sjlj.c (uw_init_context): Add return value.
967 +
968 +2009-02-17 Kazu Hirata <kazu@codesourcery.com>
969 +
970 + gcc/
971 + * config/arm/arm.c (arm_rtx_costs_1): Treat a minus with a shift
972 + the same as a minus without a shift.
973 +
974 +2009-02-16 Joseph Myers <joseph@codesourcery.com>
975 +
976 + Issue #4622
977 +
978 + gcc/
979 + * tree-predcom.c (ref_at_iteration): Return NULL_TREE if loop
980 + header is an empty block.
981 +
982 + gcc/testsuite/
983 + * g++.dg/torture/predcom-1.C: New test.
984 +
985 +2009-02-16 Julian Brown <julian@codesourcery.com>
986 +
987 + Issue #3747
988 + gcc/
989 + * config/arm/t-linux-eabi (LIB2FUNCS_STATIC_EXTRA): Add
990 + config/arm/linux-atomic.c.
991 + * config/arm/linux-atomic.c: New.
992 +
993 +2009-02-12 Nathan Sidwell <nathan@codesourcery.com>
994 +
995 + Issue #4620
996 + gcc/
997 + * config/rs6000/rs6000.c (rs6000_init_builtins): Set TYPE_NAME of
998 + our distinct integral and vector types.
999 + gcc/testsuite/
1000 + * g++.dg/ext/altivec-17.C: New.
1001 +
1002 + * release-notes-csl.xml: Add note.
1003 +
1004 +2009-02-10 Mark Mitchell <mark@codesourcery.com>
1005 +
1006 + libjava/classpath/
1007 + * m4/acinclude.m4 (CLASSPATH_TOOLEXECLIBDIR): Match libjava.
1008 + * configure.ac (--enable-version-specific-runtime-libs): Support.
1009 + * Makefile.in, */Makefile.in: Regenerated.
1010 +
1011 + libjava/
1012 + * Makefile.am (pkgconfigdir): Use toolexeclibdir, not $(libdir).
1013 + * configure.ac (dbexecdir): Likewise.
1014 + * configure: Regenerated.
1015 +
1016 + libjava/
1017 + * Makefile.am (jardir): Set to a target-specific location.
1018 + gcc/java/
1019 + * Make-lang.in: Adjust to match.
1020 +
1021 +2009-02-09 Mark Mitchell <mark@codesourcery.com>
1022 +
1023 + Backport:
1024 + libffi/
1025 + 2008-05-09 Julian Brown <julian@codesourcery.com>
1026 + * Makefile.am (LTLDFLAGS): New.
1027 + (libffi_la_LDFLAGS): Use above.
1028 + * Makefile.in: Regenerate.
1029 + boehm-gc/
1030 + 2009-02-09 Mark Mitchell <mark@codesourcery.com>
1031 + * Makefile.am (LTLDFLAGS): New variable.
1032 + (LINK): Use it.
1033 + * Makefile.in: Regenerated.
1034 + libjava/
1035 + 2009-02-09 Mark Mitchell <mark@codesourcery.com>
1036 + * Makefile.am (LTLDFLAGS): Define.
1037 + (GCJLINK): Use it.
1038 + (LIBLINK): Likewise.
1039 + * Makefile.in: Regenerated.
1040 + 2009-02-09 Mark Mitchell <mark@codesourcery.com>
1041 + * configure.ac: Define enable_sjlj_exceptions
1042 + appropriately under the ARM EH ABI.
1043 + * configure: Regenerated.
1044 + PR other/5303
1045 + * addr2name.awk: Remove.
1046 + * Makefile.am (bin_SCRIPTS): Remove addr2name.awk.
1047 + * Makefile.in: Regenerated.
1048 +
1049 +2009-02-05 Sandra Loosemore <sandra@codesourcery.com>
1050 +
1051 + gcc/
1052 + * config/arm/arm.c (struct minipool_fixup): Split mode field into
1053 + value_mode and ref_mode.
1054 + (add_minipool_forward_ref): Use value_mode of fixup.
1055 + (add_minipool_backward_ref): Likewise.
1056 + (push_minipool_fix): Pass both value_mode and ref_mode as parameters,
1057 + and store them in the fixup.
1058 + (note_invalid_constants): Adjust arguments to push_minipool_fix.
1059 + (arm_reorg): Use ref_mode of fixup.
1060 +
1061 +2009-02-04 Andrew Jenner <andrew@codesourcery.com>
1062 +
1063 + gcc/
1064 + * config.gcc: Handle arm-montavista-linux-gnueabi,
1065 + mips-montavista-linux-gnu, mips64octeon*-montavista-elf* and
1066 + powerpc-montavista-linux-gnu.
1067 + * config/rs6000/t-montavista-linux: New file.
1068 + * config/rs6000/montavista-linux.h: New file.
1069 + * config/arm/t-montavista-linux: New file.
1070 + * config/arm/montavista-linux.h: New file.
1071 + * config/mips/t-montavista-linux: New file.
1072 + * config/mips/t-montavista-elf: New file.
1073 + * config/mips/montavista-linux.h: New file.
1074 +
1075 + libgcc/
1076 + * config.host: Handle mips64octeon-montavista-elf*.
1077 +
1078 +2009-02-04 Catherine Moore <clm@codesourcery.com>
1079 +
1080 + Backport:
1081 +
1082 + 2009-02-02 Catherine Moore <clm@codesourcery.com>
1083 +
1084 + * sde.h (SUBTARGET_ARM_SPEC): Don;t assemble -fpic code as
1085 + -mabicalls.
1086 +
1087 +2009-02-03 Kazu Hirata <kazu@codesourcery.com>
1088 +
1089 + * release-notes-csl.xml: Add a release note for improved
1090 + multiplication.c
1091 +
1092 +2009-02-03 Kazu Hirata <kazu@codesourcery.com>
1093 +
1094 + gcc/
1095 + * expmed.c (synth_mult): When trying out a shift, pass the result
1096 + of a signed shift.
1097 +
1098 +2009-02-03 Andrew Stubbs <ams@codesourcery.com>
1099 +
1100 + gcc/
1101 + * config.gcc (sh-*): Add --enable-extra-sgxxlite-multilibs option to
1102 + enable uclibc multilibs.
1103 + * config/sh/cs-sgxxlite-linux.h: New file.
1104 + * config/sh/t-sgxxlite-linux: New file.
1105 +
1106 +2009-02-03 Andrew Stubbs <ams@codesourcery.com>
1107 +
1108 + gcc/
1109 + * config/sh/linux-unwind.h: Disable when inhibit_libc is defined.
1110 +
1111 +2009-02-03 Andrew Stubbs <ams@codesourcery.com>
1112 +
1113 + gcc/
1114 + * config.gcc (sh-*-*): Add sysroot-suffix.h to tm_file.
1115 + Add t-sysroot-suffix to tmake_file.
1116 +
1117 +2009-02-03 Kazu Hirata <kazu@codesourcery.com>
1118 +
1119 + config/
1120 + * mh-mingw: Add a comment.
1121 +
1122 + libiberty/
1123 + * cygpath.c (msvcrt_dll): Change the return type to HMODULE.
1124 + (msvcrt_fopen): Use HMODULE for the return value from msvcrt_dll.
1125 +
1126 +2009-02-03 Andrew Stubbs <ams@codesourcery.com>
1127 +
1128 + gcc/
1129 + * configure.ac: Add new AC_SUBST for TM_ENDIAN_CONFIG,
1130 + TM_MULTILIB_CONFIG and TM_MULTILIB_EXCEPTIONS_CONFIG.
1131 + * configure: Regenerate.
1132 + * Makefile.in: Add variables TM_ENDIAN_CONFIG, TM_MULTILIB_CONFIG
1133 + and TM_MULTILIB_EXCEPTIONS_CONFIG.
1134 + * config.gcc (sh-*-*): Switch to using TM_ENDIAN_CONFIG,
1135 + TM_MULTILIB_CONFIG, and TM_MULTILIB_EXCEPTIONS_CONFIG.
1136 + Don't add default cpu to multilib list unnecessarily, but do enable
1137 + the relevant compiler option..
1138 + Add support for --with-multilib-list=none, and
1139 + --with-multilib-list=!<somelib> to supress unwanted multilibs.
1140 + Remove use_fixproto=yes.
1141 + * config/sh/t-sh (DEFAULT_ENDIAN, OTHER_ENDIAN): New variables.
1142 + (MULTILIB_ENDIAN, MULTILIB_CPUS): Delete variables.
1143 + (MULTILIB_OPTIONS): Redefine using OTHER_ENDIAN and
1144 + TM_MULTILIB_CONFIG.
1145 + (MULTILIB_EXCEPTIONS): Add TM_MULTILIB_EXCEPTIONS_CONFIG.
1146 + (MULTILIB_OSDIRNAMES): New variable.
1147 + * config/sh/t-1e: Delete file.
1148 + * config/sh/t-mlib-sh1: Delete file.
1149 + * config/sh/t-mlib-sh2: Delete file.
1150 + * config/sh/t-mlib-sh2a: Delete file.
1151 + * config/sh/t-mlib-sh2a-nofpu: Delete file.
1152 + * config/sh/t-mlib-sh2a-single: Delete file.
1153 + * config/sh/t-mlib-sh2a-single-only: Delete file.
1154 + * config/sh/t-mlib-sh2e: Delete file.
1155 + * config/sh/t-mlib-sh3e: Delete file.
1156 + * config/sh/t-mlib-sh4: Delete file.
1157 + * config/sh/t-mlib-sh4-nofpu: Delete file.
1158 + * config/sh/t-mlib-sh4-single: Delete file.
1159 + * config/sh/t-mlib-sh4-single-only: Delete file.
1160 + * config/sh/t-mlib-sh4a: Delete file.
1161 + * config/sh/t-mlib-sh4a-nofpu: Delete file.
1162 + * config/sh/t-mlib-sh4a-single: Delete file.
1163 + * config/sh/t-mlib-sh4a-single-only: Delete file.
1164 + * config/sh/t-mlib-sh4al: Delete file.
1165 + * config/sh/t-mlib-sh5-32media: Delete file.
1166 + * config/sh/t-mlib-sh5-32media-nofpu: Delete file.
1167 + * config/sh/t-mlib-sh5-64media: Delete file.
1168 + * config/sh/t-mlib-sh5-64media-nofpu: Delete file.
1169 + * config/sh/t-mlib-sh5-compact: Delete file.
1170 + * config/sh/t-mlib-sh5-compact-nofpu: Delete file.
1171 + * config/sh/t-linux: Don't override MULTILIB_EXCEPTIONS.
1172 +
1173 +2009-02-03 Andrew Stubbs <ams@codesourcery.com>
1174 +
1175 + gcc/
1176 + * config/print-sysroot-suffix.sh: Add support for MULTILIB_ALIASES.
1177 + * config/t-sysroot-suffix: Pass MULTILIB_ALIASES.
1178 +
1179 +2009-02-03 Andrew Stubbs <ams@codesourcery.com>
1180 +
1181 + gcc/
1182 + * config/arm/print-sysroot-suffix.sh: Move to ...
1183 + * config/print-sysroot-suffix.sh: ... here.
1184 + Remove all MULTILIB_ALIASES to make it suitable for upstream
1185 + submission.
1186 + * config/arm/t-sysroot-suffix: Move to ...
1187 + * config/t-sysroot-suffix: ... here.
1188 + Modify path to print-sysroot-suffix.sh.
1189 + Remove all MULTILIB_ALIASES.
1190 + * config.gcc: Modify paths to print-sysroot-suffix.sh.
1191 +
1192 +2009-01-30 Andrew Stubbs <ams@codesourcery.com>
1193 +
1194 + gcc/libstdc++-v3/
1195 + * config/cpu/sh/atomicity.h: Put the SH4A specific functions in the
1196 + __gnu_cxx namespace. Remove "static inline".
1197 +
1198 +2009-01-29 Kazu Hirata <kazu@codesourcery.com>
1199 +
1200 + * expmed.c (shiftsub_cost): Rename to shiftsub0_cost.
1201 + (shiftsub1_cost): New.
1202 + (init_expmed): Compute shiftsub1_cost.
1203 + (synth_mult): Optimize multiplications by constants of the form
1204 + -(2^^m-1) for some constant positive integer m.
1205 +
1206 +2009-01-27 Nathan Sidwell <nathan@codesourcery.com>
1207 +
1208 + Issue #4428
1209 + gcc/
1210 + * config/mips/mips.md (jump): Deal with $gp restoration in delay
1211 + slot for o32 and o64 ABIs.
1212 +
1213 + gcc/testsuite/
1214 + * gcc.target/mips/branch-2.c: New.
1215 +
1216 + * release-notes-csl.xml: Add note.
1217 +
1218 +2009-01-26 Kazu Hirata <kazu@codesourcery.com>
1219 +
1220 + * release-notes-csl.xml: Mention performance improvements for ARM.
1221 +
1222 + Backport from mainline:
1223 + 2009-01-13 Richard Earnshaw <rearnsha@arm.com>
1224 +
1225 + * arm.c (struct processors): Pass for speed down into cost helper
1226 + functions.
1227 + (const_ok_for_op): Handle COMPARE and inequality nodes.
1228 + (arm_rtx_costs_1): Rewrite.
1229 + (arm_size_rtx_costs): Update prototype.
1230 + (arm_rtx_costs): Pass speed down to helper functions.
1231 + (arm_slowmul_rtx_costs): Rework cost calculations.
1232 + (arm_fastmul_rtx_costs, arm_xscale_rtx_costs): Likewise.
1233 + (arm_9e_rtx_costs): Likewise.
1234 +
1235 +2009-01-26 Julian Brown <julian@codesourcery.com>
1236 +
1237 + Issue #4515
1238 +
1239 + gcc/
1240 + * config/arm/ieee754-df.S (cmpdf2): Avoid writing below SP.
1241 + * config/arm/ieee754-sf.S (cmpsf2): Likewise.
1242 +
1243 +2009-01-23 Sandra Loosemore <sandra@codesourcery.com>
1244 +
1245 + Issue #3989
1246 +
1247 + * release-notes-csl.xml (Thumb half-precision floating point bug fix):
1248 + New note.
1249 +
1250 + gcc/
1251 + * config/arm/arm.c (dump_minipool): Use size of mode, not padded size,
1252 + in switch that controls whether to emit padding.
1253 +
1254 +2009-01-20 Sandra Loosemore <sandra@codesourcery.com>
1255 +
1256 + Issue #4289
1257 +
1258 + fixincludes/
1259 + * server.c (run_shell): Quote directory name passed to cd.
1260 +
1261 +2009-01-14 Nathan Froyd <froydnj@codesourcery.com>
1262 +
1263 + * release-notes-csl.xml: Add note. Correct TARGET line for
1264 + previous note.
1265 +
1266 + gcc/
1267 + * tree-ssa-remove-local-statics.c (maybe_discover_new_declaration):
1268 + Avoid variables with aggregate and vector types.
1269 + (maybe_create_new_variable): Create the var_ann prior to marking
1270 + the symbol for renaming.
1271 +
1272 + gcc/testsuite/
1273 + * gcc.dg/remove-local-statics-15.c: New test.
1274 + * gcc.dg/remove-local-statics-16.c: New test.
1275 +
1276 +2009-01-14 Joseph Myers <joseph@codesourcery.com>
1277 +
1278 + gcc/
1279 + * config/sparc/sol2-bi.h (LINK_ARCH64_SPEC_BASE): Use %R with
1280 + absolute library paths.
1281 +
1282 +2009-01-12 Joseph Myers <joseph@codesourcery.com>
1283 +
1284 + gcc/
1285 + * config/sol2.h (LINK_ARCH32_SPEC_BASE): Use %R with absolute
1286 + library paths.
1287 +
1288 +2009-01-06 Andrew Stubbs <ams@codesourcery.com>
1289 + Nathan Sidwell <nathan@codesourcery.com>
1290 +
1291 + Issue #4436
1292 +
1293 + gcc/
1294 + * config/rs6000/rs6000.c (rs6000_override_options): Don't override
1295 + an explicit -mno-isel.
1296 +
1297 +2009-01-02 Nathan Sidwell <nathan@codesourcery.com>
1298 +
1299 + Issue 4361
1300 + gcc/
1301 + * config/m68k/m68k-devices.def: Add 51jm.
1302 +
1303 + * release-notes-csl.xml: Document 51jm addition.
1304 +
1305 +2008-12-21 Mark Mitchell <mark@codesourcery.com>
1306 +
1307 + * release-notes-csl.xml: Adjust wording of last note.
1308 +
1309 +2008-12-18 Mark Mitchell <mark@codesourcery.com>
1310 +
1311 + Issue #4399
1312 + * release-notes-csl.xml: Document.
1313 + gcc/
1314 + * tree-ssa-pre.c (compute_antic): Correct loop bounds.
1315 +
1316 +2008-12-19 Joseph Myers <joseph@codesourcery.com>
1317 +
1318 + gcc/testsuite/
1319 + * gcc.target/powerpc/20081204-1.c: Require powerpc_spe_ok.
1320 +
1321 +2008-12-19 Joseph Myers <joseph@codesourcery.com>
1322 +
1323 + Backport from FSF:
1324 +
1325 + gcc/testsuite/
1326 + 2008-03-13 Uros Bizjak <ubizjak@gmail.com>
1327 + * gcc.dg/vect/vect-align-2.c: Remove dg-do run directive.
1328 + (main): Call check_vect.
1329 +
1330 +2008-12-18 Joseph Myers <joseph@codesourcery.com>
1331 +
1332 + Backport from FSF:
1333 +
1334 + gcc/
1335 + 2008-12-18 Joseph Myers <joseph@codesourcery.com>
1336 + * config/rs6000/rs6000.c (rs6000_generate_compare): Condition
1337 + choice of e500 comparison instructions on flag_finite_math_only &&
1338 + !flag_trapping_math, not flag_unsafe_math_optimizations.
1339 + * config/rs6000/rs6000.md (abstf2): Condition choice of e500
1340 + instructions on flag_finite_math_only && !flag_trapping_math, not
1341 + flag_unsafe_math_optimizations.
1342 + (bltgt, sltgt): Disable for TARGET_HARD_FLOAT && !TARGET_FPRS.
1343 + * config/rs6000/spe.md (cmpsfeq_gpr, tstsfeq_gpr, cmpsfgt_gpr,
1344 + tstsfgt_gpr, cmpsflt_gpr, tstsflt_gpr, cmpdfeq_gpr, tstdfeq_gpr,
1345 + cmpdfgt_gpr, tstdfgt_gpr, cmpdflt_gpr, tstdflt_gpr, cmptfeq_gpr,
1346 + tsttfeq_gpr, cmptfgt_gpr, tsttfgt_gpr, cmptflt_gpr, tsttflt_gpr):
1347 + Condition choice of comparison instructions on
1348 + flag_finite_math_only && !flag_trapping_math, not
1349 + flag_unsafe_math_optimizations.
1350 +
1351 +2008-12-18 Catherine Moore <clm@codesourcery.com>
1352 +
1353 + Issue #4439
1354 +
1355 + * release-notes-csl.xml: Document -march= bug fix.
1356 +
1357 +2008-12-18 Catherine Moore <clm@codesourcery.com>
1358 +
1359 + Issue #4334
1360 +
1361 + Backport:
1362 +
1363 + gcc/
1364 + 2008-11-23 Richard Sandiford <rsandiford@googlemail.com>
1365 +
1366 + * config/mips/mips.c (mips_legitimize_address): Handle
1367 + illegitimate CONST_INT addresses.
1368 +
1369 +
1370 + 2008-06-01 Richard Sandiford <rdsandiford@googlemail.com>
1371 +
1372 + * config/mips/mips.c (mips_valid_offset_p): New function.
1373 +
1374 +2008-12-18 Catherine Moore <clm@codesourcery.com>
1375 +
1376 + Issue #4439
1377 +
1378 + gcc/
1379 + * config/mips/mips.h (MIPS_ISA_LEVEL_SPEC): Remove extraneous
1380 + colon.
1381 +
1382 +2008-12-16 Joseph Myers <joseph@codesourcery.com>
1383 +
1384 + gcc/
1385 + * config/i386/cs-linux.opt (mrh73, mrhel3): New options.
1386 + * config/i386/cs-linux.h (SYSROOT_SUFFIX_SPEC): Handle new
1387 + options.
1388 + * config/i386/t-cs-linux (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
1389 + MULTILIB_OSDIRNAMES): Update for new options.
1390 + (MULTILIB_EXCEPTIONS): Define.
1391 +
1392 +2008-12-05 Catherine Moore <clm@codesourcery.com>
1393 +
1394 + gcc/testsuite/
1395 + * gcc-target/mips/mips-nonpic/mips-nonpic.h: New.
1396 + * gcc-target/mips/mips-nonpic/nonpic-[0-9]*.c: Rename to
1397 + main-[0-9]*.c.
1398 + * gcc-target/mips/mips-nonpic/mips-nonpic.exp: Run
1399 + main-*.c tests.
1400 + * gcc-target/mips/mips-nonpic/pic-*.c: Include mips-nonpic.h.
1401 + * gcc-target/mips/mips-nonpic/nonpic-*.c: Likewise.
1402 +
1403 +2008-12-05 Catherine Moore <clm@codesourcery.com>
1404 +
1405 + * gcc/config/mips/MIPS-TOOLCHAIN.pdf: Remove.
1406 +
1407 +2008-12-04 Joseph Myers <joseph@codesourcery.com>
1408 +
1409 + gcc/
1410 + * config/rs6000/rs6000.md (move_from_CR_gt_bit): Enable for
1411 + TARGET_HARD_FLOAT && !TARGET_FPRS, not TARGET_E500.
1412 + * config/rs6000/spe.md (e500_cr_ior_compare): Likewise.
1413 +
1414 + gcc/testsuite/
1415 + * gcc.target/powerpc/20081204-1.c: New test.
1416 +
1417 +2008-12-03 Daniel Jacobowitz <dan@codesourcery.com>
1418 +
1419 + gcc/testsuite/
1420 + * gcc.dg/vect/vect-shift-2.c, gcc.dg/vect/vect-shift-3.c: New.
1421 + * lib/target-supports.exp (check_effective_target_vect_shift): New
1422 + function.
1423 +
1424 +2008-12-02 Daniel Jacobowitz <dan@codesourcery.com>
1425 +
1426 + Issue #4343
1427 + * release-notes-csl.xml: Document right shift fix.
1428 +
1429 + Backport from trunk:
1430 +
1431 + gcc/
1432 + 2008-09-25 Dorit Nuzman <dorit@il.ibm.com>
1433 +
1434 + * tree-vectorizer.c (vect_is_simple_use): Fix indentation.
1435 + * tree-vect-transform.c (vect_get_constant_vectors): Use vectype
1436 + instead of vector_type for constants. Take computation out of loop.
1437 + (vect_get_vec_def_for_operand): Use only vectype for constant case,
1438 + and use only vector_type for invariant case.
1439 + (get_initial_def_for_reduction): Use vectype instead of vector_type.
1440 +
1441 + gcc/testsuite/
1442 + 2008-09-25 Dorit Nuzman <dorit@il.ibm.com>
1443 +
1444 + * gcc.dg/vect/ggc-pr37574.c: New test.
1445 + * gcc.dg/vect/vect.exp: Compile some tests with ggc flags.
1446 +
1447 +2008-12-02 Maxim Kuvyrkov <maxim@codesourcery.com>
1448 +
1449 + gcc/testsuite/
1450 + * gcc.target/m68k/tls-1.c: Rename to tls-ie.c; fix.
1451 + * gcc.target/m68k/tls-2.c: Rename to tls-le.c; fix.
1452 + * gcc.target/m68k/tls-1-pic.c: Rename to tls-gd.c; fix.
1453 + * gcc.target/m68k/tls-2-pic.c: Rename to tls-ld.c; fix.
1454 + * gcc.target/m68k/xtls-1.c: Rename to tls-ie-xgot.c; fix.
1455 + * gcc.target/m68k/xtls-2.c: Rename to tls-le-xtls.c; fix.
1456 + * gcc.target/m68k/xtls-1-pic.c: Rename to tls-gd-xgot.c; fix.
1457 + * gcc.target/m68k/xtls-2-pic.c: Split into tls-ld-xgot.c,
1458 + tls-ld-xtls.c and tls-ld-xgot-xtls.c; fix.
1459 +
1460 + gcc/
1461 + * config/m68k/m68k.md (UNSPEC_XGOT, UNSPEC_TLS, UNSPEC_XTLS): Replace
1462 + with ...
1463 + (UNSPEC_RELOC, UNSPEC_RELOC32): New.
1464 + * config/m68k/m68k.opt: Fix documentation.
1465 + * config/m68k/m68k.c (m68k_unwrap_symbol): Update.
1466 + (m68k_decompose_address): Update comment.
1467 + (enum m68k_tls_reloc): Rename to m68k_reloc; add RELOC_GOT value.
1468 + (TLS_RELOC_P): New macro.
1469 + (m68k_get_tls_unspec): Rewrite, rename to m68k_wrap_symbol.
1470 + (m68k_move_to_reg, m68k_wrap_symbol_into_got_ref): New static
1471 + functions.
1472 + (legitimize_pic_address): Use them, update comment.
1473 + (m68k_call_tls_get_addr, m68k_call_read_tp): Rewrite.
1474 + (m68k_legitimize_tls_address): Rewrite, fix code generation for
1475 + initial exec model.
1476 + (m68k_tls_referenced_p_1, m68k_tls_mentioned_p): Update.
1477 + (m68k_legitimize_address): Remove excessive assert.
1478 + (m68k_get_tls_decoration): Rename to m68k_get_reloc_decoration, update.
1479 + (m68k_output_addr_const_extra): Update.
1480 + (sched_attr_op_type): Update comment.
1481 +
1482 +2008-12-01 Catherine Moore <clm@codesourcery.com>
1483 +
1484 + * gcc/config/mips/MIPS-TOOLCHAIN.pdf: New.
1485 +
1486 +2008-11-30 Maxim Kuvyrkov <maxim@codesourcery.com>
1487 +
1488 + Fix bugs in TLS code generation, add -mxtls option, add tests.
1489 +
1490 + gcc/
1491 + * config/m68k/predicates.md (symbolc_operand): Fix.
1492 + * config/m68k/m68k.md (UNSPEC_GOTOFF): Rename to UNSPEC_XGOT, update
1493 + all uses.
1494 + (UNSPEX_XTLS): New constant.
1495 + (addsi3_5200): Handle XTLS symbols, indent.
1496 + * config/m68k/m68k-protos.h (m68k_unwrap_symbol): Declare.
1497 + * config/m68k/m68k.opt (mxtls): New option.
1498 + * config/m68k/m68k.c (m68k_unwrap_symbol): New function.
1499 + (m68k_decompose_address): Handle TLS references.
1500 + (m68k_get_gp): Move to a better place.
1501 + (legitimize_pic_address): Update, cleanup, add REG_EQUAL note when
1502 + appropriate.
1503 + (m68k_get_tls_unspec): New function to unify generation of TLS
1504 + references.
1505 + (m68k_libcall_value_in_a0_p): New static variable.
1506 + (m68k_call_tls_get_addr, m68k_call_m68k_read_tp): Rewrite.
1507 + (m68k_legitimize_tls_address): Cleanup, use m68k_get_tls_unspec.
1508 + (m68k_tls_referenced_p_1, m68k_tls_mentioned_p): Handle UNSPEC_XTLS.
1509 + (m68k_output_addr_const_extra): Handle UNSPEC_XTLS.
1510 + (print_operand_address): Update.
1511 + (m68k_libcall_value): Support calls to TLS helpers.
1512 + (m68k_sched_attr_op_type): Update.
1513 + * config/m68k/constraints.md (Cu): New constraint.
1514 +
1515 + gcc/testsuite/
1516 + * gcc.target/m68k/tls-1.c: New test.
1517 + * gcc.target/m68k/tls-1-pic.c: New test.
1518 + * gcc.target/m68k/tls-2.c: New test.
1519 + * gcc.target/m68k/tls-2-pic.c: New test.
1520 + * gcc.target/m68k/xtls-1.c: New test.
1521 + * gcc.target/m68k/xtls-1-pic.c: New test.
1522 + * gcc.target/m68k/xtls-2.c: New test.
1523 + * gcc.target/m68k/xtls-2-pic.c: New test.
1524 +
1525 +2008-11-29 Joseph Myers <joseph@codesourcery.com>
1526 +
1527 + Backport from FSF:
1528 +
1529 + gcc/testsuite/
1530 + 2008-11-29 Joseph Myers <joseph@codesourcery.com>
1531 + * g++.dg/cpp/stringop-1.C: New test.
1532 +
1533 + libcpp/
1534 + 2008-11-29 Joseph Myers <joseph@codesourcery.com>
1535 + * lex.c (cpp_token_len): Use 6 as default length.
1536 +
1537 +2008-11-26 Catherine Moore <clm@codesourcery.com>
1538 +
1539 + gcc/testsuite/
1540 + * gcc.target/mips/vr-mult-1.c: Require hard-float.
1541 + * gcc.target/mips/branch-cost-1.c: Likewise.
1542 + * gcc.target/mips/movcc-2.c: Likewise.
1543 + * gcc.target/mips/rsqrt-3.c: Likewise.
1544 + * gcc.target/mips/vr-mult-2.c: Likewise.
1545 + * gcc.target/mips/branch-cost-2.c: Likewise.
1546 + * gcc.target/mips/movcc-3.c: Likewise.
1547 + * gcc.target/mips/nmadd-1.c: Likewise.
1548 + * gcc.target/mips/nmadd-2.c: Likewise.
1549 + * gcc.target/mips/movcc-1.c: Likewise.
1550 + * gcc.target/mips/nmadd-3.c: Likewise.
1551 +
1552 +2008-11-24 Catherine Moore <clm@codesourcery.com>
1553 +
1554 + gcc/testsuite/
1555 + * gcc.target/mips/mips-nonpic/mips-nonpic.exp: Don't run for mips16.
1556 +
1557 +2008-11-24 Nathan Froyd <froydnj@codesourcery.com>
1558 +
1559 + gcc/
1560 + * config/rs6000/rs6000.c (rs6000_savres_strategy): Always use
1561 + inline saves and restores when compiling position-independent code.
1562 +
1563 +2008-11-24 Nathan Froyd <froydnj@codesourcery.com>
1564 +
1565 + gcc/
1566 + * config.gcc (powerpc-*-elf*): Only include e500mc-specific files
1567 + if --enable-powerpc-e500mc-elf was specified.
1568 +
1569 +2008-11-20 Maxim Kuvyrkov <maxim@codesourcery.com>
1570 +
1571 + PR35018
1572 +
1573 + gcc/
1574 + * config/m68k/m68k.md (addsi_lshrsi_31): Rename to
1575 + addsi_lshrsi_31_m68k, don't use it for ColdFire.
1576 + Add (define_expand "addsi_lshrsi_31").
1577 + (addsi_lshrsi_31_cf): New, almost identical copy of extendsidi2_m68k.
1578 +
1579 + gcc/testsuite/
1580 + * gcc.target/m68k/pr35018.c: New.
1581 +
1582 +2008-11-20 Joseph Myers <joseph@codesourcery.com>
1583 +
1584 + gcc/
1585 + * config/arm/thumb2.md (thumb2_casesi_internal,
1586 + thumb2_casesi_internal_pic): Use earlyclobber for scratch operand
1587 + 4.
1588 +
1589 +2008-11-19 Andrew Stubbs <ams@codesourcery.com>
1590 +
1591 + Issue #3283
1592 +
1593 + gcc/
1594 + PR target/36133
1595 + * config/m68k/m68k.h (CC_OVERFLOW_UNUSABLE, CC_NO_CARRY): New defines.
1596 + * config/m68k/m68k.c (notice_update_cc): Set cc_status properly for
1597 + shift instructions.
1598 + * config/m68k/m68k.md: Adjust all conditional branches that use the
1599 + carry and overflow flags so they understand CC_OVERFLOW_UNUSABLE.
1600 +
1601 + gcc/testsuite/
1602 + PR target/36133
1603 + * gcc.target/m68k/pr36133.c: New test.
1604 +
1605 +2008-11-17 Nathan Froyd <froydnj@codesourcery.com>
1606 +
1607 + gcc/
1608 + * config/rs6000/rs6000.c (rs6000_emit_epilogue): Adjust
1609 + computation of restore_lr. Duplicate restoration of LR and
1610 + execute the appropriate one depending on whether GPRs are being
1611 + restored inline.
1612 +
1613 +2008-11-17 Catherine Moore <clm@codesourcery.com>
1614 +
1615 + * config/mt-sde: Revert last patch.
1616 +
1617 +2008-11-17 Paul Brook <paul@codesourcery.com>
1618 +
1619 + gcc/
1620 + * config/arm/t-symbian (MULTILIB_EXCEPTIONS, MULTILIB_MATCHES,
1621 + MULTILIB_ALIASES): Define.
1622 +
1623 +2008-11-17 Nathan Froyd <froydnj@codesourcery.com>
1624 +
1625 + gcc/
1626 + * config/rs6000/rs6000.c (rs6000_savres_routine_sym): Fix
1627 + computation for cache selector. Mark the generated symbol as a
1628 + function.
1629 + (rs6000_emit_prologue): Correct condition.
1630 + * config/rs6000/rs6000.md (*save_gpregs_<mode>): Use explicit
1631 + match for register 11.
1632 + (*save_fpregs_<mode>): Likewise.
1633 + (*restore_gpregs_<mode>): Likewise.
1634 + (*return_and_restore_gpregs_<mode>): Likewise.
1635 + (*return_and_restore_fpregs_<mode>): Likewise.
1636 + * config/rs6000/spe.md (*save_gpregs_spe): Use explicit match for
1637 + register 11.
1638 + (*restore_gpregs_spe): Likewise.
1639 + (*return_and_restore_gpregs_spe): Likewise.
1640 +
1641 +2008-11-14 Catherine Moore <clm@codesourcery.com>
1642 +
1643 + * config/mt-sde (CFLAGS_FOR_TARGET): Add -mexplicit-relocs.
1644 + (CXXFLAGS_FOR_TARGET): Likewise.
1645 +
1646 +2008-11-14 Maxim Kuvyrkov <maxim@codesourcery.com>
1647 + Andrew Stubbs <ams@codesourcery.com>
1648 + Gunnar Von Boehn <gunnar@genesi-usa.com>
1649 +
1650 + Issue #3284
1651 +
1652 + gcc/
1653 + PR target/36134
1654 + * config/m68k/m68k.md (addsi3_5200): Add a new alternative preferring
1655 + the shorter LEA insn over ADD.L where possible.
1656 +
1657 + gcc/testsuite/
1658 + PR target/36134
1659 + * gcc.target/m68k/pr36134.c: New test.
1660 +
1661 +2008-11-13 Joseph Myers <joseph@codesourcery.com>
1662 +
1663 + gcc/
1664 + * config/mips/sicortex.h, config/mips/t-sicortex: New.
1665 + * config.gcc (mips64el-sicortex-linux-gnu): Use these config
1666 + files.
1667 +
1668 +2008-11-13 Nathan Froyd <froydnj@codesourcery.com>
1669 +
1670 + gcc/
1671 + * config.gcc (powerpc*-elf*): Configure for e500mc.
1672 + * config/rs6000/t-ppc-e500mc: New.
1673 + * config/rs6000/e500mc.h: New.
1674 +
1675 +2008-11-12 Nathan Sidwell <nathan@codesourcery.com>
1676 +
1677 + Issue 4221/1
1678 + * release-notes-csl.xml: Document removal of default -mfix-ice9a.
1679 +
1680 +2008-11-11 Joseph Myers <joseph@codesourcery.com>
1681 +
1682 + gcc/
1683 + * function.c (alignment_for_aligned_arrays): Use floor_log2
1684 + instead of CLZ_HWI.
1685 +
1686 +2008-11-10 Nathan Froyd <froydnj@codesourcery.com>
1687 +
1688 + Issue #4082
1689 +
1690 + gcc/
1691 + * config/rs6000/rs6000.c (rs6000_legitimize_address): Check for
1692 + non-word-aligned REG+CONST addressing.
1693 +
1694 + gcc/testsuite/
1695 + * gcc.target/powerpc/20081104-1.c: New test.
1696 +
1697 +2008-11-07 Julian Brown <julian@codesourcery.com>
1698 +
1699 + Issue #4085
1700 +
1701 + gcc/
1702 + * combine.c (find_split_point): Disable patch from PR27971.
1703 +
1704 +2008-11-06 Kazu Hirata <kazu@codesourcery.com>
1705 +
1706 + Issue 4029
1707 + gcc/
1708 + Backport:
1709 + 2008-11-06 Kazu Hirata <kazu@codesourcery.com>
1710 + PR target/35574
1711 + * config/sparc/predicates.md (const_double_or_vector_operand):
1712 + New.
1713 + * config/sparc/sparc.c (sparc_extra_constraint_check): Handle the
1714 + 'D' constraint.
1715 + * config/sparc/sparc.h: Document the 'D' constraint.
1716 + * config/sparc/sparc.md (*movdf_insn_sp32_v9, *movdf_insn_sp64):
1717 + Use the 'D' constraint in addition to 'F' in some alternatives.
1718 + (DF splitter): Generalize for V64mode.
1719 + * doc/md.texi (SPARC): Document the 'D' constraint.
1720 +
1721 + * release-notes-csl.xml: Add a release note for the fix above.
1722 +
1723 +2008-11-06 Andrew Stubbs <ams@codesourcery.com>
1724 +
1725 + Issue #3120
1726 +
1727 + gcc/
1728 + * release-notes-csl.xml: -pg support for ARM EABI.
1729 +
1730 +2008-10-29 Andrew Stubbs <ams@codesourcery.com>
1731 +
1732 + Issue 3120
1733 +
1734 + gcc/
1735 + * config/arm/linux-eabi.h (ARM_FUNCTION_PROFILER): Delete.
1736 + (SUBTARGET_FRAME_POINTER_REQUIRED): Delete.
1737 + * config/arm/bpabi.h (PROFILE_HOOK): New undef.
1738 +
1739 + Back-port from mainline:
1740 + 2008-10-08 Paul Brook <paul@codesourcery.com>
1741 + gcc/
1742 + * config/arm/bpabi.h (ARM_FUNCTION_PROFILER): Define new EABI
1743 + compatible profiler (__gnu_mcount_nc).
1744 + (SUBTARGET_FRAME_POINTER_REQUIRED): Define.
1745 +
1746 +2008-10-27 Catherine Moore <clm@codesourcery.com>
1747 +
1748 + Issue #4105
1749 +
1750 + Backport:
1751 +
1752 + gcc/
1753 + 2008-10-22 Chao-ying Fu <fu@mips.com>
1754 +
1755 + * config/mips/mips.opt (msmartmips): Accept -mno-smartmips.
1756 +
1757 +2008-10-24 Maxim Kuvyrkov <maxim@codesourcery.com>
1758 +
1759 + gcc/
1760 + * config/m68k/m68k.c (m68k_output_dwarf_dtprel): Use .long instead of
1761 + .word for TLS debug information.
1762 +
1763 +2008-10-24 Nathan Froyd <froydnj@codesourcery.com>
1764 +
1765 + gcc/
1766 + * config/rs6000/rs6000.c (no_global_regs_above): Fix precedence
1767 + problem.
1768 +
1769 +2008-10-23 Kazu Hirata <kazu@codesourcery.com>
1770 +
1771 + Issue 3852
1772 + gcc/
1773 + * config/arm/t-asa (MULTILIB_EXTRA_OPTS): New.
1774 +
1775 +2008-10-22 Paul Brook <paul@codesourcery.com>
1776 +
1777 + gcc/
1778 + * config/arm/t-uclinux-eabi (MULTILIB_EXCEPTIONS): Exclude bogus ARM
1779 + multilib.
1780 +
1781 +2008-10-21 Paul Brook <paul@codesourcery.com>
1782 +
1783 + gcc/
1784 + * doc/invoke.texi: Document -mfix-cortex-m3-ldrd.
1785 + * config/arm/arm.c (arm_override_options): Set fix_cm3_ldrd
1786 + if Cortex-M3 cpu is selected.
1787 + (output_move_double): Avoid overlapping base register and first
1788 + destination register when fix_cm3_ldrd.
1789 + * config/arm/arm.opt: Add -mfix-cortex-m3-ldrd.
1790 + * config/arm/t-cs-eabi: Add -mfix-cortex-m3-ldrd to Thumb-2 multilib.
1791 + * config/arm/t-arm-elf: Ditto.
1792 + * config/arm/t-uclinux-eabi: Ditto.
1793 +
1794 +2008-10-21 Paul Brook <paul@codesourcery.com>
1795 +
1796 + gcc/
1797 + * config/arm/arm.md (consttable_4): Handle (high ...).
1798 +
1799 +2008-10-16 Nathan Froyd <froydnj@codesourcery.com>
1800 +
1801 + gcc/
1802 + * config.gcc (powerpc-*-eabi*): Add rs6000/t-cs-eabi when
1803 + --enable-extra-sgxx-multilibs is passed to configure.
1804 + * config/rs6000/t-ppcgas (MULTILIB_OPTIONS): Remove te500mc.
1805 + (MULTILIB_DIRNAMES): Likewise.
1806 + (MULTILIB_EXCEPTIONS): Likewise.
1807 + * config/rs6000/t-cs-eabi: New file.
1808 +
1809 +2008-10-16 Julian Brown <julian@codesourcery.com>
1810 +
1811 + Issue #4039
1812 +
1813 + gcc/
1814 + * config/arm/neon.md (movmisalign<mode>): Use expander/unnamed insn
1815 + for both D & Q variants. Don't permit both operands to be mems.
1816 + * release-notes-csl.xml (Misaligned NEON memory accesses): Add note.
1817 +
1818 +2008-10-15 Catherine Moore <clm@codesourcery.com>
1819 +
1820 + gcc/testsuite/
1821 + * gcc-target/mips/octeon-1.c (dg-mips-options): Use -mno-abicalls.
1822 + * gcc-target/mips/octeon-5.c (dg-mips-options): Likewise.
1823 + * gcc-target/mips/octeon-6.c (dg-mips-options): Likewise.
1824 + * gcc-target/mips/octeon-18.c (dg-mips-options): Likewise.
1825 + * gcc-target/mips/octeon-19.c (dg-mips-options): Likewise.
1826 + * gcc-target/mips/octeon-23.c (dg-mips-options): Likewise.
1827 + * gcc-target/mips/octeon-28.c (dg-mips-options): Likewise.
1828 + * gcc-target/mips/octeon-34.c (dg-mips-options): Likewise.
1829 + * gcc-target/mips/octeon-37.c (dg-mips-options): Likewise.
1830 + * gcc-target/mips/octeon-43.c (dg-mips-options): Likewise.
1831 + * gcc-target/mips/octeon-44.c (dg-mips-options): Likewise.
1832 + * gcc-target/mips/octeon-49.c (dg-mips-options): Likewise.
1833 + * gcc-target/mips/octeon-54.c (dg-mips-options): Likewise.
1834 +
1835 +2008-10-14 Sandra Loosemore <sandra@codesourcery.com>
1836 +
1837 + Issue #4017
1838 +
1839 + * release-notes-csl.xml (Linker script option syntax): New note.
1840 +
1841 + gcc/
1842 + * config.gcc (powerpc-*): Make t-ppcgas imply usegas.h.
1843 + * config/svr4.h (SVR4_ASM_SPEC): New.
1844 + (ASM_SPEC): Inherit from SVR4_ASM_SPEC.
1845 + * config/rs6000/sysv4.h (ASM_SPEC): Inherit from SVR4_ASM_SPEC.
1846 +
1847 + gcc/doc/
1848 + * invoke.texi (Option Summary): Add -T to linker options.
1849 + (Link Options): Document -T.
1850 +
1851 +2008-10-13 Nathan Froyd <froydnj@codesourcery.com>
1852 +
1853 + gcc/
1854 + * config/rs6000/rs6000.c (rs6000_file_start): Output gnu
1855 + attribute for struct return convention.
1856 +
1857 +2008-10-13 Paul Brook <paul@codesourcery.com>
1858 +
1859 + gcc/
1860 + * config/arm/arm.h (fputype): Remove stray comma.
1861 +
1862 +2008-10-13 Andrew Stubbs <ams@codesourcery.com>
1863 +
1864 + Issue #3884
1865 +
1866 + gcc/
1867 + * doc/invoke.texi (PowerPC Options): -meabi option no longer places
1868 + __eabi function in main.
1869 +
1870 +2008-10-12 Mark Mitchell <mark@codesourcery.com>
1871 +
1872 + Issue #3224
1873 + * release-notes-csl.xml: Mention OpenMP add-on.
1874 +
1875 +2008-10-12 Catherine Moore <clm@codesourcery.com>
1876 +
1877 + Issue # 3903
1878 +
1879 + Backport:
1880 +
1881 + 2008-07-28 Ilie Garbacea <ilie@mips.com>
1882 + Chao-ying Fu <fu@mips.com>
1883 +
1884 + * configure.tgt: Enable futex for MIPS.
1885 + * config/linux/mips/futex.h: New file.
1886 +
1887 +2008-10-12 Catherine Moore <clm@codesourcery.com>
1888 +
1889 + gcc/
1890 + * config/mips/mips.opt (muclibc): New option entry.
1891 + * config/mips/mips.c (mips_override_options): Disable
1892 + __thread support when the -muclibc option is used.
1893 +
1894 +2008-10-11 Maxim Kuvyrkov <maxim@codesourcery.com>
1895 +
1896 + M68K NPTL support.
1897 + gcc/
1898 + * configure.ac (m68k-*-*): Check if binutils support TLS.
1899 + * configure: Regenerate.
1900 + * config/m68k/predicates.md (symbolic_operand): Handle UNSPECs.
1901 + * config/m68k/m68k.md (UNSPEC_TLS): New constant.
1902 + (movsi): Handle TLS symbols.
1903 + * config/m68k/m68k-protos.h (m68k_legitimize_tls_address): Declare.
1904 + (m68k_tls_referenced_p, m68k_tls_mentioned_p): Declare.
1905 + (m68k_legitimize_address): Declare.
1906 + * config/m68k/m68k.c (ggc.h): Include.
1907 + (m68k_output_dwarf_dtprel): Implement hook.
1908 + (TARGET_HAVE_TLS, TARGET_ASM_OUTPUT_DWARF_DTPREL): Define.
1909 + (m68k_expand_prologue): Load GOT pointer when function needs it.
1910 + (m68k_illegitimate_symbolic_constant_p): Handle TLS symbols.
1911 + (m68k_legitimate_constant_address_p): Same.
1912 + (legitimize_pic_address): Same.
1913 + (enum m68k_tls_reloc): New.
1914 + (m68k_tls_get_addr, m68k_get_tls_get_addr, m68k_get_gp)
1915 + (m68k_call_tls_get_addr, m68k_read_tp, m68k_get_m68k_read_tp)
1916 + (m68k_call_m68k_read_tp): Helper variables and functions for ...
1917 + (m68k_legitimize_tls_address): Handle TLS references.
1918 + (m68k_tls_symbol_p, m68k_tls_referenced_p_1, m68k_tls_referenced_p)
1919 + (m68k_tls_mentioned_p): New functions.
1920 + (m68k_legitimize_address): Rewrite LEGITIMIZE_ADDRESS macro, handle
1921 + TLS symbols.
1922 + (m68k_get_tls_decoration): New static function.
1923 + (m68k_output_addr_const_extra): Handle UNSPEC_TLS.
1924 + (m68k_output_dwarf_dtprel): Implement hook.
1925 + (gt-m68k.h): Include.
1926 + * config/m68k/m68k.h (LEGITIMATE_PIC_OPERAND_P): Support TLS.
1927 + (LEGITIMATE_ADDRESS): Move logic to m68k.c:m68k_legitimize_address.
1928 +
1929 +2008-10-11 Maxim Kuvyrkov <maxim@codesourcery.com>
1930 +
1931 + gcc/
1932 + * config/m68k/lb1sf68.asm (PICCALL, PICJUMP): Use GOT instead of
1933 + PC-relative addressing when compiling for uclinux PIC.
1934 +
1935 +2008-10-09 Catherine Moore <clm@codesourcery.com>
1936 +
1937 + Issue #3312
1938 +
1939 + gcc/
1940 + * config/mips/mips.h ( DSP_CTRL_REG_FIRST): Define.
1941 + (DSP_CTRL_REG_LAST): Define.
1942 + * config/mips/mips.c (mips_conditional_register_usage): Handle
1943 + DSP registers.
1944 +
1945 +2008-10-08 Maxim Kuvyrkov <maxim@codesourcery.com>
1946 +
1947 + * release-notes-csl.xml: Fix typo.
1948 +
1949 +2008-10-08 Nathan Sidwell <nathan@codesourcery.com>
1950 + Maxim Kuvyrkov <maxim@codesourcery.com>
1951 +
1952 + * release-notes-csl.xml (Shared Libraries bug fix): New.
1953 +
1954 + gcc/
1955 + * config/m68k/lb1sf68.asm (__cmpdf_internal, __cmpsf_internal): Hide.
1956 + (__cmpdf, __cmpsf): Use PIC call sequence.
1957 +
1958 +2008-10-07 Nathan Froyd <froydnj@codesourcery.com>
1959 +
1960 + Issue #3988
1961 +
1962 + * release-notes-csl.xml (Dynamic libraries and -Os bug fix): New.
1963 +
1964 + gcc/
1965 + * config/rs6000/ppc-asm.h (HIDDEN_FUNC): New macro.
1966 + * config/rs6000/crtresfpr.asm, config/rs6000/crtresgpr.asm,
1967 + config/rs6000/crtresxfpr.asm, config/rs6000/crtresxgpr.asm,
1968 + config/rs6000/crtsavfpr.asm, config/rs6000/crtsavgpr.asm,
1969 + config/rs6000/e500crtres32gpr.asm,
1970 + config/rs6000/e500crtres64gpr.asm,
1971 + config/rs6000/e500crtres64gprctr.asm,
1972 + config/rs6000/e500crtrest32gpr.asm,
1973 + config/rs6000/e500crtrest64gpr.asm,
1974 + config/rs6000/e500crtresx32gpr.asm,
1975 + config/rs6000/e500crtresx64gpr.asm,
1976 + config/rs6000/e500crtsav32gpr.asm,
1977 + config/rs6000/e500crtsav64gpr.asm,
1978 + config/rs6000/e500crtsav64gprctr.asm,
1979 + config/rs6000/e500crtsavg32gpr.asm,
1980 + config/rs6000/e500crtsavg64gpr.asm,
1981 + config/rs6000/e500crtsavg64gprctr.asm: Use it.
1982 +
1983 +2008-10-07 Nathan Sidwell <nathan@codesourcery.com>
1984 +
1985 + * release-notes-csl.xml: Document it.
1986 +
1987 + gcc/
1988 + * doc/invoke.texi (MIPS Options): Add ice9 arch.
1989 + * config/mips/mips.c (mips_cpu_info_table): Add ice9 arch.
1990 +
1991 +2008-10-03 Catherine Moore <clm@codesourcery.com>
1992 +
1993 + gcc/testsuite/
1994 + * gcc.target/mips/fix-ice9a-1.c: Disable for soft-float
1995 + multilibs.
1996 + * gcc.target/mips/fix-ice9a-1.c: Likewise.
1997 +
1998 +2008-10-03 Kazu Hirata <kazu@codesourcery.com>
1999 +
2000 + Backport:
2001 + gcc/testsuite/
2002 + 2008-09-23 Eric Botcazou <ebotcazou@adacore.com>
2003 +
2004 + * gcc.dg/pragma-init-fini.c: Use dg-warning in lieu of dg-error.
2005 + * gcc.dg/pragma-align-2.c: Likewise.
2006 + * gcc.dg/format/cmn-err-1.c: Likewise.
2007 +
2008 +2008-10-02 Catherine Moore <clm@codesourcery.com>
2009 +
2010 + gcc/testsuite/
2011 + * gcc.target/mips/lazy-binding-1.c: Compile with -fpic.
2012 +
2013 +2008-10-02 Maciej W. Rozycki <macro@codesourcery.com>
2014 +
2015 + Issue #3673
2016 + gcc/testsuite/
2017 + * lib/target-supports.exp
2018 + (check_effective_target_arm_iwmmxt_ok): New procedure.
2019 + * gcc.dg/arm-mmx-1.c: Only run if arm_iwmmxt_ok.
2020 +
2021 +2008-09-29 Joseph Myers <joseph@codesourcery.com>
2022 +
2023 + Backport:
2024 +
2025 + gcc/
2026 + 2008-09-29 Joseph Myers <joseph@codesourcery.com>
2027 + * ifcvt.c (noce_emit_store_flag): If using condition from original
2028 + jump, reverse it if if_info->cond was reversed.
2029 +
2030 +2008-09-29 Maxim Kuvyrkov <maxim@codesourcery.com>
2031 +
2032 + Issue #3922
2033 + * release-notes-csl.xml (Code generation bug fix): New.
2034 + gcc/
2035 + * config/m68k/m68k.md (extendsidi2): Rename to extendsidi2_m68k,
2036 + don't use it for ColdFire. Add (define_expand "extendsidi2").
2037 + (extendsidi2_cf): New, almost identical copy of extendsidi2_m68k.
2038 + gcc/testsuite/
2039 + * gcc.c-torture/compile/20080929-1.c: New.
2040 +
2041 +2008-09-29 Maxim Kuvyrkov <maxim@codesourcery.com>
2042 +
2043 + * release-notes-csl.xml (ColdFire M54455 support): Fix target.
2044 +
2045 +2008-09-25 Sandra Loosemore <sandra@codesourcery.com>
2046 +
2047 + Issue #3208
2048 +
2049 + * release-notes-csl.xml (Half-precision floating point): New note.
2050 +
2051 +2008-09-25 Paul Brook <paul@codesourcery.com>
2052 +
2053 + gcc/
2054 + * config/arm/fp16.c (__gnu_f2h_ieee, __gnu_h2f_ieee): Enable on
2055 + ARMv6-M.
2056 + * config/arm/t-bpabi (LIB2FUNCS_EXTRA): Remove fp16.c.
2057 + (LIB2FUNCS_STATIC_EXTRA): Add fp16.c.
2058 + * config/arm/t-symbian (LIB2FUNCS_EXTRA): Rename...
2059 + (LIB2FUNCS_STATIC_EXTRA): ... to this.
2060 + * config/arm/t-arm-softfp: Remove HFmode conversions.
2061 + * config/soft-fp/extendhfsf2.c: Revert HFmode suport.
2062 + * config/soft-fp/truncsfhf2.c: Ditto.
2063 + * config/soft-fp/README: Ditto.
2064 + * config/soft-fp/half.h: Ditto.
2065 +
2066 +2008-09-25 Sandra Loosemore <sandra@codesourcery.com>
2067 +
2068 + gcc/testsuite/
2069 + * gcc.dg/torture/arm-fp16-ops.h: Fix bogus tests.
2070 + * g++.dg/ext/arm-fp16/arm-fp16-ops.h: Ditto.
2071 +
2072 +2008-09-25 Julian Brown <julian@codesourcery.com>
2073 +
2074 + gcc/
2075 + * config/arm/arm.c (arm_hard_regno_mode_ok): Allow 4-word quantities
2076 + in core registers. Update comment.
2077 +
2078 +2008-09-25 Nathan Sidwell <nathan@codesourcery.com>
2079 +
2080 + * release-notes-csl.xml: Document ice9a option.
2081 +
2082 +2008-09-25 Julian Brown <julian@codesourcery.com>
2083 +
2084 + Issue #3800
2085 +
2086 + gcc/testsuite/
2087 + * gcc.target/arm/eabi1.c (__eabi_uread4, __eabi_uwrite4)
2088 + (__eabi_uread8, __eabi_uwrite8): Change spellings of declarations
2089 + to...
2090 + (__aeabi_uread4, __aeabi_uwrite4, __aeabi_uread8, __aeabi_uwrite8):
2091 + These.
2092 +
2093 +2008-09-24 Paul Brook <paul@codesourcery.com>
2094 +
2095 + gcc/
2096 + * config/arm/t-arm-softfp (softfp_extensions): Add hfsf.
2097 + (softfp_truncations): Add sfhf.
2098 + * config/arm/sfp-machine.h (_FP_NANFRAC_H, _FP_NANSIGN_H): Define.
2099 + * config/arm/fp16.c: New file.
2100 + * config/arm/t-bpabi (LIB2FUNCS_EXTRA): Add fp16.c.
2101 + * config/arm/t-symbian (LIB2FUNCS_EXTRA): Add fp16.c.
2102 + * config/soft-fp/extendhfsf2.c: New file.
2103 + * config/soft-fp/truncsfhf2.c: New file.
2104 + * config/soft-fp/half.h: New file.
2105 + * config/soft-fp/README: HFmode routines do not come from gcc.
2106 +
2107 +2008-09-22 Daniel Gutson <daniel@codesourcery.com>
2108 + Nathan Sidwell <nathan@codesourcery.com>
2109 + Maciej W. Rozycki <macro@codesourcery.com>
2110 +
2111 + Issue #3634
2112 + gcc/
2113 + * config.gcc (all_defaults): Add fix-ice9a.
2114 + * config/mips/mips.c (mips_conditional_register_usage): Add $f30
2115 + and $f31 as appropriate as fixed registers.
2116 + * config/mips/mips.h (OPTION_DEFAULT_SPECS): Add -mfix-ice9a
2117 + handling.
2118 + (ASM_SPEC): Likewise.
2119 + * config/mips/mips.md (ice9a_stallnops): New mode attribute.
2120 + (ice9a_round): Likewise.
2121 + (ice9a_length_stall): Likewise.
2122 + (ice9a_length_round): Likewise.
2123 + (ice9a_length_both): Likewise.
2124 + (*mul<mode>3): Change condition.
2125 + (*mul<mode>3_fix_ice9a): New.
2126 + (*madd<mode>): Change condition.
2127 + (*madd<mode>_ice9a): New.
2128 + (*msub<mode>): Change condition.
2129 + (*msub<mode>_ice9a): New.
2130 + (*nmadd<mode>): Change condition.
2131 + (*nmadd<mode>_fastmath): Likewise.
2132 + (*nmadd<mode>_ice9a): New.
2133 + (*nmadd<mode>_fastmath_ice9a): New.
2134 + (*nmsub<mode>): Change condition.
2135 + (*nmsub<mode>_fastmath): Likewise.
2136 + (*nmsub<mode>_ice9a): New.
2137 + (*nmsub<mode>_fastmath_ice9a): Likewise.
2138 + (*recip<mode>3): Change condition and definition. Move the SB1
2139 + fix to...
2140 + (*recip<mode>3_fix_sb1): ... this new pattern.
2141 + (*recip<mode>3_fix_ice9a): New.
2142 + (sqrt<mode>2): Change from define_insn to define_expand. Move
2143 + the SB1 fix to...
2144 + (*sqrt<mode>2): New.
2145 + (*sqrt<mode>2_fix_sb1): ... this new pattern.
2146 + (*sqrt<mode>2_fix_ice9a): New.
2147 + (*rsqrt<mode>a): Change condition and definition. Move the SB1
2148 + fix to...
2149 + (*rsqrt<mode>a_fix_sb1): ... this new pattern.
2150 + (*rsqrt<mode>a_fix_ice9a): New.
2151 + (*rsqrt<mode>b): Likewise *rsqrt<mode>a.
2152 + (*rsqrt<mode>b_fix_sb1): Likewise *rsqrt<mode>a_fix_sb1.
2153 + (*rsqrt<mode>b_fix_ice9a): New.
2154 + * config/mips/mips.opt (mfix-ice9a): New option.
2155 + * doc/invoke.texi (-mno-fix-ice9a): New option.
2156 + (-mfix-ice9a): Likewise.
2157 +
2158 + gcc/testsuite/
2159 + * gcc.target/mips/fix-ice9a.h: New file.
2160 + * gcc.target/mips/fix-ice9a-1.c: Likewise.
2161 + * gcc.target/mips/fix-ice9a-2.c: Likewise.
2162 +
2163 +2008-09-23 Sandra Loosemore <sandra@codesourcery.com>
2164 +
2165 + Issue #3208
2166 +
2167 + gcc/
2168 + * config/arm/arm.c (arm_init_libfuncs): Add NULL entries for
2169 + HFmode arithmetic functions.
2170 + (arm_override_options): Call sorry for fp16 and no ldrh.
2171 + (arm_legitimate_index_p): Treat HFmode like HImode.
2172 + (coproc_secondary_reload_class): Special-case HFmode.
2173 + * config/arm/arm.md (floatsihf2): Use emit_move_insn.
2174 + (floatdihf2): Likewise.
2175 + (truncdfhf2): Likewise.
2176 + (*thumb1_movhf): Fix backwards operands to strh.
2177 +
2178 +2008-09-23 Sandra Loosemore <sandra@codesourcery.com>
2179 +
2180 + Issue #3208
2181 +
2182 + gcc/testsuite/
2183 + * gcc.target/arm/fp16-compile-alt-10.c: Add -std=gnu99 to options.
2184 + * gcc.target/arm/fp16-compile-alt-11.c: Likewise.
2185 + * gcc.target/arm/fp16-compile-ieee-10.c: Likewise.
2186 + * gcc.target/arm/fp16-compile-ieee-11.c: Likewise.
2187 + * gcc.target/arm/fp16-compile-exprtype.c: New.
2188 + * gcc.target/arm/fp16-builtins-1.c: New.
2189 + * gcc.target/arm/fp16-unprototyped-1.c: New.
2190 + * gcc.target/arm/fp16-unprototyped-2.c: New.
2191 + * gcc.target/arm/fp16-variadic-1.c: New.
2192 + * gcc.target/arm/fp16-rounding-alt-1.c: New.
2193 + * gcc.target/arm/fp16-rounding-ieee-1.c: New.
2194 + * gcc.dg/torture/arm-fp16-int-convert-alt.c: New.
2195 + * gcc.dg/torture/arm-fp16-int-convert-ieee.c: New.
2196 + * gcc.dg/torture/arm-fp16-ops.h: New.
2197 + * gcc.dg/torture/arm-fp16-ops-1.c: New.
2198 + * gcc.dg/torture/arm-fp16-ops-2.c: New.
2199 + * gcc.dg/torture/arm-fp16-ops-3.c: New.
2200 + * gcc.dg/torture/arm-fp16-ops-4.c: New.
2201 + * gcc.dg/torture/arm-fp16-ops-5.c: New.
2202 + * gcc.dg/torture/arm-fp16-ops-6.c: New.
2203 + * gcc.dg/torture/arm-fp16-ops-7.c: New.
2204 + * gcc.dg/torture/arm-fp16-ops-8.c: New.
2205 + * g++.dg/ext/arm-fp16/arm-fp16-ops.h: New.
2206 + * g++.dg/ext/arm-fp16/arm-fp16-ops-1.C: New.
2207 + * g++.dg/ext/arm-fp16/arm-fp16-ops-2.C: New.
2208 + * g++.dg/ext/arm-fp16/arm-fp16-ops-3.C: New.
2209 + * g++.dg/ext/arm-fp16/arm-fp16-ops-4.C: New.
2210 + * g++.dg/ext/arm-fp16/arm-fp16-ops-5.C: New.
2211 + * g++.dg/ext/arm-fp16/arm-fp16-ops-6.C: New.
2212 + * g++.dg/ext/arm-fp16/arm-fp16-ops-7.C: New.
2213 + * g++.dg/ext/arm-fp16/arm-fp16-ops-8.C: New.
2214 +
2215 +2008-09-23 Sandra Loosemore <sandra@codesourcery.com>
2216 +
2217 + gcc/
2218 + * optabs.c (prepare_float_lib_cmp): Test that the comparison,
2219 + swapped, and reversed optabs exist before trying to use them.
2220 +
2221 +2008-09-23 Julian Brown <julian@codesourcery.com>
2222 +
2223 + gcc/
2224 + * config/arm/arm.c (arm_override_options): Override alignments if
2225 + tuning for Cortex-A8.
2226 + (create_fix_barrier, arm_reorg): If aligning to jumps or loops,
2227 + make labels have a size.
2228 + * config/arm/arm.md (VUNSPEC_ALIGN16, VUNSPEC_ALIGN32): New constants.
2229 + (align_16, align_32): New patterns.
2230 +
2231 +2008-09-23 Julian Brown <julian@codesourcery.com>
2232 +
2233 + gcc/
2234 + * config/arm/vfp.md (*arm_movsi_vfp, *thumb2_movsi_vfp)
2235 + (*arm_movdi_vfp, *thumb2_movdi_vfp, *movsf_vfp, *thumb2_movsf_vfp)
2236 + (*movdf_vfp, *thumb2_movdf_vfp, *movsfcc_vfp, *thumb2_movsfcc_vfp)
2237 + (*movdfcc_vfp, *thumb2_movdfcc_vfp): Add neon_type.
2238 + * config/arm/arm.md (neon_type): Update comment.
2239 +
2240 +2008-09-23 Julian Brown <julian@codesourcery.com>
2241 +
2242 + gcc/
2243 + * config/arm/arm.md (movsi): Don't split symbol refs here.
2244 + (define_split): New.
2245 +
2246 +2008-09-22 Maxim Kuvyrkov <maxim@codesourcery.com>
2247 + Paul Brook <paul@codesourcery.com>
2248 +
2249 + gcc/
2250 + * config/m68k/lb1sf68.asm: Add GNU-stack annotation to avoid
2251 + executable stack.
2252 +
2253 +2008-09-18 Joseph Myers <joseph@codesourcery.com>
2254 +
2255 + Backport:
2256 +
2257 + gcc/
2258 + 2008-09-17 Joseph Myers <joseph@codesourcery.com>
2259 + * expr.c (emit_group_store): Do not shift before moving via a
2260 + stack slot.
2261 +
2262 + 2008-08-13 H.J. Lu <hongjiu.lu@intel.com>
2263 + PR middle-end/36701
2264 + * expr.c (emit_group_store): Allocate stack temp with the
2265 + largest alignment when copying from register to stack.
2266 +
2267 + 2008-09-02 H.J. Lu <hongjiu.lu@intel.com>
2268 + * expr.c (emit_group_store): Don't assert stack temp mode size.
2269 +
2270 +2008-09-15 Joseph Myers <joseph@codesourcery.com>
2271 +
2272 + gcc/
2273 + * config/mips-octeon-elf.h (TARGET_OS_CPP_BUILTINS): Remove.
2274 +
2275 +2008-09-11 Mark Mitchell <mark@codesourcery.com>
2276 +
2277 + Issue #3606
2278 + * release-notes-csl.xml: Document dllexport fix.
2279 +
2280 + gcc/
2281 + * tree.c (handle_dll_attribute): Mark dllexport'd inlines as
2282 + non-external.
2283 + gcc/cp
2284 + * decl2.c (decl_needed_p): Consider dllexport'd functions needed.
2285 + * semantics.c (expand_or_defer_fn): Similarly.
2286 + gcc/testsuite/
2287 + * gcc.dg/dll-6.c: New test.
2288 + * gcc.dg/dll-6a.c: Likewise.
2289 + * gcc.dg/dll-7.c: Likewise.
2290 + * gcc.dg/dll-7a.c: Likewise.
2291 + * g++.dg/ext/dllexport2.C: Likewise.
2292 + * g++.dg/ext/dllexport2a.cc: Likewise.
2293 +
2294 +2008-09-12 Nathan Froyd <froydnj@codesourcery.com>
2295 +
2296 + Backport from mainline:
2297 +
2298 + gcc/testsuite/
2299 + 2008-08-25 Janis Johnson <janis187@us.ibm.com>
2300 + * gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c: Ignore a warning.
2301 +
2302 +2008-09-11 Joseph Myers <joseph@codesourcery.com>
2303 +
2304 + Backport:
2305 +
2306 + gcc/testsuite/
2307 + 2008-09-11 Joseph Myers <joseph@codesourcery.com>
2308 + * gcc.dg/builtins-8.c: Condition cbrt test on HAVE_C99_RUNTIME.
2309 +
2310 + 2008-09-11 Joseph Myers <joseph@codesourcery.com>
2311 + * gcc.target/i386/sse5-haddX.c, gcc.target/i386/sse5-hsubX.c:
2312 + Avoid intN_t types.
2313 +
2314 + 2008-09-11 Joseph Myers <joseph@codesourcery.com>
2315 + * lib/compat.exp, gcc.dg/compat/struct-layout-1.exp,
2316 + g++.dg/compat/struct-layout-1.exp: Use .exe extension for compat
2317 + test executables.
2318 + * gcc.dg/compat/struct-layout-1_generate.c,
2319 + g++.dg/compat/struct-layout-1_generate.c: Convert backslash to
2320 + slash in srcdir for dg-options string.
2321 +
2322 +2008-09-11 Nathan Sidwell <nathan@codesourcery.com>
2323 +
2324 + gcc/
2325 + * config.gcc (mips*-sde-elf*): Always apply sdemtk parts. Apply
2326 + t-sdelib only when not building newlib.
2327 + * config/mips/t-sdemtk: Move sdelib specific pieces to ...
2328 + * config/mips/t-sdelib: ... here. New file.
2329 +
2330 +2008-09-10 Daniel Jacobowitz <dan@codesourcery.com>
2331 +
2332 + Issue #3406
2333 + * release-notes-csl.xml: Document -fpie fix.
2334 +
2335 + gcc/
2336 + * config/mips/linux.h (SUBTARGET_ASM_SPEC): Add -fpie and -fPIE.
2337 + * config/mips/linux64.h (SUBTARGET_ASM_SPEC): Likewise.
2338 +
2339 +2008-09-09 Sandra Loosemore <sandra@codesourcery.com>
2340 +
2341 + Issue #3208
2342 +
2343 + gcc/testsuite/
2344 + * gcc.target/arm/fp16-compile-alt-1.c: New.
2345 + * gcc.target/arm/fp16-compile-alt-2.c: New.
2346 + * gcc.target/arm/fp16-compile-alt-3.c: New.
2347 + * gcc.target/arm/fp16-compile-alt-4.c: New.
2348 + * gcc.target/arm/fp16-compile-alt-5.c: New.
2349 + * gcc.target/arm/fp16-compile-alt-6.c: New.
2350 + * gcc.target/arm/fp16-compile-alt-7.c: New.
2351 + * gcc.target/arm/fp16-compile-alt-8.c: New.
2352 + * gcc.target/arm/fp16-compile-alt-9.c: New.
2353 + * gcc.target/arm/fp16-compile-alt-10.c: New.
2354 + * gcc.target/arm/fp16-compile-alt-11.c: New.
2355 + * gcc.target/arm/fp16-compile-ieee-1.c: New.
2356 + * gcc.target/arm/fp16-compile-ieee-2.c: New.
2357 + * gcc.target/arm/fp16-compile-ieee-3.c: New.
2358 + * gcc.target/arm/fp16-compile-ieee-4.c: New.
2359 + * gcc.target/arm/fp16-compile-ieee-5.c: New.
2360 + * gcc.target/arm/fp16-compile-ieee-6.c: New.
2361 + * gcc.target/arm/fp16-compile-ieee-7.c: New.
2362 + * gcc.target/arm/fp16-compile-ieee-8.c: New.
2363 + * gcc.target/arm/fp16-compile-ieee-9.c: New.
2364 + * gcc.target/arm/fp16-compile-ieee-10.c: New.
2365 + * gcc.target/arm/fp16-compile-ieee-11.c: New.
2366 + * gcc.target/arm/fp16-compile-none-1.c: New.
2367 + * gcc.target/arm/fp16-param-1.c: New.
2368 + * gcc.target/arm/fp16-return-1.c: New.
2369 + * gcc.target/arm/fp16-compile-vcvt.c: New.
2370 + * gcc.dg/torture/arm-fp16-compile-assign.c: New.
2371 + * gcc.dg/torture/arm-fp16-compile-convert.c: New.
2372 + * g++.dg/ext/arm-fp16/fp16-overload-1.C: New.
2373 + * g++.dg/ext/arm-fp16/fp16-return-1.C: New.
2374 + * g++.dg/ext/arm-fp16/fp16-param-1.C: New.
2375 + * g++.dg/ext/arm-fp16/fp16-mangle-1.C: New.
2376 +
2377 +2008-09-09 Sandra Loosemore <sandra@codesourcery.com>
2378 +
2379 + Issue #3208
2380 +
2381 + gcc/
2382 + * doc/tm.texi (Misc): Document TARGET_INVALID_PARAMETER_TYPE,
2383 + TARGET_INVALID_RETURN_TYPE, TARGET_PROMOTED_TYPE, and
2384 + TARGET_CONVERT_TO_TYPE.
2385 + * doc/invoke.texi (Option Summary): List -mfp16-format.
2386 + (ARM Options): List neon-fp16 as -mfpu value. Document -mfp16-format.
2387 + * hooks.c (hook_tree_const_tree_null): Define.
2388 + * hooks.h (hook_tree_const_tree_null): Declare.
2389 + * target.h (struct gcc_target): Add invalid_parameter_type,
2390 + invalid_return_type, promoted_type, and convert_to_type fields.
2391 + * target-def.h: (TARGET_INVALID_PARAMETER_TYPE): Define.
2392 + (TARGET_INVALID_RETURN_TYPE): Define.
2393 + (TARGET_PROMOTED_TYPE): Define.
2394 + (TARGET_CONVERT_TO_TYPE): Define.
2395 + (TARGET_INITIALIZER): Update for new fields.
2396 + * fold-const.c (fold_convert_const_real_from_real): Check for
2397 + overflow.
2398 + * real.c (encode_ieee_half): Define.
2399 + (decode_ieee_half): Define.
2400 + (ieee_half_format): Define.
2401 + (arm_half_format): Define.
2402 + * real.h (ieee_half_format): Declare.
2403 + (arm_half_format): Declare.
2404 + * c-decl.c (grokdeclarator): Check targetm.invalid_return_type.
2405 + (grokparms): Check targetm.invalid_parameter_type.
2406 + * c-typeck.c (default_conversion): Check targetm.promoted_type.
2407 + * c-convert.c (convert): Check targetm.convert_to_type.
2408 + * cp/typeck.c (default_conversion): Check targetm.promoted_type.
2409 + * cp/decl.c (grokdeclarator): Check targetm.invalid_return_type.
2410 + (grokparms): Check targetm.invalid_parameter_type.
2411 + * cp/cvt.c (ocp_convert): Check targetm.convert_to_type.
2412 + (build_expr_type_conversion): Check targetm.promoted_type.
2413 + * config/arm/arm.c: Include intl.h.
2414 + (TARGET_INVALID_PARAMETER_TYPE): Redefine.
2415 + (TARGET_INVALID_RETURN_TYPE): Redefine.
2416 + (TARGET_PROMOTED_TYPE): Redefine.
2417 + (TARGET_CONVERT_TO_TYPE): Redefine.
2418 + (arm_fp16_format): Define.
2419 + (all_fpus): Add entry for neon-fp16.
2420 + (fp_model_for_fpu): Likewise.
2421 + (struct fp16_format): Declare.
2422 + (all_fp16_formats): Define.
2423 + (arm_init_libfuncs): Add entries for HFmode conversions.
2424 + (arm_override_options): Set arm_fp16_format.
2425 + (thumb1_legitimate_address_p): Make it recognize HFmode constants.
2426 + (arm_print_operand): Add 'z' specifier for vld1.16/vst1.16.
2427 + (arm_hard_regno_mode_ok): Allow HFmode values in VFP registers.
2428 + (arm_init_fp16_builtins): New.
2429 + (arm_init_builtins): Call it.
2430 + (arm_invalid_parameter_type): New.
2431 + (arm_invalid_return_type): New.
2432 + (arm_promoted_type): New.
2433 + (arm_convert_to_type).
2434 + (arm_file_start): Deal with neon-fp16 as fpu_name. Emit tag for fp16
2435 + format.
2436 + (arm_mangle_type): Mangle __fp16 as "Dh".
2437 + * config/arm/arm.h (TARGET_VFPD32): Make it know about
2438 + FPUTYPE_NEON_FP16.
2439 + (TARGET_NEON_FP16): New.
2440 + (TARGET_NEON): Make it know about FPUTYPE_NEON_FP16.
2441 + (enum fputype): Add FPUTYPE_NEON_FP16.
2442 + (enum arm_fp16_format_type): Declare.
2443 + (arm_fp16_format): Declare.
2444 + (LARGEST_EXPONENT_IS_NORMAL): Define.
2445 + * config/arm/arm-modes.def (HFmode): Define.
2446 + * config/arm/vfp.md: (*movhf_vfp): New.
2447 + (extendhfsf2): New.
2448 + (truncsfhf2): New.
2449 + * config/arm/arm.opt (mfp16-format=): New.
2450 + * config/arm/arm.md: (fpu): Add neon_fp16.
2451 + (floatsihf2, floatdihf2): New.
2452 + (fix_trunchfsi2, fix_trunchfdi2): New.
2453 + (truncdfhf2): New.
2454 + (extendhfdf2): New.
2455 + (movhf): New.
2456 + (*arm32_movhf): New.
2457 + (*thumb1_movhf): New.
2458 + (consttable_2): Handle HFmode constants.
2459 +
2460 + libiberty/
2461 + * cp-demangle.c (cplus_demangle_builtin_Dh_type): Declare.
2462 + (cplus_demangle_type): Make it handle "Dh".
2463 +
2464 +2008-09-09 Sandra Loosemore <sandra@codesourcery.com>
2465 +
2466 + Issue #3732
2467 +
2468 + gcc/
2469 + * doc/invoke.texi (ARM Options): Correct errors in discussion
2470 + of -mfloat-abi, -mhard-float, and -msoft-float.
2471 +
2472 +2008-09-09 Kazu Hirata <kazu@codesourcery.com>
2473 +
2474 + gcc/
2475 + * config.gcc (mips-sgi-irix[56]*, mips*-*-netbsd*,
2476 + mips*-*-openbsd*, mips*-sde-elf*, mips64octeon*-wrs-elf*,
2477 + mipsisa64-*-elf*, mipsisa64el-*-elf*, mipsisa64sr71k-*-elf*,
2478 + mipsisa64sb1-*-elf*, mipsisa64sb1el-*-elf*, mips-*-elf*,
2479 + mipsel-*-elf*, mips64-*-elf*, mips64el-*-elf*, mips64vr-*-elf*,
2480 + mips64vrel-*-elf*, mips64orion-*-elf*, mips64orionel-*-elf*,
2481 + mips*-*-rtems*, mips-wrs-vxworks, mips-wrs-windiss,
2482 + mipstx39-*-elf*, mipstx39el-*-elf*): Don't add t-crtfm to
2483 + tmake_file.
2484 +
2485 + libgcc/
2486 + * config.host (mips-sgi-irix[56]*, mips*-*-netbsd*,
2487 + mips*-*-openbsd*, mipsisa32-*-elf*, mipsisa32el-*-elf*,
2488 + mipsisa32r2-*-elf*, mipsisa32r2el-*-elf*, mipsisa64-*-elf*,
2489 + mipsisa64el-*-elf*, mipsisa64sr71k-*-elf*, mipsisa64sb1-*-elf*,
2490 + mipsisa64sb1el-*-elf*, mips-*-elf*, mipsel-*-elf*, mips64-*-elf*,
2491 + mips64el-*-elf*, mips64vr-*-elf*, mips64vrel-*-elf*,
2492 + mips64orion-*-elf*, mips64orionel-*-elf*, mips64octeon-wrs-elf*,
2493 + mips64octeonel-wrs-elf*, mips*-*-rtems*, mips-wrs-vxworks,
2494 + mips-wrs-windiss, mipstx39-*-elf*, mipstx39el-*-elf*): Remove
2495 + extra_parts and tmake_file.
2496 +
2497 +2008-09-08 Daniel Jacobowitz <dan@codesourcery.com>
2498 +
2499 + * release-notes-csl.xml: Document exception handler fix.
2500 +
2501 + gcc/
2502 + * config/arm/unwind-arm.c (__gnu_unwind_pr_common): Correct test
2503 + for barrier handlers.
2504 +
2505 +2008-09-08 Daniel Jacobowitz <dan@codesourcery.com>
2506 + Mark Mitchell <mark@codesourcery.com>
2507 +
2508 + gcc/testsuite/
2509 + * g++.dg/compat/eh/filter2_x.C: Declare abort.
2510 + * g++.dg/compat/eh/new1_x.C, g++.dg/compat/eh/new1_y.C: Include
2511 + cstddef and use std::size_t.
2512 +
2513 + * gcc.dg/compat/compat-common.h: Define SKIP_COMPLEX_INT if
2514 + SKIP_COMPLEX. Honor SKIP_COMPLEX.
2515 + * gcc.dg/compat/scalar-by-value-3_x.c,
2516 + gcc.dg/compat/scalar-by-value-3_y.c,
2517 + gcc.dg/compat/scalar-by-value-4_x.c,
2518 + gcc.dg/compat/scalar-by-value-4_y.c,
2519 + gcc.dg/compat/scalar-by-value-5.c,
2520 + gcc.dg/compat/scalar-by-value-5_main.c,
2521 + gcc.dg/compat/scalar-by-value-6.c,
2522 + gcc.dg/compat/scalar-by-value-6_main.c,
2523 + gcc.dg/compat/scalar-by-value-6_x.c,
2524 + gcc.dg/compat/scalar-by-value-6_y.c,
2525 + gcc.dg/compat/struct-by-value-16_x.c,
2526 + gcc.dg/compat/struct-by-value-16_y.c,
2527 + gcc.dg/compat/struct-by-value-17_x.c,
2528 + gcc.dg/compat/struct-by-value-17_y.c,
2529 + gcc.dg/compat/struct-by-value-18_x.c,
2530 + gcc.dg/compat/struct-by-value-18_y.c,
2531 + gcc.dg/compat/struct-layout-1.h,
2532 + gcc.dg/compat/scalar-return-3_x.c,
2533 + gcc.dg/compat/scalar-return-3_y.c,
2534 + gcc.dg/compat/scalar-return-4_x.c,
2535 + gcc.dg/compat/scalar-return-4_y.c: Honor SKIP_COMPLEX.
2536 +
2537 + * gcc.dg/compat/scalar-by-value-y.h: Use stdarg.h for non-GCC
2538 + compilers.
2539 +
2540 + * gcc.dg/compat/struct-by-value-22_y.c,
2541 + gcc.dg/compat/struct-by-value-22_main.c,
2542 + gcc.dg/compat/struct-by-value-22_x.c: Honor SKIP_VLA_IN_STRUCT.
2543 +
2544 + * lib/c-compat.exp (compat_setup_dfp): Check the compiler under test
2545 + first.
2546 + * lib/compat.exp: Document COMPLEX and VLA_IN_STRUCT skips.
2547 +
2548 +2008-09-08 Paul Brook <paul@codesourcery.com>
2549 +
2550 + gcc/
2551 + * config/arm/arm.md (arm_addsi3): Add r/r/k alternative.
2552 +
2553 +2008-09-08 Kazu Hirata <kazu@codesourcery.com>
2554 +
2555 + gcc/
2556 + * config.gcc (mips-sgi-irix[56]*, mips*-*-netbsd*, mips*-*-linux*,
2557 + mips*-sde-elf*, mips64octeon*-wrs-elf*, mipsisa32r2*,
2558 + mipsisa64sr71k-*-elf*, mipsisa64sb1*, mips64vr*, mips64orion*,
2559 + mips*-*-rtems*, mips-wrs-vxworks, mips-wrs-windiss, mipstx39): Add
2560 + mips/t-crtfm to tmake_file.
2561 +
2562 + libgcc/
2563 + * config.host (mips*): Add mips/t-crtfm to tmake_file. Add
2564 + crtfastmath.o to extra_parts.
2565 + * config/mips/t-crtfm: New.
2566 +
2567 +2008-09-07 Maxim Kuvyrkov <maxim@codesourcery.com>
2568 +
2569 + gcc/testsuite/
2570 + * gcc.gd/struct/wo_prof_global_var.c: Use uninitialized integer
2571 + values instead of uninitialized FP values to avoid NaNs.
2572 + * gcc.dg/struct/wo_prof_local_var.c: Same.
2573 +
2574 +2008-09-07 Maxim Kuvyrkov <maxim@codesourcery.com>
2575 +
2576 + gcc/
2577 + * config/m68k/m68k.c (sched_attr_op_type): Handle all CONSTs.
2578 +
2579 + gcc/testsuite/
2580 + * gcc.target/m68k/xgot-1.c (dg-options): Add -O2.
2581 +
2582 +2008-09-06 Joseph Myers <joseph@codesourcery.com>
2583 +
2584 + gcc/
2585 + * combine.c (simplify_set): Avoid calling LOAD_EXTEND_OP on
2586 + non-integer modes.
2587 +
2588 +2008-09-05 Joseph Myers <joseph@codesourcery.com>
2589 +
2590 + Backport:
2591 +
2592 + gcc/
2593 + 2008-09-05 Joseph Myers <joseph@codesourcery.com>
2594 + * config/mips/mips.h (enum reg_class): Add FRAME_REGS.
2595 + (REG_CLASS_NAMES): Update.
2596 + (REG_CLASS_CONTENTS): Update.
2597 + * config/mips/mips.c (mips_regno_to_class): Use FRAME_REGS instead
2598 + of ALL_REGS for regs 77 and 78.
2599 + * function.c (instantiate_virtual_regs_in_insn): Assert that
2600 + return value of simplify_gen_subreg is not NULL.
2601 +
2602 + gcc/testsuite/
2603 + 2008-09-05 Joseph Myers <joseph@codesourcery.com>
2604 + * gcc.c-torture/compile/20080903-1.c: New test.
2605 +
2606 +2008-09-04 Nathan Sidwell <nathan@codesourcery.com>
2607 +
2608 + Issue 3304
2609 + gcc/
2610 + * config/arm/arm.c (arm_print_operand): Deal with HIGH.
2611 + * config/arm/constraints.md (j): New constraint for movw operands.
2612 + (N): Remove thumb2 meaning.
2613 + * config/arm/arm.md (*arm_movw): Delete.
2614 + (*arm_movsi_insn): Use j constraint for movw instead of N constraint.
2615 + * config/arm/vfp.md (*arm_movsi_vfp, *thumb2_movsi_vfp): Likewise.
2616 + * config/arm/thumb2.md (*thumb2_movsi_insn): Likewise.
2617 +
2618 +2008-09-04 Julian Brown <julian@codesourcery.com>
2619 +
2620 + gcc/
2621 + * Makefile.in (CSL_LICENSELIB): Remove space after -L to appease
2622 + Darwin ld.
2623 +
2624 +2008-09-04 Nathan Sidwell <nathan@codesourcery.com>
2625 +
2626 + gcc/
2627 + * config/arm/bpabi.h (LINK_SPEC): Add --fix-janus-2cc if needed.
2628 +
2629 + * release-notes-csl.xml: Adjust janus-2cc note.
2630 +
2631 +2008-09-03 Nathan Froyd <froydnj@codesourcery.com>
2632 +
2633 + libgomp/
2634 + * libgomp.texi (Library Index): Renamed from "Index" to prevent
2635 + conflict with index.html on case-insensitive file systems.
2636 +
2637 +2008-09-03 Julian Brown <julian@codesourcery.com>
2638 +
2639 + * release-notes-csl.xml (NEON improvements): Add release note.
2640 +
2641 +2008-09-02 Joseph Myers <joseph@codesourcery.com>
2642 +
2643 + gcc/testsuite/
2644 + * g++.dg/abi/arm_va_list.C: Correct order of dg-do and
2645 + dg-require-effective-target directives.
2646 +
2647 +2008-09-02 Mark Mitchell <mark@codesourcery.com>
2648 +
2649 + gcc/testsuite/
2650 + * gcc.target/arm/long-calls-1.c: Tolerate the lack of sibling
2651 + calls and/or PLT markers.
2652 + * gcc.target/arm/long-calls-2.c: Tolerate the lack of sibling
2653 + calls and/or PLT markers.
2654 + * gcc.target/arm/long-calls-3.c: Tolerate the lack of sibling
2655 + calls and/or PLT markers.
2656 + * gcc.target/arm/long-calls-4.c: Tolerate the lack of sibling
2657 + calls and/or PLT markers.
2658 +
2659 +2008-09-01 Mark Mitchell <mark@codesourcery.com>
2660 +
2661 + Backport:
2662 + 2008-09-01 Mark Mitchell <mark@codesourcery.com>
2663 + * include/std/type_traits (__make_unsigned_selector<>): Consider
2664 + enums of size smaller than short.
2665 + (__make_signed_selector<>): Likewise.
2666 + * testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
2667 + Adjust line numbers.
2668 + * testsuite/20_util/make_usigned/requirements/typedefs_neg.cc:
2669 + Adjust line numbers.
2670 + * testsuite/20_util/make_signed/requirements/typedefs-2.cc:
2671 + Ensure test_enum is the same size as short.
2672 + * testsuite/20_util/make_unsigned/requirements/typedefs-2.cc:
2673 + Ensure test_enum is the same size as short.
2674 +
2675 +2008-09-01 Joseph Myers <joseph@codesourcery.com>
2676 +
2677 + * release-notes-csl.xml: Avoid line containing only whitespace.
2678 +
2679 +2008-08-27 Daniel Gutson <daniel@codesourcery.com>
2680 +
2681 + Janus 2CC ARM shift fix:
2682 + gcc/
2683 + * config/arm/arm.md (*addsi3_carryin_shift): Added "length" clause
2684 + to handle the extra NOP.
2685 + (andsi_not_shiftsi_si): Likewise.
2686 + (*thumb1_ashlsi3): Likewise.
2687 + (*thumb1_ashrsi3): Likewise.
2688 + (*thumb1_lshrsi3): Likewise.
2689 + (*thumb1_rotrsi3): Likewise.
2690 + (*arm_shiftsi3): Likewise.
2691 + (*shiftsi3_compare0): Likewise.
2692 + (*shiftsi3_compare0_scratch): Likewise.
2693 + (*arm_notsi_shiftsi): Likewise.
2694 + (*arm_notsi_shiftsi_compare0): Likewise.
2695 + (*arm_not_shiftsi_compare0_scratch): Likewise.
2696 + (*arm_cmpsi_shiftsi): Likewise.
2697 + (*arm_cmpsi_shiftsi_swp): Likewise.
2698 + (*arm_cmpsi_negshiftsi_si): Likewise.
2699 + (*arith_shiftsi): Likewise.
2700 + (*arith_shiftsi_compare0): Likewise.
2701 + (*arith_shiftsi_compare0_scratch): Likewise.
2702 + (*sub_shiftsi): Likewise.
2703 + (*sub_shiftsi_compare0): Likewise.
2704 + (*sub_shiftsi_compare0_scratch): Likewise.
2705 + (*if_shift_move): Likewise.
2706 + (*if_move_shift): Likewise.
2707 + (*if_shift_shift): Likewise.
2708 + (*thumb1_ashlsi3_janus2): New. Duplicated pattern to handle the
2709 + extra NOP.
2710 + (*thumb1_ashrsi3_janus2): Likewise.
2711 + (*thumb1_lshrsi3_janus2): Likewise.
2712 + (*thumb1_rotrsi3_janus2): Likewise.
2713 + * config/arm/arm.c (arm_print_operand): Added the nop after the %S
2714 + pattern.
2715 + (arm_override_options): Added handling of the -mfix-janus-2cc flag.
2716 + * config/arm/arm.h (janus2_code): Declare.
2717 + * config/arm/arm.opt (-mfix-janus-2cc): New.
2718 +
2719 + gcc/testsuite/
2720 + * lib/target-supports.exp (check_effective_target_arm_no_thumb):
2721 + New function.
2722 + * gcc.target/arm/janus-2cc-shift-1.c: New.
2723 + * gcc.target/arm/janus-2cc-shift-2.c: New.
2724 +
2725 + * release-notes-csl.xml: Document.
2726 +
2727 +2008-08-31 Mark Mitchell <mark@codesourcery.com>
2728 +
2729 + gcc/
2730 + * gcc.target/arm/va_list.c: Return zero on success.
2731 +
2732 + * release-notes-csl.xml: Update note for va_list change.
2733 +
2734 +2008-08-30 Mark Mitchell <mark@codesourcery.com>
2735 +
2736 + libstdc++-v3/
2737 + * testsuite/25_algorithms/nth_element/2.cc: Constrain iterations
2738 + when testing on a simultor.
2739 +
2740 +2008-08-29 Mark Mitchell <mark@codesourcery.com>
2741 +
2742 + * release-notes-csl.xml: Update note for NEON mangling.
2743 +
2744 + Issue #3579
2745 + gcc/
2746 + * config/arm/arm.c (arm_build_builtin_va_list): New function.
2747 + (arm_extract_valist_ptr): Likewise.
2748 + (arm_expand_builtin_va_start): Likewise.
2749 + (arm_gimplify_va_arg_expr): Likewise.
2750 + (TARGET_BUILD_BUILTIN_VA_LIST): Define.
2751 + (TARGET_EXPAND_BUILTIN_VA_START): Likewise.
2752 + (TARGET_GIMPLIFY_VA_VARG_EXPR): Likewise.
2753 + (arm_mangle_type): Handle __va_list specially.
2754 + gcc/testsuite/
2755 + * lib/target-supports.exp (check_effective_target_arm_eabi): New
2756 + function.
2757 + * gcc.target/arm/va_list.c: New test.
2758 + * g++.dg/abi/arm_va_list.C: Likewise.
2759 +
2760 +2008-08-29 Mark Mitchell <mark@codesourcery.com>
2761 +
2762 + gcc/cp/
2763 + * mangle.c (write_type): Add target-specific manglings for
2764 + non-fundamental types to the substitution table.
2765 + gcc/testsuite/
2766 + * g++.dg/abi/mangle-neon.C: Add substitution test.
2767 +
2768 + * release-notes-csl.xml: Document change.
2769 +
2770 +2008-08-29 Joseph Myers <joseph@codesourcery.com>
2771 +
2772 + Backport:
2773 +
2774 + gcc/testsuite/
2775 + 2008-04-09 Andy Hutchinson <hutchinsonandy@aim.com>
2776 + PR testsuite/34894
2777 + PR testsuite/33782
2778 + * lib/target-supports.dg: Add check_effective_target_trampolines.
2779 + Disable profiling for avr-*-*.
2780 + * gcc.c-torture/compile/pr27889.c: dg-requires trampolines.
2781 + * gcc.c-torture/compile/nested-1.c: Ditto.
2782 + * gcc.c-torture/compile/20050122-2.c: Ditto.
2783 + * gcc.c-torture/compile/20010226-1.c: Ditto.
2784 + * gcc.c-torture/compile/20010327-1.c: Skip for avr-*-*.
2785 + * gcc.c-torture/compile/980506-1.c: Ditto.
2786 + * gcc.c-torture/compile/20020604-1.c: Ditto.
2787 + * gcc.c-torture/compile/limits-stringlit.c: Ditto
2788 + * gcc.c-torture/compile/20001226-1.c: Ditto
2789 +
2790 + 2008-05-12 Andy Hutchinson <hutchinsonandy@aim.com>
2791 + * gcc.dg/pr34457-1.c: Skip for target without trampolines.
2792 + * gcc.dg/20050607-1.c: Ditto.
2793 + * gcc.dg/trampoline-1.c: Ditto.
2794 + * gcc.dg/debug/debug-3.c: Ditto.
2795 + * gcc.dg/debug/debug-5.c: Ditto.
2796 +
2797 +2008-08-29 Mark Mitchell <mark@codesourcery.com>
2798 +
2799 + gcc/testsuite/
2800 + * gcc.dg/vect/vect-105.c: Prevent compiler from hoisting abort out
2801 + of loop.
2802 +
2803 +2008-08-28 Mark Mitchell <mark@codesourcery.com>
2804 +
2805 + gcc/testsuite/
2806 + * gcc.dg/struct/wo_prof_single_str_global.c: Mask return value.
2807 + * gcc.dg/struct/wo_prof_single_str_local.c: Mask return value.
2808 + * gcc.dg/struct/wo_prof_single_str_pointer.c: Mask return value.
2809 +
2810 + Backport:
2811 +
2812 + gcc/testsuite/
2813 + 2008-04-22 Steve Ellcey <sje@cup.hp.com>
2814 + * gcc.dg/struct/wo_prof_global_var.c: Initialize array.
2815 + * gcc.dg/struct/wo_prof_malloc_size_var.c: Ditto.
2816 + * gcc.dg/struct/w_prof_local_var.c: Ditto.
2817 + * gcc.dg/struct/w_prof_global_var.c: Ditto.
2818 + * gcc.dg/struct/wo_prof_local_var.c: Ditto.
2819 +
2820 +2008-08-28 Mark Mitchell <mark@codesourcery.com>
2821 +
2822 + gcc/cp
2823 + * decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
2824 + gcc/testsuite/
2825 + * g++.dg/cpp/_Pragma1.C: Skip on arm*-*-eabi*.
2826 + * g++.dg/ext/visibility/arm1.C: Require DLL targets.
2827 + * g++.dg/init/ref15.C: Require unwrapped targets.
2828 +
2829 +2008-08-28 Paul Brook <paul@codesourcery.com>
2830 +
2831 + Merge from Sourcery G++ 4.2:
2832 + gcc/
2833 + * config/arm/neon.md (neon_type): Move to arm.md.
2834 + (neon_mov<VSTRUCT>): Add neon_type attribute.
2835 + (movmisalign<mode>): Ditto.
2836 + * config/arm/arm.md (neon_type): Move to here.
2837 + (conds): Add "unconditioal" and use as default for NEON insns.
2838 +
2839 + gcc/testsuite/
2840 + * gcc.target/arm/neon-cond-1.c: New test.
2841 +
2842 +2008-08-27 Nathan Froyd <froydnj@codesourcery.com>
2843 +
2844 + libgomp/
2845 + * Makefile.am: Use install-data-local for install-html and
2846 + install-pdf.
2847 + * Makefile.in: Regenerate.
2848 +
2849 +2008-08-26 Maxim Kuvyrkov <maxim@codesourcery.com>
2850 +
2851 + Port not-reviewed patch from gcc-patches@.
2852 +
2853 + gcc/
2854 + 200x-xx-xx Roman Zippel <zippel@linux-m68k.org>
2855 + PR middle-end/29474
2856 + * gcc/recog.c (validate_replace_rtx_1): Prevent swap of
2857 + commutative operands during reload
2858 +
2859 +
2860 +2008-08-26 Maxim Kuvyrkov <maxim@codesourcery.com>
2861 +
2862 + gcc/
2863 + * config/m68k/m68k.md (cmpdi): Use (scratch) instead of pseudo.
2864 +
2865 +2008-08-25 Nathan Froyd <froydnj@codesourcery.com>
2866 +
2867 + Issue #3604
2868 +
2869 + * release-notes-csl.xml (-msim build fix): New.
2870 +
2871 + gcc/
2872 + * config/rs6000/sysv4.h (LIB_SIM_SPEC): Use LIB_DEFAULT_SPEC.
2873 + (STARTFILE_SIM_SPEC): Remove sim-crt0.o%s.
2874 + (ENDFILE_SIM_SPEC): Add -Tsim-hosted.ld.
2875 + (LINK_OS_SIM_SPEC): Define to empty.
2876 +
2877 +2008-08-23 Nathan Froyd <froydnj@codesourcery.com>
2878 +
2879 + * release-notes-csl.xml (OpenMP support): New.
2880 +
2881 +2008-08-21 Nathan Sidwell <nathan@codesourcery.com>
2882 +
2883 + gcc/
2884 + * config/m68k/m68k-devices.def (52274, 52277): New devices.
2885 +
2886 + * release-notes-csl.xml: Document addition of DragonFire0.
2887 +
2888 +2008-08-21 Joseph Myers <joseph@codesourcery.com>
2889 +
2890 + Backport:
2891 +
2892 + gcc/testsuite/
2893 + 2008-08-21 Joseph Myers <joseph@codesourcery.com>
2894 + * g++.dg/opt/anchor1.C (foo): Return the return value of
2895 + ycf->ascent.
2896 +
2897 +2008-08-21 Nathan Froyd <froydnj@codesourcery.com>
2898 +
2899 + Backport from mainline:
2900 +
2901 + libgomp/
2902 + 2008-08-21 Nathan Froyd <froydnj@codesourcery.com>
2903 + * testsuite/libgomp.exp (libgomp_init): Only set things that
2904 + depend on blddir if blddir exists.
2905 + (libgomp_target_compile): Likewise.
2906 + * testsuite/libgomp.c++/c++.exp: Likewise.
2907 + * testsuite/libgomp.fortran/fortran.exp: Likewise.
2908 +
2909 +2008-08-20 Joseph Myers <joseph@codesourcery.com>
2910 +
2911 + Backport:
2912 +
2913 + gcc/
2914 + 2008-08-20 Joseph Myers <joseph@codesourcery.com>
2915 + PR target/31070
2916 + * config/sparc/sparc.c (function_arg_slotno): Handle structure
2917 + with MODE_VECTOR_INT mode.
2918 +
2919 +2008-08-19 Joseph Myers <joseph@codesourcery.com>
2920 +
2921 + * release-notes-csl.xml (Target architecture defaults to i686):
2922 + Add new release note.
2923 +
2924 +2008-08-19 Joseph Myers <joseph@codesourcery.com>
2925 +
2926 + * release-notes-csl.xml: Update release note for upgrade to refer
2927 + to version 4.3.2.
2928 +
2929 +2008-08-19 Kazu Hirata <kazu@codesourcery.com>
2930 +
2931 + Issue 3422
2932 + gcc/
2933 + * config.gcc (mips64*-*-linux*, mips-*-elf*, mipsel-*-elf*,
2934 + mips64-*-elf*, mips64el-*-elf*): Add mips/t-crtfm.
2935 + * config/mips/crtfastmath.c: New.
2936 + * config/mips/linux.h (ENDFILE_SPEC): New.
2937 + * config/mips/linux64.h (ENDFILE_SPEC): New.
2938 + * config/mips/t-crtfm: New.
2939 +
2940 + * release-notes-csl.xml: Add a release note for the new FPU
2941 + defaults on mips64el-sicortex-linux-gnu
2942 +
2943 +2008-08-18 Nathan Froyd <froydnj@codesourcery.com>
2944 +
2945 + gcc/testuite/
2946 + * gcc.dg/pr34856.c: Fix thinko
2947 +
2948 +2008-08-18 Nathan Froyd <froydnj@codesourcery.com>
2949 +
2950 + libgomp/
2951 + * Makefile.am (datarootdir, docdir, htmldir, pdfdir): Define.
2952 + (HTMLS_INSTALL, HTMLS_BUILD): Define.
2953 + ($(HTMLS_BUILD)): New rule.
2954 + (html__strip_dir): Define.
2955 + (install-data-am): Add install-html and install-pdf prerequsites.
2956 + (install-html): Add actions.
2957 + (TEXI2HTML): Define.
2958 + * Makefile.in: Regenerate.
2959 + * configure.ac (datarootdir, docdir, htmldir, pdfdir): Add
2960 + appropriate --with options and AC_SUBSTs.
2961 + * configure: Regenerate.
2962 +
2963 +2008-08-18 Nathan Froyd <froydnj@codesourcery.com>
2964 +
2965 + libgomp/
2966 + * Makefile.am (LTLDFLAGS): Define.
2967 + (LINK): Define.
2968 + * Makefile.in: Regenerate.
2969 +
2970 +2008-08-18 Nathan Froyd <froydnj@codesourcery.com>
2971 +
2972 + gcc/testuite/
2973 + * gcc.dg/pr34856.c: Add powerpc*-eabi* exception.
2974 +
2975 +2008-08-15 Joseph Myers <joseph@codesourcery.com>
2976 +
2977 + Backport:
2978 +
2979 + gcc/
2980 + 2008-06-28 Andrew Jenner <andrew@codesourcery.com>
2981 + * regrename.c (build_def_use): Don't copy RTX.
2982 +
2983 +2008-08-13 Joseph Myers <joseph@codesourcery.com>
2984 +
2985 + Backport:
2986 +
2987 + gcc/
2988 + 2008-08-13 Joseph Myers <joseph@codesourcery.com>
2989 + * config/sparc/sparc.c (emit_soft_tfmode_cvt): Explicitly sign or
2990 + zero extend SImode values being converted to TFmode before passing
2991 + to libcalls.
2992 +
2993 +2008-08-12 Nathan Froyd <froydnj@codesourcery.com>
2994 +
2995 + Backport from mainline:
2996 +
2997 + gcc/
2998 + 2008-08-12 Nathan Froyd <froydnj@codesourcery.com>
2999 +
3000 + PR libgomp/26165
3001 + * gcc.c (include_spec_function): Tweak call to find_a_file.
3002 +
3003 +2008-08-10 Catherine Moore <clm@codesourcery.com>
3004 +
3005 + Merge from Sourcery G++ 4.2:
3006 +
3007 + 2008-02-28 Julian Brown <julian@codesourcery.com>
3008 +
3009 + Merge from MIPS:
3010 +
3011 + gcc/
3012 + * Makefile.in (stmp-int-hdrs): Don't depend on
3013 + fixinc_list. Only
3014 + process fixincludes if fixinc_list is
3015 + present.
3016 + (install-mkheaders): Likewise.
3017 +
3018 + 2008-02-11 Julian Brown <julian@codesourcery.com>
3019 +
3020 + Merge from MIPS:
3021 +
3022 + 2004-06-29 Nigel Stephens <nigel@mips.com>
3023 +
3024 + * Makefile.in (libgcc.mk): Make this depend on
3025 + $(tmake_file), in
3026 + case new multilib options have been defined.
3027 + (s-mlib): Similarly.
3028 +
3029 +2008-08-07 Joseph Myers <joseph@codesourcery.com>
3030 +
3031 + Backport:
3032 +
3033 + gcc/
3034 + * config/arm/neon.md neon_vget_lane<mode>): Adjust element indices
3035 + for big-endian.
3036 +
3037 +2008-08-07 Joseph Myers <joseph@codesourcery.com>
3038 +
3039 + Backport:
3040 +
3041 + gcc/
3042 + 2008-08-07 Joseph Myers <joseph@codesourcery.com>
3043 + * config/arm/iwmmxt.md (movv8qi_internal, movv4hi_internal,
3044 + movv2si_internal): Combine into mov<mode>_internal.
3045 + (movv2si_internal_2): Remove.
3046 +
3047 +2008-08-06 Catherine Moore <clm@codesourcery.com>
3048 +
3049 + gcc/
3050 + * config/mips/mips.h (MIPS_ARCH_DSP_SPEC): Add missing *.
3051 +
3052 + * release-notes-csl.xml: Fix target.
3053 +
3054 +2008-08-06 Joseph Myers <joseph@codesourcery.com>
3055 +
3056 + Backport:
3057 +
3058 + gcc/
3059 + 2008-08-06 Joseph Myers <joseph@codesourcery.com>
3060 + * jump.c (rtx_renumbered_equal_p): Do not call subreg_regno_offset
3061 + for unrepresentable subregs or treat them as equal to other regs
3062 + or subregs with the same register number.
3063 +
3064 +2008-08-05 Catherine Moore <clm@codesourcery.com>
3065 +
3066 + Issue #3088
3067 + gcc/
3068 + * config/mips/sde.h (SUBTARGET_SELF_SPECS): Add
3069 + MIPS_ARCH_DSP_SPEC.
3070 + * config/mips/mips.h (MIPS_ARCH_DSP_SPEC): New.
3071 +
3072 + * release-notes-csl.xml: Document.
3073 +
3074 +2008-08-04 Joseph Myers <joseph@codesourcery.com>
3075 +
3076 + gcc/testsuite/
3077 + * gcc.target/mips/mips-nonpic/nonpic-9.c (main): Call exit.
3078 +
3079 +2008-07-30 Nathan Froyd <froydnj@codesourcery.com>
3080 +
3081 + Issue #2576
3082 +
3083 + Backport:
3084 +
3085 + gcc/
3086 + 2008-07-30 Nathan Froyd <froydnj@codesourcery.com>
3087 +
3088 + * config/arm/arm.c (arm_expand_prologue): Use 0-length rtvec
3089 + instead of NULL_RTVEC.
3090 +
3091 +2008-07-28 Mark Mitchell <mark@codesourcery.com>
3092 +
3093 + Issue #466
3094 + gcc/
3095 + * config/arm/thumb2.md: Add 16-bit multiply instructions.
3096 + gcc/testsuite/
3097 + * lib/target-supports.exp (check_effective_target_arm_thumb2_ok):
3098 + New function.
3099 + * gcc.target/arm/thumb2-mul-space.c: New file.
3100 + * gcc.target/arm/thumb2-mul-space-2.c: New file.
3101 + * gcc.target/arm/thumb2-mul-space-3.c: New file.
3102 + * gcc.target/arm/thumb2-mul-speed.c: New file.
3103 +
3104 + * release-notes-csl.xml: Document.
3105 +
3106 +2008-07-29 Catherine Moore <clm@codesourcery.com>
3107 + Daniel Jacobowitz <dan@codesourcery.com>
3108 +
3109 + gcc/
3110 + * config/mips/mips.h (ISA_HAS_BBIT): Enable for TARGET_OCTEON.
3111 + * config/mips/mips.md (branch_with_likely): New attribute.
3112 + (branch_without_likely): New attribute.
3113 + (define_delay): Check for new branch_likely attributes.
3114 + (branch_bit<mode>): Set branch_without_likely to "yes".
3115 + (branch_bit_truncdi<mode>): Likewise.
3116 + (branch_bit<mode>_inverted): Likewise.
3117 + (branch_bit_truncdi<mode>_inverted): Likewise.
3118 +
3119 +2008-07-25 Mark Mitchell <mark@codesourcery.com>
3120 +
3121 + Issue #3433
3122 + gcc/
3123 + * gcc.c (SWITCHES_NEED_SPACES): Define to "o".
3124 +
3125 + * release-notes-csl.xml: Document.
3126 +
3127 +2008-07-25 Joseph Myers <joseph@codesourcery.com>
3128 +
3129 + gcc/
3130 + * config/arm/iwmmxt.md (movv8qi_internal, movv4hi_internal,
3131 + movv2si_internal): Use "*" for pool_range and neg_pool_range for
3132 + mem = reg alternative.
3133 +
3134 +2008-07-25 Maxim Kuvyrkov <maxim@codesourcery.com>
3135 +
3136 + Merge from Sourcery G++ 4.2:
3137 +
3138 + 2008-06-03 Maxim Kuvyrkov <maxim@codesourcery.com>
3139 + * release-notes-csl.xml: Add note.
3140 + gcc/
3141 + * config/mips/mips.c (mips_expand_prologue): Fix thinko.
3142 +
3143 + 2008-05-27 Maxim Kuvyrkov <maxim@codesourcery.com>
3144 + -mwarn-framesize=<size> option for MIPS.
3145 + * release-notes-csl.xml: Add note.
3146 + gcc/
3147 + * doc/invoke.texi (mwarn-framesize): Document option.
3148 + * config/mips/mips.opt (mwarn-framesize): Add option.
3149 + * config/mips/mips.c (mips_warn_framesize): New static variable.
3150 + (mips_handle_option): Handle mwarn-framesize.
3151 + (mips_expand_prologue): Emit warning if frame size exceeds specified
3152 + value.
3153 +
3154 +2008-07-24 Joseph Myers <joseph@codesourcery.com>
3155 +
3156 + * config.sub: Allow mips64octeon* targets.
3157 +
3158 + NOT ASSIGNED TO FSF
3159 + COPYRIGHT CAVIUM
3160 + gcc/
3161 + * config/mips/octeon-elf-unwind.h, config/mips/octeon-elf.h,
3162 + config/mips/octeon.h, config/mips/t-octeon-elf: New.
3163 + * config.gcc: Handle mips64octeon*-wrs-elf*.
3164 + (mips-wrs-linux-gnu): Use mips/octeon.h.
3165 + * config/mips/mips-protos.h (octeon_output_shared_variable): New.
3166 + * config/mips/mips.c (octeon_handle_cvmx_shared_attribute,
3167 + octeon_select_section, octeon_unique_section,
3168 + octeon_output_shared_variable): New.
3169 + (mips_attribute_table): Add cvmx_shared.
3170 + (mips_in_small_data_p): Check for cvmx_shared attribute.
3171 + * config/mips/mips.opt (mocteon-useun): Use Mask.
3172 +
3173 + libgcc/
3174 + * config.host: Handle mips64octeon*-wrs-elf*.
3175 +
3176 +2008-07-24 Joseph Myers <joseph@codesourcery.com>
3177 +
3178 + gcc/
3179 + * config/mips/mips.c (mips_expand_ins_as_unaligned_store): Restore
3180 + Octeon unaligned store support.
3181 +
3182 +2008-07-21 Mark Mitchell <mark@codesourcery.com>
3183 +
3184 + Issue #3245
3185 +
3186 + Backport:
3187 +
3188 + libstdc++-v3/
3189 + 2008-07-21 Mark Mitchell <mark@codesourcery.com>
3190 + * config/os/gnu-linux/arm-eabi-extra.ver: New file.
3191 + * configure.host: Use it for arm*-*-linux-*eabi.
3192 +
3193 + * release-notes-csl.xml: Document.
3194 +
3195 +2008-07-21 Joseph Myers <joseph@codesourcery.com>
3196 +
3197 + gcc/
3198 + * config/mips/mips.md (extzv): Avoid using dext instructions for
3199 + certain DImode subreg extractions. From Cavium toolchain.
3200 +
3201 +2008-07-21 Nathan Froyd <froydnj@codesourcery.com>
3202 +
3203 + gcc/
3204 + * tree-ssa-remove-local-statics.c
3205 + (find_static_nonvolatile_declarations): Don't check for potential
3206 + definitions if we're looking at a statement with a CALL_EXPR.
3207 + (compute_definedness_for_block): Reorganize logic.
3208 +
3209 + gcc/testsuite/
3210 + * gcc.dg/remove-local-statics-13.c: New test.
3211 + * gcc.dg/remove-local-statics-14.c: New test.
3212 +
3213 +2008-07-18 Joseph Myers <joseph@codesourcery.com>
3214 +
3215 + Backport:
3216 +
3217 + gcc/testsuite/
3218 + 2008-07-18 Joseph Myers <joseph@codesourcery.com>
3219 + * gcc.dg/fshort-wchar.c: Use -Wl,--no-wchar-size-warning on
3220 + arm*-*-*eabi.
3221 +
3222 +2008-07-17 Catherine Moore <clm@codesourcery.com>
3223 +
3224 + gcc/
3225 + * config/mips/sde.h (TARET_MIPS_SDE): Define to 1.
3226 + (SUBTARGET_SELF_SPECS): Undefine before defining.
3227 +
3228 +2008-07-10 Joseph Myers <joseph@codesourcery.com>
3229 +
3230 + Backport:
3231 +
3232 + gcc/testsuite/
3233 + 2008-07-10 Joseph Myers <joseph@codesourcery.com>
3234 + PR middle-end/29056
3235 + * gcc.target/powerpc/ppc-negeq0-1.c: Use long instead of int.
3236 + Adjust shift and scan-assembler-not pattern to allow for 64-bit
3237 + case.
3238 +
3239 +2008-07-10 Joseph Myers <joseph@codesourcery.com>
3240 +
3241 + config/
3242 + * mh-mingw (LDFLAGS): Append to rather than replacing previous
3243 + value.
3244 +
3245 +2008-07-09 Joseph Myers <joseph@codesourcery.com>
3246 +
3247 + gcc/
3248 + * config/mips/linux64.h (SUBTARGET_ASM_SPEC): Update for non-PIC.
3249 +
3250 +2008-07-09 Joseph Myers <joseph@codesourcery.com>
3251 +
3252 + gcc/
3253 + * config/mips/wrs-linux.h (SUBTARGET_SELF_SPECS): Add missing
3254 + comma.
3255 +
3256 +2008-07-09 Joseph Myers <joseph@codesourcery.com>
3257 +
3258 + Backport:
3259 +
3260 + libstdc++-v3/
3261 + 2008-07-09 Joseph Myers <joseph@codesourcery.com>
3262 + * libsupc++/unwind-cxx.h (__is_gxx_forced_unwind_class,
3263 + __GXX_INIT_FORCED_UNWIND_CLASS): Define for ARM EABI unwinder.
3264 + * libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Call
3265 + __GXX_INIT_FORCED_UNWIND_CLASS for forced unwind with ARM EABI
3266 + unwinder.
3267 + * libsupc++/eh_arm.cc (__cxa_type_match): Use
3268 + __is_gxx_forced_unwind_class to check for forced unwind.
3269 +
3270 +2008-07-09 Joseph Myers <joseph@codesourcery.com>
3271 +
3272 + gcc/
3273 + * config/mips/wrs-linux.h (SUBTARGET_SELF_SPECS): Add
3274 + NO_SHARED_SPECS.
3275 +
3276 +2008-07-09 Joseph Myers <joseph@codesourcery.com>
3277 +
3278 + Backport:
3279 +
3280 + libstdc++-v3/
3281 + 2008-07-09 Joseph Myers <joseph@codesourcery.com>
3282 + * testsuite/20_util/make_signed/requirements/typedefs-2.cc,
3283 + testsuite/20_util/make_unsigned/requirements/typedefs-2.cc: Use
3284 + -Wl,--no-enum-size-warning for arm*-*-linux*eabi.
3285 +
3286 +2008-07-09 Joseph Myers <joseph@codesourcery.com>
3287 +
3288 + gcc/
3289 + * config/mips/mips.h (ISA_HAS_BBIT): Temporarily disable.
3290 +
3291 +2008-07-09 Joseph Myers <joseph@codesourcery.com>
3292 +
3293 + gcc/
3294 + * config/mips/linux64.h (SUBTARGET_SELF_SPECS): Undefine before
3295 + redefining.
3296 +
3297 +2008-07-08 Catherine Moore <clm@codesourcery.com>
3298 +
3299 + gcc/config/mips
3300 + xlr.md (ir_xlr_alu): Add logical, signext attributes.
3301 +
3302 +2008-07-08 Nathan Froyd <froydnj@codesourcery.com>
3303 +
3304 + gcc/
3305 + * passes.c (init_optimization_passes): Move pass_remove_local_statics
3306 + later in the pass order.
3307 + * tree-ssa-remove-local-statics.c (rls_done): Conditionally free the
3308 + bitmaps and NULL out bb->aux.
3309 + (unstaticize_variable): Deal with GIMPLE_MODIFY_STMTs instead of
3310 + MODIFY_EXPRs.
3311 + (compute_definedness_for_block): Check for defines only if we haven't
3312 + found a CALL_EXPR.
3313 +
3314 +2008-07-07 Joseph Myers <joseph@codesourcery.com>
3315 +
3316 + Backport:
3317 +
3318 + gcc/
3319 + 2008-07-07 Joseph Myers <joseph@codesourcery.com>
3320 + * config/arm/aout.h (DOLLARS_IN_IDENTIFIERS): Remove.
3321 +
3322 +2008-07-07 Vladimir Prus <vladimir@codesourcery.com>
3323 +
3324 + gcc/
3325 + * gcc.c (print_sysroot): New.
3326 + (option_map, display_help, process_command): Handle the
3327 + -print-sysroot option.
3328 + (main): Print the sysroot if requested.
3329 +
3330 + gcc/doc/
3331 + * invoke.texi (Debugging Options): Document -print-sysroot.
3332 +
3333 +2008-07-03 Joseph Myers <joseph@codesourcery.com>
3334 +
3335 + gcc/
3336 + * config/arm/arm.c (arm_init_neon_builtins): Register built-in
3337 + types immediately after creating them.
3338 +
3339 +2008-07-03 Joseph Myers <joseph@codesourcery.com>
3340 +
3341 + gcc/
3342 + * config/arm/arm.c (add_minipool_backward_ref): Check for
3343 + 8-byte-aligned entries in second case of forcing insertion after a
3344 + particular entry. Change third case to avoid inserting
3345 + non-8-byte-aligned entries before 8-byte-aligned ones.
3346 +
3347 +2008-07-03 Joseph Myers <joseph@codesourcery.com>
3348 +
3349 + gcc/
3350 + * config/arm/iwmmxt.md (movv8qi_internal, movv4hi_internal,
3351 + movv2si_internal): Add mem = reg alternative.
3352 +
3353 +2008-07-03 Nathan Froyd <froydnj@codesourcery.com>
3354 +
3355 + Merge from Sourcery G++ 4.2:
3356 +
3357 + 2008-07-02 Nathan Froyd <froydnj@codesourcery.com>
3358 +
3359 + gcc/
3360 + * config/rs6000/t-ppcgas (MULTILIB_OPTIONS): Add te500mc.
3361 + (MULTILIB_DIRNAMES): Likewise.
3362 + (MULTILIB_EXCEPTIONS): Add exception for te500mc.
3363 + * config/rs6000/eabi.h (NAME__MAIN, INVOKE__main): Remove.
3364 + (CC1_EXTRA_SPEC): Add te500mc clause.
3365 + (ASM_DEFAULT_SPEC): Likewise.
3366 + * config/rs6000/t-ppccomm (LIB2FUNS_STATIC_EXTRA): Remove eabi.S.
3367 + (eabi.S): Remove rule.
3368 +
3369 +2008-07-03 Nathan Sidwell <nathan@codesourcery.com>
3370 +
3371 + gcc/
3372 + * config/m68k/t-uclinux (M68K_MLIB_CPU): Check for FL_UCLINUX.
3373 + * config/m68k/m68k-devices.def: Add FL_UCLINUX to 68020 and 54455
3374 + multilibs.
3375 + * config/m68k/m68k.h (FL_UCLINUX): Define.
3376 +
3377 + * release-notes-csl.xml: Document.
3378 +
3379 +2008-07-02 Joseph Myers <joseph@codesourcery.com>
3380 +
3381 + gcc/
3382 + * c-incpath.c: Include toplev.h.
3383 + (merge_include_chains): Use warning instead of cpp_error for
3384 + system directory poisoning diagnostic.
3385 + * Makefile.in (c-incpath.o): Depend on toplev.h.
3386 + * gcc.c (LINK_COMMAND_SPEC): Pass
3387 + --error-poison-system-directories if
3388 + -Werror=poison-system-directories.
3389 +
3390 +2008-07-02 Julian Brown <julian@codesourcery.com>
3391 +
3392 + Backport from mainline:
3393 +
3394 + 2008-06-27 Mark Mitchell <mark@codesourcery.com>
3395 +
3396 + libstdc++-v3/
3397 + * libsupc++/vec.cc (__aeabi_vec_dtor_cookie): Handle NULL array
3398 + address.
3399 + (__aeabi_vec_delete): Likewise.
3400 + (__aeabi_vec_delete3): Likewise.
3401 + (__aeabi_vec_delete3_nodtor): Likewise.
3402 +
3403 + gcc/testsuite/
3404 + * g++.dg/abi/arm_cxa_vec2.C: New test.
3405 +
3406 +2008-07-01 Joseph Myers <joseph@codesourcery.com>
3407 +
3408 + gcc/testsuite/
3409 + * lib/target-supports.exp (check_effective_target_arm_neon): New.
3410 + (check_effective_target_vect_cmdline_needed): Use it.
3411 +
3412 +2008-07-01 Joseph Myers <joseph@codesourcery.com>
3413 +
3414 + gcc/
3415 + * config/arm/neon.md (neon_vget_lane<mode>_sext_internal,
3416 + neon_vget_lane<mode>_zext_internal): Adjust element indices for
3417 + big-endian.
3418 +
3419 +2008-07-01 Nathan Sidwell <nathan@codesourcery.com>
3420 +
3421 + gcc/
3422 + * config/mips/linux.h (SUBTARGET_SELF_SPECS): Override this,
3423 + rather than ...
3424 + (DRIVER_SELF_SPECS): ... this.
3425 + * config/mips/mips.md (extzv, extzv<mode>, insv, insv<mode>,
3426 + *insv<mode>di): Use mips_use_ins_ext_p rather than mips_use_ext_p
3427 + and mips_use_ins_p.
3428 + * config/mips/mips-protos.h (mips_lower_sign_bit_p,
3429 + mips_use_ext_p): Delete.
3430 + (mips_expand_vector_init): Declare.
3431 + * config/mips/mips.c (mips_gnu_local_gp): Declare.
3432 + (mips_got_base): Use can_create_pseudo_p.
3433 + (mips16_build_function_stub): Remove unused variable.
3434 + (mips_lower_sign_bit_p, mips_use_ins_p, mips_use_ext_p): Delete.
3435 +
3436 + gcc/
3437 + * config/mips/mips.md (type): Correct typo for accext.
3438 +
3439 +2008-06-30 Joseph Myers <joseph@codesourcery.com>
3440 +
3441 + config/
3442 + * mh-mingw (BOOT_CFLAGS): Do not use -D__USE_MINGW_ACCESS.
3443 +
3444 +2008-06-28 Sandra Loosemore <sandra@codesourcery.com>
3445 +
3446 + Backport 2 patches from mainline:
3447 +
3448 + 2008-06-28 Sandra Loosemore <sandra@codesourcery.com>
3449 +
3450 + gcc/
3451 + * doc/extend.texi (Variable Attributes): Use @ref instead of @xref.
3452 + (Type Attributes): Fix nesting of @table and @subsection. Adjust
3453 + punctuation. Use @ref instead of @xref.
3454 + (Function Names): Remove stray @display/@end display.
3455 + (C++ Attributes): Use @ref instead of @xref.
3456 + (Deprecated Features): Fix punctuation around @xref.
3457 + (Backwards Compatibility): Likewise.
3458 + * doc/rtl.texi (Incdec): Remove stray @table/@end table.
3459 +
3460 + 2008-06-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3461 +
3462 + gcc/
3463 + * doc/sourcebuild.texi (Config Fragments): Remove obsolete
3464 + FIXME note about gcc/config.guess.
3465 + * doc/options.texi (Option file format): Remove non-ASCII bytes.
3466 + * doc/cpp.texi: Expand TABs, drop indentation outside examples.
3467 + * doc/cppopts.texi: Likewise.
3468 + * doc/extend.texi: Likewise.
3469 + * doc/gcc.texi: Likewise.
3470 + * doc/gccint.texi: Likewise.
3471 + * doc/gcov.texi: Likewise.
3472 + * doc/gty.texi: Likewise.
3473 + * doc/hostconfig.texi: Likewise.
3474 + * doc/install.texi: Likewise.
3475 + * doc/invoke.texi: Likewise.
3476 + * doc/loop.texi: Likewise.
3477 + * doc/makefile.texi: Likewise.
3478 + * doc/md.texi: Likewise.
3479 + * doc/passes.texi: Likewise.
3480 + * doc/tm.texi: Likewise.
3481 + * doc/tree-ssa.texi: Likewise.
3482 + * doc/trouble.texi: Likewise.
3483 +
3484 +2008-06-27 Julian Brown <julian@codesourcery.com>
3485 +
3486 + gcc/cp/
3487 + * decl2.c (determine_visibility): Allow target to override
3488 + visibility of class data.
3489 +
3490 + gcc/
3491 + * config/arm/arm.c (arm_cxx_determine_class_data_visibility): Make
3492 + no-op for targets which don't use DLLs.
3493 +
3494 + gcc/testsuite/
3495 + * g++.dg/ext/visibility/arm3.C: Add explanatory text. Skip on
3496 + non-DLL targets.
3497 +
3498 +2008-06-26 Nathan Froyd <froydnj@codesourcery.com>
3499 +
3500 + Merge from Sourcery G++ 4.2:
3501 +
3502 + 2008-02-13 Nathan Froyd <froydnj@codesourcery.com>
3503 +
3504 + gcc/
3505 + * optabs.c (expand_binop): Force operands to registers before
3506 + generating libcalls.
3507 +
3508 +2008-06-26 Daniel Jacobowitz <dan@codesourcery.com>
3509 +
3510 + gcc/
3511 + * config/mips/mips.c (mips_call_tls_get_addr)
3512 + (mips_emit_loadgp): Correct merge.
3513 +
3514 +2008-06-26 Joseph Myers <joseph@codesourcery.com>
3515 +
3516 + * release-notes-csl.xml: Resync release note text with Sourcery
3517 + G++ 4.2.
3518 +
3519 +2008-06-25 Catherine Moore <clm@codesourcery.com>
3520 +
3521 + Merge from SourceryG++ 4.2:
3522 +
3523 + 2008-04-01 Joseph Myers <joseph@codesourcery.com>
3524 +
3525 + gcc/
3526 + * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Define
3527 + __mips_isa_rev=2 for Octeon.
3528 +
3529 +2008-06-25 Julian Brown <julian@codesourcery.com>
3530 +
3531 + gcc/
3532 + * config.gcc (arm*-*-uclinux*): Remove duplicate uclinux-elf.h.
3533 +
3534 +2008-06-25 Catherine Moore <clm@codesourcery.com>
3535 +
3536 + Merge from SourceryG++ 4.2:
3537 +
3538 + 2008-02-15 Julian Brown <julian@codesourcery.com>
3539 +
3540 + Merge from MIPS:
3541 +
3542 + 2007-11-06 David Ung <davidu@mips.com>
3543 +
3544 + gcc/
3545 + * config/mips/mips.h (AC1HI_REGNUM, AC1LO_REGNUM, AC2HI_REGNUM)
3546 + (AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): Define constants.
3547 +
3548 +2008-06-25 Catherine Moore <clm@codesourcery.com>
3549 +
3550 + Merge from SourceryG++ 4.2:
3551 +
3552 + 2007-07-02 Richard Sandiford <richard@codesourcery.com>
3553 +
3554 + gcc/
3555 + * config/mips/mips.h (MIPS_ISA_LEVEL_SPEC): Handle -march=octeon.
3556 +
3557 +2008-06-25 Catherine Moore <clm@codesourcery.com>
3558 +
3559 + Revert:
3560 +
3561 + 2008-06-25 Catherine Moore <clm@codesourcery.com>
3562 +
3563 + Merge from SourceryG++ 4.2:
3564 +
3565 + 2007-10-18 Joseph Myers <joseph@codesourcery.com>
3566 +
3567 + NOT ASSIGNED TO FSF
3568 + COPYRIGHT RAZA
3569 + * config.sub (mipsisa64xlr, ipsisa64xlrel): Add new machine names.
3570 +
3571 + gcc/
3572 + * config.gcc (mipsisa64xlr-*-elf*, mipsisa64xlrel-*-elf*): New
3573 + targets.
3574 +
3575 +2008-06-25 Catherine Moore <clm@codesourcery.com>
3576 +
3577 + Merge from SourceryG++ 4.2:
3578 +
3579 + 2007-10-18 Joseph Myers <joseph@codesourcery.com>
3580 +
3581 + NOT ASSIGNED TO FSF
3582 + COPYRIGHT RAZA
3583 + * config.sub (mipsisa64xlr, ipsisa64xlrel): Add new machine names.
3584 +
3585 + gcc/
3586 + * config.gcc (mipsisa64xlr-*-elf*, mipsisa64xlrel-*-elf*): New
3587 + targets.
3588 + * config/mips/mips.h (PROCESSOR_XLR, TARGET_XLR): Define.
3589 + (MIPS_ISA_LEVEL_SPEC): Handle -march=xlr.
3590 +
3591 +2008-06-24 Catherine Moore <clm@codesourcery.com>
3592 +
3593 + Merge from SourceryG++ 4.2:
3594 +
3595 + 2008-02-12 Julian Brown <julian@codesourcery.com>
3596 +
3597 + Merge from MIPS:
3598 +
3599 + 2008-01-16 David Ung <davidu@mips.com>
3600 +
3601 + * config/mips/sdemtk.h: Define macro TARGET_MIPS_SDEMTK.
3602 + * config/mips/mips.c (mips_file_start): Check against
3603 + TARGET_MIPS_SDEMTK which supports the TARGET_NO_FLOAT option.
3604 +
3605 + 2007-11-02 Thiemo Seufer <ths@mips.com>
3606 +
3607 + * config/mips/mips.c (mips_file_start): Add support for flagging
3608 + 32-bit code with -mfp64 floating point.
3609 +
3610 +2008-06-24 Catherine Moore <clm@codesourcery.com>
3611 +
3612 + Merge from SourceryG++ 4.2:
3613 +
3614 + 2008-03-12 Julian Brown <julian@codesourcery.com>
3615 +
3616 + Merge from MIPS:
3617 +
3618 + 2007-11-29 Thiemo Seufer <ths@mips.com>
3619 +
3620 + gcc/
3621 + * config/mips/mips.c (override_options): Let -fpic imply
3622 + -mabicalls, forward port from SDE6.
3623 +
3624 +2008-06-23 Julian Brown <julian@codesourcery.com>
3625 +
3626 + gcc/
3627 + * config/arm/arm.h (ASM_OUTPUT_REG_PUSH): Handle STATIC_CHAIN_REGNUM
3628 + specially for Thumb-1.
3629 + (ASM_OUTPUT_REG_POP): Likewise.
3630 +
3631 +2008-06-23 Julian Brown <julian@codesourcery.com>
3632 +
3633 + gcc/
3634 + * config/arm/thumb2.md (*thumb2_negscc): Remove bad negated-GT
3635 + code sequence.
3636 +
3637 +2008-06-20 Catherine Moore <clm@codesourcery.com>
3638 +
3639 + Merge from SourceryG++ 4.2:
3640 +
3641 + 2007-10-21 Sandra Loosemore <sandra@codesourcery.com>
3642 +
3643 + gcc/
3644 + * config/mips/mips.c (mips_cpu_info_table): Fix damaged merge
3645 + of XLR entry from r185319.
3646 + (mips_rtx_cost_data): Likewise.
3647 + (mips_sched_reorder): Add ATTRIBUTE_UNUSED to cycle parameter.
3648 +
3649 +2008-06-18 Catherine Moore <clm@codesourcery.com>
3650 +
3651 + Merge from SourceryG++ 4.2:
3652 +
3653 + 2007-09-06 Sandra Loosemore <sandra@codesourcery.com>
3654 +
3655 + gcc/
3656 + * config/mips/mips.opt (mips16e): Add as deprecated alias
3657 + for -mips16.
3658 + * doc/invoke.texi (Option Summary, MIPS Options): Document it.
3659 +
3660 +2008-06-18 Catherine Moore <clm@codesourcery.com>
3661 +
3662 + Merge from SourceryG++ 4.2:
3663 +
3664 + 2008-02-12 Julian Brown <julian@codesourcery.com>
3665 +
3666 + Merge from MIPS:
3667 +
3668 + 2007-12-21 David Ung <davidu@mips.com>
3669 +
3670 + gcc/
3671 + * config/mips/mips.h (TARGET_MIPS_SDE): Define macro as 0.
3672 + * config/mips/sde.h (TARGET_MIPS_SDE): Override macro definition to 1.
3673 + * config/mips/mips.md (abs<mode>2): Enable abs.[sd] patterns if
3674 + TARGET_MIPS_SDE && TARGET_HARD_FLOAT.
3675 +
3676 +2008-06-18 Catherine Moore <clm@codesourcery.com>
3677 +
3678 + Merge from SourceryG++ 4.2:
3679 +
3680 + 2007-10-14 Sandra Loosemore <sandra@codesourcery.com>
3681 +
3682 + * config/mt-sde: Update to make it agree with the mainline
3683 + version committed with the below patch.
3684 +
3685 + Backport from mainline:
3686 + gcc/
3687 +
3688 + 2007-08-17 Richard Sandiford <richard@codesourcery.com>
3689 + Nigel Stephens <nigel@mips.com>
3690 +
3691 + * config/mips/sde.h (DRIVER_SELF_SPECS): Add commas.
3692 + Treat -mno-data-in-code and -mcode-xonly as aliases for
3693 + -mcode-readable=no and -mcode-readable=pcrel respectively.
3694 + * config/mips/t-sde (TARGET_LIBGCC2_CFLAGS): Add -mcode-xonly.
3695 + (MULTILIB_OPTIONS): Add -mcode-readable=no multilibs.
3696 + (MULTILIB_DIRNAMES): Update accordingly.
3697 +
3698 +2008-06-18 Catherine Moore <clm@codesourcery.com>
3699 +
3700 + Merge from SourceryG++ 4.2:
3701 +
3702 + 2007-09-08 Sandra Loosemore <sandra@codesourcery.com>
3703 +
3704 + gcc/
3705 + * config/mips/t-sde (MULTILIB_MATCHES): Add mips16e as alias
3706 + for mips16.
3707 +
3708 +2008-06-18 Joseph Myers <joseph@codesourcery.com>
3709 +
3710 + gcc/
3711 + * config/arm/arm.c (arm_assemble_integer): Do not handle
3712 + big-endian NEON vectors specially.
3713 + * config/arm/neon.md (vec_set<mode>_internal, vec_extract<mode>):
3714 + Adjust element indices for big-endian.
3715 +
3716 +2008-06-18 Catherine Moore <clm@codesourcery.com>
3717 +
3718 + Merge from SourceryG++ 4.2:
3719 +
3720 + 2008-02-11 Julian Brown <julian@codesourcery.com>
3721 +
3722 + Merge from MIPS:
3723 +
3724 + gcc/
3725 + * config/mips/t-sde (MULTILIB_OPTIONS): Substitute mno-data-in-code for
3726 + mcode-readable=no option.
3727 +
3728 +2008-06-17 Catherine Moore <clm@codesourcery.com>
3729 +
3730 + Merge from SourceryG++ 4.2:
3731 +
3732 + 2008-03-28 Nathan Sidwell <nathan@codesourcery.com>
3733 +
3734 + * config/mips/t-sdemtk (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
3735 + MULTILIB_EXCLUSIONS): Likewise.
3736 +
3737 +2008-06-17 Catherine Moore <clm@codesourcery.com>
3738 +
3739 +
3740 + Merge from Sourcery G++ 4.2:
3741 +
3742 + 2008-03-17 Julian Brown <julian@codesourcery.com>
3743 +
3744 + gcc/
3745 + * config.gcc (mips*-sde-elf*): Add SourceryG++ multilib support.
3746 + * config/mips/t-sgxx-sde: New.
3747 + * config/mips/sdemtk.h (MIPS_ARCH_FLOAT_SPEC): Override, adding
3748 + -mno-float option.
3749 +
3750 +2008-06-17 Joseph Myers <joseph@codesourcery.com>
3751 +
3752 + Backport:
3753 +
3754 + gcc/
3755 + 2008-03-09 Ira Rosen <irar@il.ibm.com>
3756 + * config/rs6000/rs6000.c (builtin_description): Rename vector
3757 + left shift operations.
3758 + * config/rs6000/altivec.md (UNSPEC_VSL): Remove.
3759 + (altivec_vsl<VI_char>): Rename to ...
3760 + (ashl<mode>3): ... new name.
3761 + (mulv4sf3, mulv4si3, negv4sf2): Replace gen_altivec_vslw with
3762 + gen_ashlv4si3.
3763 + (absv4sf2): Convert to use ashift:V4SI instead of UNSPEC_VSL.
3764 +
3765 +2008-06-16 Julian Brown <julian@codesourcery.com>
3766 +
3767 + Merge from Sourcery G++ 4.2:
3768 +
3769 + 2007-03-30 Mark Mitchell <mark@codesourcery.com>
3770 +
3771 + gcc/testsuite/
3772 + * gcc.dg/sibcall-3.c: XFAIL for Thumb.
3773 + * gcc.dg/sibcall-4.c: Likewise.
3774 +
3775 +2008-06-16 Paul Brook <paul@codesourcery.com>
3776 +
3777 + Merge from Sourcery G++ 4.2
3778 + 2007-03-30 Paul Brook <paul@codesourcery.com>
3779 + gcc/
3780 + * calls.c (store_one_arg): Check alignment of mode used for save.
3781 +
3782 +2008-06-13 Nathan Froyd <froydnj@codesourcery.com>
3783 +
3784 + gcc/
3785 + * config.gcc (powerpc-*-linux*): Add rs6000/e500.h to tm_file
3786 + and rs6000/t-linux to tmake_file.
3787 +
3788 +2008-06-13 Paul Brook <paul@codesourcery.com>
3789 +
3790 + Merge from Sourcery G++ 4.2
3791 + Issue #1510
3792 + 2007-04-27 Paul Brook <paul@codesourcery.com>
3793 + gcc/
3794 + * cse.c (cse_process_notes): Make sure PLUS are canonical.
3795 +
3796 +2008-06-13 Julian Brown <julian@codesourcery.com>
3797 +
3798 + Merge from Sourcery G++ 4.2:
3799 +
3800 + libgcc/
3801 + * config.host (arm*-*-linux*, arm*-*-uclinux*, arm*-*-eabi*)
3802 + (arm*-*-symbianelf): Add arm/t-divmod-ef to tmake_file.
3803 + * Makefile.in (LIB2_DIVMOD_EXCEPTION_FLAGS): Set to previous
3804 + default if not set by a target-specific Makefile fragment.
3805 + (lib2-divmod-o, lib2-divmod-s-o): Use above.
3806 + * config/arm/t-divmod-ef: New.
3807 +
3808 +2008-06-13 Daniel Jacobowitz <dan@codesourcery.com>
3809 +
3810 + libgcc/
3811 + * shared-object.mk (c_flags-$(base)$(objext)): New.
3812 + ($(base)$(objext)): Use above.
3813 + ($(base)_s$(objext)): Likewise.
3814 + * static-object.mk (c_flags-$(base)$(objext)): New.
3815 + ($(base)$(objext)): Use above.
3816 +
3817 +2008-06-13 Julian Brown <julian@codesourcery.com>
3818 +
3819 + Merge from Sourcery G++ 4.2:
3820 +
3821 + gcc/testsuite/
3822 + * lib/target-supports.exp (check_effective_target_vect_int)
3823 + (check_effective_target_vect_shift)
3824 + (check_effective_target_vect_long)
3825 + (check_effective_target_vect_float)
3826 + (check_effective_target_vect_int_mult): Check for ARM.
3827 +
3828 +2008-06-12 Catherine Moore <clm@codesourcery.com>
3829 +
3830 + Merge from Sourcery G++ 4.2:
3831 +
3832 + gcc/
3833 + * config/mips/linux64.h: USE_SUBTARGET_SELF_SPECS.
3834 + * config/mips/sde.h: Likewise.
3835 + * config/mips/iris6.h: Likewise.
3836 +
3837 +2008-06-12 Catherine Moore <clm@codesourcery.com>
3838 +
3839 + Merge from Sourcery G++ 4.2:
3840 +
3841 + 2008-02-15 Julian Brown <julian@codesourcery.com>
3842 +
3843 + gcc/
3844 + * config/mips/t-sgxx-linux: New target fragment.
3845 + * config/mips/t-sgxxlite-linux: New target fragment.
3846 + * config/mips/cs-sgxx-linux.h: New header file.
3847 + * config/mips/cs-sgxxlite-linux.h: New header file.
3848 + * config/mips/t-none-linux: Remove.
3849 + * config/mips/cs-linux.h: Remove.
3850 + * config.gcc (mips*-*-linux*): Handle --enable-extra-sgxx-multilibs
3851 + and --enable-extra-sgxxlite-multilibs configure options. Use
3852 + sgxx-specific header files and target fragments. Remove use of
3853 + t-none-linux and cs-linux.h.
3854 +
3855 +2008-06-12 Catherine Moore <clm@codesourcery.com>
3856 +
3857 + Merge from Sourcery G++ 4.2:
3858 +
3859 + 2008-03-25 Maxim Kuvyrkov <maxim@codesourcery.com>
3860 + Julian Brown <julian@codesourcery.com>
3861 +
3862 + * 74k.md: (r74k_dsp_alu, r74k_dsp_alu_sat, r74k_dsp_mac, r74k_dsp_mac_sat)
3863 + (r74k_dsp_acc_ext, r74k_dsp_acc_mod): New insn reservations.
3864 + (r74k_dsp_mac, r74k_dsp_mac_sat, r74k_int_mult, r74k_int_mul3)
3865 + (r74k_dsp_mac, r74k_dsp_mac_sat): New bypasses.
3866 +
3867 +
3868 +2008-06-12 Catherine Moore <clm@codesourcery.com>
3869 +
3870 + Merge from Sourcery G++ 4.2:
3871 +
3872 + 2008-03-25 Maxim Kuvyrkov <maxim@codesourcery.com>
3873 + Julian Brown <julian@codesourcery.com>
3874 +
3875 + Merge from MIPS:
3876 +
3877 + gcc/
3878 + * config/mips/mips-protos.h (dspalu_bypass_p): Add prototype.
3879 + * config/mips/mips.c (dspalu_bypass_table): New.
3880 + (dspalu_bypass_p): New.
3881 + * 24k.md (r24k_dsp_alu, r24k_dsp_mac, r24k_dsp_mac_sat)
3882 + (r24k_dsp_acc_ext, r24k_dsp_acc_mod): New insn reservations.
3883 + (r24k_int_mult, r24k_int_mthilo, r24k_dsp_mac, r24k_dsp_mac_sat)
3884 + (r24k_dsp_acc_ext, r24k_dsp_acc_mod, r24k_dsp_alu): New bypasses.
3885 + * config/mips/mips.md (dspmac, dspmacsat, accext, accmod, dspalu)
3886 + (dspalusat): Add insn types.
3887 + * config/mips/mips-dsp.md (add<DSPV:mode>3)
3888 + (mips_add<DSP:dspfmt1>_s_<DSP:dspfmt2>)
3889 + (sub<DSPV:mode>3, mips_sub<DSP:dspfmt1>_s_<DSP:dspfmt2>, mips_addsc)
3890 + (mips_addwc, mips_modsub, mips_raddu_w_qb, mips_absq_s_<DSPQ:dspfmt2>)
3891 + (mips_precrq_qb_ph, mips_precrq_ph_w, mips_precrq_rs_ph_w)
3892 + (mips_precrqu_s_qb_ph, mips_preceq_w_phl, mips_preceq_w_phr)
3893 + (mips_precequ_ph_qbl, mips_precequ_ph_qbr, mips_precequ_ph_qbla)
3894 + (mips_precequ_ph_qbra, mips_preceu_ph_qbl, mips_preceu_ph_qbr)
3895 + (mips_preceu_ph_qbla, mips_preceu_ph_qbra, mips_shll_<DSPV:dspfmt2>)
3896 + (mips_shll_s_<DSPQ:dspfmt2>, mips_shll_s_<DSPQ:dspfmt2>, mips_shrl_qb)
3897 + (mips_shra_ph, mips_shra_r_<DSPQ:dspfmt2>, mips_bitrev, mips_insv)
3898 + (mips_repl_qb, mips_repl_ph, mips_cmp<DSPV:dspfmt1_1>_eq_<DSPV:dspfmt2>)
3899 + (mips_cmp<DSPV:dspfmt1_1>_lt_<DSPV:dspfmt2>)
3900 + (mips_cmp<DSPV:dspfmt1_1>_le_<DSPV:dspfmt2>, mips_cmpgu_eq_qb)
3901 + (mips_cmpgu_lt_qb, mips_cmpgu_le_qb, mips_pick_<DSPV:dspfmt2>)
3902 + (mips_packrl_ph, mips_wrdsp, mips_rddsp): Change type to dspalu.
3903 + (mips_dpau_h_qbl, mips_dpau_h_qbr, mips_dpsu_h_qbl, mips_dpsu_h_qbr)
3904 + (mips_dpaq_s_w_ph, mips_dpsq_s_w_ph, mips_mulsaq_s_w_ph)
3905 + (mips_maq_s_w_phl, mips_maq_s_w_phr, mips_maq_sa_w_phr: Set type to
3906 + dspmac.
3907 + (mips_dpaq_sa_l_w, mips_dpsq_sa_l_w, mips_maq_sa_w_phl): Set type to
3908 + dspmacsat.
3909 + (mips_extr_w, mips_extr_r_w, mips_extr_rs_w, mips_extp, mips_extpdp):
3910 + Set type to accext.
3911 + (mips_shilo, mips_mthlip): Set type to accmod.
3912 + * config/mips/mips-dspr2.md (mips_absq_s_qb, mips_addu_s_ph)
3913 + (mips_adduh_r_qb): Set type to dspalusat.
3914 + (mips_addu_ph, mips_adduh_qb, mips_append, mips_balign)
3915 + (mips_cmpgdu_eq_qb, mips_cmpgdu_lt_qb, mips_cmpgdu_le_qb)
3916 + (mips_precr_qb_ph, mips_precr_sra_ph_w, mips_precr_sra_r_ph_w)
3917 + (mips_prepend, mips_shra_qb, mips_shra_r_qb, mips_shrl_ph)
3918 + (mips_subu_ph, mips_subuh_qb, mips_subuh_r_qb, mips_addqh_ph)
3919 + (mips_addqh_r_ph, mips_addqh_w, mips_addqh_r_w, mips_subqh_ph)
3920 + (mips_subqh_r_ph, mips_subqh_w, mips_subqh_r_w): Set type to dspalu.
3921 + (mips_dpa_w_ph, mips_dps_w_ph, mips_mulsa_w_ph, mips_dpax_w_ph)
3922 + (mips_dpsx_w_ph, mips_dpaqx_s_w_ph, mips_dpsqx_s_w_ph): Set type to
3923 + dspmac.
3924 + (mips_subu_s_ph): Set type to dspalusat.
3925 + (mips_dpaqx_sa_w_ph, mips_dpsqx_sa_w_ph): Set type to dspmacsat.
3926 +
3927 +2008-06-12 Joseph Myers <joseph@codesourcery.com>
3928 +
3929 + gcc/testsuite/
3930 + * lib/target-supports.exp
3931 + (check_effective_target_powerpc_hard_double): New.
3932 + * gcc.dg/tree-ssa/loop-19.c: Use powerpc_hard_double instead of
3933 + powerpc*-*-*.
3934 +
3935 +2008-06-12 Joseph Myers <joseph@codesourcery.com>
3936 +
3937 + gcc/testsuite/
3938 + * gcc.dg/dfp/convert-bfp-6.c, gcc.dg/dfp/convert-bfp-9.c: XFAIL
3939 + for lax_strtofp.
3940 +
3941 +2008-06-12 Joseph Myers <joseph@codesourcery.com>
3942 +
3943 + Backport:
3944 +
3945 + gcc/
3946 + 2008-05-21 Janis Johnson <janis187@us.ibm.com>
3947 + * doc/sourcebuild.texi (Test Directives): Add dg-xfail-run-if.
3948 +
3949 + gcc/testsuite/
3950 + 2008-05-21 Janis Johnson <janis187@us.ibm.com>
3951 + * lib/target-supports-dg.exp (dg-xfail-run-if): New.
3952 +
3953 +2008-06-12 Catherine Moore <clm@codesourcery.com>
3954 +
3955 + Merge from Sourcery G++ 4.2:
3956 +
3957 + 2008-03-25 Maxim Kuvyrkov <maxim@codesourcery.com>
3958 + Julian Brown <julian@codesourcery.com>
3959 +
3960 + Merge from MIPS:
3961 +
3962 + gcc/
3963 + * config/mips/mips.c (mips_mult_madd_chain_bypass_p): New.
3964 + * config/mips/mips-protos.h (mips_mult_madd_chain_bypass_p): Add
3965 + prototype.
3966 + * config/mips/74k.md: Add bypasses for r74k_int_mult, r74_int_madd,
3967 + r74k_int_mul3.
3968 +
3969 +
3970 +2008-06-11 Catherine Moore <clm@codesourcery.com>
3971 +
3972 + Backport:
3973 +
3974 + gcc/
3975 + 2008-06-06 Sandip Matte <sandip@rmicorp.com>
3976 +
3977 + * doc/invoke.texi: Document -march=xlr.
3978 + * config/mips/xlr.md: New file.
3979 + * config/mips/mips.md: Include it.
3980 + (cpu): Add "xlr".
3981 + * config/mips/mips.h (PROCESSOR_XLR): New processor_type.
3982 + * config/mips/mips.c (mips_cpu_info_table): Add an XLR entry.
3983 + (mips_rtx_cost_data): Likewise.
3984 +
3985 +2008-06-10 Catherine Moore <clm@codesourcery.com>
3986 +
3987 + Merge from Sourcery G++ 4.2:
3988 +
3989 +
3990 + 2008-03-27 Daniel Jacobowitz <dan@codesourcery.com>
3991 +
3992 + gcc/
3993 + * config/mips/mips.md (loadgp_nonpic): New pattern.
3994 + (builtin_longjmp): Use for all TARGET_ABICALLS.
3995 + (exception_receiver): Revert local changes.
3996 + * config/mips/mips.c (mips_gnu_local_gp, mips_got_base): New functions.
3997 + (struct machine_function): Update the comment for
3998 + mips16_gp_pseudo_rtx.
3999 + (mips_call_tls_get_addr, mips_legitimize_tls_address): Use
4000 + mips_got_base.
4001 + (mips_restore_gp): Revert local changes. Assert PIC.
4002 + (mips_load_call_address, mips_expand_call): Revert local changes.
4003 + (mips_conditional_register_usage): Make $gp ordinary for
4004 + non-PIC.
4005 + (mips_tls_got_ref_1, mips_tls_got_ref_p): Delete.
4006 + (mips_function_has_gp_insn, mips_global_pointer): Revert local changes.
4007 + (mips_save_reg_p): Check for fixed $gp.
4008 + (mips_gnu_local_gp_rtx): Renamed from mips_gnu_local_gp.
4009 + (mips_emit_loadgp): Use mips_gnu_local_gp.
4010 + (mips_dangerous_for_la25_p): Revert local change.
4011 + (mips16_gp_pseudo_reg): Use gen_loadgp_nonpic.
4012 + (mips_extra_live_on_entry): Revert local change.
4013 + * config/mips/mips.h (TARGET_USE_GOT): Require flag_pic.
4014 + (TARGET_CALL_CLOBBERED_GP): Likewise.
4015 + (TARGET_NONPIC_ABICALLS): Define.
4016 + 2008-03-19 Mark Shinwell <shinwell@codesourcery.com>
4017 + Catherine Moore <clm@codesourcery.com>
4018 + Daniel Jacobowitz <dan@codesourcery.com>
4019 +
4020 + gcc/
4021 + * configure.ac: Add --enable-mips-nonpic.
4022 + * configure: Regenerated.
4023 + * config.gcc: Set TARGET_ABICALLS_DEFAULT instead of MASK_ABICALLS
4024 + for MIPS targets. Handle --enable-mips-nonpic.
4025 + * config/mips/linux.h (TARGET_DEFAULT): Delete.
4026 + (SUBTARGET_ASM_SPEC): Use -mnon-pic-abicalls.
4027 + * config/mips/elfoabi.h, config/mips/linux64.h,
4028 + config/mips/sde.h, config/mips/iris6.h, config/mips/wrs-linux.h,
4029 + config/mips/vr.h: Use SUBTARGET_SELF_SPECS.
4030 + * config/mips/mips.md (exception_receiver): Disable for
4031 + non-PIC.
4032 + * config/mips/mips.c (mips_classify_symbol): Do not use the GOT
4033 + for non-PIC.
4034 + (mips_tls_symbol_ref_1, mips_cannot_force_const_mem): Correct comments.
4035 + (mips_restore_gp): Skip for non-PIC.
4036 + (mips_load_call_address): Skip lazy binding for non-PIC.
4037 + (mips_expand_call): Skip GP usage for non-PIC.
4038 + (override_options): Remove flag_pic override. Use sorry for
4039 + other ABIs.
4040 + (mips_file_start): Emit pic0 for non-PIC.
4041 + (mips_tls_got_ref_1, mips_tls_got_ref_p): New.
4042 + (mips_function_has_gp_insn): Use mips_tls_got_ref_p. Skip jump
4043 + tables.
4044 + (mips_global_pointer, mips_current_loadgp_style): Adjust for non-PIC.
4045 + (mips_expand_prologue): Do not cprestore for non-PIC.
4046 + (mips_function_rodata_section): Skip for non-PIC.
4047 + (mips_dangerous_for_la25_p): Likewise.
4048 + (mips_extra_live_on_entry): Skip for non-PIC.
4049 + * config/mips/mips.h (TARGET_GPWORD): Require flag_pic.
4050 + (ABICALLS_SPEC, ABICALLS_SELF_SPECS, SUBTARGET_SELF_SPECS)
4051 + (DRIVER_SELF_SPECS): New.
4052 + (MIPS_CALL): Correct for non-PIC.
4053 +
4054 +2008-06-09 Kazu Hirata <kazu@codesourcery.com>
4055 +
4056 + Merge from Sourcery G++ 4.2:
4057 +
4058 + 2008-05-28 Kazu Hirata <kazu@codesourcery.com>
4059 +
4060 + Issue 2895
4061 + gcc/
4062 + * config.gcc (arm*-*-linux*): Handle enable_extra_asa_multilibs.
4063 + enable_extra_asa_multilibs.
4064 + * config/arm/t-asa: New.
4065 +
4066 + 2008-05-28 Kazu Hirata <kazu@codesourcery.com>
4067 +
4068 + * config/arm/t-asa (MULTILIB_EXCEPTIONS): Remove
4069 + march=armv4t/mfpu=neon* and march=armv4t/*mfloat-abi=softfp. Add
4070 + *march=armv4t*/*mfpu=neon* and *march=armv4t*/*mfloat-abi=softfp*.
4071 + (MULTILIB_ALIASES): Remove march?armv4t=mthumb/march?armv4t* and
4072 + march?armv6=mthumb/march?armv6*. Add
4073 + march?armv4t=mthumb/march?armv4t, march?armv6=mthumb/march?armv6,
4074 + and
4075 + march?armv6/mfloat-abi?softfp=mthumb/march?armv6/mfloat-abi?softfp.
4076 +
4077 +2008-06-09 Joseph Myers <joseph@codesourcery.com>
4078 +
4079 + gcc/testsuite/
4080 + * gcc.target/powerpc/20030218-1.c: Separate dg-message and
4081 + dg-error for two diagnostics on the same line.
4082 +
4083 +2008-06-09 Catherine Moore <clm@codesourcery.com>
4084 +
4085 + From 4.2 branch:
4086 +
4087 + gcc/testsuite/
4088 + * gcc.target/mips/branch-1.c: Support OCTEON.
4089 +
4090 +2008-06-09 Joseph Myers <joseph@codesourcery.com>
4091 +
4092 + Backport:
4093 +
4094 + gcc/testsuite/
4095 + 2008-05-20 Janis Johnson <janis187@us.ibm.com>
4096 + * g++.dg/ext/vector14.C: Ignore a possible warning.
4097 +
4098 +2008-06-09 Joseph Myers <joseph@codesourcery.com>
4099 +
4100 + Backport:
4101 +
4102 + gcc/testsuite/
4103 + 2008-06-09 Joseph Myers <joseph@codesourcery.com>
4104 + * gcc.dg/pr34856.c: Condition use of -maltivec on
4105 + powerpc_altivec_ok. Use -w on other powerpc*-*-linux*.
4106 +
4107 +2008-06-09 Catherine Moore <clm@codesourcery.com>
4108 +
4109 + From 4.2 branch:
4110 +
4111 + gcc/testsuite/
4112 + * gcc.target/mips/mips-nonpic: New testsuite.
4113 +
4114 +2008-06-09 Catherine Moore <clm@codesourery.com>
4115 +
4116 + gcc/testsuite/
4117 + * gcc.target/mips/mips32-dsp-run.c (mipsisa32-sde-elf): Add as
4118 + target.
4119 + * gcc.target/mips/mips32-dsp.c: Likewise.
4120 +
4121 +2008-06-07 Joseph Myers <joseph@codesourcery.com>
4122 +
4123 + Backport:
4124 +
4125 + gcc/testsuite/
4126 + 2008-04-04 Janis Johnson <janis187@us.ibm.com>
4127 + * g++.dg/other/anon5.C: Don't depend on line number for error message.
4128 + * gcc.dg/torture/builtin-modf-1.c: Use special options for
4129 + powerpc*-*-linux*.
4130 + * gcc.dg/var-expand3.c: Skip for powerpc-linux if not on AltiVec HW.
4131 + * gcc.dg/pr34856.c: Use -maltivec on powerpc linux.
4132 +
4133 +2008-06-07 Joseph Myers <joseph@codesourcery.com>
4134 +
4135 + gcc/testsuite/
4136 + * gcc.target/powerpc/altivec-24.c, gcc.target/powerpc/pr35907.c:
4137 + Correct target selector syntax.
4138 +
4139 +2008-06-06 Sandra Loosemore <sandra@codesourcery.com>
4140 +
4141 + From 4.2 branch:
4142 +
4143 + * release-notes-csl.xml (GCC stack size limit increased):
4144 + Conditionalize release note for host.
4145 + (UNC pathname bug fix): Likewise.
4146 +
4147 +2008-06-06 Joseph Myers <joseph@codesourcery.com>
4148 +
4149 + gcc/
4150 + * config/arm/wrs-linux.h (SUBTARGET_EXTRA_LINK_SPEC): Don't pass
4151 + --be8 for -r links.
4152 +
4153 +2008-06-06 Joseph Myers <joseph@codesourcery.com>
4154 +
4155 + Backport:
4156 +
4157 + libstdc++-v3/
4158 + 2008-06-06 Joseph Myers <joseph@codesourcery.com>
4159 + * configure.ac: Do not check for gconv.h.
4160 + * crossconfig.m4 (GLIBCXX_CROSSCONFIG): Do not test for gconv.h or
4161 + gconf.h. For glibc and uClibc systems, define
4162 + _GLIBCXX_USE_RANDOM_TR1 and HAVE_MMAP and use AC_LC_MESSAGES and
4163 + AM_ICONV.
4164 + * configure, config.h.in: Regenerate.
4165 +
4166 +2008-06-06 Joseph Myers <joseph@codesourcery.com>
4167 +
4168 + Backport:
4169 +
4170 + libstdc++-v3/
4171 + 2008-06-06 Joseph Myers <joseph@codesourcery.com>
4172 + * testsuite/17_intro/headers/all.cc,
4173 + testsuite/17_intro/headers/all_c++200x_compatibility.cc,
4174 + testsuite/17_intro/headers/all_pedantic_errors.cc,
4175 + testsuite/ext/headers.cc: Only include
4176 + <ext/codecvt_specializations.h> and <ext/enc_filebuf.h> if
4177 + _GLIBCXX_HAVE_ICONV.
4178 +
4179 +2008-06-05 Catherine Moore <clm@codesourcery.com>
4180 +
4181 + Merge from Sourcery G++ 4.2:
4182 +
4183 + 2006-12-15 Richard Sandiford <richard@codesourcery.com>
4184 +
4185 + gcc/testsuite/
4186 + * gcc.target/mips/mips.exp (setup_mips_tests): Record whether
4187 + endianness is forced. Trest -mabicalls and -mno-abicalls as
4188 + ABI options.
4189 + (is_gp32_flag): Treat -mabi=32 as a 32-bit option.
4190 + (is_gp64_flag): New function.
4191 + (dg-mips-options): Generalize -mgp64 handling to is_gp64_flag.
4192 + Do not set the ABI if the arguments already specify one.
4193 + Skip tests if the arguments specify an incompatible ABI.
4194 + Use -mno-abicalls for -mabi=eabi.
4195 + * gcc.target/mips/octeon-1.c, gcc.target/mips/octeon-2.c: New tests.
4196 + * gcc.target/mips/octeon-3.c, gcc.target/mips/octeon-4.c: Likewise
4197 + * gcc.target/mips/octeon-5.c, gcc.target/mips/octeon-6.c: Likewise
4198 + * gcc.target/mips/octeon-7.c, gcc.target/mips/octeon-8.c: Likewise
4199 + * gcc.target/mips/octeon-9.c, gcc.target/mips/octeon-10.c: Likewise
4200 + * gcc.target/mips/octeon-11.c, gcc.target/mips/octeon-12.c: Likewise
4201 + * gcc.target/mips/octeon-13.c, gcc.target/mips/octeon-14.c: Likewise
4202 + * gcc.target/mips/octeon-15.c, gcc.target/mips/octeon-16.c: Likewise
4203 + * gcc.target/mips/octeon-17.c, gcc.target/mips/octeon-18.c: Likewise
4204 + * gcc.target/mips/octeon-19.c, gcc.target/mips/octeon-20.c: Likewise
4205 + * gcc.target/mips/octeon-21.c, gcc.target/mips/octeon-22.c: Likewise
4206 + * gcc.target/mips/octeon-23.c, gcc.target/mips/octeon-24.c: Likewise
4207 + * gcc.target/mips/octeon-25.c, gcc.target/mips/octeon-26.c: Likewise
4208 + * gcc.target/mips/octeon-27.c, gcc.target/mips/octeon-28.c: Likewise
4209 + * gcc.target/mips/octeon-29.c, gcc.target/mips/octeon-30.c: Likewise
4210 + * gcc.target/mips/octeon-31.c, gcc.target/mips/octeon-32.c: Likewise
4211 + * gcc.target/mips/octeon-33.c, gcc.target/mips/octeon-34.c: Likewise
4212 + * gcc.target/mips/octeon-35.c, gcc.target/mips/octeon-36.c: Likewise
4213 + * gcc.target/mips/octeon-37.c, gcc.target/mips/octeon-38.c: Likewise
4214 + * gcc.target/mips/octeon-39.c, gcc.target/mips/octeon-40.c: Likewise
4215 + * gcc.target/mips/octeon-41.c, gcc.target/mips/octeon-42.c: Likewise
4216 + * gcc.target/mips/octeon-43.c, gcc.target/mips/octeon-44.c: Likewise
4217 + * gcc.target/mips/octeon-45.c, gcc.target/mips/octeon-46.c: Likewise
4218 + * gcc.target/mips/octeon-47.c, gcc.target/mips/octeon-48.c: Likewise
4219 + * gcc.target/mips/octeon-49.c, gcc.target/mips/octeon-50.c: Likewise
4220 + * gcc.target/mips/octeon-51.c, gcc.target/mips/octeon-52.c: Likewise
4221 + * gcc.target/mips/octeon-53.c, gcc.target/mips/octeon-54.c: Likewise
4222 + * gcc.target/mips/octeon-55.c, gcc.target/mips/octeon-56.c: Likewise
4223 + * gcc.target/mips/scc-1.c, gcc.target/mips/scc-2.c: Likewise.
4224 + * gcc.target/mips/branch-1.c: Likewise.
4225 +2008-06-05 Catherine Moore <clm@codesourcery.com>
4226 +
4227 + Merge from Sourcery G++ 4.2:
4228 +
4229 + 2006-12-15 Richard Sandiford <richard@codesourcery.com>
4230 +
4231 + Adapted from a patch by Cavium Networks.
4232 +
4233 + gcc/
4234 + * config/mips/mips.opt (mocteon-useun): New option.
4235 + * config/mips/mips-protos.h (mask_low_and_shift_len): Declare.
4236 + (mips_lower_sign_bit_p, mips_use_ins_p, mips_use_ext_p): Declare.
4237 + (mips_adjust_register_ext_operands): Likewise.
4238 + * config/mips/mips.h (PROCESSOR_OCTEON): New processor_type.
4239 + (TARGET_OCTEON): New macro.
4240 + (ISA_HAS_DCLZ_DCLO): Delete.
4241 + (ISA_HAS_POPCOUNT): New macro.
4242 + (ISA_HAS_ROTR_SI, ISA_HAS_ROTR_DI): Include TARGET_OCTEON.
4243 + (ISA_HAS_SEB_SEH, ISA_HAS_INS_EXT): Likewise.
4244 + (ISA_HAS_EXTS, ISA_HAS_BBIT, ISA_HAS_SEQ_SNE, ISA_HAS_BADDU)
4245 + (ISA_HAS_UL_US, ISA_HAS_CINS): New macros.
4246 + (ASM_SPEC): Pass down -mocteon-useun and -mno-octeon-useun.
4247 + * config/mips/mips.c (mips_cpu_info_table): Add an octeon entry.
4248 + (mips_rtx_cost_data): Likewise.
4249 + (mask_low_and_shift_len, mips_get_seq_sne_operand): New functions.
4250 + (mips_emit_scc): Use mips_get_seq_sne_operand to choose between
4251 + seq/sne and xor/addu.
4252 + (mips_expand_unaligned_load): Use mov_ulw and mov_uld if
4253 + ISA_HAS_UL_US.
4254 + (mips_expand_unaligned_store): Likewise mov_usw and mov_usd.
4255 + (mips_lower_sign_bit_p, mips_use_ins_p, mips_use_ext_p): New functions.
4256 + (mips_adjust_register_ext_operands): Likewise.
4257 + (print_operand): Add %E, %G and %H formats.
4258 + (mips_issue_rate): Return 2 when scheduling for PROCESSOR_OCTEON.
4259 + (mips_multipass_dfa_lookahead): Likewise.
4260 + * config/mips/octeon.md: New file.
4261 + * config/mips/mips.md: Include it.
4262 + (UNSPEC_UNALIGNED_LOAD, UNSPEC_UNALIGNED_STORE): New constants.
4263 + (type): Add pop.
4264 + (cpu): Add octeon.
4265 + (SUBDI): New mode macro.
4266 + (topbit): New mode attribute.
4267 + (any_extract, any_shiftrt, equailty_op): New code macros.
4268 + (*baddu_si, *baddu_disi, *baddu_didi, *baddu_didi2, popcount<mode>2)
4269 + (*<code>_trunc_exts<mode>, *trunc_zero_ext_<SHORT:mode><GPR:mode>):
4270 + New patterns.
4271 + (zero_extendsidi2): Turn into a define_expand. Rename old
4272 + define_insn_and_split to...
4273 + (*zero_extendsidi2): ...this and require !ISA_HAS_EXT_INS.
4274 + (*clear_upper32): Require !ISA_HAS_EXT_INS.
4275 + (*zero_extendsidi2_dext, *clear_upper32_dext): New patterns.
4276 + (extv): Change operand 1 from a QImode memory_operand to any
4277 + nonimmediate_operand. Try using extvsi and extvdi for register
4278 + extractions if ISA_HAS_EXTS.
4279 + (extv<mode>, *extv_truncdi<mode>): New patterns.
4280 + (extzv): Use mips_use_ext_p instead of mips_use_ins_ext_p.
4281 + Call mips_adjust_register_ext_operands.
4282 + (extzv<mode>): Use mips_use_ext_p instead of mips_use_ins_ext_p.
4283 + (*extzv_truncdi<mode>, *extz_truncdi<mode>_exts): New patterns.
4284 + (insv): Use mips_use_ins_p instead of mips_use_ins_ext_p.
4285 + Fix formatting.
4286 + (insv<mode>): Use mips_use_ins_p instead of mips_use_ins_ext_p.
4287 + (*insv<mode>di, *insv_<code>_<mode>di, *insvdi_clear_upper32)
4288 + (*cins): New patterns.
4289 + (mov_<load>l, mov_<load>r, mov_<store>l, mov_<store>r): Require
4290 + ISA_HAS_UL_US.
4291 + (mov_u<load>, mov_u<store>): New patterns.
4292 + (*truncsi_storeqi, *truncsi_storehi): Likewise.
4293 + (*branch_bit<mode>, *branch_bit<mode>_testdi): New patterns.
4294 + (*branch_bit<mode>_inverted): New pattern.
4295 + (*branch_bit_truncdi<mode>_inverted): Likewise.
4296 + (*seq_<mode>, *seq_<mode>_mips16, *sne_<mode>): Require
4297 + !ISA_HAS_SEQ_SNE.
4298 + (*seq_si_to_di, *seq_si_to_di_mips16, *sne_si_to_di): New patterns.
4299 + (*s<code>_<mode>_s<code>, *s<code>_si_to_di_s<code>): Likewise.
4300 + * config/mips/predicates.md (mask_low_and_shift_operator): New
4301 + predicate.
4302 +
4303 +2008-06-05 Joseph Myers <joseph@codesourcery.com>
4304 +
4305 + gcc/
4306 + * config.gcc (powerpc-*-linux*spe*): Use t-dfprules.
4307 + * config/rs6000/dfp.md (negdd2, absdd2, negtd2, abstd2): Do not
4308 + enable for TARGET_E500_DOUBLE.
4309 + (*movdd_softfloat32): Also enable for !TARGET_FPRS.
4310 + * config/rs6000/rs6000.c (invalid_e500_subreg): Treat decimal
4311 + floating-point modes like integer modes for E500 double.
4312 + (rs6000_legitimate_offset_address_p): Likewise.
4313 + (rs6000_legitimize_address): Likewise. Do not allow REG+REG
4314 + addressing for DDmode for E500 double.
4315 + (rs6000_hard_regno_nregs): Do not treat decimal floating-point
4316 + modes as using 64-bits of registers for E500 double.
4317 + (spe_build_register_parallel): Do not handle DDmode or TDmode.
4318 + (rs6000_spe_function_arg): Do not handle DDmode or TDmode
4319 + specially for E500 double.
4320 + (function_arg): Do not call rs6000_spe_function_arg for DDmode or
4321 + TDmode for E500 double.
4322 + (rs6000_gimplify_va_arg): Only handle SDmode in registers
4323 + specially if TARGET_HARD_FLOAT && TARGET_FPRS.
4324 + (rs6000_split_multireg_move): Do not handle TDmode specially for
4325 + E500 double.
4326 + (spe_func_has_64bit_regs_p): Do not treat DDmode or TDmode as
4327 + using 64-bit registers for E500 double.
4328 + (emit_frame_save): Do not handle DDmode specially for E500 double.
4329 + (gen_frame_mem_offset): Likewise.
4330 + (rs6000_function_value): Do not call spe_build_register_parallel
4331 + for DDmode or TDmode.
4332 + (rs6000_libcall_value): Likewise.
4333 + * config/rs6000/rs6000.h (LOCAL_ALIGNMENT, MEMBER_TYPE_FORCES_BLK,
4334 + DATA_ALIGNMENT, CLASS_MAX_NREGS): Do not handle DDmode specially
4335 + for E500 double.
4336 +
4337 +2008-06-05 Joseph Myers <joseph@codesourcery.com>
4338 +
4339 + gcc/
4340 + * dfp.c (WORDS_BIGENDIAN): Define to 0 if not defined.
4341 + (encode_decimal64, decode_decimal64, encode_decimal128,
4342 + decode_decimal128): Reverse order of 32-bit parts of value if host
4343 + and target endianness differ.
4344 +
4345 + libdecnumber/
4346 + * dconfig.h: New.
4347 + * decContext.c, decExcept.c, decExcept.h, decLibrary.c,
4348 + decNumber.c, decNumberLocal.h, decRound.c, dpd/decimal128.c,
4349 + dpd/decimal32.c, dpd/decimal64.c: Include dconfig.h not config.h.
4350 + * dpd/decimal128Local.h (decimal128SetSign, decimal128ClearSign,
4351 + decimal128FlipSign): Use WORDS_BIGENDIAN not
4352 + FLOAT_WORDS_BIG_ENDIAN.
4353 + * bid/host-ieee128.c: Include dconfig.h.
4354 + (__host_to_ieee_128, __ieee_to_host_128): Swap 64-bit halves of
4355 + value if WORDS_BIGENDIAN.
4356 +
4357 + libgcc/
4358 + * Makefile.in (DECNUMINC): Remove
4359 + -I$(MULTIBUILDTOP)../../libdecnumber.
4360 + * gstdint.h: New.
4361 +
4362 +2008-06-05 Joseph Myers <joseph@codesourcery.com>
4363 +
4364 + gcc/
4365 + * config/arm/arm.c (arm_init_neon_builtins): Move initialization
4366 + with function calls after declarations. Lay out
4367 + neon_float_type_node before further use.
4368 +
4369 +2008-06-04 Catherine Moore <clm@codesourcery.com>
4370 +
4371 + Merge from Sourcery G++ 4.2:
4372 +
4373 + 2008-03-27 Robin Randhawa <robin@mips.com>
4374 +
4375 + * libstdc++-v3/config/cpu/mips/atomicity.h : Added memory barriers
4376 + to enforce strict ordering on weakly ordered systems.
4377 +
4378 +2008-06-04 Paul Brook <paul@codesourcery.com>
4379 +
4380 + Fix Issue #2917
4381 + gcc/
4382 + * config/arm/arm.c (neon_vector_mem_operand): Handle element/structure
4383 + loads. Allow PRE_DEC.
4384 + (output_move_neon): Handle PRE_DEC.
4385 + (arm_print_operand): Add 'A' for neon structure loads.
4386 + * config/arm/arm-protos.h (neon_vector_mem_operand): Update prototype.
4387 + * config/arm/neon.md (movmisalign): Use Um constraint and %A.
4388 + * config/arm/constraints.md (Un, Us): Update neon_vector_mem_operand
4389 + calls.
4390 + (Um): New constraint.
4391 +
4392 +2008-06-04 Joseph Myers <joseph@codesourcery.com>
4393 +
4394 + Backport:
4395 +
4396 + gcc/testsuite/
4397 + 2008-06-04 Joseph Myers <joseph@codesourcery.com>
4398 + * lib/target-supports.exp (check_effective_target_powerpc_spu):
4399 + Call check_effective_target_powerpc_altivec_ok.
4400 + * gcc.target/powerpc/dfp-dd.c, gcc.target/powerpc/dfp-td.c,
4401 + gcc.target/powerpc/ppc32-abi-dfp-1.c,
4402 + gcc.target/powerpc/ppu-intrinsics.c: Require powerpc_fprs.
4403 +
4404 +2008-06-04 Kazu Hirata <kazu@codesourcery.com>
4405 +
4406 + Issue 1073
4407 + gcc/
4408 + * config/m68k/m68k.c (m68k_tune_flags): New.
4409 + (override_options): Compute m68k_tune_flags.
4410 + (MULL_COST, MULW_COST): Update for various variants of CFV2.
4411 + * config/m68k/m68k.h (TUNE_MAC, TUNE_EMAC): New.
4412 +
4413 +2008-06-03 Nathan Froyd <froydnj@codesourcery.com>
4414 +
4415 + Merge from Sourcery G++ 4.2:
4416 +
4417 + 2008-06-02 Nathan Froyd <froydnj@codesourcery.com>
4418 +
4419 + gcc/
4420 + * config/rs6000/t-linux (MULTILIB_OPTIONS): Add te500mc.
4421 + (MULTILIB_DIRNAMES): Likewise.
4422 + (MULTILIB_EXCEPTIONS): Handle te500mc.
4423 + * config/rs6000/linux.h (CC1_EXTRA_SPEC): Handle te500mc.
4424 + (ASM_DEFAULT_SPEC): Likewise.
4425 + * config/rs6000/rs6000.h (OPTION_DEFAULT_SPECS): Handle te500mc.
4426 +
4427 +2008-06-03 Nathan Froyd <froydnj@codesourcery.com>
4428 +
4429 + Merge from Sourcery G++ 4.2:
4430 +
4431 + 2008-06-02 Nathan Froyd <froydnj@codesourcery.com>
4432 +
4433 + NOT ASSIGNED TO FSF
4434 + COPYRIGHT FREESCALE
4435 +
4436 + gcc/doc:
4437 + * invoke.texi: Mention e500mc as a legitimate Power cpu.
4438 +
4439 + gcc/
4440 + * config.gcc: Mention e500mc as a legitimate --with-cpu option.
4441 + * config/rs6000/rs6000.c (ppce500mc_cost): New.
4442 + (rs6000_override_options): Add e500mc to processor_target_table.
4443 + Enable isel for e500mc. Disable string instructions for e500mc.
4444 + Set rs6000_cost for e500mc.
4445 + (rs6000_issue_rate): Handle CPU_PPCE500MC.
4446 + * config/rs6000/rs6000.h (ASM_CPU_SPEC): Handle mcpu=e500mc.
4447 + (enum processor_type): Add PROCESSOR_PPCE500MC.
4448 + (TARGET_ISEL): Use rs6000_isel.
4449 + * config/rs6000/e500mc.md: New file.
4450 + * config/rs6000/rs6000.md: Include it.
4451 + (define_attr "cpu"): Add e500mc.
4452 + (define_attr "type"): Add insert_dword.
4453 + * config/rs6000/e500.h (TARGET_ISEL): Remove.
4454 + (CHECK_E500_OPTIONS): Remove TARGET_ISEL condition.
4455 +
4456 + 2008-06-02 Nathan Froyd <froydnj@codesourcery.com>
4457 +
4458 + * release-notes-csl.xml (E500mc support): New.
4459 +
4460 + gcc/
4461 + * config/rs6000/e500mc.md: Eliminate duplication.
4462 +
4463 +2008-06-03 Joseph Myers <joseph@codesourcery.com>
4464 +
4465 + Backport:
4466 +
4467 + gcc/
4468 + 2008-02-22 Nathan Froyd <froydnj@codesourcery.com>
4469 + * config/rs6000/rs6000.c (rs6000_legitimize_address): Check to
4470 + ensure that we can address an entire entity > 8 bytes. Don't
4471 + generate reg+reg addressing for such data.
4472 +
4473 + 2008-03-07 Peter Bergner <bergner@vnet.ibm.com>
4474 + PR target/35373
4475 + * config/rs6000/rs6000.c (rs6000_legitimize_address): Don't generate
4476 + reg+const addressing for Altivec modes. Don't generate reg+reg
4477 + addressing for TFmode or TDmode quantities.
4478 +
4479 +2008-06-03 Nathan Froyd <froydnj@codesourcery.com>
4480 +
4481 + Merge from Sourcery G++ 4.2:
4482 +
4483 + 2007-03-28 Daniel Jacobowitz <dan@codesourcery.com>
4484 +
4485 + gcc/testsuite/
4486 + * lib/target-supports.exp (check_effective_target_powerpc_spe_ok): New.
4487 +
4488 +2008-06-03 Nathan Froyd <froydnj@codesourcery.com>
4489 +
4490 + gcc/
4491 + * config/rs6000/predicates.md (save_world_operation): Adjust checks.
4492 +
4493 + Merge from Sourcery G++ 4.2:
4494 +
4495 + 2008-05-22 Nathan Froyd <froydnj@codesourcery.com>
4496 +
4497 + Issue #3062
4498 +
4499 + * release-notes-csl.xml (E500 size optimization compiler crash): New.
4500 +
4501 + gcc/
4502 + * config/rs6000/rs6000.c (rs6000_emit_prologue): Mark the
4503 + adjustment to r11 as frame related when generating out-of-line
4504 + prologues.
4505 +
4506 + 2008-03-07 Nathan Froyd <froydnj@codesourcery.com>
4507 +
4508 + gcc/
4509 + * config/rs6000/rs6000.c (rs6000_savres_strategy): Be slightly
4510 + smarter about restoring with an out-of-line function.
4511 + (rs6000_emit_prologue): Make sure we only set r11 once. Be
4512 + smarter about restoring LR.
4513 +
4514 + 2008-02-29 Nathan Froyd <froydnj@codesourcery.com>
4515 +
4516 + gcc/
4517 + * config/rs6000/rs6000.c (emit_allocate_stack): Add copy_r11
4518 + parameter. Copy stack_reg to r11 where appropriate.
4519 + (rs6000_stack_info): Only add padding for SPE save area if we
4520 + are saving SPE GPRs and CR.
4521 + (saveres_routine_syms): New variable.
4522 + (FIRST_SAVRES_REGISTER, LAST_SAVRES_REGISTER, N_SAVRES_REGISTERS):
4523 + Define.
4524 + (rs6000_savres_routine_sym): New function.
4525 + (rs6000_emit_stack_reset, rs6000_restore_saved_cr): New functions,
4526 + split out of...
4527 + (rs6000_emit_epilogue): ...here. Use rs6000_use_multiple_p and
4528 + rs6000_savres_strategy. Restore GPRs out-of-line if appropriate.
4529 + Tweak FPR out-of-line saving.
4530 + (rs6000_make_savres_rtx): New function.
4531 + (rs6000_use_multiple_p): New function.
4532 + (rs6000_savres_strategy): New function.
4533 + (rs6000_emit_prologue): Use rs6000_savres_strategy. Save GPRs
4534 + out-of-line if appropriate.
4535 + * config/rs6000/sysv4.h (FP_SAVE_INLINE): Save FPRs out-of-line
4536 + if we are optimizing for size.
4537 + (GP_SAVE_INLINE): Define.
4538 + (SAVE_FP_SUFFIX, RESTORE_FP_SUFFIX): Only use _l on 64-bit targets.
4539 + * config/rs6000/darwin.h (GP_SAVE_INLINE): Define.
4540 + * config/rs6000/aix.h (GP_SAVE_INLINE): Define.
4541 + * config/rs6000/rs6000.md (*save_gpregs_<mode>): New insn.
4542 + (*save_fpregs_<mode>): Add use of r11.
4543 + (*restore_gpregs_<mode>): New insn.
4544 + (*return_and_restore_gpregs_<mode>): New insn.
4545 + (*return_and_restore_fpregs_<mode>): Adjust to clobber LR and
4546 + use r11.
4547 + * config/rs6000/spe.md (*save_gpregs_spe): New insn.
4548 + (*restore_gpregs_spe): New insn.
4549 + (*return_and_restore_gpregs_spe): New insn.
4550 +
4551 +2008-06-02 Nathan Froyd <froydnj@codesourcery.com>
4552 +
4553 + gcc/
4554 + * config/rs6000/rs6000.md (absv2sf2, negv2sf2, addv2sf3, subv2sf3,
4555 + mulv2sf3, divv2sf3): New expanders.
4556 + * config/rs6000/spe.md (spe_evabs, spe_evand, spe_evaddw,
4557 + spe_evdivws): Rename to use standard GCC names.
4558 + * config/rs6000/paired.md (negv2sf, absv2sf2, addv2sf3, subv2sf3,
4559 + mulv2sf3, divv2sf3): Rename to avoid conflict with the new expanders.
4560 +
4561 + Merge from Sourcery G++ 4.2:
4562 +
4563 + 2007-09-19 Nathan Froyd <froydnj@codesourcery.com>
4564 +
4565 + gcc/
4566 + * config/rs6000/rs6000.c (bdesc_2arg, bdesc_1arg): Use new CODE_FOR_
4567 + names for renamed patterns.
4568 +
4569 +2008-05-30 Joseph Myers <joseph@codesourcery.com>
4570 +
4571 + gcc/
4572 + * config/arm/wrs-linux.h (CC1_SPEC): Allow -tcortex-a8-be8
4573 + -mfloat-abi=softfp.
4574 + (SUBTARGET_EXTRA_ASM_SPEC): Use -meabi=5.
4575 + * config/arm/t-wrs-linux (MULTILIB_EXCEPTIONS): Remove
4576 + *cortex-a8-be8*/*mfloat-abi=softfp*.
4577 + (MULTILIB_ALIASES): Add
4578 + tcortex-a8-be8=tcortex-a8-be8/mfloat-abi?softfp.
4579 +
4580 +2008-05-30 Maxim Kuvyrkov <maxim@codesourcery.com>
4581 +
4582 + Merge from Sourcery G++ 4.2:
4583 +
4584 + 2006-12-12 Richard Sandiford <richard@codesourcery.com>
4585 + gcc/testsuite/
4586 + * gcc.dg/torture/m68k-interrupt-1.c: New file.
4587 + 2006-06-23 Richard Sandiford <richard@codesourcery.com>
4588 + gcc/testsuite/
4589 + * gcc.dg/tree-ssa/20040204-1.c: Don't XFAIL for m68k*-*-*.
4590 +
4591 +2008-05-30 Nathan Froyd <froydnj@codesourcery.com>
4592 +
4593 + gcc/
4594 + * config/rs6000/rs6000.c (ppc8540_cost): Fix typo.
4595 + (spe_synthesize_frame_save): Remove declaration.
4596 +
4597 +2008-05-30 Nathan Froyd <froydnj@codesourcery.com>
4598 +
4599 + gcc/
4600 + * tree-ssa-remove-local-statics.c
4601 + (find_static_nonvolatile_declarations): Use SSA_OP_VDEF.
4602 + (unstaticize_variable): Likewise.
4603 + (dump_final_bitmaps): Remove.
4604 +
4605 +2008-05-30 Maxim Kuvyrkov <maxim@codesourcery.com>
4606 +
4607 + Tree->const_tree fix.
4608 +
4609 + gcc/
4610 + * config/m68k/m68k.c (m68k_return_in_memory): Fix arguments types.
4611 +
4612 +2008-05-30 Maxim Kuvyrkov <maxim@codesourcery.com>
4613 +
4614 + Merge from Sourcery G++ 4.2:
4615 +
4616 + 2007-02-16 Richard Sandiford <richard@codesourcery.com>
4617 + gcc/
4618 + * config/m68k/m68k.h (INDEX_REG_CLASS): Delete in favor of...
4619 + (MODE_INDEX_REG_CLASS): ...this new macro. Return NO_REGS unless
4620 + MODE_OK_FOR_INDEX_P.
4621 + (MODE_OK_FOR_INDEX_P): New macro.
4622 + (REGNO_OK_FOR_INDEX_P): Delete in favor of...
4623 + (REGNO_MODE_OK_FOR_INDEX_P): ...this new macro. Return false
4624 + unless MODE_OK_FOR_INDEX_P.
4625 + (REG_OK_FOR_INDEX_P): Delete in favor of...
4626 + (REG_MODE_OK_FOR_INDEX_P): ...this new macro. Return false
4627 + unless MODE_OK_FOR_INDEX_P.
4628 + * m68k-protos.h (m68k_legitimate_index_reg_p): Add mode argument.
4629 + * m68k.c (m68k_legitimate_index_reg_p, m68k_decompose_index):
4630 + Add mode argument. Use it.
4631 + * config/m68k/m68k.md (tst<mode>_cf, cmp<mode>_cf, movsf_cf_hard)
4632 + (movdf_cf_hard, extendsfdf2_cf, truncdfsf2_cf, ftrunc<mode>2_cf)
4633 + (add<mode>3_cf, sub<mode>3_cf, fmul<mode>3_cf, div<mode>3_cf)
4634 + (neg<mode>2_cf, sqrt<mode>2_cf, abs<mode>2_cf): Replace "Q<U>"
4635 + constraints for FP addresses with "m" constraints.
4636 + 2007-02-16 Nathan Sidwell <nathan@codesourcery.com>
4637 + gcc/testsuite/
4638 + * gcc.dg/m68k-fp-1.c: New.
4639 +
4640 +2008-05-30 Julian Brown <julian@codesourcery.com>
4641 +
4642 + gcc/
4643 + * config/arm/cortex-r4.md: Update GPLv3 notice.
4644 + * hwdiv.md: Likewise.
4645 + * marvell-f-vfp.md: Likewise.
4646 + * marvell-f.md: Likewise.
4647 + * nocrt0.h: Likewise.
4648 + * vfp11.md: Likewise.
4649 +
4650 +2008-05-30 Maxim Kuvyrkov <maxim@codesourcery.com>
4651 +
4652 + Merge from Sourcery G++ 4.2 (Add missing testcase from
4653 + earlier merge):
4654 +
4655 + 2008-02-01 Joseph Myers <joseph@codesourcery.com>
4656 + gcc/testsuite/
4657 + * gcc.target/m68k/xgot-1.c: New test.
4658 +
4659 +2008-05-30 Maxim Kuvyrkov <maxim@codesourcery.com>
4660 +
4661 + Merge from Sourcery G++ 4.2:
4662 +
4663 + 2008-01-11 Kazu Hirata <kazu@codesourcery.com>
4664 + Issue 2396
4665 + gcc/
4666 + * configure.ac: Teach that fido supports .debug_line.
4667 + * configure: Regenerate.
4668 +
4669 +2008-05-30 Maxim Kuvyrkov <maxim@codesourcery.com>
4670 +
4671 + Merge from Sourcery G++ 4.2 (config.gcc part was merged earlier):
4672 +
4673 + 2007-03-26 Nathan Sidwell <nathan@codesourcery.com>
4674 + gcc/
4675 + * config.gcc (m68k-*-linux*): Add sysroot-suffix.h to tm_file. Add
4676 + m68k/t-floatlib, m68k/t-linux & m68k/t-mlibs to tmake_file.
4677 + * config/m68k/t-linux: New.
4678 + * doc/install.texi: Document m68k-*-linux is now multilibbed by
4679 + default.
4680 +
4681 +2008-05-30 Maxim Kuvyrkov <maxim@codesourcery.com>
4682 +
4683 + Revert:
4684 +
4685 + 2008-05-29 Maxim Kuvyrkov <maxim@codesourcery.com>
4686 + Merge from Sourcery G++ 4.2:
4687 + 2007-02-16 Paul Brook <paul@codesourcery.com>
4688 + Richard Sandiford <richard@codesourcery.com>
4689 + gcc/
4690 + * config/m68k/m68k.md (UNSPEC_MOVEQ_MEM): New constant.
4691 + (*movsi_smallconst): New pattern.
4692 +
4693 +2008-05-29 Maxim Kuvyrkov <maxim@codesourcery.com>
4694 +
4695 + * config/m68k/m68k.md: Fix previous commit.
4696 +
4697 +2008-05-29 Maxim Kuvyrkov <maxim@codesourcery.com>
4698 +
4699 + Merge from Sourcery G++ 4.2:
4700 +
4701 + 2007-02-16 Richard Sandiford <richard@codesourcery.com>
4702 + gcc/
4703 + * config/m68k/m68k.md (tst<mode>_cf, cmp<mode>_cf, movsf_cf_hard)
4704 + (movdf_cf_hard, extendsfdf2_cf, truncdfsf2_cf, floatsi<mode>2_cf)
4705 + (floathi<mode>2_cf, floatqi<mode>2_cf, ftrunc<mode>2_cf)
4706 + (fix<mode>qi2_cf, fix<mode>hi2_cf, fix<mode>si2_cf)
4707 + (add<mode>3_cf, sub<mode>3_cf, fmul<mode>3_cf, div<mode>3_cf)
4708 + (divmodsi4_cf, udivmodsi4_cf)
4709 + (neg<mode>2_cf, sqrt<mode>2_cf, abs<mode>2_cf): Replace "Q<U>"
4710 + constraints for FP addresses with "m" constraints.
4711 +
4712 +2008-05-29 Maxim Kuvyrkov <maxim@codesourcery.com>
4713 +
4714 + Merge from Sourcery G++ 4.2:
4715 +
4716 + 2007-02-16 Paul Brook <paul@codesourcery.com>
4717 + Richard Sandiford <richard@codesourcery.com>
4718 + gcc/
4719 + * config/m68k/m68k.md (UNSPEC_MOVEQ_MEM): New constant.
4720 + (*movsi_smallconst): New pattern.
4721 +
4722 +2008-05-29 Julian Brown <julian@codesourcery.com>
4723 +
4724 + Merge from Sourcery G++ 4.2:
4725 +
4726 + 2008-05-19 Kazu Hirata <kazu@codesourcery.com>
4727 +
4728 + gcc/
4729 + * config.gcc (arm-timesys-linux-gnueabi): Add ./sysroot-suffix.h
4730 + ./sysroot-suffix.h to tm_file while removing arm/timesys-linux.h
4731 + from tm_file. Add tmake_file.
4732 + * config/arm/t-timesys (MULTILIB_OSDIRNAMES): Populate.
4733 + * config/arm/timesys-liunx.h: Remove.
4734 +
4735 +2008-05-29 Julian Brown <julian@codesourcery.com>
4736 +
4737 + Merge from Sourcery G++ 4.2:
4738 +
4739 + 2008-05-07 Paul Brook <paul@codesourcery.com>
4740 +
4741 + * config/arm/arm.c (arm_no_early_mul_dep): Correct the logic to
4742 + look into a MAC instruction.
4743 +
4744 +2008-05-29 Julian Brown <julian@codesourcery.com>
4745 +
4746 + Merge from Sourcery G++ 4.2:
4747 +
4748 + 2008-04-04 Paul Brook <paul@codesourcery.com>
4749 +
4750 + gcc/
4751 + * config/arm/linux-eabi.h (ARM_FUNCTION_PROFILER): Define.
4752 + (SUBTARGET_FRAME_POINTER_REQUIRED): Define.
4753 +
4754 +2008-05-29 Julian Brown <julian@codesourcery.com>
4755 +
4756 + Merge from Sourcery G++ 4.2:
4757 +
4758 + 2008-03-08 Paul Brook <paul@codesourcery.com>
4759 +
4760 + gcc/
4761 + * config/arm/t-linux-eabi (MULTILIB_OSDIRNAMES): Override old value.
4762 +
4763 +2008-05-29 Julian Brown <julian@codesourcery.com>
4764 +
4765 + Merge from Sourcery G++ 4.2:
4766 +
4767 + 2008-02-29 Paul Brook <paul@codesourcery.com>
4768 +
4769 + gcc/
4770 + * config/arm/lib1funcs.asm (THUMB_LDIV0): Fix bogus ARCH_7 ifdefs.
4771 + Use cbz.
4772 +
4773 +2008-05-29 Julian Brown <julian@codesourcery.com>
4774 +
4775 + Merge from Sourcery G++ 4.2:
4776 +
4777 + 2008-02-25 Sandra Loosemore <sandra@codesourcery.com>
4778 +
4779 + gcc/
4780 + * testsuite/gcc.dg/arm-mmx-1.c: Skip if conflicting -mcpu or -mabi
4781 + argument specified.
4782 +
4783 +2008-05-29 Julian Brown <julian@codesourcery.com>
4784 +
4785 + Merge from Sourcery G++ 4.2:
4786 +
4787 + 2008-02-18 Julian Brown <julian@codesourcery.com>
4788 +
4789 + gcc/
4790 + * config/arm/bpabi.S (test_div_by_zero): New macro.
4791 + (aeabi_ldivmod): Use above macro to tailcall long long div-by-zero
4792 + handler.
4793 + (aeabi_uldivmod): Likewise.
4794 + * config/arm/bpabi-v6m.S (test_div_by_zero): New macro.
4795 + (aeabi_ldivmod, aeabi_uldivmod): Use above macro.
4796 + * config/arm/lib1funcs.asm (ARM_LDIV0): Tailcall int div-by-zero
4797 + handler. Add signed/unsigned argument, pass correct value to that
4798 + handler.
4799 + (THUMB_LDIV0): Same, for Thumb.
4800 + (DIV_FUNC_END): Add signed argument.
4801 + (WEAK): New macro.
4802 + (__udivsi3, __umodsi3): Add unsigned argument to DIV_FUNC_END.
4803 + (__divsi3, modsi3): Add signed argument to DIV_FUNC_END.
4804 + (__aeabi_uidivmod, __aeabi_idivmod): Check division by zero.
4805 + (__div0): Rename to __aeabi_idiv0, __aeabi_ldiv0 for EABI, and declare
4806 + those names weak.
4807 + * config/arm/t-bpabi (LIB1ASMFUNCS): Add _aeabi_idiv0, _aeabi_ldiv0.
4808 +
4809 +2008-05-29 Julian Brown <julian@codesourcery.com>
4810 +
4811 + Merge from Sourcery G++ 4.2:
4812 +
4813 + 2008-02-17 Paul Brook <paul@codesourcery.com>
4814 +
4815 + gcc/
4816 + * doc/invoke.texi: Document -mword-relocations.
4817 + * config/arm/uclinux-elf.h: Define TARGET_DEFAULT_WORD_RELOCATIONS.
4818 + * config/arm/symbian.h: Define TARGET_DEFAULT_WORD_RELOCATIONS.
4819 + * config/arm/vxworks.h: Define TARGET_DEFAULT_WORD_RELOCATIONS.
4820 + * config/arm/arm.h: Define TARGET_DEFAULT_WORD_RELOCATIONS.
4821 + * config/arm/arm.md (movsi): Don't use movt if only word relocations
4822 + are permitted.
4823 + * config/arm/arm.opt: Add -mword-relocations.
4824 +
4825 +2008-05-29 Julian Brown <julian@codesourcery.com>
4826 +
4827 + Merge from Sourcery G++ 4.2:
4828 +
4829 + 2008-02-16 Paul Brook <paul@codesourcery.com>
4830 +
4831 + gcc/
4832 + * config.gcc (arm*): Handle --enable-extra-sgxx-multilibs.
4833 + Use arm/t-sysroot-suffix and ./sysroot-suffix.h.
4834 + * config/arm/uclinux-eabi.h (SYSROOT_SUFFIX_SPEC): Remove.
4835 + * config/arm/linux-eabi.h (SYSROOT_SUFFIX_SPEC): Remove.
4836 + * config/arm/t-linux-eabi: Remove marvell-f multilib.
4837 + Match Cortex-A9 and Cortex-R4F.
4838 + * config/arm/t-arm-elf: Remove marvell-f multilib.
4839 + Match Cortex-A9 and Cortex-R4F.
4840 + * config/arm/t-uclinux-eabi: Match Cortex-A9 and Cortex-R4F.
4841 + * config/arm/print-sysroot-suffix.sh: New file.
4842 + * config/arm/t-sysroot-suffix: New file.
4843 + * config/arm/t-cs-eabi: New file.
4844 + * config/arm/t-cs-linux: New file.
4845 +
4846 +2008-05-29 Julian Brown <julian@codesourcery.com>
4847 +
4848 + Merge from Sourcery G++ 4.2:
4849 +
4850 + 2008-02-05 Paul Brook <paul@codesourcery.com>
4851 +
4852 + gcc/
4853 + * genmultilib: Fix sed patterns.
4854 + Verify that aliases are valid.
4855 + * config/arm/t-timesys (MULTILIB_ALIASES): Set.
4856 +
4857 +2008-05-29 Julian Brown <julian@codesourcery.com>
4858 +
4859 + Merge from Sourcery G++ 4.2:
4860 +
4861 + 2008-02-05 Paul Brook <paul@codesourcery.com>
4862 +
4863 + gcc/doc/
4864 + * fragments.texi: Document MULTILIB_ALIASES.
4865 +
4866 + gcc/
4867 + * genmultilib: Add aliases.
4868 + * Makefile.in (s-mlib): Pass MULTILIB_ALIASES.
4869 + * config/arm/t-linux-eabi: Use MULTILIB_ALIASES.
4870 + * config/arm/t-arm-elf: Ditto.
4871 + * config/arm/t-uclinux-eabi: Ditto.
4872 +
4873 +2008-05-29 Julian Brown <julian@codesourcery.com>
4874 +
4875 + Merge from Sourcery G++ 4.2:
4876 +
4877 + 2008-01-28 Paul Brook <paul@codesourcery.com>
4878 +
4879 + gcc/
4880 + * config/arm/arm.c (arm_override_options): Set arm_abi earlier.
4881 + Allow Interworking on ARMv4 EABI based targets.
4882 + * config/arm/bpabi.h (TARGET_FIX_V4BX_SPEC): Define.
4883 + (SUBTARGET_EXTRA_ASM_SPEC, LINK_SPEC): Add TARGET_FIX_V4BX_SPEC.
4884 +
4885 +2008-05-29 Julian Brown <julian@codesourcery.com>
4886 +
4887 + Merge from Sourcery G++ 4.2:
4888 +
4889 + 2008-01-25 Paul Brook <paul@codesourcery.com>
4890 +
4891 + gcc/
4892 + * config/arm/ieee754-df.S (muldf3): Use RET macros.
4893 +
4894 +2008-05-29 Julian Brown <julian@codesourcery.com>
4895 +
4896 + Merge from Sourcery G++ 4.2:
4897 +
4898 + 2008-01-23 Paul Brook <paul@codesourcery.com>
4899 +
4900 + gcc/
4901 + * config/arm/arm.c (arm_tune_cortex_a9): New variable.
4902 + (arm_override_options): Set arm_tune_cortex_a9.
4903 + (arm_split_constant): Use arm_emit_movpair.
4904 + (arm_rtx_costs_1): Increase cost of register shifts on cortex-A9.
4905 + Add costs for HIGH and LO_SUM.
4906 + (arm_size_rtx_costs): Add costs for HIGH and LO_SUM.
4907 + (arm_emit_movpair): New function.
4908 + (arm_print_operand): Handle symbols with %c.
4909 + (arm_final_prescan_insn): Use TARGET_NO_SINGLE_COND_EXEC.
4910 + (arm_issue_rate): Add cortexa9.
4911 + * config/arm/arm.h (TARGET_NO_SINGLE_COND_EXEC): Define.
4912 + (TARGET_USE_MOVT): Define.
4913 + (arm_tune_cortex_a9): Add prototype.
4914 + * config/arm/arm-cores.def: Add cortex-a9.
4915 + * config/arm/arm-tune.md: Regenerate.
4916 + * config/arm/arm-protos.h (arm_emit_movpair): Add prototype.
4917 + * config/arm/arm.md: Include cortex-a9.md.
4918 + Add TARGET_NO_SINGLE_COND_EXEC conditions.
4919 + (generic_sched, generic_vfp): Add cortex-a9.
4920 + (movsi): Use arm_emit_movpair.
4921 + (arm_movt, arm_movw): New patterns.
4922 + * config/arm/cortex-a9.md: New file.
4923 +
4924 +2008-05-29 Julian Brown <julian@codesourcery.com>
4925 +
4926 + Merge from Sourcery G++ 4.2:
4927 +
4928 + 2008-01-09 Julian Brown <julian@codesourcery.com>
4929 +
4930 + gcc/
4931 + * config/arm/neon.md (UNSPEC_MISALIGNED_ACCESS): New constant.
4932 + (movmisalign<mode>): Define for D and Q width registers.
4933 +
4934 + gcc/testsuite/
4935 + * lib/target-supports.exp
4936 + (check_effective_target_arm_vect_no_misalign): New function.
4937 + (check_effective_target_vect_no_align): Use above to determine
4938 + whether misaligned accesses are expected for ARM.
4939 +
4940 +2008-05-29 Julian Brown <julian@codesourcery.com>
4941 +
4942 + Merge from Sourcery G++ 4.2:
4943 +
4944 + 2008-01-04 Paul Brook <paul@codesourcery.com>
4945 +
4946 + gcc/
4947 + * config/arm/arm.c (arm_output_epilogue): Avoid clobbering tail call
4948 + arguments.
4949 +
4950 +2008-05-29 Julian Brown <julian@codesourcery.com>
4951 +
4952 + Merge from Sourcery G++ 4.2:
4953 +
4954 + 2008-01-03 Paul Brook <paul@codesourcery.com>
4955 +
4956 + gcc/
4957 + * config/arm/arm.c (arm_rtx_costs_1): Add costs for ARMv6 value
4958 + extension instructions.
4959 +
4960 +2008-05-29 Julian Brown <julian@codesourcery.com>
4961 +
4962 + Merge from Sourcery G++ 4.2:
4963 +
4964 + 2007-12-20 Paul Brook <paul@codesourcery.com>
4965 +
4966 + gcc/
4967 + * config/arm/cortex-r4f.md: New file.
4968 + * config/arm/arm.c (arm_no_early_mul_dep): Also match
4969 + multiply-subtract.
4970 + (arm_issue_rate): Return 2 for cortex-a8 and cortex-r4.
4971 + * config/arm/cortex-r4.md: Replace (eq_attr "tune" "cortexr4")
4972 + with (eq_attr "tune_cortexr4" "yes").
4973 + * config/arm/vfp.md: Split ffarith and ffarith into fcpys, ffariths,
4974 + ffarithd, fadds, faddd, fconsts, fconstd, fcmps and fcmpd.
4975 + * config/arm/arm.md: Inlcude cortex-r4f.md.
4976 + (define_attr fpu): Add new VFP variants.
4977 + (define_attr type): Add new types.
4978 + (tune_cortexr4): New attr.
4979 + (generic_sched, generic_vfp): Use tune_cortexr4 and new FPU types.
4980 + * config/arm/cortex-a8-neon.md: Split farith and ffarith insn types.
4981 + * config/arm/marvell-f-vfp.md: Ditto.
4982 + * config/arm/arm1020e.md: Ditto.
4983 + * config/arm/vfp11.md: Ditto.
4984 + * config/arm/arm-tune.md: Regenerate.
4985 +
4986 +2008-05-29 Julian Brown <julian@codesourcery.com>
4987 +
4988 + Merge from Sourcery G++ 4.2:
4989 +
4990 + 2007-12-14 Paul Brook <paul@codesourcery.com>
4991 +
4992 + gcc/
4993 + * doc/invoke.texi: Document new ARM -mfpu= and -mcpu= options.
4994 + * config/arm/arm.c (all_fpus): Add vfpv3 and vfpv3-d16.
4995 + (fp_model_for_fpu): Add entry for FPUTYPE_VFP3D16.
4996 + (arm_file_start): Add FPUTYPE_VFP3D16. Rename vfp3 to vfpv3.
4997 + * config/arm/arm.h (TARGET_VFPD32): Define.
4998 + (TARGET_VFP3): Use TARGET_VFPD32.
4999 + (fputype): Add FPUTYPE_VFP3D16.
5000 + (LAST_VFP_REGNUM): Use TARGET_VFPD32.
5001 + * config/arm/constraints.md ("w"): Use TARGET_VFPD32.
5002 + * config/arm/arm-cores.def: Add cortex-r4f.
5003 +
5004 +2008-05-29 Julian Brown <julian@codesourcery.com>
5005 +
5006 + Merge from Sourcery G++ 4.2:
5007 +
5008 + 2007-12-11 Paul Brook <paul@codesourcery.com>
5009 +
5010 + gcc/
5011 + * config/arm/thumb2.md: Extend peephole to cover 3-arg subs.
5012 + (thumb2_alusi3_short): Exclude MINUS.
5013 + (thumb2_subsi_short): New pattern.
5014 +
5015 +2008-05-29 Julian Brown <julian@codesourcery.com>
5016 +
5017 + Merge from Sourcery G++ 4.2:
5018 +
5019 + 2007-09-27 Paul Brook <paul@codesourcery.com>
5020 +
5021 + gcc/
5022 + * config/arm/arm.c (arm_optimization_options): Revert flag_see
5023 + change.
5024 +
5025 +2008-05-29 Julian Brown <julian@codesourcery.com>
5026 +
5027 + Merge from Sourcery G++ 4.2:
5028 +
5029 + 2007-09-19 Paul Brook <paul@codesourcery.com>
5030 +
5031 + gcc/
5032 + * config/arm/arm.c (FL_COMPAT): Define.
5033 + (arm_override_options): Mask out FL_COMPAT when checking cpu vs. arch.
5034 +
5035 +2008-05-29 Julian Brown <julian@codesourcery.com>
5036 +
5037 + Merge from Sourcery G++ 4.2:
5038 +
5039 + 2007-09-19 Vladimir Prus <vladimir@codesourcery.com>
5040 +
5041 + gcc/
5042 + * config/arm/arm.c (arm_optimization_options):
5043 + Enable -fsee and disable -fmove-loop-invariants.
5044 + Use very restrictive inlining heuristics.
5045 +
5046 + gcc/testsuite/
5047 + * gcc.c-torture/execute/bcp-1.x: New. Don't
5048 + run bcp-1.c test on arm, with -Os.
5049 + * gcc.c-torture/execute/990208-1.x: New. Likewise.
5050 +
5051 +2008-05-29 Julian Brown <julian@codesourcery.com>
5052 +
5053 + Merge from Sourcery G++ 4.2:
5054 +
5055 + 2007-08-20 Paul Brook <paul@codesourcery.com>
5056 +
5057 + gcc/
5058 + * config/arm/arm.md (insv): Use gen_insv_t2 and gen_insv_zero.
5059 + (extzv): Use gen_extzv_t2.
5060 + (insv_t2, insv_zero, extv, extzv_t2): New patterns.
5061 +
5062 +2008-05-29 Julian Brown <julian@codesourcery.com>
5063 +
5064 + Merge from Sourcery G++ 4.2:
5065 +
5066 + 2007-08-20 Paul Brook <paul@codesourcery.com>
5067 +
5068 + gcc/
5069 + * config/arm/thumb2.md (thumb2_one_cmplsi2_short,
5070 + thumb2_negsi2_short): New patterns and peepholes.
5071 +
5072 +2008-05-29 Julian Brown <julian@codesourcery.com>
5073 +
5074 + Merge from Sourcery G++ 4.2:
5075 +
5076 + 2007-08-20 Paul Brook <paul@codesourcery.com>
5077 +
5078 + gcc/
5079 + * config/arm/arm.c (arm_size_rtx_costs): Use ARM costs for Thumb-2.
5080 +
5081 +2008-05-29 Julian Brown <julian@codesourcery.com>
5082 +
5083 + Merge from Sourcery G++ 4.2:
5084 +
5085 + 2007-08-13 Paul Brook <paul@codesourcery.com>
5086 +
5087 + * config/arm/arm.c (arm_output_epilogue): Adjust stack pointer by
5088 + popping call-clobbered registers.
5089 + (arm_expand_prologue): Adjust stack pointer by pushing extra
5090 + registers.
5091 +
5092 +2008-05-29 Julian Brown <julian@codesourcery.com>
5093 +
5094 + Merge from Sourcery G++ 4.2:
5095 +
5096 + 2007-08-12 Mark Shinwell <shinwell@codesourcery.com>
5097 +
5098 + gcc/
5099 + * config/arm/arm.c (TARGET_ADJUST_REG_ALLOC_ORDER): Define.
5100 + (thumb_core_reg_alloc_order): New.
5101 + (arm_adjust_reg_alloc_order): New.
5102 + * config/arm/arm.h (REG_ALLOC_ORDER): Adjust comment.
5103 + * config/arm/arm-protos.h (arm_adjust_reg_alloc_order): New
5104 + prototype.
5105 +
5106 +2008-05-29 Julian Brown <julian@codesourcery.com>
5107 +
5108 + Merge from Sourcery G++ 4.2:
5109 +
5110 + 2007-08-12 Mark Shinwell <shinwell@codesourcery.com>
5111 +
5112 + gcc/
5113 + * config/arm/arm.h (CLASS_LIKELY_SPILLED_P): Update comment.
5114 +
5115 +2008-05-29 Julian Brown <julian@codesourcery.com>
5116 +
5117 + Merge from Sourcery G++ 4.2:
5118 +
5119 + 2007-08-12 Mark Shinwell <shinwell@codesourcery.com>
5120 +
5121 + gcc/
5122 + * config/arm/arm.h (CLASS_LIKELY_SPILLED_P): Check against
5123 + LO_REGS only for Thumb-1.
5124 + (MODE_BASE_REG_CLASS): Restrict base registers to low
5125 + registers for Thumb-2.
5126 +
5127 +2008-05-29 Julian Brown <julian@codesourcery.com>
5128 +
5129 + Merge from Sourcery G++ 4.2:
5130 +
5131 + 2007-08-10 Paul Brook <paul@codesourcery.com>
5132 +
5133 + * config/arm/arm.md (arm_addsi3): Add r/k/n alternative.
5134 +
5135 +2008-05-29 Julian Brown <julian@codesourcery.com>
5136 +
5137 + Merge from Sourcery G++ 4.2:
5138 +
5139 + 2007-08-07 Kazu Hirata <kazu@codesourcery.com>
5140 +
5141 + gcc/testsuite/
5142 + * gcc.dg/arm-g2.c, gcc.dg/arm-mmx-1.c, gcc.dg/arm-scd42-2.c:
5143 + Skip if the multilib testing specifies -march that does not
5144 + agree with the one specified in the testcase.
5145 +
5146 +2008-05-29 Julian Brown <julian@codesourcery.com>
5147 +
5148 + Merge from Sourcery G++ 4.2:
5149 +
5150 + 2007-07-25 Nathan Sidwell <nathan@codesourcery.com>
5151 +
5152 + gcc/
5153 + * config.gcc (arm*-*-linux*): Add timesys specific files.
5154 + * config/arm/timesys-linux.h: New.
5155 + * config/arm/t-timesys: New.
5156 +
5157 +2008-05-29 Julian Brown <julian@codesourcery.com>
5158 +
5159 + Merge from Sourcery G++ 4.2:
5160 +
5161 + 2007-07-16 Paul Brook <paul@codesourcery.com>
5162 +
5163 + gcc/
5164 + * config/arm/arm.c (use_return_insn): Use offsets->saved_regs_mask
5165 + instead of {arm,thumb}_compute_save_reg_mask.
5166 + (output_return_instruction): Ditto.
5167 + (arm_output_epilogue): Ditto.
5168 + (arm_expand_prologue): Ditto.
5169 + (thumb_unexpanded_epilogue): Ditto.
5170 + (thumb1_expand_prologue): Ditto.
5171 + (thumb1_output_function_prologue): Ditto.
5172 + (arm_set_return_address): Ditto.
5173 + (thumb_set_return_address): Ditto.
5174 + (arm_get_frame_offsets): Set offsets->saved_regs_mask. Push extra
5175 + regs to achieve stack alignment.
5176 + (thumb1_compute_save_reg_mask): Fix compiler warning.
5177 + * gcc/config/arm.h (arm_stack_offsets): Add saved_regs_mask.
5178 +
5179 +2008-05-29 Julian Brown <julian@codesourcery.com>
5180 +
5181 + Merge from Sourcery G++ 4.2:
5182 +
5183 + 2007-07-05 Mark Shinwell <shinwell@codesourcery.com>
5184 +
5185 + gcc/
5186 + * config/arm/arm.h (BRANCH_COST): Set to 1 when optimizing
5187 + for size on Thumb-2.
5188 +
5189 +2008-05-29 Julian Brown <julian@codesourcery.com>
5190 +
5191 + Merge from Sourcery G++ 4.2:
5192 +
5193 + 2007-07-05 Richard Sandiford <richard@codesourcery.com>
5194 +
5195 + gcc/
5196 + * config/arm/neon-gen.ml: Include vxWorks.h rather than stdint.h
5197 + for VxWorks kernels.
5198 + * config/arm/arm_neon.h: Regenerate.
5199 +
5200 +2008-05-29 Julian Brown <julian@codesourcery.com>
5201 +
5202 + Merge from Sourcery G++ 4.2:
5203 +
5204 + 2007-07-05 Mark Shinwell <shinwell@codesourcery.com>
5205 +
5206 + gcc/
5207 + * config/arm/thumb2.md (thumb2_movsi_insn): Split ldr and
5208 + str alternatives according to use of high and low regs.
5209 + * config/arm/vfp.md (thumb2_movsi_vfp): Likewise.
5210 + * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Use high
5211 + regs when optimizing for size on Thumb-2.
5212 +
5213 +2008-05-29 Julian Brown <julian@codesourcery.com>
5214 +
5215 + Merge from Sourcery G++ 4.2:
5216 +
5217 + 2007-07-02 Paul Brook <paul@codesourcery.com>
5218 +
5219 + gcc/
5220 + * config/arm/thumb2.md (thumb2_alusi3_short): Exclude PLUS.
5221 + (thumb2_addsi_shortim): Rename ...
5222 + (thumb2_addsi_short): ... to this. Allow register operands.
5223 +
5224 +2008-05-29 Julian Brown <julian@codesourcery.com>
5225 +
5226 + Backport from mainline:
5227 +
5228 + 2008-02-26 Paul Brook <paul@codesourcery.com>
5229 +
5230 + * config/arm/arm.c (thumb_set_frame_pointer): Ensure SP is first
5231 + operand for Thumb-2.
5232 + * config/arm/arm.h (reg_class): Add CORE_REGS.
5233 + (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Ditto.
5234 + (BASE_REG_CLASS): Use CORE_REGS.
5235 + (PREFERRED_RELOAD_CLASS): Add STACK_REG.
5236 + (REGNO_MODE_OK_FOR_REG_BASE_P): Use REGNO_MODE_OK_FOR_BASE_P.
5237 + (REGNO_OK_FOR_INDEX_P): Exclude SP.
5238 + (ARM_REG_OK_FOR_INDEX_P): Always define. Use
5239 + ARM_REGNO_OK_FOR_INDEX_P.
5240 + (ARM_PRINT_OPERAND_ADDRESS): Swap operands for [reg, sp].
5241 + * config/arm/arm.md (arm_addsi3, thumb1_addsi3, arm_subsi3_insn,
5242 + arm_movsi_insn, thumb1_movsi_insni, stack_tie): Add "k" alternatives.
5243 + (ldm/stm peepholes): Ditto.
5244 + * config/arm/thumb2.md (thumb2_movdi): Add "k" alternatives.
5245 + * config/arm/vfp.md (arm_movsi_vfp, thumb2_movsi_vfp): Ditto.
5246 + * config/arm/iwmmxt.md (iwmmxt_movsi_insn): Ditto.
5247 + * config/arm/constraints.md: Enable "k" constraint on ARM.
5248 +
5249 +2008-05-29 Maxim Kuvyrkov <maxim@codesourcery.com>
5250 +
5251 + Merge from Sourcery G++ 4.2:
5252 +
5253 + 2008-02-01 Joseph Myers <joseph@codesourcery.com>
5254 + * release-notes-csl.xml: Add -mxgot release note.
5255 + gcc/
5256 + * config/m68k/m68k.opt (mxgot): New option.
5257 + * config/m68k/m68k.c (legitimize_pic_address): Handle -mxgot.
5258 + (m68k_output_addr_const_extra): New.
5259 + * config/m68k/m68k.h (OUTPUT_ADDR_CONST_EXTRA): New.
5260 + * config/m68k/m68k-protos.h (m68k_output_addr_const_extra): Declare.
5261 + * config/m68k/m68k.md (UNSPEC_GOTOFF): Define.
5262 + * doc/invoke.texi (M680x0 Options): Document -mxgot.
5263 + gcc/testsuite/
5264 + * gcc.target/m68k/xgot-1.c: New test.
5265 +
5266 +2008-05-29 Maxim Kuvyrkov <maxim@codesourcery.com>
5267 +
5268 + Merge from Sourcery G++ 4.2:
5269 +
5270 + 2008-03-12 Nathan Sidwell <nathan@codesourcery.com>
5271 + gcc/
5272 + * config/m68k/t-cf (MULTILIB_EXTRA_OPTS): Add no-mac.
5273 + * config/m68k/m68k-devices.def: Remove multilibs that only differ
5274 + by MAC/EMAC.
5275 +
5276 +2008-05-29 Julian Brown <julian@codesourcery.com>
5277 +
5278 + Merge from Sourcery G++ 4.2:
5279 +
5280 + 2007-06-13 Joseph Myers <joseph@codesourcery.com>
5281 +
5282 + gcc/
5283 + * config/arm/crti.asm, config/arm/crtn.asm: Remove .file
5284 + directives.
5285 +
5286 +2008-05-29 Julian Brown <julian@codesourcery.com>
5287 +
5288 + Merge from Sourcery G++ 4.2:
5289 +
5290 + 2007-06-06 Joseph Myers <joseph@codesourcery.com>
5291 +
5292 + gcc/
5293 + * config/arm/arm.h (VALID_IWMMXT_REG_MODE): Allow SImode.
5294 + (ARM_LEGITIMIZE_RELOAD_ADDRESS): Reduce range allowed for SImode
5295 + offsets with iWMMXt.
5296 + * config/arm/arm.c (arm_hard_regno_mode_ok): Update for change to
5297 + VALID_IWMMXT_REG_MODE.
5298 +
5299 +2008-05-29 Julian Brown <julian@codesourcery.com>
5300 +
5301 + Merge from Sourcery G++ 4.2:
5302 +
5303 + 2007-05-17 Paul Brook <paul@codesourcery.com>
5304 +
5305 + gcc/
5306 + * config/arm/arm.c (output_move_double): Prefer LDRD to LDM.
5307 +
5308 +2008-05-29 Julian Brown <julian@codesourcery.com>
5309 +
5310 + Merge from Sourcery G++ 4.2:
5311 +
5312 + 2007-05-15 Paul Brook <paul@codesourcery.com>
5313 +
5314 + gcc/
5315 + * config/arm/nocrt0.h (LIB_SPEC): Remove default -T.
5316 +
5317 +2008-05-29 Julian Brown <julian@codesourcery.com>
5318 +
5319 + Merge from Sourcery G++ 4.2:
5320 +
5321 + 2007-05-04 Mark Shinwell <shinwell@codesourcery.com>
5322 +
5323 + gcc/
5324 + * config/arm/bpabi.h (SUBTARGET_EXTRA_ASM_SPEC): Bump EABI
5325 + version number to five.
5326 +
5327 +2008-05-29 Julian Brown <julian@codesourcery.com>
5328 +
5329 + Merge from Sourcery G++ 4.2:
5330 +
5331 + 2007-05-02 Paul Brook <paul@codesourcery.com>
5332 +
5333 + gcc/
5334 + * config/arm/arm.c (arm_unwind_emit): Suppress unused unwinding
5335 + annotations.
5336 + (arm_output_fn_unwind): Mark functions that can not be unwound.
5337 +
5338 +2008-05-29 Julian Brown <julian@codesourcery.com>
5339 +
5340 + Merge from Sourcery G++ 4.2:
5341 +
5342 + 2007-04-26 Vladimir Prus <vladimir@codesourcery.com>
5343 +
5344 + gcc/
5345 + * config/arm/arm.c (vfp_output_fldmd): When low_irq_latency
5346 + is non zero, pop each register separately.
5347 + (vfp_emit_fstmd): When low_irq_latency is non zero,
5348 + save each register separately.
5349 + (arm_get_vfp_saved_size): Adjust saved register
5350 + size calculation for the above changes.
5351 +
5352 +2008-05-29 Julian Brown <julian@codesourcery.com>
5353 +
5354 + Merge from Sourcery G++ 4.2:
5355 +
5356 + 2007-04-25 Paul Brook <paul@codesourcery.com>
5357 +
5358 + gcc/
5359 + * config/arm/bpabi-v6m.S (aeabi_lcmp): Use unsigned comparison for
5360 + low word.
5361 +
5362 +2008-05-29 Julian Brown <julian@codesourcery.com>
5363 +
5364 + Merge from Sourcery G++ 4.2:
5365 +
5366 + 2007-04-22 Mark Shinwell <shinwell@codesourcery.com>
5367 +
5368 + gcc/
5369 + * config/arm/lib1funcs.asm (div0): Use correct punctuation.
5370 + * config/arm/ieee754-sf.S (mulsf3): Likewise.
5371 +
5372 +2008-05-29 Julian Brown <julian@codesourcery.com>
5373 +
5374 + Merge from Sourcery G++ 4.2:
5375 +
5376 + 2007-04-18 Vladimir Prus <vladimir@codesourcery.com>
5377 +
5378 + gcc/
5379 + * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Set
5380 + __low_irq_latency__.
5381 + * config/arm/lib1funcs.asm: Define do_pop and
5382 + do_push as variadic macros. When __low_irq_latency__
5383 + is defined, push and pop registers individually.
5384 + * config/arm/ieee754-df.S: Adjust syntax of using
5385 + do_push.
5386 + * config/arm/ieee754-sf.S: Likewise.
5387 + * config/arm/bpapi.S: Likewise.
5388 +
5389 +2008-05-29 Julian Brown <julian@codesourcery.com>
5390 +
5391 + Merge from Sourcery G++ 4.2:
5392 +
5393 + 2007-04-17 Paul Brook <paul@codesourcery.com>
5394 +
5395 + gcc/
5396 + * config/arm/arm.c (TARGET_DWARF_REGISTER_SPAN): Define.
5397 + (arm_dwarf_register_span): New function.
5398 + (arm_dbx_register_number): Add VFPv3 dwarf numbering.
5399 +
5400 +2008-05-29 Julian Brown <julian@codesourcery.com>
5401 +
5402 + Merge from Sourcery G++ 4.2:
5403 +
5404 + 2007-04-16 Paul Brook <paul@codesourcery.com>
5405 +
5406 + gcc/
5407 + * config/arm/arm.c (print_pop_reg_by_ldr): Fix warning about ambiguous
5408 + else.
5409 +
5410 +2008-05-29 Julian Brown <julian@codesourcery.com>
5411 +
5412 + Backport from mainline:
5413 +
5414 + 2008-05-06 Mark Shinwell <shinwell@codesourcery.com>
5415 + Daniel Jacobowitz <dan@codesourcery.com>
5416 + Andrew Jenner <andrew@codesourcery.com>
5417 +
5418 + * g++.old-deja/g++.jason/enum6.C, g++.old-deja/g++.law/enum9.C,
5419 + g++.old-deja/g++.other/enum4.C, gfortran/enum_9.f90,
5420 + gfortran.dg/enum_10.f90: Broaden dg-options pattern.
5421 +
5422 +2008-05-29 Julian Brown <julian@codesourcery.com>
5423 +
5424 + Merge from Sourcery G++ 4.2:
5425 +
5426 + 2007-04-01 Paul Brook <paul@codesourcery.com>
5427 +
5428 + gcc/
5429 + * config/arm/uclinux-eabi.h (SUBTARGET_EXTRA_LINK_SPEC): Add
5430 + --target2=abs.
5431 + * config/arm/unwind-arm.h (_Unwind_decode_target2): Handle uClinux.
5432 +
5433 +2008-05-29 Julian Brown <julian@codesourcery.com>
5434 +
5435 + Merge from Sourcery G++ 4.2:
5436 +
5437 + 2007-03-31 Paul Brook <paul@codesourcery.com>
5438 +
5439 + * config/arm/arm.c (output_move_double): Only apply limited range
5440 + check in ARM mode.
5441 +
5442 +2008-05-29 Julian Brown <julian@codesourcery.com>
5443 +
5444 + Merge from Sourcery G++ 4.2:
5445 +
5446 + 2007-03-30 Sandra Loosemore <sandra@codesourcery.com>
5447 +
5448 + gcc/
5449 + * config/arm/arm.c (use_return_insn): Test for TARGET_APCS_FRAME
5450 + if we need to adjust the stack.
5451 +
5452 +2008-05-29 Maxim Kuvyrkov <maxim@codesourcery.com>
5453 +
5454 + Merge from Sourcery G++ 4.2:
5455 +
5456 + 2007-09-07 Mark Shinwell <shinwell@codesourcery.com>
5457 + gcc/
5458 + * config/m68k/lb1sf68.asm: Add PIC macros for Linux targets.
5459 +
5460 +2008-05-29 Maxim Kuvyrkov <maxim@codesourcery.com>
5461 +
5462 + Merge from Sourcery G++ 4.2:
5463 +
5464 + gcc/
5465 + * config.gcc (m68k-*-linux*): Add with_arch, adjust tm_file,
5466 + add tmake_file.
5467 +
5468 +2008-05-28 Paul Brook <paul@codesourcery.com>
5469 +
5470 + Avoid Issue #2945
5471 + gcc/
5472 + * config/arm/arm.md (abssi2): Add TARGET_NO_SINGLE_COND_EXEC expander.
5473 + (arm_abssi2, arm_neg_abssi2): Enable for Thumb-2. Always split.
5474 + (arm_nocond_abssi2, arm_nocond_neg_abssi2): New patterns.
5475 + Add splitters for abssi patterns.
5476 + * config/arm/thumb2.md (thumb2_abssi2, thumb2_neg_abssi2): Remove.
5477 +
5478 +2008-05-26 Carlos O'Donell <carlos@codesourcery.com>
5479 +
5480 + Backport from mainline:
5481 +
5482 + gcc/
5483 + 2008-05-23 Paul Brook <paul@codesourcery.com>
5484 + Carlos O'Donell <carlos@codesourcery.com>
5485 +
5486 + * doc/extend.texi: Clarify use of __attribute__((naked)).
5487 + * doc/tm.texi: Document TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS.
5488 + * target.h (gcc_target): Add allocate_stack_slots_for_args.
5489 + * function.c (use_register_for_decl): Use
5490 + targetm.calls.allocate_stack_slots_for_args.
5491 + * target-def.h (TARGET_CALLS): Add
5492 + TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS.
5493 + * config/arm/arm.c (arm_allocate_stack_slots_for_args):
5494 + New function.
5495 + (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Define.
5496 +
5497 + gcc/testsuite/
5498 + 2008-05-23 Paul Brook <paul@codesourcery.com>
5499 + Carlos O'Donell <carlos@codesourcery.com>
5500 +
5501 + * gcc.target/arm/naked-1.c: New test.
5502 + * gcc.target/arm/naked-2.c: New test.
5503 +
5504 +2008-05-26 Nathan Froyd <froydnj@codesourcery.com>
5505 +
5506 + Backport from mainline:
5507 +
5508 + gcc/
5509 + 2008-04-30 Nathan Froyd <froydnj@codesourcery.com>
5510 +
5511 + * config/rs6000/crtresgpr.asm, config/rs6000/crtresxgpr.asm,
5512 + config/rs6000/crtsavgpr.asm, config/rs6000/crtresfpr.asm,
5513 + config/rs6000/crtresxfpr.asm, config/rs6000/crtsavfpr.asm: Break out
5514 + from...
5515 + * config/rs6000/crtsavres.asm: ...here. Remove unneeded file.
5516 + * config/rs6000/e500crtres32gpr.asm, config/rs6000/e500crtres64gpr.asm,
5517 + config/rs6000/e500crtres64gprctr.asm,
5518 + config/rs6000/e500crtrest32gpr.asm, config/rs6000/e500crtrest64gpr.asm,
5519 + config/rs6000/e500crtresx32gpr.asm, config/rs6000/e500crtresx64gpr.asm,
5520 + config/rs6000/e500crtsav32gpr.asm, config/rs6000/e500crtsav64gpr.asm,
5521 + config/rs6000/e500crtsav64gprctr.asm,
5522 + config/rs6000/e500crtsavg32gpr.asm, config/rs6000/e500crtsavg64gpr.asm,
5523 + config/rs6000/e500crtsavg64gprctr.asm: New files.
5524 + * config/rs6000/t-ppccomm: Add build rules for new files.
5525 + (LIB2FUNCS_STATIC_EXTRA): Add new files.
5526 + * config/rs6000/t-netbsd: Add build rules for new files.
5527 + (LIB2FUNCS_STATIC_EXTRA): New variable.
5528 + * config/rs6000/sysv4.h (ENDFILE_SPEC): Don't include crtsavres.o
5529 + (CRTSAVRES_DEFAULT_SPEC): Likewise.
5530 + * config/rs6000/netbsd.h (ENDFILE_SPEC): Likewise.
5531 +
5532 + libgcc/
5533 + 2008-04-30 Nathan Froyd <froydnj@codesourcery.com>
5534 +
5535 + * config/rs6000/t-ppccomm: Add build rules for new files.
5536 + (LIB2ADD_ST): New variable.
5537 +
5538 +2008-05-26 Nathan Froyd <froydnj@codesourcery.com>
5539 +
5540 + Merge from Sourcery G++ 4.2:
5541 +
5542 + 2008-02-25 Nathan Froyd <froydnj@codesourcery.com>
5543 +
5544 + gcc/
5545 + * tree-ssa-remove-local-statics. (initialize_statement_dataflow):
5546 + Continue hash table traversal.
5547 + (compute_definedness_for_block): Delete useless return statement.
5548 + Adjust comment accordingly.
5549 +
5550 + 2007-03-05 Nathan Froyd <froydnj@codesourcery.com>
5551 +
5552 + gcc/
5553 + * tree-pass.h (pass_remove_local_statics): Declare.
5554 + * passes.c (init_optimization_passes): Add
5555 + pass_remove_local_statics to the optimization passes.
5556 + * Makefile.in (OBJS-common): Add tree-ssa-remove-local-statics.c.
5557 + (tree-ssa-remove-local-statics.o): New rule.
5558 + * tree-ssa-remove-local-statics.c: New file.
5559 + * c.opt (fremove-local-statics): New option.
5560 + * timevar.def (TV_RLS): New timevar.
5561 + * toplev.h (flag_remove_local_statics): Declare.
5562 + * cgraph.h (struct cgraph_node): Add 'ever_was_nested'.
5563 + * cgraph.c (cgraph_node): Set ever_was_nested in the node and
5564 + its parent when creating a new node.
5565 + gcc/doc/
5566 + * invoke.texi: Document -fremove-local-statics.
5567 + gcc/testsuite/
5568 + * gcc.dg/remove-local-statics-1.c: New file.
5569 + * gcc.dg/remove-local-statics-2.c: New file.
5570 + * gcc.dg/remove-local-statics-3.c: New file.
5571 + * gcc.dg/remove-local-statics-4.c: New file.
5572 + * gcc.dg/remove-local-statics-5.c: New file.
5573 + * gcc.dg/remove-local-statics-6.c: New file.
5574 + * gcc.dg/remove-local-statics-7.c: New file.
5575 + * gcc.dg/remove-local-statics-8.c: New file.
5576 + * gcc.dg/remove-local-statics-9.c: New file.
5577 + * gcc.dg/remove-local-statics-10.c: New file.
5578 + * gcc.dg/remove-local-statics-11.c: New file.
5579 + * gcc.dg/remove-local-statics-12.c: New file.
5580 +
5581 +
5582 +2008-05-26 Nathan Froyd <froydnj@codesourcery.com>
5583 +
5584 + Backport from mainline:
5585 +
5586 + 2008-04-24 Nathan Froyd <froydnj@codesourcery.com>
5587 + Nathan Sidwell <nathan@codesourcery.com>
5588 +
5589 + * config/rs6000/rs6000.opt (mspe): Remove Var property.
5590 + (misel): Likewise.
5591 + * config/rs6000/rs6000.h (rs6000_spe): Declare.
5592 + (rs6000_isel): Likewise.
5593 + * config/rs6000/rs6000.c (rs6000_spe): New variable.
5594 + (rs6000_isel): New variable.
5595 + (rs6000_handle_option): Handle OPT_mspe and OPT_misel.
5596 +
5597 +2008-05-26 Nathan Froyd <froydnj@codesourcery.com>
5598 +
5599 + gcc/testsuite/
5600 + * gcc.target/powerpc/altivec-24.c, gcc.target/powerpc/pr35907.c:
5601 + Run if vmx_hw, compile otherwise. Do not check for AltiVec at
5602 + runtime.
5603 +
5604 + Merge from Sourcery G++ 4.2:
5605 +
5606 + 2007-03-22 Daniel Jacobowitz <dan@codesourcery.com>
5607 +
5608 + gcc/testsuite/
5609 + * gcc.target/powerpc/altivec-vec-merge.c,
5610 + gcc.target/powerpc/altivec-10.c, gcc.target/powerpc/altivec-12.c,
5611 + gcc.target/powerpc/altivec-1.c, gcc.target/powerpc/altivec-3.c,
5612 + g++.dg/ext/altivec-2.C, g++.dg/ext/altivec-3.C: Run if vmx_hw, compile
5613 + otherwise. Do not check for AltiVec at runtime.
5614 + * gcc.target/powerpc/altivec_check.h: Delete.
5615 + * g++.dg/eh/simd-2.C: Only use -maltivec if vmx_hw.
5616 + * g++.dg/ext/altivec_check.h: Delete.
5617 + * g++.dg/eh/check-vect.h (sig_ill_handler): Remove AltiVec runtime
5618 + check.
5619 +
5620 + * gcc.target/powerpc/20030505.c: Compile for all EABI targets.
5621 + Explicitly enable SPE.
5622 + * gcc.target/powerpc/ppc-spe.c: Likewise.
5623 +
5624 + * gcc.target/powerpc/darwin-longlong.c: Explicitly require 64-bit
5625 + instruction support. Do not check for it at runtime.
5626 +
5627 + * gcc.target/powerpc/20030218-1.c: Pass -mfloat-gprs=single. Expect
5628 + -flax-vector-conversions message.
5629 + * gcc.target/powerpc/spe1.c: Pass -mfloat-gprs=single. Make Foo
5630 + extern.
5631 + * g++.dg/other/opaque-2.C: Pass -mfloat-gprs=single.
5632 + * g++.dg/other/opaque-3.C, g++.dg/ext/spe1.C: Likewise.
5633 +
5634 + * gcc.dg/cpp/assert4.c: Recognize __PPC__.
5635 +
5636 + * g++.dg/other/opaque-1.C: Run on targets with SPE.
5637 + * g++.dg/other/profile1.C: Use dg-require-profiling.
5638 +
5639 + * g++.dg/conversion/simd1.C: Expect warning on all PowerPC
5640 + non-AltiVec targets.
5641 + * g++.dg/ext/attribute-test-1.C, g++.dg/ext/attribute-test-2.C,
5642 + g++.dg/ext/attribute-test-3.C, g++.dg/ext/attribute-test-4.C: Likewise.
5643 +
5644 + * lib/target-supports.exp (check_effective_target_ppc64): New.
5645 +
5646 +2008-05-26 Maxim Kuvyrkov <maxim@codesourcery.com>
5647 +
5648 + * release-notes-csl.xml: Add missing release note.
5649 +
5650 +2008-05-23 Joseph Myers <joseph@codesourcery.com>
5651 +
5652 + gcc/
5653 + * config/arm/t-wrs-linux (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
5654 + MULTILIB_EXCEPTIONS): Add -tcortex-a8-be8 multilib.
5655 + * config/arm/wrs-linux.h (CC1_SPEC, SUBTARGET_EXTRA_ASM_SPEC,
5656 + SUBTARGET_EXTRA_LINK_SPEC, SYSROOT_SUFFIX_SPEC): Update for new
5657 + multilib.
5658 +
5659 +2008-05-23 Nathan Froyd <froydnj@codesourcery.com>
5660 +
5661 + Backport from mainline:
5662 +
5663 + gcc/
5664 + 2008-02-23 David Edelsohn <edelsohn@gnu.org>
5665 +
5666 + * config/rs6000/rs6000.h (CONSTANT_ALIGNMENT): Use STRICT_ALIGNMENT
5667 + instead of TARGET_STRICT_ALIGN.
5668 +
5669 + gcc/
5670 + 2008-02-22 Nathan Froyd <froydnj@codesourcery.com>
5671 +
5672 + * config/rs6000/rs6000.h (CONSTANT_ALIGNMENT): Don't overalign
5673 + strings when optimizing for size, unless the target cares about
5674 + alignment.
5675 +
5676 +2008-05-23 Julian Brown <julian@codesourcery.com>
5677 +
5678 + Merge from Sourcery G++ 4.2:
5679 +
5680 + 2007-03-28 Paul Brook <paul@codesourcery.com>
5681 +
5682 + Merge ARMv6-M support.
5683 + gcc/
5684 + * config/arm/t-linux-eabi: Remove explicit marm (default) multilib.
5685 + Add entries for all multilibs to MULTILIB_OSDIRNAMES.
5686 + * config/arm/t-arm-elf: Ditto. Add armv6-m multilib.
5687 + (LIB1ASMFUNCS): Prefix sf/df routines with arm_.
5688 + * config/arm/t-uclinux-eabi: New file.
5689 + * config/arm/t-linux-eabi: Add Thumb-2 multilib.
5690 + * config/arm/uclinux-eabi.h (SYSROOT_SUFFIX_SPEC): Define.
5691 + * config/arm/linux-eabi.h (SYSROOT_SUFFIX_SPEC): Add thumb-2 sysroot.
5692 + * config.gcc: Add t-softfp and t-arm-softfp to ARM ELF based targets.
5693 + Add armv6-m.
5694 + * config/arm/t-arm-softfp: New file.
5695 + * config/arm/elf.h: Prevent libgcc float conversion routines being
5696 + built when we have assembly implementations.
5697 + * config/arm/ieee754-sf.S: Rename L_* L_arm_*
5698 + * config/arm/ieee754-df.S: Ditto.
5699 + * config/arm/arm.c (FL_FOR_ARCH6M): Define.
5700 + (all_architectures): Add armv6-m.
5701 + (arm_output_mi_thunk): Add TARGET_THUNMB1_ONLY code.
5702 + * config/arm/arm.h (TARGET_THUMB1_ONLY): Define.
5703 + (ARM_DECLARE_FUNCTION_NAME): Handle v6m thunks.
5704 + * config/arm/lib1funcs.asm: Add __ARM_ARCH_6M__. Omit ARM mode
5705 + code and macros when it is defined. Include bpabi-v6m.S.
5706 + (gnu_Unwind_Restore_VFP_D, gnu_Unwind_Save_VFP_D,
5707 + gnu_Unwind_Restore_VFP_D_16_to_31, gnu_Unwind_Save_VFP_D_16_to_31,
5708 + gnu_Unwind_Restore_WMMXD, gnu_Unwind_Save_WMMXD,
5709 + gnu_Unwind_Restore_WMMXC, gnu_Unwind_Save_WMMXC): Stubs for ARMv6-M.
5710 + * config/arm/sfp-machine.h: New file.
5711 + * config/arm/arm-cores.def: Add cortex-m1.
5712 + * config/arm/arm-tune.md: Regenerate.
5713 + * config/arm/libunwind.S: Add ARMv6-M implementation.
5714 + * config/arm/bpabi.h: Add renames for unsigned conversion routines.
5715 + * config/arm/bpabi-v6m.S: New file.
5716 +
5717 +2008-05-23 Julian Brown <julian@codesourcery.com>
5718 +
5719 + Merge from Sourcery G++ 4.2:
5720 +
5721 + 2007-03-26 Joseph Myers <joseph@codesourcery.com>
5722 +
5723 + Merge from Sourcery G++ 4.1 branch:
5724 +
5725 + 2006-03-01 Paul Brook <paul@codesourcery.com>
5726 + gcc/testsuite/
5727 + * g++.dg/other/armv7m-1.C: New test.
5728 +
5729 + 2006-10-27 Joseph Myers <joseph@codesourcery.com>
5730 + Richard Sandiford <richard@codesourcery.com>
5731 + gcc/testsuite/
5732 + * gcc.dg/arm-vfp1.c, gcc.target/arm/vfp-ldmdbd.c,
5733 + gcc.target/arm/vfp-ldmdbs.c, gcc.target/arm/vfp-ldmiad.c,
5734 + gcc.target/arm/vfp-ldmias.c, gcc.target/arm/vfp-stmdbd.c,
5735 + gcc.target/arm/vfp-stmdbs.c, gcc.target/arm/vfp-stmiad.c,
5736 + gcc.target/arm/vfp-stmias.c: Use arm_vfp_ok.
5737 +
5738 + 2006-08-19 Joseph Myers <joseph@codesourcery.com>
5739 + gcc/testsuite/
5740 + * gcc.target/arm/vfp-ldmdbd.c, gcc.target/arm/vfp-ldmdbs.c,
5741 + gcc.target/arm/vfp-ldmiad.c, gcc.target/arm/vfp-ldmias.c,
5742 + gcc.target/arm/vfp-stmdbd.c, gcc.target/arm/vfp-stmdbs.c,
5743 + gcc.target/arm/vfp-stmiad.c, gcc.target/arm/vfp-stmias.c: Skip for
5744 + iWMMXt.
5745 +
5746 + 2006-04-21 Kazu Hirata <kazu@codesourcery.com>
5747 + gcc/testsuite/
5748 + * gcc.target/arm/vfp-ldmdbd.c, gcc.target/arm/vfp-ldmdbs.c,
5749 + gcc.target/arm/vfp-ldmiad.c, gcc.target/arm/vfp-ldmias.c,
5750 + gcc.target/arm/vfp-stmdbd.c, gcc.target/arm/vfp-stmdbs.c,
5751 + gcc.target/arm/vfp-stmiad.c, gcc.target/arm/vfp-stmias.c: New.
5752 +
5753 +2008-05-23 Julian Brown <julian@codesourcery.com>
5754 +
5755 + Merge from Sourcery G++ 4.2:
5756 +
5757 + 2007-03-25 Vladimir Prus <vladimir@codesourcery.com>
5758 +
5759 + gcc/
5760 + * config/arm/arm.c (load_multiple_sequence): Return
5761 + 0 if low irq latency is requested.
5762 + (store_multiple_sequence): Likewise.
5763 + (arm_gen_load_multiple): Load registers one-by-one
5764 + if low irq latency is requested.
5765 + (arm_gen_store_multiple): Likewise.
5766 + * config/arm/predicates.md (load_multiple_operation):
5767 + Return false is low irq latency is requested.
5768 + (store_multiple_operation): Likewise.
5769 + * config/arm/arm.h (low_irq_latency): Define.
5770 + * config/arm/arm.md (movmemqi): Don't use
5771 + it if low irq latency is requsted.
5772 +
5773 +2008-05-23 Julian Brown <julian@codesourcery.com>
5774 +
5775 + Merge from Sourcery G++ 4.2:
5776 +
5777 + 2007-03-24 Vladimir Prus <vladimir@codesourcery.com>
5778 +
5779 + gcc/
5780 + * config/arm/arm.c (arm_override_options): Warn if
5781 + mlow-irq-latency is specified in thumb mode.
5782 + (print_pop_reg_by_ldr): New.
5783 + (arm_output_epilogue): Use print_pop_reg_by_ldr
5784 + when low irq latency is requested.
5785 + (emit_multi_reg_push): Push registers separately
5786 + if low irq latency is requested.
5787 + * config/arm/arm.opt (mlow-irq-latency): New option.
5788 +
5789 +2008-05-23 Julian Brown <julian@codesourcery.com>
5790 +
5791 + Merge from Sourcery G++ 4.2:
5792 +
5793 + 2007-03-23 Paul Brook <paul@codesourcery.com>
5794 +
5795 + gcc/
5796 + * config/arm/uclinux-eabi.h (SUBTARGET_EXTRA_LINK_SPEC): Add -elf2flt
5797 + and --pic-veneer.
5798 + * config/arm/bpabi.h (SUBTARGET_EXTRA_LINK_SPEC): Provide empty
5799 + default definition.
5800 + (LINK_SPEC): Include SUBTARGET_EXTRA_LINK_SPEC.
5801 +
5802 +2008-05-23 Julian Brown <julian@codesourcery.com>
5803 +
5804 + Merge from Sourcery G++ 4.2:
5805 +
5806 + 2007-03-22 Paul Brook <paul@codesourcery.com>
5807 +
5808 + gcc/
5809 + * config.gcc: Loosen checks for arm uclinux eabi targets.
5810 +
5811 +2008-05-23 Julian Brown <julian@codesourcery.com>
5812 +
5813 + Merge from Sourcery G++ 4.2:
5814 +
5815 + 2007-03-22 Sandra Loosemore <sandra@codesourcery.com>
5816 +
5817 + gcc/
5818 + * config/arm/lib1funcs.asm (ARM_DIV_BODY): Conditionalize for
5819 + __ARM_TUNE_MARVELL_F__.
5820 + * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Add code to define
5821 + __ARM_TUNE_MARVELL_F__.
5822 + * config/arm/linux-eabi.h (SYSROOT_SUFFIX_SPEC): Add support for
5823 + marvell-f multilibs.
5824 + * config/arm/t-linux-eabi (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
5825 + MULTILIB_EXCEPTIONS, MULTILIB_MATCHES): Likewise.
5826 + * config/arm/t-arm-elf (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
5827 + MULTILIB_EXCEPTIONS, MULTILIB_MATCHES): Likewise.
5828 +
5829 +2008-05-23 Julian Brown <julian@codesourcery.com>
5830 +
5831 + Merge from Sourcery G++ 4.2:
5832 +
5833 + 2007-03-22 Mark Shinwell <shinwell@codesourcery.com>
5834 +
5835 + gcc/
5836 + * config/arm/cortex-r4.md: New.
5837 + * config/arm/hwdiv.md (divsi3, udivsi3): Annotate with
5838 + insn attributes.
5839 + * config/arm/arm.md: Include cortex-r4.md.
5840 + (insn): Add sdiv and udiv values.
5841 + (generic_sched): Don't use generic scheduling for Cortex-R4.
5842 +
5843 +2008-05-23 Julian Brown <julian@codesourcery.com>
5844 +
5845 + Merge from Sourcery G++ 4.2:
5846 +
5847 + 2007-03-22 Vladimir Prus <vladimir@codesourcery>
5848 +
5849 + * config/arm/arm.c
5850 + (arm_compute_save_reg0_reg12_mask): Always
5851 + check if register 11 must be saved. Additionally
5852 + force save of it if frame_pointer_needeed.
5853 + (arm_compute_save_reg_mask): Save IP and PC
5854 + only with apcs frames.
5855 + (arm_output_epilogue): Adjust Thumb2 codepath to
5856 + be also invoked and work for ARM non-apcs frames.
5857 + (arm_expand_prologue): Don't bother saving IP
5858 + for non-apcs frame, since it's not clobbered by
5859 + prologue code. Implement non-apcs frame
5860 + layout.
5861 +
5862 +2008-05-23 Julian Brown <julian@codesourcery.com>
5863 +
5864 + Merge from Sourcery G++ 4.2:
5865 +
5866 + 2007-03-20 Mark Shinwell <shinwell@codesourcery.com>
5867 +
5868 + gcc/
5869 + * config/arm/arm.c (arm_arch_marvell_f): Delete.
5870 + (all_architectures): Delete marvell-f entry.
5871 + (arm_override_options): Improve diagnostic. Ignore
5872 + FL_MARVELL_F when checking CPU feature flags against
5873 + architecture feature flags. Don't set arm_arch_marvell_f.
5874 + Check insn_flags instead of TARGET_MARVELL_F.
5875 + * config/arm/arm.h (arm_arch_marvell_f): Delete.
5876 + (TARGET_MARVELL_F): Delete.
5877 + * doc/invoke.texi: Remove marvell-f entry from -march=
5878 + documentation.
5879 +
5880 +2008-05-23 Julian Brown <julian@codesourcery.com>
5881 +
5882 + Merge from Sourcery G++ 4.2:
5883 +
5884 + 2007-03-20 Carlos O'Donell <carlos@codesourcery.com>
5885 +
5886 + Issue #1314
5887 + gcc/
5888 + * target.h (calls): Add use_reg_for_func.
5889 + * function.c (use_register_for_decl): Return true if
5890 + target hook use_ref_for_func returns true.
5891 + * target-def.h (TARGET_USE_REG_FOR_FUNC): Define.
5892 + (TARGET_CALLS): Add TARGET_USE_REG_FOR_FUNC.
5893 + * config/arm/arm.c (arm_use_reg_for_func): New function.
5894 + (TARGET_USE_REG_FOR_FUNC): Define as arm_use_reg_for_func.
5895 + * doc/extend.texi (naked): Naked functions must only have
5896 + asms without operands.
5897 + * release-notes-csl.xml: Document #1314 fix.
5898 +
5899 +2008-05-23 Nathan Froyd <froydnj@codesourcery.com>
5900 +
5901 + Backport from mainline:
5902 +
5903 + gcc/
5904 + 2008-05-23 Steven Munroe <sjmunroe@us.ibm.com>
5905 +
5906 + * config/rs6000/darwin-ldouble.c (fmsub): Eliminate the full
5907 + PACK/UNPACK between FP_SUB_Q and FD_TRUNC so that the result
5908 + is only rounded once.
5909 +
5910 +2008-05-23 Julian Brown <julian@codesourcery.com>
5911 +
5912 + Merge from Sourcery G++ 4.2:
5913 +
5914 + 2007-03-18 Mark Shinwell <shinwell@codesourcery.com>
5915 +
5916 + gcc/
5917 + * doc/invoke.texi: Document -mmarvell-div.
5918 + * config/arm/arm.c (arm_override_options): Take setting of
5919 + -mmarvell-div and TARGET_THUMB2 into account when setting
5920 + arm_arch_hwdiv. Cause error if -mmarvell-div is used when
5921 + not targeting a Marvell core.
5922 + * config/arm/arm.opt: Add entry for -mmarvell-div option.
5923 + * config/arm/hwdiv.md: Use only arm_arch_hwdiv to check
5924 + applicability of instruction patterns.
5925 +
5926 +2008-05-23 Julian Brown <julian@codesourcery.com>
5927 +
5928 + Merge from Sourcery G++ 4.2:
5929 +
5930 + 2007-03-18 Mark Shinwell <shinwell@codesourcery.com>
5931 +
5932 + gcc/
5933 + * config/arm/vfp.md: When targeting a Marvell core, only
5934 + enable patterns involving multiply-accumulate type
5935 + instructions when optimizing for size.
5936 +
5937 +2008-05-23 Julian Brown <julian@codesourcery.com>
5938 +
5939 + Merge from Sourcery G++ 4.2:
5940 +
5941 + 2007-03-12 Sandra Loosemore <sandra@codesourcery.com>
5942 +
5943 + gcc/
5944 + * config/arm/arm.c (arm_final_prescan_insn): Skip this processing
5945 + if TARGET_NO_COND_EXEC is true.
5946 + * config/arm/arm.h (TARGET_NO_COND_EXEC): Define.
5947 + * config/arm/arm.md (smaxsi3, *arm_smax_insn): Disable if
5948 + TARGET_NO_COND_EXEC is set.
5949 + (sminsi3, *arm_smin_insn): Likewise.
5950 + (umaxsi3, *arm_umaxsi3): Likewise.
5951 + (uminsi3, *arm_uminsi3): Likewise.
5952 + (*store_minmaxsi): Likewise.
5953 + (seq, sne, sgt, sle, sge, slt): Likewise.
5954 + (sgtu, sleu, sgeu, sltu): Likewise.
5955 + (sunordered, sordered): Likewise.
5956 + (sungt, sunge, sunlt, sunle): Likewise.
5957 + (movsicc, movsfcc, movdfcc): Likewise.
5958 + (*cond_return, *cond_return_inverted): Likewise.
5959 + (*compare_scc): Likewise.
5960 + (*cond_arith): Likewise.
5961 + (movcond): Likewise.
5962 + (anonymous define_split patterns): Likewise.
5963 + (define_cond_exec): Likewise.
5964 +
5965 +2008-05-23 Julian Brown <julian@codesourcery.com>
5966 +
5967 + Merge from Sourcery G++ 4.2:
5968 +
5969 + 2007-02-02 Mark Shinwell <shinwell@codesourcery.com>
5970 + Richard Earnshaw <richard.earnshaw@arm.com>
5971 +
5972 + gcc/
5973 + * config/arm/arm.c (TARGET_MAX_ANCHOR_OFFSET): New.
5974 + (TARGET_MIN_ANCHOR_OFFSET): New.
5975 + (arm_override_options): Set correct anchor ranges for Thumb-1
5976 + and Thumb-2 if required.
5977 + (legitimize_pic_address): Handle case involving a TLS symbol
5978 + reference with an addend.
5979 + (arm_optimization_options): Enable section anchors at -O1 and
5980 + above.
5981 + * config/arm/arm.h (OPTIMIZATION_OPTIONS): New.
5982 + * config/arm/arm-protos.h (arm_optimization_options): New.
5983 +
5984 +2008-05-23 Julian Brown <julian@codesourcery.com>
5985 +
5986 + Merge from Sourcery G++ 4.2:
5987 +
5988 + 2007-02-02 Mark Shinwell <shinwell@codesourcery.com>
5989 +
5990 + gcc/
5991 + * config/arm/arm.md (UNSPEC_STACK_ALIGN): Use a number that
5992 + does not clash with other unspecs.
5993 +
5994 +2008-05-23 Julian Brown <julian@codesourcery.com>
5995 +
5996 + Merge from Sourcery G++ 4.2:
5997 +
5998 + 2007-02-02 Mark Shinwell <shinwell@codesourcery.com>
5999 +
6000 + gcc/
6001 + * config/arm/thumb2.md: Update copyright notice and FSF address.
6002 + Include hwdiv.md and move instruction patterns for sdiv and udiv
6003 + to that file.
6004 + * config/arm/arm.c (arm_arch_marvell_f): New.
6005 + (all_architectures): Add marvell-f entry.
6006 + (ARM_ARCH_NAME_SIZE): Define.
6007 + (arm_arch_name): Allocate ARM_ARCH_NAME_SIZE bytes of space.
6008 + (arm_override_options): Be more careful writing to arm_arch_name.
6009 + Set arm_arch_hwdiv if arm_tune_marvell_f is set.
6010 + * config/arm/arm.h (arm_arch_marvell_f): New.
6011 + * config/arm/arm_cores.def: Add FL_MARVELL_F for the marvell-f
6012 + entry.
6013 + * config/arm/hwdiv.md: New.
6014 + * config/arm/t-arm (MD_INCLUDES): Add hwdiv.md.
6015 + * config.gcc: Recognize marvell-f as a supported ARM architecture.
6016 + * doc/invoke.texi (ARM Options): Document -mcpu=marvell-f and
6017 + -march=marvell-f.
6018 +
6019 +2008-05-23 Julian Brown <julian@codesourcery.com>
6020 +
6021 + Merge from Sourcery G++ 4.2:
6022 +
6023 + 2007-01-10 Mark Shinwell <shinwell@codesourcery.com>
6024 +
6025 + gcc/
6026 + * config/arm/marvell-f.md: Fix FSF address and comment
6027 + capitalization.
6028 + * config/arm/marvell-f-vfp.md: New.
6029 + * config/arm/arm-cores.def: Add FL_VFPV2 for marvell-f.
6030 + * config/arm/arm.md: Include marvell-f-vfp.md.
6031 + (generic_vfp): Don't set attribute to "yes" for marvell_f tuning.
6032 +
6033 +2008-05-23 Julian Brown <julian@codesourcery.com>
6034 +
6035 + Merge from Sourcery G++ 4.2:
6036 +
6037 + 2007-01-07 Mark Shinwell <shinwell@codesourcery.com>
6038 +
6039 + gcc/
6040 + * config/arm/vfp.md: Document fmul{s,d} and fmac{s,d} types.
6041 + Remove documentation entry for fmul type.
6042 + Use fmuls to annotate single-precision multiplication patterns,
6043 + fmuld to annotate double-precision multiplication patterns,
6044 + fmacs to annotate single-precision multiply-accumulate patterns
6045 + and fmacd to annotate double-precision multiply-accumulate patterns.
6046 + * config/arm/vfp11.md: Update reservations accordingly.
6047 + * config/arm/arm.md: Note that certain values of the "type"
6048 + attribute are documented in vfp.md. Add fmul{s,d} and fmac{s,d}
6049 + values for that attribute.
6050 +
6051 +2008-05-23 Julian Brown <julian@codesourcery.com>
6052 +
6053 + Merge from Sourcery G++ 4.2:
6054 +
6055 + 2007-01-04 Mark Shinwell <shinwell@codesourcery.com>
6056 +
6057 + gcc/
6058 + * config/arm/vfp.md: Move pipeline description for VFP11 to...
6059 + * config/arm/vfp11.md: ...here. New.
6060 + * config/arm/arm.md: Include vfp11.md.
6061 +
6062 +2008-05-23 Julian Brown <julian@codesourcery.com>
6063 +
6064 + Merge from Sourcery G++ 4.2:
6065 +
6066 + 2007-01-03 Mark Shinwell <shinwell@codesourcery.com>
6067 +
6068 + NOT ASSIGNED TO FSF
6069 + Port from Marvell compiler:
6070 + gcc/
6071 + * config/arm/arm.c (arm_issue_rate): New.
6072 + (arm_multipass_dfa_lookahead): New.
6073 + (TARGET_SCHED_ISSUE_RATE): Define.
6074 + (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD): Define.
6075 + (FL_MARVELL_F): New.
6076 + (arm_tune_marvell_f): New.
6077 + (arm_override_options): Set arm_tune_marvell_f as appropriate.
6078 + * config/arm/arm.h (arm_tune_marvell_f): Declare.
6079 + * config/arm/arm-cores.def: Add marvell-f entry.
6080 + * config/arm/arm-tune.md: Regenerate.
6081 + * config/arm/t-arm (MD_INCLUDES): Add marvell-f.md.
6082 + * config/arm/arm.md: Don't use generic scheduler for marvell-f.
6083 + Include marvell-f.md. Extend "insn" attribute with mov/mvn/
6084 + and/orr/eor cases and annotate instruction patterns accordingly.
6085 + * config/arm/vfp.md: Annotate likewise.
6086 + * config/arm/marvell-f.md: New.
6087 +
6088 +2008-05-23 Julian Brown <julian@codesourcery.com>
6089 +
6090 + Merge from Sourcery G++ 4.2:
6091 +
6092 + 2006-11-09 Paul Brook <paul@codesourcery.com>
6093 +
6094 + Merge from branches/csl/sourcerygxx-4_1.
6095 + gcc/
6096 + * config/arm/arm.c (all_architectures): Add iWMMXt2 entry.
6097 + * config/arm/arm-cores.def: New ARM_CORE entry for iWMMXt2.
6098 + * config/arm/arm-tune.md: Regenerate.
6099 +
6100 +2008-05-23 Julian Brown <julian@codesourcery.com>
6101 +
6102 + Merge from Sourcery G++ 4.2:
6103 +
6104 + 2006-11-09 Paul Brook <paul@codesourcery.com>
6105 +
6106 + Merge from branches/csl/sourcerygxx-4_1.
6107 + 2006-09-10 Paul Brook <paul@codesourcery.com>
6108 + gcc/
6109 + * config/arm/linux-eabi.h (SYSROOT_SUFFIX_SPEC): Define.
6110 + * config/arm/t-linux-eabi (MULTILIB_OPTIONS, MULTILIB_DIRNAMES):
6111 + Add armv4t multilib.
6112 +
6113 +2008-05-23 Julian Brown <julian@codesourcery.com>
6114 +
6115 + Merge from Sourcery G++ 4.2:
6116 +
6117 + 2006-11-02 Paul Brook <paul@codesourcery.com>
6118 +
6119 + gcc/
6120 + * config.gcc (arm*-*-eabi*): Add arm/nocrt0.h to tm_file.
6121 + * config/arm/nocrt0.h: New file.
6122 +
6123 +2008-05-23 Nathan Froyd <froydnj@codesourcery.com>
6124 +
6125 + gcc/
6126 + * config/rs6000/e300c2c3.md: Correctly use FSF upstream version,
6127 + not Sourcery G++ 4.2 version.
6128 +
6129 +2008-05-23 Nathan Froyd <froydnj@codesourcery.com>
6130 +
6131 + Backport from mainline:
6132 +
6133 + gcc/
6134 + 2008-02-26 Edmar Wienskoski <edmar@freescale.com>
6135 +
6136 + * config/rs6000/rs6000.c (processor_costs): Update e300 cache
6137 + line sizes.
6138 + * doc/invoke.texi: Add e300c2 and e300c3 to list of cpus.
6139 +
6140 + gcc/
6141 + 2008-02-24 Edmar Wienskoski <edmar@freescale.com>
6142 +
6143 + * config.gcc (powerpc*-*-*): Add new cores e300c2 and e300c3.
6144 + * config/rs6000/e300c2c3.md: New file.
6145 + * config/rs6000/rs6000.c (processor_costs): Add new costs for
6146 + e300c2 and e300c3.
6147 + (rs6000_override_options): Add e300c2 and e300c3 cases to
6148 + processor_target_table. Do not allow usage of Altivec or Spe
6149 + with e300 cores. Initialize rs6000_cost for e300c2 and e300c3.
6150 + (rs6000_issue_rate): Set issue rate for e300c2 and e300c3.
6151 + * config/rs6000/rs6000.h (processor_type): Add
6152 + PROCESSOR_PPCE300C2 and PROCESSOR_PPCE300C3.
6153 + (ASM_CPU_SPEC): Add e300c2 and e300c3.
6154 + * config/rs6000/rs6000.md (define_attr "cpu"): Add ppce300c2
6155 + and ppce300c3. Include e300c2c3.md.
6156 +
6157 +2008-05-23 Nathan Froyd <froydnj@codesourcery.com>
6158 +
6159 + Merge from Sourcery G++ 4.2:
6160 +
6161 + 2007-12-31 Joseph Myers <joseph@codesourcery.com>
6162 +
6163 + gcc/
6164 + * config/rs6000/eabi-cn.asm, config/rs6000/sol-ci.asm,
6165 + config/rs6000/sol-cn.asm: Remove .file directives.
6166 +
6167 +2008-05-23 Nathan Froyd <froydnj@codesourcery.com>
6168 +
6169 + Backport from mainline:
6170 +
6171 + 2008-03-06 Nathan Froyd <froydnj@codesourcery.com>
6172 +
6173 + * dwarf2out.c (dwarf2out_frame_debug_expr): Consult the
6174 + dwarf_register_span hook when emitting unwind information for
6175 + register-to-memory saves.
6176 + * config/rs6000/rs6000.c (spe_synthesize_frame): Delete.
6177 + (rs6000_frame_related): Remove call to spe_synthesize_frame.
6178 +
6179 +2008-05-23 Nathan Froyd <froydnj@codesourcery.com>
6180 +
6181 + Merge from Sourcery G++ 4.2:
6182 +
6183 + 2008-03-04 Nathan Froyd <froydnj@codesourcery.com>
6184 +
6185 + gcc/
6186 + * config/rs6000/eabi.asm (__eabi): Don't run __init.
6187 + (__eabi_convert, __eabi_uconvert): Define only if _RELOCATABLE.
6188 +
6189 +2008-05-23 Nathan Froyd <froydnj@codesourcery.com>
6190 +
6191 + Merge from Sourcery G++ 4.2:
6192 +
6193 + 2007-03-22 Daniel Jacobowitz <dan@codesourcery.com>
6194 +
6195 + gcc/
6196 + * config/rs6000/eabi.asm (.Lfini): New.
6197 +
6198 +2008-05-23 Nathan Froyd <froydnj@codesourcery.com>
6199 +
6200 + Merge from Sourcery G++ 4.2:
6201 +
6202 + 2008-02-12 Nathan Sidwell <nathan@codesourcery.com>
6203 + Daniel Jacobowitz <dan@codesourcery.com>
6204 +
6205 + gcc/
6206 + * config/rs6000/eabi-ci.asm (__init): Add _init func start.
6207 + (__fini): Also declare _fini for newlib.
6208 +
6209 +2008-05-22 Daniel Jacobowitz <dan@codesourcery.com>
6210 +
6211 + gcc/
6212 + * function.c (assign_parm_remove_parallels): New.
6213 + (assign_parm_setup_block_p): Do not return true for non-BLKmode
6214 + PARALLELs.
6215 + (assign_parm_setup_block): Do not handle them.
6216 + (assign_parm_setup_reg, assign_parm_setup_stack): Call
6217 + assign_parm_remove_parallels.
6218 +
6219 +2008-05-22 Daniel Jacobowitz <dan@codesourcery.com>
6220 +
6221 + gcc/
6222 + * c-typeck.c (convert_for_assignment): Use
6223 + vector_targets_convertible_p.
6224 + * c-common.c (vector_targets_convertible_p): New.
6225 + * c-common.h (vector_targets_convertible_p): New prototype.
6226 + * config/rs6000/rs6000.c (rs6000_is_opaque_type): Do not check
6227 + opaque_p_V2SI_type_node.
6228 +
6229 + gcc/cp/
6230 + * typeck.c (comp_ptr_ttypes_real): Use vector_targets_convertible_p.
6231 + (comp_ptr_ttypes_const): Likewise.
6232 +
6233 + gcc/testsuite/
6234 + * g++.dg/other/opaque-1.C, g++.dg/other/opaque-2.C,
6235 + g++.dg/other/opaque-3.C: Also run on powerpc*-*-linux*spe*.
6236 +
6237 +2008-05-22 Sandra Loosemore <sandra@codesourcery.com>
6238 +
6239 + Revert (as already fixed in a different way):
6240 +
6241 + 2008-05-21 Sandra Loosemore <sandra@codesourcery.com>
6242 +
6243 + libgcc/
6244 + * config/t-vxworks: New file.
6245 + * config.host (Common parts for widely ported systems): Use it.
6246 +
6247 +2008-05-22 Nathan Sidwell <nathan@codesourcery.com>
6248 +
6249 + gcc/testsuite/
6250 + Backport 2008-05-22 Nathan Sidwell <nathan@codesourcery.com>
6251 + * lib/dg-pch.exp (dg-pch): Fix if bracing.
6252 +
6253 +2008-05-21 Sandra Loosemore <sandra@codesourcery.com>
6254 +
6255 + Merge from Sourcery G++ 4.2:
6256 +
6257 + 2007-04-13 Joseph Myers <joseph@codesourcery.com>
6258 +
6259 + Merge from Sourcery G++ 4.1 branch:
6260 +
6261 + 2007-03-27 Mark Mitchell <mark@codesourcery.com>
6262 + gcc/testsuite/
6263 + * gcc.target/i386/sse-10.c: Pass -mno-omit-leaf-frame-pointer.
6264 +
6265 +2008-05-21 Sandra Loosemore <sandra@codesourcery.com>
6266 +
6267 + Merge from Sourcery G++ 4.2:
6268 +
6269 + 2007-08-26 Mark Mitchell <mark@codesourcery.com>
6270 +
6271 + gcc/testsuite/
6272 + * lib/prune.exp (prune_warnings): Extend the default
6273 + implementation to prune linker warnings about libm on Solaris.
6274 + libstdc++-v3/
6275 + * testsuite/lib/prune.exp (prune_g++_output): Prune linker
6276 + warnings about libm on Solaris.
6277 +
6278 +2008-05-21 Sandra Loosemore <sandra@codesourcery.com>
6279 +
6280 + Merge from Sourcery G++ 4.2:
6281 +
6282 + 2007-08-26 Mark Mitchell <mark@codesourcery.com>
6283 +
6284 + fixincludes/
6285 + * inclhack.def (solaris_mutex_init_2): Remove precise machine
6286 + checks; look at <sys/types.h> to determine whether fix is
6287 + required.
6288 + (solaris_rwlock_init_1): Likewise.
6289 + (solaris_once_init_2): Likewise.
6290 + * tests/base/sys/types.h: Add output generated by
6291 + solaris_mutex_init_2.
6292 + * fixincl.x: Regenerated.
6293 +
6294 +2008-05-21 Sandra Loosemore <sandra@codesourcery.com>
6295 +
6296 + Merge from Sourcery G++ 4.2:
6297 +
6298 + 2007-03-05 Mark Mitchell <mark@codesourcery.com>
6299 +
6300 + * configure.in (*-*-vxworks*): Remove target-libstdc++-v3 from
6301 + noconfigdirs.
6302 + * configure: Regenerated.
6303 +
6304 +2008-05-21 Sandra Loosemore <sandra@codesourcery.com>
6305 +
6306 + Merge from Sourcery G++ 4.2:
6307 +
6308 + 2007-03-12 Richard Sandiford <richard@codesourcery.com>
6309 +
6310 + gcc/
6311 + * config/vx-common.h (TARGET_FLEXLM): Define.
6312 +
6313 +2008-05-21 Sandra Loosemore <sandra@codesourcery.com>
6314 +
6315 + Merge from Sourcery G++ 4.2:
6316 +
6317 + 2007-03-22 Daniel Jacobowitz <dan@codesourcery.com>
6318 +
6319 + gcc/testsuite/
6320 + * g++.dg/other/profile1.C: Use dg-require-profiling.
6321 +
6322 +2008-05-21 Sandra Loosemore <sandra@codesourcery.com>
6323 +
6324 + libgcc/
6325 + * config/t-vxworks: New file.
6326 + * config.host (Common parts for widely ported systems): Use it.
6327 +
6328 +2008-05-21 Sandra Loosemore <sandra@codesourcery.com>
6329 +
6330 + Merge from Sourcery G++ 4.2:
6331 +
6332 + 2007-04-25 Paul Brook <paul@codesourcery.com>
6333 +
6334 + Merge from sourcerygxx-4_1
6335 + 2005-03-10 Julian Brown <julian@codesourcery.com>
6336 + libstdc++-v3/
6337 + * configure.ac (LIBSUPCXX_PRONLY): New AM_CONDITIONAL: yes
6338 + if we are compiling for SymbianOS on ARM.
6339 + * include/Makefile.am: Don't install C++ headers if
6340 + LIBSUPCXX_PRONLY is true.
6341 + * libsupc++/Makefile.am: Include only eh_personality.cc
6342 + in libsupc++ if LIBSUPCXX_PRONLY is true.
6343 + * Makefile.in: Regenerate.
6344 + * configure: Regenerate.
6345 + * include/Makefile.in: Regenerate.
6346 + * libmath/Makefile.in: Regenerate.
6347 + * libsupc++/Makefile.in: Regenerate.
6348 + * po/Makefile.in: Regenerate.
6349 + * src/Makefile.in: Regenerate.
6350 + * testsuite/Makefile.in: Regenerate.
6351 +
6352 +2008-05-21 Maxim Kuvyrkov <maxim@codesourcery.com>
6353 +
6354 + Merge from Sourcery G++ 4.2:
6355 +
6356 + 2008-05-02 Maxim Kuvyrkov <maxim@codesourcery.com>
6357 + gcc/
6358 + Backport from mainline.
6359 + 2008-02-19 Christian Bruel <christian.bruel@st.com>
6360 + Zdenek Dvorak <ook@ucw.cz>
6361 + * tree-ssa-loop-ivopts.c (may_be_unaligned_p): Check step alignment.
6362 +
6363 +2008-05-21 Maxim Kuvyrkov <maxim@codesourcery.com>
6364 +
6365 + Merge from Sourcery G++ 4.2:
6366 +
6367 + 2007-12-05 Maxim Kuvyrkov <maxim@codesourcery.com>
6368 + Make scheduler better process end of the blocks.
6369 +
6370 + gcc/
6371 + * haifa-sched.c (insn_finishes_cycle_p): New static function.
6372 + (max_issue): Use it. Fix handling of number of instruction to try.
6373 + * sched-int.h (struct sched_info: insn_finished_block_p): New
6374 + scheduler hook.
6375 + * sched-rgn.c (rgn_insn_finishes_block_p): Implement it.
6376 + (region_sched_info): Update.
6377 + * sched-ebb.c (ebb_sched_info): Update.
6378 + * modulo-sched.c (sms_sched_info): Update.
6379 +
6380 +2008-05-20 Sandra Loosemore <sandra@codesourcery.com>
6381 +
6382 + Merge from Sourcery G++ 4.2:
6383 +
6384 + 2007-03-22 Daniel Jacobowitz <dan@codesourcery.com>
6385 +
6386 + libstdc++-v3/
6387 + * testsuite/27_io/basic_filebuf/sputbackc/char/9425.cc: Use
6388 + dg-require-fileio.
6389 + * testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc: Likewise.
6390 + * testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc: Likewise.
6391 +
6392 +2008-05-20 Sandra Loosemore <sandra@codesourcery.com>
6393 +
6394 + Merge from Sourcery G++ 4.2:
6395 +
6396 + 2008-02-12 Julian Brown <julian@codesourcery.com>
6397 +
6398 + Merge from MIPS:
6399 +
6400 + 2007-12-05 Thiemo Seufer <ths@mips.com>
6401 +
6402 + libcpp/
6403 + * Makefile.in ($(srcdir)/config.in): Fix dependency.
6404 +
6405 +2008-05-20 Sandra Loosemore <sandra@codesourcery.com>
6406 +
6407 + Merge from Sourcery G++ 4.2:
6408 +
6409 + 2006-03-29 Richard Sandiford <richard@codesourcery.com>
6410 + gcc/
6411 + * config.gcc (tm_file): Update commentary.
6412 +
6413 +2008-05-20 Nathan Sidwell <nathan@codesourcery.com>
6414 +
6415 + Merge from Sourcery G++ 4.2:
6416 +
6417 + * gcc.c-torture/execute/builtins/memops-asm.c: Set inside_main.
6418 +
6419 + * lib/gcc-dg.exp (cleanup-saved-temps): Add optional list of
6420 + suffixes not to delete.
6421 + * gcc.dg/pch/save-temps-1.c: Don't delete ".s" temp.
6422 + * g++.dg/pch/pch.C: Likewise.
6423 +
6424 + * g++.old-deja/g++.pt/static11.C: Replace xfail by target requirement.
6425 +
6426 + * lib/dg-pch.exp (dg-pch): Don't expect .s files if there are
6427 + dg-errors expected.
6428 +
6429 +2008-05-20 Nathan Sidwell <nathan@codesourcery.com>
6430 +
6431 + Merge from Sourcery G++ 4.2:
6432 +
6433 + * c-incpath.c (INO_T_EQ): Do not define on non-inode systems.
6434 + (DIRS_EQ): New.
6435 + (remove_duplicates): Do not set inode on non-inode systems. Use
6436 + DIRS_EQ.
6437 +
6438 +2008-05-19 Sandra Loosemore <sandra@codesourcery.com>
6439 +
6440 + Merge from Sourcery G++ 4.2:
6441 +
6442 + 2007-08-12 Mark Shinwell <shinwell@codesourcery.com>
6443 +
6444 + gcc/
6445 + * target.h (gcc_target): Add adjust_reg_alloc_order member.
6446 + * target-def.h (TARGET_ADJUST_REG_ALLOC_ORDER): New.
6447 + (TARGET_INITIALIZER): Add TARGET_ADJUST_REG_ALLOC_ORDER.
6448 + * regclass.c (init_reg_sets): Don't initialize
6449 + inv_reg_alloc_order.
6450 + (init_reg_sets_1): Call adjust_reg_alloc_order hook and
6451 + then initialize inv_reg_alloc_order.
6452 + * hooks.c (hook_intp_void): New.
6453 + * hooks.h (hook_intp_void): New.
6454 + * doc/tm.texi: Document TARGET_ADJUST_REG_ALLOC_ORDER.
6455 +
6456 +2008-05-19 Sandra Loosemore <sandra@codesourcery.com>
6457 +
6458 + Merge from Sourcery G++ 4.2:
6459 +
6460 + 2007-02-02 Mark Shinwell <shinwell@codesourcery.com>
6461 + Richard Earnshaw <richard.earnshaw@arm.com>
6462 +
6463 + gcc/
6464 + * varasm.c (use_object_blocks_p): Prevent use of object blocks
6465 + if -fno-toplevel-reorder is specified.
6466 +
6467 +2008-05-19 Sandra Loosemore <sandra@codesourcery.com>
6468 +
6469 + Merge from Sourcery G++ 4.2:
6470 +
6471 + 2007-02-16 Richard Sandiford <richard@codesourcery.com>
6472 +
6473 + gcc/
6474 + * Makefile.in (postreload.o): Depend on addresses.h.
6475 + * addresses.h (index_reg_class, ok_for_index_p_1): New functions.
6476 + (regno_ok_for_index_p): New function.
6477 + * postreload.c: Include addresses.h.
6478 + (reload_combine): Use index_reg_class instead of INDEX_REG_CLASS.
6479 + * regclass.c (ok_for_index_p_nonstrict): Add a mode argument.
6480 + Use ok_for_index_p_1 instead of REGNO_OK_FOR_INDEX_P.
6481 + (record_address_regs): Use index_reg_class instead of INDEX_REG_CLASS.
6482 + Update calls to ok_for_index_p_nonstrict.
6483 + * regrename.c (scan_rtx_address): Use regno_ok_for_index_p instead of
6484 + REGNO_OK_FOR_INDEX_P and index_reg_class instead of INDEX_REG_CLASS.
6485 + (replace_oldest_value_addr): Likewise.
6486 + * reload.c (find_reloads_address): Use index_reg_class instead
6487 + of INDEX_REG_CLASS. Do not push an index register reload if
6488 + index_reg_class returns NO_REGS.
6489 + (find_reloads_address_1): Use index_reg_class instead
6490 + of INDEX_REG_CLASS and regno_ok_for_index_p instead of
6491 + REGNO_OK_FOR_INDEX_P.
6492 + * doc/tm.texi (MODE_INDEX_REG_CLASS): Document new macro.
6493 + (REGNO_MODE_OK_FOR_INDEX_P): Likewise.
6494 +
6495 +2008-05-19 Sandra Loosemore <sandra@codesourcery.com>
6496 +
6497 + Merge from Sourcery G++ 4.2:
6498 +
6499 + 2007-06-05 Mark Shinwell <shinwell@codesourcery.com>
6500 +
6501 + * release-notes-csl.xml (Register allocation bug fix): New.
6502 +
6503 + gcc/
6504 + * reload1.c (emit_reload_insns): Upon discovery of an input
6505 + reload whose reload register is not a spill register,
6506 + invalidate any existing reloads involving that register.
6507 +
6508 +2008-05-19 Sandra Loosemore <sandra@codesourcery.com>
6509 +
6510 + Merge from Sourcery G++ 4.2:
6511 +
6512 + 2006-10-24 Mark Shinwell <shinwell@codesourcery.com>
6513 + gcc/
6514 + * final.c (asm_insn_count): Return zero for an empty asm body.
6515 +
6516 +2008-05-19 Sandra Loosemore <sandra@codesourcery.com>
6517 +
6518 + Merge from Sourcery G++ 4.2:
6519 +
6520 + 2006-12-15 Richard Sandiford <richard@codesourcery.com>
6521 + gcc/testsuite/
6522 + * gcc.c-torture/compile/20061214-1.c: New test.
6523 +
6524 +2008-05-19 Sandra Loosemore <sandra@codesourcery.com>
6525 +
6526 + Merge from Sourcery G++ 4.2:
6527 +
6528 + 2007-05-02 Mark Shinwell <shinwell@codesourcery.com>
6529 +
6530 + * release-notes-csl.xml (Forced alignment of array variables):
6531 + New.
6532 +
6533 + gcc/
6534 + * doc/tm.texi: Document that LOCAL_ALIGNMENT and
6535 + DATA_ALIGNMENT should not be used directly.
6536 + * doc/invoke.texi (-falign-arrays): Document.
6537 + * function.c (DATA_ALIGNMENT): Define to a default if
6538 + undefined.
6539 + (alignment_for_aligned_arrays): New.
6540 + (calculate_local_alignment): New.
6541 + (calculate_global_alignment): New.
6542 + * function.h (calculate_local_alignment): New.
6543 + (calculate_global_alignment): New.
6544 + * cfgexpand.c (LOCAL_ALIGNMENT): Don't define to a default.
6545 + (get_decl_align_unit): Use calculate_local_alignment.
6546 + * common.opt (-falign-arrays): New.
6547 + * varasm.c (assemble_variable): Use calculate_data_alignment,
6548 + and use it irrespective of whether DATA_ALIGNMENT is defined.
6549 +
6550 +2008-05-16 Nathan Froyd <froydnj@codesourcery.com>
6551 + Kazu Hirata <kazu@codesourcery.com>
6552 + Daniel Jacobowitz <dan@codesourcery.com>
6553 + Nathan Sidwell <nathan@codesourcery.com>
6554 +
6555 + Merge from Sourcery G++ 4.2:
6556 +
6557 + gcc/
6558 + * config/rs6000/linux.h (CC1_EXTRA_SPEC, ASM_DEFAULT_SPEC,
6559 + SYSROOT_SUFFIX_SPEC): Define.
6560 + * config/rs6000/eabi.h (CC1_EXTRA_SPEC, ASM_DEFAULT_SPEC): Define.
6561 + * config/rs6000/t-linux: New file.
6562 + * config/rs6000/t-ppcgas (MULTILIB_OPTIONS): Add te500v1/te500v2/te600.
6563 + (MULTILIB_DIRNAMES): Add te500v1 te500v2 te600.
6564 + (MULTILIB_EXCEPTIONS): New.
6565 + (MULTILIB_EXTRA_OPTS): Remove mrelocatable-lib.
6566 +
6567 +2008-05-16 Nathan Froyd <froydnj@codesourcery.com>
6568 +
6569 + Merge from Sourcery G++ 4.2:
6570 +
6571 + 2007-09-07 Daniel Jacobowitz <dan@codesourcery.com>
6572 + gcc/
6573 + * config/rs6000/rs6000.c (rs6000_dwarf_register_span): Fix
6574 + debug output for other floating point modes.
6575 +
6576 +2008-05-16 Nathan Froyd <froydnj@codesourcery.com>
6577 +
6578 + Merge from Sourcery G++ 4.2:
6579 +
6580 + 2007-08-16 Daniel Jacobowitz <dan@codesourcery.com>
6581 + gcc/
6582 + * config/rs6000/rs6000.c (rs6000_conditional_register_usage): Mark
6583 + call-saved AltiVec registers call-used if ! TARGET_ALTIVEC_ABI.
6584 + * config/rs6000/rs6000.h (CALL_USED_REGISTERS): Mark the first 20
6585 + AltiVec registers call-used.
6586 + (CALL_REALLY_USED_REGISTERS): Likewise.
6587 +
6588 + gcc/testsuite/
6589 + * gcc.target/powerpc/altivec-consts.c: Remove -mabi=altivec.
6590 + * gcc.target/powerpc/altivec-varargs-1.c: Likewise.
6591 + * gcc.dg/vmx/vmx.exp: Likewise.
6592 +
6593 +2008-05-16 Nathan Froyd <froydnj@codesourcery.com>
6594 +
6595 + Merge from Sourcery G++ 4.2:
6596 +
6597 + gcc/
6598 + * config.gcc (powerpc-timesys-linux-gnu): Handle new target.
6599 + * config/rs6000/timesys-linux.h: New file.
6600 + * config/rs6000/t-timesys: New file.
6601 +
6602 +2008-05-14 Joseph Myers <joseph@codesourcery.com>
6603 +
6604 + Backport:
6605 +
6606 + fixincludes/
6607 + 2008-05-14 Joseph Myers <joseph@codesourcery.com>
6608 + * inclhack.def (AAB_fd_zero_asm_posix_types_h): Bypass on
6609 + posix_types_64.
6610 + * fixincl.x: Regenerate.
6611 +
6612 +2008-05-09 Maxim Kuvyrkov <maxim@codesourcery.com>
6613 +
6614 + Backport from mainline.
6615 +
6616 + gcc/
6617 + 2008-05-09 Maxim Kuvyrkov <maxim@codesourcery.com>
6618 +
6619 + * rtl-factoring.c (collect_pattern_seqs): Fix typo.
6620 +
6621 +2008-05-09 Maxim Kuvyrkov <maxim@codesourcery.com>
6622 +
6623 + Backport from mainline.
6624 +
6625 + gcc/
6626 + 2008-05-07 Maxim Kuvyrkov <maxim@codesourcery.com>
6627 +
6628 + Cleanup ColdFire scheduling support and add V4 pipeline model.
6629 +
6630 + * config/m68k/m68k.md (UNSPEC_TIE): New constant.
6631 + (define_attr cpu): Add cfv4 value.
6632 + (define_attr type, define_attr type1): Merge into a single 'type'
6633 + attribute. Update all uses.
6634 + (define_attr opx_type, define_attr opy_type, define_attr opx_access):
6635 + Rearrange and update. Rename value 'reg' to 'Rn', add value 'FPn'.
6636 + Update all uses.
6637 + (define_attr opx_mem, define_attr opy_mem): Remove.
6638 + (define_attr op_mem): Clean up, update comment.
6639 + (define_attr size): Use specific values instead of general int.
6640 + (define_attr guess, define_attr split): Remove. Update all uses.
6641 + (movdf_internal, tstsi_internal, tsthi_internal, tstqi_internal,
6642 + tst<mode>_68881, pushexthisi_const, movsi_const0_68000_10,
6643 + movsi_const0_68040_60, movsi_const0, movsi_cf, movstrictqi_cf,
6644 + zero_extendhisi2_cf, zero_extendqisi2_cfv4, cfv4_extendhisi2,
6645 + 68k_extendhisi2, extendqihi2, cfv4_extendqisi2, 68k_extendqisi2,
6646 + floatsi<mode>2_68881, ftrunc<mode>2_68881, ftrunc<mode>2_cf,
6647 + fix<mode>qi2_68881, fix<mode>hi2_68881, fix<mode>si2_68881,
6648 + adddi_dishl32, addsi3_5200, add<mode>3_floatsi_68881,
6649 + add<mode>3_floathi_68881, add<mode>3_floatqi_68881,
6650 + add<mode>3_68881, add<mode>3_cf, subdi_dishl32, subsi3,
6651 + sub<mode>3_floatsi_68881, sub<mode>3_floathi_68881,
6652 + sub<mode>3_floatqi_68881, sub<mode>3_68881, sub<mode>3_cf,
6653 + mulhi3, mulhisi3, mulhisisi3_s, mulsi3_68020, mulsi3_cf,
6654 + umulhisi3, mulhisisi3_z, mul<mode>3_floatsi_68881,
6655 + mul<mode>3_floathi_68881, mul<mode>3_floatqi_68881, fmul<mode>3_cf,
6656 + div<mode>3_cf, sqrt<mode>2_cf, abs<mode>2_cf, clzsi2,
6657 + one_cmplsi2_5200, subreghi1ashrdi_const32, ashrsi3, lshrsi3,
6658 + bsetmemqi, bsetmemqi_ext, bclrmemqi, bclrmemqi_ext,
6659 + beq, bne, bgt, blt, bordered, bunordered, buneq, bunge, bungt, bunle,
6660 + bunlt, bltgt, tablejump_internal, call, non_symbolic_call_value,
6661 + symbolic_call_value_jsr, symbolic_call_value_bsr, link):
6662 + Update or set attributes.
6663 + (stack_tie): New fake instruction.
6664 +
6665 + * config/m68k/m68k.h (TUNE_CFV4): New macro.
6666 + (m68k_sched_attr_size): Update declaration.
6667 + (m68k_sched_attr_type2): Remove.
6668 + (m68k_sched_address_bypass_p, m68k_sched_indexed_address_bypass_p):
6669 + Declare new bypass predicates.
6670 +
6671 + * config/m68k/m68k.c (m68k_sched_issue_rate,
6672 + m68k_sched_first_cycle_multipass_dfa_lookahead): Declare hook
6673 + implementations.
6674 + (TARGET_SCHED_ISSUE_RATE,
6675 + TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD): Override hooks.
6676 + (override_options): Handle scheduling for ColdFire V4 core.
6677 + (m68k_expand_prologue): Emit stack_tie.
6678 + (enum attr_op_type): Split value 'OP_TYPE_REG' to 'OP_TYPE_RN' and
6679 + 'OP_TYPE_FPN'. Update all uses.
6680 + (sched_guess_p): Remove.
6681 + (sched_address_type): Handle symbolic addresses.
6682 + (sched_get_operand): New static function.
6683 + (sched_operand_type): Merge into sched_attr_op_type.
6684 + (sched_attr_op_type): Handle FP registers, handle quick constants,
6685 + update.
6686 + (m68k_sched_attr_opx_type, m68k_sched_attr_opy_type): Update.
6687 + (m68k_sched_attr_size): Update. Move logic to ...
6688 + (sched_get_attr_size_int): New static function.
6689 + (sched_get_opxy_mem_type): New static function.
6690 + (m68k_sched_attr_op_mem): Update.
6691 + (m68k_sched_attr_type2): Remove.
6692 + (sched_cfv4_bypass_data): New static variable.
6693 + (m68k_sched_adjust_cost): Handle ColdFire V4 bypass.
6694 + (m68k_sched_issue_rate): Implement scheduler hook.
6695 + (struct _sched_ib: enabled_p): New field.
6696 + (m68k_sched_variable_issue): Update. Handle V4.
6697 + (SCHED_DUMP_TODO, SCHED_DUMP_DONE, SCHED_DUMP_NOTHING,
6698 + sched_dump_class_func_t, sched_dump_split_class,
6699 + sched_dump_dfa_guess_unit_code, sched_dump_dfa_state,
6700 + sched_dump_dfa_class, m68k_sched_dump): Remove.
6701 + (m68k_sched_first_cycle_multipass_dfa_lookahead): Implement scheduler
6702 + hook.
6703 + (m68k_sched_init_global): Remove statisctics dumping, introduce
6704 + sanity check that all instructions have pipeline reservations. Handle
6705 + ColdFire V4 core.
6706 + (m68k_sched_dfa_pre_advance_cycle, m68k_sched_dfa_post_advance_cycle):
6707 + Handle ColdFire V4 core.
6708 + (sched_mem_operand_p, sched_get_reg_operand, sched_get_mem_operand):
6709 + New static functions.
6710 + (m68k_sched_address_bypass_p): New bypass predicate.
6711 + (sched_get_indexed_address_scale): New static function.
6712 + (m68k_sched_indexed_address_bypass_p): New bypass predicate.
6713 +
6714 + * cf.md: Update comments.
6715 + (define_attr type2): Remove. Use 'type' attribute instead.
6716 + Update all uses.
6717 + (cf_ib): Rename to cfv123_ib. Update all uses.
6718 + (cf_oep): Rename to cfv123_oep. Update all uses.
6719 + (cf_chr): Rename to cfv123_chr. Update all uses.
6720 + (cf_mem): Rename to cfv123_mem. Update all uses.
6721 + (cf_mac): Move to more appropriate place.
6722 + (cfv123_guess): New automaton and cpu_unit.
6723 + (cfv123_*, cfv12_*, cfv1_*, cfv2_*, cfv3_*): Use type attribute.
6724 + Update uses of 'size' attribute. Handle before reload scheduling.
6725 + (cfv123_guess): New dummy reservation for unhandled instructions.
6726 + (cfv4_*): Pipeline description of ColdFire V4 core.
6727 + (ignore): New reservation to handle 'ignore' type.
6728 +
6729 +2008-05-09 Maxim Kuvyrkov <maxim@codesourcery.com>
6730 +
6731 + Backport from mainline.
6732 +
6733 + gcc/
6734 +
6735 + 2008-04-22 Maxim Kuvyrkov <maxim@codesourcery.com>
6736 +
6737 + Support scheduling for ColdFire V1 and V3 microarchitecture.
6738 + Improve scheduling of multiplication instructions.
6739 +
6740 + * config/m68k/m68k.md (cpu): Add cfv1 and cfv3. Rename cf_v2 to cfv1.
6741 + (mac): New instruction attribute.
6742 + * config/m68k/m68k.c (override_options): Handle cfv1, cfv3 and mac.
6743 + (m68k_sched_mac): New variable.
6744 + (m68k_sched_attr_type2, m68k_sched_md_init_global): Update.
6745 + Handle cfv1 and cfv3.
6746 + (max_insn_size): New static variable.
6747 + (struct _sched_ib): New type.
6748 + (sched_ib): New static variable.
6749 + (sched_ib_size, sched_ib_filled, sched_ib_insn): Convert variables
6750 + to fields of 'struct _sched_ib sched_ib'. Update all uses.
6751 + (m68k_sched_variable_issue): Add modeling of cfv3 instruction buffer.
6752 + Update.
6753 + (m68k_sched_md_init_global, m68k_sched_md_finish_global,
6754 + m68k_sched_md_init, m68k_sched_md_finish): Handle cfv1 and cfv3. Init
6755 + new variables. Update.
6756 + (m68k_sched_dfa_pre_advance_cycle, m68k_sched_dfa_post_advance_cycle):
6757 + Add modeling of cfv3 instruction buffer. Update.
6758 + * config/m68k/m68k-protos.h (m68k_sched_mac): Declare.
6759 + * config/m68k/m68k.h (TUNE_CFV3): New macro.
6760 + * config/m68k/cf.md: Change substrings 'cf_v2' to 'cfv12' or 'cfv123'.
6761 + (cf_* reservations): Rename to cfv12 or cfv123 to indicate cores
6762 + a particular reservation applies to.
6763 + (type2): Reorganize attribute values. Rename alu to alu_reg,
6764 + alu_l to alu, move_l to omove. Join move to alu. Split mul
6765 + to mul_l and mul_w.
6766 + (cf_ib_*): Simplify description of instruction buffer.
6767 + (cf_ib_w0, cf_ib_w4, cf_ib_w5, cf_ib_w6): Remove.
6768 + (cf_mem): Split into cf_mem1 and cf_mem2.
6769 + (cf_v2_move_??): Rename to cfv12_alu_??.
6770 + (cf_v2_move_l_??): Rename to cfv12_omove_??.
6771 + (cf_v2_mul_??): Remove reservations.
6772 + (cfv12_mul_l_??, cfv12_mul_w_??, cfv12_mac_w_??, cfv12_mac_l_??,
6773 + cfv12_emac_??, cfv12_emac_w_i0): New reservations.
6774 + (cfv12_rts, cfv12_call, cfv12_bcc, cfv12_bra, cfv12_jmp): Move to
6775 + appropriate place.
6776 + (cfv3_alu_10, cfv3_omove_10, cfv3_alu_i0, cfv3_omove_i0, cfv3_alu_01,
6777 + cfv3_alu_0i, cfv3_alu_11, cfv3_omove_11, cfv3_alu_i1, cfv3_omove_i1,
6778 + cfv3_alu_1i, cfv3_omove_1i, cfv3_pea_11, cfv3_pea_i1, cfv3_mul_w_10,
6779 + cfv3_mul_l_10, cfv3_mul_w_i0, cfv3_mac_w_10, cfv3_mac_l_10,
6780 + cfv3_mac_w_i0, cfv3_emac_10, cfv3_emac_w_i0, cfv3_rts, cfv3_call,
6781 + cfv3_bcc, cfv3_bra, cfv3_jmp): New reservations.
6782 + (cfv3_*_1, cfv3_*_2, cfv3_*_3): New instruction reservations that are
6783 + expansions of the above reservations for instructions of sizes
6784 + 1, 2 and 3 words.
6785 +
6786 +2008-05-09 Maxim Kuvyrkov <maxim@codesourcery.com>
6787 +
6788 + Backport from mainline.
6789 +
6790 + gcc/
6791 + 2008-04-22 Maxim Kuvyrkov <maxim@codesourcery.com>
6792 + * rtl-factoring.c (collect_patterns_seqs): Handle CC0 targets.
6793 +
6794 +2008-05-05 Mark Mitchell <mark@codesourcery.com>
6795 + Joseph Myers <joseph@codesourcery.com>
6796 + Mark Shinwell <shinwell@codesourcery.com>
6797 + Vladimir Prus <vladimir@codesourcery.com>
6798 + Paul Brook <paul@codesourcery.com>
6799 +
6800 + Merge from Sourcery G++ 4.2:
6801 +
6802 + gcc/
6803 + * config.gcc (arm-wrs-linux-gnueabi, i586-wrs-linux-gnu,
6804 + mips-wrs-linux-gnu, powerpc-wrs-linux-gnu, sparc-wrs-linux-gnu):
6805 + Handle new targets.
6806 + * config/arm/t-wrs-linux, config/arm/wrs-linux.h,
6807 + config/mips/t-wrs-linux, config/mips/wrs-linux.h,
6808 + config/rs6000/t-wrs-linux, config/rs6000/wrs-linux.h: New.
6809 + * config/sparc/linux64.h (TARGET_DEFAULT): Define differently for
6810 + BIARCH_32BIT_DEFAULT.
6811 +
6812 + libcpp/
6813 + * configure.ac (sparc-wrs-linux-gnu): Add to need_64bit_hwint=yes
6814 + targets.
6815 + * configure: Regenerate.
6816 +
6817 +2008-05-05 Joseph Myers <joseph@codesourcery.com>
6818 +
6819 + Merge from Sourcery G++ 4.2:
6820 +
6821 + gcc/
6822 + * config/sparc/linux64.h (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC,
6823 + LINK_SPEC): Use %R in -Y P argument.
6824 +
6825 +2008-05-05 Joseph Myers <joseph@codesourcery.com>
6826 + Daniel Jacobowitz <dan@codesourcery.com>
6827 +
6828 + Merge from Sourcery G++ 4.2:
6829 +
6830 + gcc/
6831 + * config/rs6000/rs6000.h (OPTION_DEFAULT_SPECS): Handle -te500v1,
6832 + -te500v2 and -te600.
6833 +
6834 +2008-05-05 Joseph Myers <joseph@codesourcery.com>
6835 +
6836 + Merge from Sourcery G++ 4.2:
6837 +
6838 + gcc/
6839 + * config/rs6000/sysv4.h (CC1_EXTRA_SPEC): Define and use.
6840 +
6841 +2008-05-05 Joseph Myers <joseph@codesourcery.com>
6842 +
6843 + Merge from Sourcery G++ 4.2:
6844 +
6845 + gcc/testsuite/
6846 + * g++.dg/compat/struct-layout-1.exp: Compile generator on build
6847 + system.
6848 + * gcc.dg/compat/struct-layout-1.exp: Likewise.
6849 +
6850 +2008-05-05 Joseph Myers <joseph@codesourcery.com>
6851 +
6852 + Merge from Sourcery G++ 4.2:
6853 +
6854 + gcc/testsuite/
6855 + * lib/gcc-dg.exp (remove-build-file): Remove files on remote host
6856 + as well as on build.
6857 +
6858 +2008-05-05 Joseph Myers <joseph@codesourcery.com>
6859 +
6860 + Backport:
6861 +
6862 + gcc/
6863 + 2008-03-04 Joseph Myers <joseph@codesourcery.com>
6864 + * config/i386/i386.c (override_options): Force
6865 + -maccumulate-outgoing-args on if TARGET_STACK_PROBE.
6866 +
6867 + gcc/testsuite/
6868 + 2008-03-04 Joseph Myers <joseph@codesourcery.com>
6869 + * gcc.target/i386/sse-10.c: Don't use
6870 + -mno-accumulate-outgoing-args on *-*-mingw* *-*-cygwin*.
6871 +
6872 +2008-05-05 Joseph Myers <joseph@codesourcery.com>
6873 +
6874 + Merge from Sourcery G++ 4.2:
6875 +
6876 + config/
6877 + * config/mh-mingw (LDFLAGS): Define.
6878 +
6879 + gcc/
6880 + * configure.ac: Use empty LDFLAGS when running configure for the
6881 + build system.
6882 + * configure: Regenerate.
6883 + * Makefile.in (BUILD_LDFLAGS): Do not define to $(LDFLAGS) unless
6884 + host == build.
6885 +
6886 +2008-05-05 Joseph Myers <joseph@codesourcery.com>
6887 +
6888 + Merge from Sourcery G++ 4.2:
6889 +
6890 + gcc/
6891 + * libgcc2.c (__do_global_dtors): Do not call
6892 + __deregister_frame_info on MinGW.
6893 + (__do_global_ctors): Call atexit before calling constructors. Do
6894 + not call __register_frame_info on MinGW.
6895 + * config/i386/mingw32.h (LIBGCC_SPEC): Start with -lgcc.
6896 +
6897 +2008-05-05 Joseph Myers <joseph@codesourcery.com>
6898 +
6899 + Merge from Sourcery G++ 4.2:
6900 +
6901 + gcc/
6902 + 2007-06-13 Joseph Myers <joseph@codesourcery.com>
6903 + * common.opt (--Wno-poison-system-directories): New.
6904 + * doc/invoke.texi (-Wno-poison-system-directories): Document.
6905 + * c-incpath.c: Include flags.h.
6906 + (merge_include_chains): Check flag_poison_system_directories.
6907 + * gcc.c (LINK_COMMAND_SPEC): Pass --no-poison-system-directories
6908 + to linker if -Wno-poison-system-directories.
6909 + * Makefile.in (c-incpath.o): Depend on $(FLAGS_H).
6910 +
6911 + 2007-03-20 Daniel Jacobowitz <dan@codesourcery.com>
6912 + Joseph Myers <joseph@codesourcery.com>
6913 + * configure.ac (--enable-poison-system-directories): New option.
6914 + * configure, config.in: Regenerate.
6915 + * c-incpath.c (merge_include_chains): If
6916 + ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of
6917 + /usr/include, /usr/local/include or /usr/X11R6/include.
6918 +
6919 +2008-05-02 Joseph Myers <joseph@codesourcery.com>
6920 +
6921 + Backport:
6922 +
6923 + gcc/
6924 + 2008-02-23 Joseph Myers <joseph@codesourcery.com>
6925 + * explow.c (memory_address): Assert that the generated address is
6926 + valid.
6927 +
6928 +2008-05-02 Joseph Myers <joseph@codesourcery.com>
6929 +
6930 + Backport:
6931 +
6932 + libstdc++-v3/
6933 + 2008-03-04 Joseph Myers <joseph@codesourcery.com>
6934 + * crossconfig.m4 (*-mingw32*): Define HAVE_STRTOF and
6935 + HAVE_STRTOLD.
6936 + * configure: Regenerate.
6937 +
6938 +2008-05-02 Joseph Myers <joseph@codesourcery.com>
6939 +
6940 + Merge from Sourcery G++ 4.2:
6941 +
6942 + gcc/
6943 + * collect2.c (find_a_file): Use IS_ABSOLUTE_PATH.
6944 +
6945 +2008-05-02 Joseph Myers <joseph@codesourcery.com>
6946 +
6947 + gcc/
6948 + * config.gcc (i[34567]86-*-* | x86_64-*-*): Support arch32 arch64.
6949 + * config/i386/i386.h (OPT_ARCH32, OPT_ARCH64): Define.
6950 + (OPTION_DEFAULT_SPECS): Add arch32 and arch64.
6951 +
6952 +2008-05-02 Joseph Myers <joseph@codesourcery.com>
6953 +
6954 + Merge from Sourcery G++ 4.2:
6955 +
6956 + gcc/
6957 + * config.gcc (mips*-*-*): Support arch32 arch64 tune32 tune64.
6958 + (powerpc*-*-* | rs6000-*-*): Support cpu32 cpu64.
6959 + (all_defaults): Add arch32 arch64 cpu32 cpu64 tune32 tune64.
6960 + * config/mips/mips.h (OPTION_DEFAULT_SPECS): Add support for
6961 + arch32 arch64 tune32 tune64.
6962 + * gcc/config/rs6000/rs6000.h (OPTION_DEFAULT_SPECS): Add cpu32 and
6963 + cpu64.
6964 +
6965 +2008-05-02 Joseph Myers <joseph@codesourcery.com>
6966 +
6967 + Merge from Sourcery G++ 4.2:
6968 +
6969 + gcc/
6970 + * config.gcc (i[34567]86-*-linux*): Use extra config files if
6971 + --enable-extra-sgxx-multilibs.
6972 + * config/i386/cs-linux.h, config/i386/cs-linux.opt,
6973 + config/i386/t-cs-linux: New.
6974 +
6975 +2008-05-01 Mark Mitchell <mark@codesourcery.com>
6976 + Vladimir Prus <vladimir@codesourcery.com>
6977 + Joseph Myers <joseph@codesourcery.com>
6978 + Carlos O'Donell <carlos@codesourcery.com>
6979 + Daniel Jacobowitz <dan@codesourcery.com>
6980 + Kazu Hirata <kazu@codesourcery.com>
6981 +
6982 + libiberty/
6983 + * configure.ac: Add cygpath for mingw hosts.
6984 + * configure: Regenerate.
6985 + * Makefile.in: Add cygpath.
6986 + * cygpath.c: New.
6987 + * pex-win32.c (pex_win32_open_read, pex_win32_open_write): Use
6988 + open not _open.
6989 +
6990 + include/
6991 + * libiberty.h (cygpath): Declare.
6992 +
6993 +2008-05-01 Carlos O'Donell <carlos@codesourcery.com>
6994 +
6995 + Merge from Sourcery G++ 4.2:
6996 +
6997 + * Makefile.tpl (install): Call install-html and install-pdf.
6998 + * Makefile.in: Regenerate.
6999 +
7000 + gcc/
7001 + * Makefile.in (install): Depend on install-html and install-pdf.
7002 +
7003 +2008-05-01 Joseph Myers <joseph@codesourcery.com>
7004 +
7005 + Merge from Sourcery G++ 4.2:
7006 +
7007 + gcc/
7008 + 2007-10-16 Joseph Myers <joseph@codesourcery.com>
7009 + * gcc.c (license_me_flag): Define to 1 if not TARGET_FLEXLM.
7010 +
7011 + 2007-08-10 Nathan Froyd <froydnj@codesourcery.com>
7012 + * gcc.c (main): Consult license_me_flag to see if failure to
7013 + acquire a license implies bailing out entirely.
7014 +
7015 + 2007-08-24 Nathan Froyd <froydnj@codesourcery.com>
7016 + Issue #1892
7017 + * gcc.c (main): Check license_me_flag before declaring failure.
7018 +
7019 + 2007-08-30 Nathan Sidwell <nathan@codesourcery.com>
7020 + Issue #1892
7021 + * gcc.c (main): Don't complain if license fails without -flicense-me
7022 +
7023 + 2007-04-12 Richard Sandiford <richard@codesourcery.com>
7024 + * gcc.c (main): If find_a_file fails, pass the original subproc
7025 + to csl_subproc_license_new.
7026 +
7027 + 2006-12-27 Mark Mitchell <mark@codesourcery.com>
7028 + NOT ASSIGNED TO FSF
7029 + COPYRIGHT CODESOURCERY
7030 + * gcc.c (main): If the license check fails, remove the generated
7031 + file.
7032 +
7033 + 2006-12-22 Mark Mitchell <mark@codesourcery.com>
7034 + NOT ASSIGNED TO FSF
7035 + COPYRIGHT CODESOURCERY
7036 + * aclocal.m4: Move licensing options ...
7037 + * acinclude.m4: ... here.
7038 +
7039 + 2006-12-13 Mark Mitchell <mark@codesourcery.com>
7040 + NOT ASSIGNED TO FSF
7041 + COPYRIGHT CODESOURCERY
7042 + * gcc.c (csl/license.h): Include, if required.
7043 + (license_checked): New variable.
7044 + (no_license): Remove.
7045 + (process_command): Set license_checked, not no_license.
7046 + (main): Use CodeSourcery license library. Remove most
7047 + TARGET_FLEXLM code.
7048 + * aclocal.m4 (--with-license): New option.
7049 + (--with-csl-license-feature): Likewise.
7050 + (--with-csl-license-version): Likewise.
7051 + * Makefile.in (CSL_LICENSEINC): Define it.
7052 + (CSL_LICENSELIB): Likewise.
7053 + (CSL_LICENSE_PROG): Likewise.
7054 + (LIBS): Depend on CSL_LICENSELIB.
7055 + (GCC_PASSES): Depend on CSL_LICENSE_PROG.
7056 + (INCLUDES): Add CSL_LICENSEINC.
7057 + * configure.ac (CSL_AC_LICENSE_VERSION): Use it.
7058 + (CSL_AC_LICENSE): Likewise.
7059 + (CSL_AC_LICENSE_FEATURE): Likewise.
7060 + * config.in: Regenerated.
7061 + * configure: Regenerated.
7062 +
7063 + 2006-10-29 Richard Sandiford <richard@codesourcery.com>
7064 + Joseph Myers <joseph@codesourcery.com>
7065 + * gcc.c (license_me_flag): New variable.
7066 + (feature_proxy_flag): New variable.
7067 + (no_license): New variable.
7068 + (process_command): Handle -flicense-me, -ffeature-proxy and
7069 + -fno-feature-proxy. Initialize no_license.
7070 + (main): Check licenses.
7071 +
7072 +2008-05-01 Joseph Myers <joseph@codesourcery.com>
7073 +
7074 + * release-notes-csl.xml: New.
7075 +
7076 +\f
7077 +Local Variables:
7078 +mode: change-log
7079 +change-log-default-name: "ChangeLog.csl"
7080 +End:
7081 --- a/boehm-gc/Makefile.am
7082 +++ b/boehm-gc/Makefile.am
7083 @@ -66,7 +66,8 @@ TESTS = gctest
7084 ## CFLAGS, not those passed in from the top level make.
7085 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) \
7086 $(AM_CFLAGS) $(MY_CFLAGS) $(GC_CFLAGS)
7087 -LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LDFLAGS) -o $@
7088 +LTLDFLAGS = $(shell $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
7089 +LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LTLDFLAGS) -o $@
7090
7091 # Work around what appears to be a GNU make bug handling MAKEFLAGS
7092 # values defined in terms of make variables, as is the case for CC and
7093 --- a/boehm-gc/Makefile.in
7094 +++ b/boehm-gc/Makefile.in
7095 @@ -303,7 +303,8 @@ TESTS = gctest
7096 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) \
7097 $(AM_CFLAGS) $(MY_CFLAGS) $(GC_CFLAGS)
7098
7099 -LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LDFLAGS) -o $@
7100 +LTLDFLAGS = $(shell $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
7101 +LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LTLDFLAGS) -o $@
7102
7103 # Work around what appears to be a GNU make bug handling MAKEFLAGS
7104 # values defined in terms of make variables, as is the case for CC and
7105 --- a/config.sub
7106 +++ b/config.sub
7107 @@ -254,6 +254,7 @@ case $basic_machine in
7108 | mips | mipsbe | mipseb | mipsel | mipsle \
7109 | mips16 \
7110 | mips64 | mips64el \
7111 + | mips64octeon | mips64octeonel \
7112 | mips64vr | mips64vrel \
7113 | mips64orion | mips64orionel \
7114 | mips64vr4100 | mips64vr4100el \
7115 @@ -335,6 +336,7 @@ case $basic_machine in
7116 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
7117 | mips16-* \
7118 | mips64-* | mips64el-* \
7119 + | mips64octeon-* | mips64octeonel-* \
7120 | mips64vr-* | mips64vrel-* \
7121 | mips64orion-* | mips64orionel-* \
7122 | mips64vr4100-* | mips64vr4100el-* \
7123 --- a/config/mh-mingw
7124 +++ b/config/mh-mingw
7125 @@ -1,3 +1,7 @@
7126 # Add -D__USE_MINGW_ACCESS to enable the built compiler to work on Windows
7127 # Vista (see PR33281 for details).
7128 -BOOT_CFLAGS += -D__USE_MINGW_ACCESS
7129 +# Because we wrap access in libiberty/cygpath.c, we do not want to use
7130 +# the MinGW wrappers for access.
7131 +# BOOT_CFLAGS += -D__USE_MINGW_ACCESS
7132 +# Increase stack limit to same as Linux default.
7133 +LDFLAGS += -Wl,--stack,8388608
7134 --- a/config/mt-sde
7135 +++ b/config/mt-sde
7136 @@ -6,5 +6,5 @@
7137 # has two purposes: it allows libraries to be used in situations where
7138 # $gp != our _gp, and it allows them to be built with -G8 while
7139 # retaining link compability with -G0 and -G4.
7140 -CFLAGS_FOR_TARGET += -Os -minterlink-mips16 -mcode-xonly -mno-gpopt
7141 +CFLAGS_FOR_TARGET += -Os -minterlink-mips16 -mcode-xonly -mno-gpopt
7142 CXXFLAGS_FOR_TARGET += -Os -minterlink-mips16 -mcode-xonly -mno-gpopt
7143 --- a/configure
7144 +++ b/configure
7145 @@ -2195,7 +2195,7 @@ case "${target}" in
7146 noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda ${libgcj}"
7147 ;;
7148 *-*-vxworks*)
7149 - noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty target-libstdc++-v3 ${libgcj}"
7150 + noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty ${libgcj}"
7151 ;;
7152 alpha*-dec-osf*)
7153 # ld works, but does not support shared libraries.
7154 --- a/configure.ac
7155 +++ b/configure.ac
7156 @@ -472,7 +472,7 @@ case "${target}" in
7157 noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda ${libgcj}"
7158 ;;
7159 *-*-vxworks*)
7160 - noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty target-libstdc++-v3 ${libgcj}"
7161 + noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty ${libgcj}"
7162 ;;
7163 alpha*-dec-osf*)
7164 # ld works, but does not support shared libraries.
7165 --- a/fixincludes/fixincl.x
7166 +++ b/fixincludes/fixincl.x
7167 @@ -2,11 +2,11 @@
7168 *
7169 * DO NOT EDIT THIS FILE (fixincl.x)
7170 *
7171 - * It has been AutoGen-ed Monday January 5, 2009 at 04:00:24 PM PST
7172 + * It has been AutoGen-ed Tuesday February 17, 2009 at 01:49:33 PM PST
7173 * From the definitions inclhack.def
7174 * and the template file fixincl
7175 */
7176 -/* DO NOT SVN-MERGE THIS FILE, EITHER Mon Jan 5 16:00:24 PST 2009
7177 +/* DO NOT SVN-MERGE THIS FILE, EITHER Tue Feb 17 13:49:33 PST 2009
7178 *
7179 * You must regenerate it. Use the ./genfixes script.
7180 *
7181 @@ -214,11 +214,14 @@ tSCC zAab_Fd_Zero_Asm_Posix_Types_HBypas
7182 "} while";
7183 tSCC zAab_Fd_Zero_Asm_Posix_Types_HBypass1[] =
7184 "x86_64";
7185 +tSCC zAab_Fd_Zero_Asm_Posix_Types_HBypass2[] =
7186 + "posix_types_64";
7187
7188 -#define AAB_FD_ZERO_ASM_POSIX_TYPES_H_TEST_CT 2
7189 +#define AAB_FD_ZERO_ASM_POSIX_TYPES_H_TEST_CT 3
7190 static tTestDesc aAab_Fd_Zero_Asm_Posix_Types_HTests[] = {
7191 { TT_NEGREP, zAab_Fd_Zero_Asm_Posix_Types_HBypass0, (regex_t*)NULL },
7192 - { TT_NEGREP, zAab_Fd_Zero_Asm_Posix_Types_HBypass1, (regex_t*)NULL }, };
7193 + { TT_NEGREP, zAab_Fd_Zero_Asm_Posix_Types_HBypass1, (regex_t*)NULL },
7194 + { TT_NEGREP, zAab_Fd_Zero_Asm_Posix_Types_HBypass2, (regex_t*)NULL }, };
7195
7196 /*
7197 * Fix Command Arguments for Aab_Fd_Zero_Asm_Posix_Types_H
7198 @@ -5974,8 +5977,7 @@ tSCC zSolaris_Mutex_Init_2List[] =
7199 * Machine/OS name selection pattern
7200 */
7201 tSCC* apzSolaris_Mutex_Init_2Machs[] = {
7202 - "*-*-solaris2.[0-9]",
7203 - "*-*-solaris2.[0-9][!0-9]*",
7204 + "*-*-solaris*",
7205 (const char*)NULL };
7206
7207 /*
7208 @@ -5984,8 +5986,15 @@ tSCC* apzSolaris_Mutex_Init_2Machs[] = {
7209 tSCC zSolaris_Mutex_Init_2Select0[] =
7210 "@\\(#\\)pthread.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
7211
7212 -#define SOLARIS_MUTEX_INIT_2_TEST_CT 1
7213 +/*
7214 + * perform the 'test' shell command - do fix on success
7215 + */
7216 +tSCC zSolaris_Mutex_Init_2Test0[] =
7217 + " -n \"`grep '#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)' \\`dirname $file\\`/sys/types.h`\"";
7218 +
7219 +#define SOLARIS_MUTEX_INIT_2_TEST_CT 2
7220 static tTestDesc aSolaris_Mutex_Init_2Tests[] = {
7221 + { TT_TEST, zSolaris_Mutex_Init_2Test0, 0 /* unused */ },
7222 { TT_EGREP, zSolaris_Mutex_Init_2Select0, (regex_t*)NULL }, };
7223
7224 /*
7225 @@ -6027,8 +6036,15 @@ tSCC* apzSolaris_Rwlock_Init_1Machs[] =
7226 tSCC zSolaris_Rwlock_Init_1Select0[] =
7227 "@\\(#\\)pthread.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
7228
7229 -#define SOLARIS_RWLOCK_INIT_1_TEST_CT 1
7230 +/*
7231 + * perform the 'test' shell command - do fix on success
7232 + */
7233 +tSCC zSolaris_Rwlock_Init_1Test0[] =
7234 + " -n \"`grep '#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)' \\`dirname $file\\`/sys/types.h`\"";
7235 +
7236 +#define SOLARIS_RWLOCK_INIT_1_TEST_CT 2
7237 static tTestDesc aSolaris_Rwlock_Init_1Tests[] = {
7238 + { TT_TEST, zSolaris_Rwlock_Init_1Test0, 0 /* unused */ },
7239 { TT_EGREP, zSolaris_Rwlock_Init_1Select0, (regex_t*)NULL }, };
7240
7241 /*
7242 @@ -6098,8 +6114,7 @@ tSCC zSolaris_Once_Init_2List[] =
7243 * Machine/OS name selection pattern
7244 */
7245 tSCC* apzSolaris_Once_Init_2Machs[] = {
7246 - "*-*-solaris2.[0-9]",
7247 - "*-*-solaris2.[0-9][!0-9]*",
7248 + "*-*-solaris*",
7249 (const char*)NULL };
7250
7251 /*
7252 @@ -6108,8 +6123,15 @@ tSCC* apzSolaris_Once_Init_2Machs[] = {
7253 tSCC zSolaris_Once_Init_2Select0[] =
7254 "@\\(#\\)pthread.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
7255
7256 -#define SOLARIS_ONCE_INIT_2_TEST_CT 1
7257 +/*
7258 + * perform the 'test' shell command - do fix on success
7259 + */
7260 +tSCC zSolaris_Once_Init_2Test0[] =
7261 + " -n \"`grep '#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)' \\`dirname $file\\`/sys/types.h`\"";
7262 +
7263 +#define SOLARIS_ONCE_INIT_2_TEST_CT 2
7264 static tTestDesc aSolaris_Once_Init_2Tests[] = {
7265 + { TT_TEST, zSolaris_Once_Init_2Test0, 0 /* unused */ },
7266 { TT_EGREP, zSolaris_Once_Init_2Select0, (regex_t*)NULL }, };
7267
7268 /*
7269 @@ -8606,7 +8628,7 @@ static const char* apzX11_SprintfPatch[]
7270 *
7271 * List of all fixes
7272 */
7273 -#define REGEX_COUNT 255
7274 +#define REGEX_COUNT 256
7275 #define MACH_LIST_SIZE_LIMIT 261
7276 #define FIX_COUNT 212
7277
7278 --- a/fixincludes/inclhack.def
7279 +++ b/fixincludes/inclhack.def
7280 @@ -141,6 +141,7 @@ fix = {
7281 mach = 'i[34567]86-*-linux*';
7282 bypass = '} while';
7283 bypass = 'x86_64';
7284 + bypass = 'posix_types_64';
7285
7286 /*
7287 * Define _POSIX_TYPES_H_WRAPPER at the end of the wrapper, not
7288 @@ -3274,24 +3275,32 @@ fix = {
7289
7290
7291 /*
7292 - * Sun Solaris defines PTHREAD_MUTEX_INITIALIZER with a trailing
7293 - * "0" for the last field of the pthread_mutex_t structure, which is
7294 - * of type upad64_t, which itself is typedef'd to int64_t, but with
7295 - * __STDC__ defined (e.g. by -ansi) it is a union. So change the
7296 - * initializer to "{0}" instead
7297 + * Sun Solaris defines the last field of the pthread_mutex_t structure
7298 + * to have type upad64_t. Whether upad64_t is an integer type or a
7299 + * union depends on whether or not the headers believe that a 64-bit
7300 + * integer type is available. But, PTHREAD_MUTEX_INITIALIZER is not
7301 + * appropriately conditionalized; it always uses "0", and never "{0}".
7302 + * In order to avoid warnings/errors from the compiler, we must make
7303 + * the initializer use braces where appropriate.
7304 + *
7305 + * Prior to Solaris 10, if __STDC__ is 1 (as when compiling with
7306 + * -ansi), the definition would be a union. Beginning with Solaris
7307 + * 10, the headers check for __GNUC__, and will never use a union with
7308 + * GCC. We check /usr/include/sys/types.h to see if it checks for
7309 + * __STDC__.
7310 + *
7311 + * A "mach" test for Solaris 10 is undesirable because we want to
7312 + * allow a compiler built for Solaris <10 to be used on Solaris >=10,
7313 + * but the installed version of fixincludes hard-wires the target
7314 + * machine to the configure-time $target, rather than automatically
7315 + * determining it at installation time.
7316 */
7317 fix = {
7318 hackname = solaris_mutex_init_2;
7319 select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
7320 files = pthread.h;
7321 - /*
7322 - * On Solaris 10, this fix is unnecessary because upad64_t is
7323 - * always defined correctly regardless of the definition of the
7324 - * __STDC__ macro. The first "mach" pattern matches up to
7325 - * solaris9. The second "mach" pattern will not match any two (or
7326 - * more) digit solaris version, but it will match e.g. 2.5.1.
7327 - */
7328 - mach = '*-*-solaris2.[0-9]', '*-*-solaris2.[0-9][!0-9]*';
7329 + mach = '*-*-solaris*';
7330 + test = " -n \"`grep '#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)' \\`dirname $file\\`/sys/types.h`\"";
7331 c_fix = format;
7332 c_fix_arg = "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n"
7333 "%0\n"
7334 @@ -3302,6 +3311,7 @@ fix = {
7335 "(|/\*.*\*/[ \t]*\\\\\n[ \t]*)\\{.*)"
7336 ",[ \t]*0\\}" "(|[ \t].*)$";
7337 test_text =
7338 + "`mkdir -p sys; echo '#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)' >> sys/types.h`"
7339 '#ident "@(#)pthread.h 1.26 98/04/12 SMI"'"\n"
7340 "#define PTHREAD_MUTEX_INITIALIZER\t{{{0},0}, {{{0}}}, 0}\n"
7341 "#define PTHREAD_COND_INITIALIZER\t{{{0}, 0}, 0}\t/* DEFAULTCV */\n"
7342 @@ -3313,17 +3323,14 @@ fix = {
7343
7344
7345 /*
7346 - * Sun Solaris defines PTHREAD_RWLOCK_INITIALIZER with a "0" for some
7347 - * fields of the pthread_rwlock_t structure, which are of type
7348 - * upad64_t, which itself is typedef'd to int64_t, but with __STDC__
7349 - * defined (e.g. by -ansi) it is a union. So change the initializer
7350 - * to "{0}" instead.
7351 + * See comments for solaris_mutex_init_2 re. upad64_t.
7352 */
7353 fix = {
7354 hackname = solaris_rwlock_init_1;
7355 select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
7356 files = pthread.h;
7357 mach = '*-*-solaris*';
7358 + test = " -n \"`grep '#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)' \\`dirname $file\\`/sys/types.h`\"";
7359 c_fix = format;
7360 c_fix_arg = "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n"
7361 "%0\n"
7362 @@ -3359,24 +3366,14 @@ fix = {
7363
7364
7365 /*
7366 - * Sun Solaris defines PTHREAD_ONCE_INIT with a "0" for some
7367 - * fields of the pthread_once_t structure, which are of type
7368 - * upad64_t, which itself is typedef'd to int64_t, but with __STDC__
7369 - * defined (e.g. by -ansi) it is a union. So change the initializer
7370 - * to "{0}" instead. This test relies on solaris_once_init_1.
7371 + * See comments for solaris_mutex_init_2 re. upad64_t.
7372 */
7373 fix = {
7374 hackname = solaris_once_init_2;
7375 select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
7376 files = pthread.h;
7377 - /*
7378 - * On Solaris 10, this fix is unnecessary because upad64_t is
7379 - * always defined correctly regardless of the definition of the
7380 - * __STDC__ macro. The first "mach" pattern matches up to
7381 - * solaris9. The second "mach" pattern will not match any two (or
7382 - * more) digit solaris version, but it will match e.g. 2.5.1.
7383 - */
7384 - mach = '*-*-solaris2.[0-9]', '*-*-solaris2.[0-9][!0-9]*';
7385 + mach = '*-*-solaris*';
7386 + test = " -n \"`grep '#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)' \\`dirname $file\\`/sys/types.h`\"";
7387 c_fix = format;
7388 c_fix_arg = "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n"
7389 "%0\n"
7390 --- a/fixincludes/server.c
7391 +++ b/fixincludes/server.c
7392 @@ -266,7 +266,7 @@ run_shell (const char* pz_cmd)
7393 /* Make sure the process will pay attention to us, send the
7394 supplied command, and then have it output a special marker that
7395 we can find. */
7396 - fprintf (server_pair.pf_write, "cd %s\n%s\n\necho\necho %s\n",
7397 + fprintf (server_pair.pf_write, "cd '%s'\n%s\n\necho\necho %s\n",
7398 p_cur_dir, pz_cmd, z_done);
7399 fflush (server_pair.pf_write);
7400
7401 --- a/fixincludes/tests/base/sys/types.h
7402 +++ b/fixincludes/tests/base/sys/types.h
7403 @@ -28,3 +28,4 @@ typedef __WCHAR_TYPE__ wchar_t;
7404
7405 #endif /* ushort_t */
7406 #endif /* GNU_TYPES_CHECK */
7407 +#if !defined(__STRICT_ANSI__) && !defined(_NO_LONGLONG)
7408 --- a/gcc/Makefile.in
7409 +++ b/gcc/Makefile.in
7410 @@ -321,6 +321,8 @@ GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./x
7411 # It also specifies -isystem ./include to find, e.g., stddef.h.
7412 GCC_CFLAGS=$(CFLAGS_FOR_TARGET) $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) -Wold-style-definition $($@-warn) -isystem ./include $(TCFLAGS)
7413
7414 +EGLIBC_CONFIGS = @EGLIBC_CONFIGS@
7415 +
7416 # ---------------------------------------------------
7417 # Programs which produce files for the target machine
7418 # ---------------------------------------------------
7419 @@ -402,6 +404,9 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT
7420
7421 xmake_file=@xmake_file@
7422 tmake_file=@tmake_file@
7423 +TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@
7424 +TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
7425 +TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
7426 out_file=$(srcdir)/config/@out_file@
7427 out_object_file=@out_object_file@
7428 md_file=$(srcdir)/config/@md_file@
7429 @@ -688,7 +693,11 @@ CC_FOR_BUILD = @CC_FOR_BUILD@
7430 BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE
7431
7432 # Native linker and preprocessor flags. For x-fragment overrides.
7433 +ifeq ($(host),$(build))
7434 BUILD_LDFLAGS=$(LDFLAGS)
7435 +else
7436 +BUILD_LDFLAGS=
7437 +endif
7438 BUILD_CPPFLAGS=$(ALL_CPPFLAGS)
7439
7440 # Actual name to use when installing a native compiler.
7441 @@ -1205,6 +1214,7 @@ OBJS-common = \
7442 tree-ssa-loop-manip.o \
7443 tree-ssa-loop-niter.o \
7444 tree-ssa-loop-prefetch.o \
7445 + tree-ssa-loop-promote.o \
7446 tree-ssa-loop-unswitch.o \
7447 tree-ssa-loop.o \
7448 tree-ssa-math-opts.o \
7449 @@ -1213,6 +1223,7 @@ OBJS-common = \
7450 tree-ssa-pre.o \
7451 tree-ssa-propagate.o \
7452 tree-ssa-reassoc.o \
7453 + tree-ssa-remove-local-statics.o \
7454 tree-ssa-sccvn.o \
7455 tree-ssa-sink.o \
7456 tree-ssa-structalias.o \
7457 @@ -1605,7 +1616,7 @@ libgcc-support: libgcc.mvars stmp-int-hd
7458 $(MACHMODE_H) $(FPBIT) $(DPBIT) $(TPBIT) $(LIB2ADD) \
7459 $(LIB2ADD_ST) $(LIB2ADDEH) $(srcdir)/emutls.c gcov-iov.h $(SFP_MACHINE)
7460
7461 -libgcc.mvars: config.status Makefile $(LIB2ADD) $(LIB2ADD_ST) specs \
7462 +libgcc.mvars: config.status Makefile $(LIB2ADD) $(LIB2ADD_ST) specs $(tmake_file) \
7463 xgcc$(exeext)
7464 : > tmp-libgcc.mvars
7465 echo LIB1ASMFUNCS = '$(LIB1ASMFUNCS)' >> tmp-libgcc.mvars
7466 @@ -1656,7 +1667,7 @@ libgcc.mvars: config.status Makefile $(L
7467 # driver program needs to select the library directory based on the
7468 # switches.
7469 multilib.h: s-mlib; @true
7470 -s-mlib: $(srcdir)/genmultilib Makefile
7471 +s-mlib: $(srcdir)/genmultilib Makefile $(tmakefile)
7472 if test @enable_multilib@ = yes \
7473 || test -n "$(MULTILIB_OSDIRNAMES)"; then \
7474 $(SHELL) $(srcdir)/genmultilib \
7475 @@ -1667,10 +1678,11 @@ s-mlib: $(srcdir)/genmultilib Makefile
7476 "$(MULTILIB_EXTRA_OPTS)" \
7477 "$(MULTILIB_EXCLUSIONS)" \
7478 "$(MULTILIB_OSDIRNAMES)" \
7479 + "$(MULTILIB_ALIASES)" \
7480 "@enable_multilib@" \
7481 > tmp-mlib.h; \
7482 else \
7483 - $(SHELL) $(srcdir)/genmultilib '' '' '' '' '' '' '' no \
7484 + $(SHELL) $(srcdir)/genmultilib '' '' '' '' '' '' '' '' no \
7485 > tmp-mlib.h; \
7486 fi
7487 $(SHELL) $(srcdir)/../move-if-change tmp-mlib.h multilib.h
7488 @@ -1744,7 +1756,7 @@ gcc.srcextra: gengtype-lex.c
7489
7490 c-incpath.o: c-incpath.c c-incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \
7491 intl.h prefix.h coretypes.h $(TM_H) cppdefault.h $(TARGET_H) \
7492 - $(MACHMODE_H)
7493 + $(MACHMODE_H) $(FLAGS_H) toplev.h
7494
7495 c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
7496 $(RTL_H) $(C_TREE_H) $(GGC_H) $(TARGET_H) $(FLAGS_H) $(FUNCTION_H) output.h \
7497 @@ -1874,7 +1886,8 @@ DRIVER_DEFINES = \
7498 -DTOOLDIR_BASE_PREFIX=\"$(libsubdir_to_prefix)$(prefix_to_exec_prefix)\" \
7499 @TARGET_SYSTEM_ROOT_DEFINE@ \
7500 $(VALGRIND_DRIVER_DEFINES) \
7501 - `test "X$${SHLIB_LINK}" = "X" || test "@enable_shared@" != "yes" || echo "-DENABLE_SHARED_LIBGCC"`
7502 + `test "X$${SHLIB_LINK}" = "X" || test "@enable_shared@" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` \
7503 + -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\""
7504
7505 gcc.o: gcc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h multilib.h \
7506 Makefile $(lang_specs_files) specs.h prefix.h $(GCC_H) $(FLAGS_H) \
7507 @@ -2091,6 +2104,9 @@ tree-ssa-pre.o : tree-ssa-pre.c $(TREE_F
7508 $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(CFGLOOP_H) \
7509 alloc-pool.h $(BASIC_BLOCK_H) bitmap.h $(HASHTAB_H) $(TREE_GIMPLE_H) \
7510 $(TREE_INLINE_H) tree-iterator.h tree-ssa-sccvn.h $(PARAMS_H)
7511 +tree-ssa-remove-local-statics.o: tree-ssa-remove-local-statics.c \
7512 + coretypes.h $(CONFIG_H) $(SYSTEM_H) $(BASIC_BLOCK_H) tree.h tree-pass.h \
7513 + $(TM_H)
7514 tree-ssa-sccvn.o : tree-ssa-sccvn.c $(TREE_FLOW_H) $(CONFIG_H) \
7515 $(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
7516 $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(CFGLOOP_H) \
7517 @@ -2190,6 +2206,9 @@ tree-ssa-loop-prefetch.o: tree-ssa-loop-
7518 $(CFGLOOP_H) $(PARAMS_H) langhooks.h $(BASIC_BLOCK_H) hard-reg-set.h \
7519 tree-chrec.h toplev.h langhooks.h $(TREE_INLINE_H) $(TREE_DATA_REF_H) \
7520 $(OPTABS_H)
7521 +tree-ssa-loop-promote.o: tree-ssa-loop-promote.c \
7522 + coretypes.h $(CONFIG_H) $(SYSTEM_H) $(BASIC_BLOCK_H) $(CFGLOOP_H) $(TIMEVAR_H) \
7523 + $(TREE_DUMP_H) tree.h tree-pass.h $(TM_H)
7524 tree-predcom.o: tree-predcom.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_P_H) \
7525 $(CFGLOOP_H) $(TREE_FLOW_H) $(GGC_H) $(TREE_DATA_REF_H) $(SCEV_H) \
7526 $(PARAMS_H) $(DIAGNOSTIC_H) tree-pass.h $(TM_H) coretypes.h tree-affine.h \
7527 @@ -2759,7 +2778,7 @@ postreload.o : postreload.c $(CONFIG_H)
7528 $(RTL_H) $(REAL_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) \
7529 hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) $(RECOG_H) output.h \
7530 $(FUNCTION_H) toplev.h cselib.h $(TM_P_H) except.h $(TREE_H) $(MACHMODE_H) \
7531 - $(OBSTACK_H) $(TIMEVAR_H) tree-pass.h $(DF_H)
7532 + $(OBSTACK_H) $(TIMEVAR_H) tree-pass.h addresses.h $(DF_H)
7533 postreload-gcse.o : postreload-gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
7534 $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
7535 $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h toplev.h \
7536 @@ -3406,7 +3425,7 @@ gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(
7537 # be rebuilt.
7538
7539 # Build the include directories.
7540 -stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) $(UNWIND_H) fixinc_list
7541 +stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) $(UNWIND_H)
7542 # Copy in the headers provided with gcc.
7543 # The sed command gets just the last file name component;
7544 # this is necessary because VPATH could add a dirname.
7545 @@ -3425,21 +3444,23 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H)
7546 done
7547 rm -f include/unwind.h
7548 cp $(UNWIND_H) include/unwind.h
7549 - set -e; for ml in `cat fixinc_list`; do \
7550 - sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
7551 - multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
7552 - fix_dir=include-fixed$${multi_dir}; \
7553 - if $(LIMITS_H_TEST) ; then \
7554 - cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \
7555 - else \
7556 - cat $(srcdir)/glimits.h > tmp-xlimits.h; \
7557 - fi; \
7558 - $(mkinstalldirs) $${fix_dir}; \
7559 - chmod a+rx $${fix_dir} || true; \
7560 - rm -f $${fix_dir}/limits.h; \
7561 - mv tmp-xlimits.h $${fix_dir}/limits.h; \
7562 - chmod a+r $${fix_dir}/limits.h; \
7563 - done
7564 + set -e; if [ -f fixinc_list ] ; then \
7565 + for ml in `cat fixinc_list`; do \
7566 + sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
7567 + multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
7568 + fix_dir=include-fixed$${multi_dir}; \
7569 + if $(LIMITS_H_TEST) ; then \
7570 + cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \
7571 + else \
7572 + cat $(srcdir)/glimits.h > tmp-xlimits.h; \
7573 + fi; \
7574 + $(mkinstalldirs) $${fix_dir}; \
7575 + chmod a+rx $${fix_dir} || true; \
7576 + rm -f $${fix_dir}/limits.h; \
7577 + mv tmp-xlimits.h $${fix_dir}/limits.h; \
7578 + chmod a+r $${fix_dir}/limits.h; \
7579 + done; \
7580 + fi
7581 # Install the README
7582 rm -f include-fixed/README
7583 cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README
7584 @@ -4164,16 +4185,18 @@ real-install-headers-cp:
7585
7586 # Install supporting files for fixincludes to be run later.
7587 install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-itoolsdirs \
7588 - macro_list fixinc_list
7589 + macro_list
7590 $(INSTALL_DATA) $(srcdir)/gsyslimits.h \
7591 $(DESTDIR)$(itoolsdatadir)/gsyslimits.h
7592 $(INSTALL_DATA) macro_list $(DESTDIR)$(itoolsdatadir)/macro_list
7593 - $(INSTALL_DATA) fixinc_list $(DESTDIR)$(itoolsdatadir)/fixinc_list
7594 - set -e; for ml in `cat fixinc_list`; do \
7595 - multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
7596 - $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}; \
7597 - $(INSTALL_DATA) include-fixed$${multidir}/limits.h $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}/limits.h; \
7598 - done
7599 + set -e; if [ -f fixinc_list ] ; then \
7600 + $(INSTALL_DATA) fixinc_list $(DESTDIR)$(itoolsdatadir)/fixinc_list; \
7601 + for ml in `cat fixinc_list`; do \
7602 + multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
7603 + $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}; \
7604 + $(INSTALL_DATA) include-fixed$${multidir}/limits.h $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}/limits.h; \
7605 + done; \
7606 + fi
7607 $(INSTALL_SCRIPT) $(srcdir)/../mkinstalldirs \
7608 $(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
7609 if [ x$(STMP_FIXPROTO) != x ] ; then \
7610 --- a/gcc/addresses.h
7611 +++ b/gcc/addresses.h
7612 @@ -78,3 +78,42 @@ regno_ok_for_base_p (unsigned regno, enu
7613
7614 return ok_for_base_p_1 (regno, mode, outer_code, index_code);
7615 }
7616 +
7617 +/* Wrapper function to unify target macros MODE_INDEX_REG_CLASS and
7618 + INDEX_REG_CLASS. Arguments as for the MODE_INDEX_REG_CLASS macro. */
7619 +
7620 +static inline enum reg_class
7621 +index_reg_class (enum machine_mode mode ATTRIBUTE_UNUSED)
7622 +{
7623 +#ifdef MODE_INDEX_REG_CLASS
7624 + return MODE_INDEX_REG_CLASS (mode);
7625 +#else
7626 + return INDEX_REG_CLASS;
7627 +#endif
7628 +}
7629 +
7630 +/* Wrapper function to unify target macros REGNO_MODE_OK_FOR_INDEX_P
7631 + and REGNO_OK_FOR_INDEX_P. Arguments as for the
7632 + REGNO_MODE_OK_FOR_INDEX_P macro. */
7633 +
7634 +static inline bool
7635 +ok_for_index_p_1 (unsigned regno, enum machine_mode mode ATTRIBUTE_UNUSED)
7636 +{
7637 +#ifdef REGNO_MODE_OK_FOR_INDEX_P
7638 + return REGNO_MODE_OK_FOR_INDEX_P (regno, mode);
7639 +#else
7640 + return REGNO_OK_FOR_INDEX_P (regno);
7641 +#endif
7642 +}
7643 +
7644 +/* Wrapper around ok_for_index_p_1, for use after register allocation is
7645 + complete. Arguments as for the called function. */
7646 +
7647 +static inline bool
7648 +regno_ok_for_index_p (unsigned regno, enum machine_mode mode)
7649 +{
7650 + if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] >= 0)
7651 + regno = reg_renumber[regno];
7652 +
7653 + return ok_for_index_p_1 (regno, mode);
7654 +}
7655 --- a/gcc/c-common.c
7656 +++ b/gcc/c-common.c
7657 @@ -1173,6 +1173,20 @@ check_main_parameter_types (tree decl)
7658 pedwarn ("%q+D takes only zero or two arguments", decl);
7659 }
7660
7661 +/* True if pointers to distinct types T1 and T2 can be converted to
7662 + each other without an explicit cast. Only returns true for opaque
7663 + vector types. */
7664 +bool
7665 +vector_targets_convertible_p (const_tree t1, const_tree t2)
7666 +{
7667 + if (TREE_CODE (t1) == VECTOR_TYPE && TREE_CODE (t2) == VECTOR_TYPE
7668 + && (targetm.vector_opaque_p (t1) || targetm.vector_opaque_p (t2))
7669 + && tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2)))
7670 + return true;
7671 +
7672 + return false;
7673 +}
7674 +
7675 /* True if vector types T1 and T2 can be converted to each other
7676 without an explicit cast. If EMIT_LAX_NOTE is true, and T1 and T2
7677 can only be converted with -flax-vector-conversions yet that is not
7678 --- a/gcc/c-common.h
7679 +++ b/gcc/c-common.h
7680 @@ -829,6 +829,7 @@ extern tree finish_label_address_expr (t
7681 extern tree lookup_label (tree);
7682 extern tree lookup_name (tree);
7683
7684 +extern bool vector_targets_convertible_p (const_tree t1, const_tree t2);
7685 extern bool vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note);
7686
7687 extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
7688 --- a/gcc/c-convert.c
7689 +++ b/gcc/c-convert.c
7690 @@ -70,6 +70,7 @@ convert (tree type, tree expr)
7691 tree e = expr;
7692 enum tree_code code = TREE_CODE (type);
7693 const char *invalid_conv_diag;
7694 + tree e1;
7695
7696 if (type == error_mark_node
7697 || expr == error_mark_node
7698 @@ -85,7 +86,8 @@ convert (tree type, tree expr)
7699
7700 if (type == TREE_TYPE (expr))
7701 return expr;
7702 -
7703 + if (e1 = targetm.convert_to_type (type, expr))
7704 + return e1;
7705 if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (expr)))
7706 return fold_convert (type, expr);
7707 if (TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK)
7708 --- a/gcc/c-decl.c
7709 +++ b/gcc/c-decl.c
7710 @@ -3995,6 +3995,7 @@ grokdeclarator (const struct c_declarato
7711 bool bitfield = width != NULL;
7712 tree element_type;
7713 struct c_arg_info *arg_info = 0;
7714 + const char *errmsg;
7715
7716 if (decl_context == FUNCDEF)
7717 funcdef_flag = true, decl_context = NORMAL;
7718 @@ -4513,6 +4514,12 @@ grokdeclarator (const struct c_declarato
7719 error ("%qs declared as function returning an array", name);
7720 type = integer_type_node;
7721 }
7722 + errmsg = targetm.invalid_return_type (type);
7723 + if (errmsg)
7724 + {
7725 + error (errmsg);
7726 + type = integer_type_node;
7727 + }
7728
7729 /* Construct the function type and go to the next
7730 inner layer of declarator. */
7731 @@ -5039,6 +5046,7 @@ grokparms (struct c_arg_info *arg_info,
7732 {
7733 tree parm, type, typelt;
7734 unsigned int parmno;
7735 + const char *errmsg;
7736
7737 /* If there is a parameter of incomplete type in a definition,
7738 this is an error. In a declaration this is valid, and a
7739 @@ -5082,6 +5090,14 @@ grokparms (struct c_arg_info *arg_info,
7740 }
7741 }
7742
7743 + errmsg = targetm.invalid_parameter_type (type);
7744 + if (errmsg)
7745 + {
7746 + error (errmsg);
7747 + TREE_VALUE (typelt) = error_mark_node;
7748 + TREE_TYPE (parm) = error_mark_node;
7749 + }
7750 +
7751 if (DECL_NAME (parm) && TREE_USED (parm))
7752 warn_if_shadowing (parm);
7753 }
7754 --- a/gcc/c-incpath.c
7755 +++ b/gcc/c-incpath.c
7756 @@ -30,6 +30,8 @@
7757 #include "intl.h"
7758 #include "c-incpath.h"
7759 #include "cppdefault.h"
7760 +#include "flags.h"
7761 +#include "toplev.h"
7762
7763 /* Windows does not natively support inodes, and neither does MSDOS.
7764 Cygwin's emulation can generate non-unique inodes, so don't use it.
7765 @@ -37,15 +39,18 @@
7766 #ifdef VMS
7767 # define INO_T_EQ(A, B) (!memcmp (&(A), &(B), sizeof (A)))
7768 # define INO_T_COPY(DEST, SRC) memcpy(&(DEST), &(SRC), sizeof (SRC))
7769 -#else
7770 -# if (defined _WIN32 && !defined (_UWIN)) || defined __MSDOS__
7771 -# define INO_T_EQ(A, B) 0
7772 -# else
7773 -# define INO_T_EQ(A, B) ((A) == (B))
7774 -# endif
7775 +#elif !((defined _WIN32 && !defined (_UWIN)) || defined __MSDOS__)
7776 +# define INO_T_EQ(A, B) ((A) == (B))
7777 # define INO_T_COPY(DEST, SRC) (DEST) = (SRC)
7778 #endif
7779
7780 +#if defined INO_T_EQ
7781 +#define DIRS_EQ(A, B) ((A)->dev == (B)->dev \
7782 + && INO_T_EQ((A)->ino, (B)->ino))
7783 +#else
7784 +#define DIRS_EQ(A, B) (!strcasecmp ((A)->name, (B)->name))
7785 +#endif
7786 +
7787 static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
7788
7789 static void add_env_var_paths (const char *, int);
7790 @@ -241,14 +246,15 @@ remove_duplicates (cpp_reader *pfile, st
7791 "%s: not a directory", cur->name);
7792 else
7793 {
7794 +#if defined (INO_T_COPY)
7795 INO_T_COPY (cur->ino, st.st_ino);
7796 cur->dev = st.st_dev;
7797 +#endif
7798
7799 /* Remove this one if it is in the system chain. */
7800 reason = REASON_DUP_SYS;
7801 for (tmp = system; tmp; tmp = tmp->next)
7802 - if (INO_T_EQ (tmp->ino, cur->ino) && tmp->dev == cur->dev
7803 - && cur->construct == tmp->construct)
7804 + if (DIRS_EQ (tmp, cur) && cur->construct == tmp->construct)
7805 break;
7806
7807 if (!tmp)
7808 @@ -256,16 +262,14 @@ remove_duplicates (cpp_reader *pfile, st
7809 /* Duplicate of something earlier in the same chain? */
7810 reason = REASON_DUP;
7811 for (tmp = head; tmp != cur; tmp = tmp->next)
7812 - if (INO_T_EQ (cur->ino, tmp->ino) && cur->dev == tmp->dev
7813 - && cur->construct == tmp->construct)
7814 + if (DIRS_EQ (cur, tmp) && cur->construct == tmp->construct)
7815 break;
7816
7817 if (tmp == cur
7818 /* Last in the chain and duplicate of JOIN? */
7819 && !(cur->next == NULL && join
7820 - && INO_T_EQ (cur->ino, join->ino)
7821 - && cur->dev == join->dev
7822 - && cur->construct == join->construct))
7823 + && DIRS_EQ (cur, join)
7824 + && cur->construct == join->construct))
7825 {
7826 /* Unique, so keep this directory. */
7827 pcur = &cur->next;
7828 @@ -297,8 +301,8 @@ add_sysroot_to_chain (const char *sysroo
7829 }
7830
7831 /* Merge the four include chains together in the order quote, bracket,
7832 - system, after. Remove duplicate dirs (as determined by
7833 - INO_T_EQ()).
7834 + system, after. Remove duplicate dirs (determined in
7835 + system-specific manner).
7836
7837 We can't just merge the lists and then uniquify them because then
7838 we may lose directories from the <> search path that should be
7839 @@ -352,6 +356,24 @@ merge_include_chains (const char *sysroo
7840 }
7841 fprintf (stderr, _("End of search list.\n"));
7842 }
7843 +
7844 +#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
7845 + if (flag_poison_system_directories)
7846 + {
7847 + struct cpp_dir *p;
7848 +
7849 + for (p = heads[QUOTE]; p; p = p->next)
7850 + {
7851 + if ((!strncmp (p->name, "/usr/include", 12))
7852 + || (!strncmp (p->name, "/usr/local/include", 18))
7853 + || (!strncmp (p->name, "/usr/X11R6/include", 18)))
7854 + warning (OPT_Wpoison_system_directories,
7855 + "include location \"%s\" is unsafe for "
7856 + "cross-compilation",
7857 + p->name);
7858 + }
7859 + }
7860 +#endif
7861 }
7862
7863 /* Use given -I paths for #include "..." but not #include <...>, and
7864 --- a/gcc/c-typeck.c
7865 +++ b/gcc/c-typeck.c
7866 @@ -1754,6 +1754,7 @@ default_conversion (tree exp)
7867 tree orig_exp;
7868 tree type = TREE_TYPE (exp);
7869 enum tree_code code = TREE_CODE (type);
7870 + tree promoted_type;
7871
7872 /* Functions and arrays have been converted during parsing. */
7873 gcc_assert (code != FUNCTION_TYPE);
7874 @@ -1790,6 +1791,10 @@ default_conversion (tree exp)
7875 if (exp == error_mark_node)
7876 return error_mark_node;
7877
7878 + promoted_type = targetm.promoted_type (type);
7879 + if (promoted_type)
7880 + return convert (promoted_type, exp);
7881 +
7882 if (INTEGRAL_TYPE_P (type))
7883 return perform_integral_promotions (exp);
7884
7885 @@ -4196,10 +4201,7 @@ convert_for_assignment (tree type, tree
7886 if (TREE_CODE (mvr) != ARRAY_TYPE)
7887 mvr = TYPE_MAIN_VARIANT (mvr);
7888 /* Opaque pointers are treated like void pointers. */
7889 - is_opaque_pointer = (targetm.vector_opaque_p (type)
7890 - || targetm.vector_opaque_p (rhstype))
7891 - && TREE_CODE (ttl) == VECTOR_TYPE
7892 - && TREE_CODE (ttr) == VECTOR_TYPE;
7893 + is_opaque_pointer = vector_targets_convertible_p (ttl, ttr);
7894
7895 /* C++ does not allow the implicit conversion void* -> T*. However,
7896 for the purpose of reducing the number of false positives, we
7897 --- a/gcc/c.opt
7898 +++ b/gcc/c.opt
7899 @@ -697,6 +697,10 @@ fpreprocessed
7900 C ObjC C++ ObjC++
7901 Treat the input file as already preprocessed
7902
7903 +fremove-local-statics
7904 +C Var(flag_remove_local_statics)
7905 +Convert function-local static variables to automatic variables when it is safe to do so
7906 +
7907 freplace-objc-classes
7908 ObjC ObjC++
7909 Used in Fix-and-Continue mode to indicate that object files may be swapped in at runtime
7910 --- a/gcc/calls.c
7911 +++ b/gcc/calls.c
7912 @@ -3834,7 +3834,7 @@ emit_library_call_value_1 (int retval, r
7913 cse'ing of library calls could delete a call and leave the pop. */
7914 NO_DEFER_POP;
7915 valreg = (mem_value == 0 && outmode != VOIDmode
7916 - ? hard_libcall_value (outmode) : NULL_RTX);
7917 + ? hard_libcall_value (outmode, orgfun) : NULL_RTX);
7918
7919 /* Stack must be properly aligned now. */
7920 gcc_assert (!(stack_pointer_delta
7921 @@ -4133,8 +4133,17 @@ store_one_arg (struct arg_data *arg, rtx
7922 /* We need to make a save area. */
7923 unsigned int size = arg->locate.size.constant * BITS_PER_UNIT;
7924 enum machine_mode save_mode = mode_for_size (size, MODE_INT, 1);
7925 - rtx adr = memory_address (save_mode, XEXP (arg->stack_slot, 0));
7926 - rtx stack_area = gen_rtx_MEM (save_mode, adr);
7927 + rtx adr;
7928 + rtx stack_area;
7929 +
7930 + /* We can only use save_mode if the arg is sufficiently
7931 + aligned. */
7932 + if (STRICT_ALIGNMENT
7933 + && GET_MODE_ALIGNMENT (save_mode) > arg->locate.boundary)
7934 + save_mode = BLKmode;
7935 +
7936 + adr = memory_address (save_mode, XEXP (arg->stack_slot, 0));
7937 + stack_area = gen_rtx_MEM (save_mode, adr);
7938
7939 if (save_mode == BLKmode)
7940 {
7941 --- a/gcc/cfgexpand.c
7942 +++ b/gcc/cfgexpand.c
7943 @@ -86,10 +86,6 @@ failed:
7944 }
7945
7946
7947 -#ifndef LOCAL_ALIGNMENT
7948 -#define LOCAL_ALIGNMENT(TYPE, ALIGNMENT) ALIGNMENT
7949 -#endif
7950 -
7951 #ifndef STACK_ALIGNMENT_NEEDED
7952 #define STACK_ALIGNMENT_NEEDED 1
7953 #endif
7954 @@ -160,7 +156,7 @@ get_decl_align_unit (tree decl)
7955 unsigned int align;
7956
7957 align = DECL_ALIGN (decl);
7958 - align = LOCAL_ALIGNMENT (TREE_TYPE (decl), align);
7959 + align = calculate_local_alignment (TREE_TYPE (decl), align);
7960 if (align > PREFERRED_STACK_BOUNDARY)
7961 align = PREFERRED_STACK_BOUNDARY;
7962 if (cfun->stack_alignment_needed < align)
7963 --- a/gcc/cgraph.c
7964 +++ b/gcc/cgraph.c
7965 @@ -205,9 +205,11 @@ cgraph_node (tree decl)
7966 if (DECL_CONTEXT (decl) && TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)
7967 {
7968 node->origin = cgraph_node (DECL_CONTEXT (decl));
7969 + node->origin->ever_was_nested = 1;
7970 node->next_nested = node->origin->nested;
7971 node->origin->nested = node;
7972 node->master_clone = node;
7973 + node->ever_was_nested = 1;
7974 }
7975 return node;
7976 }
7977 --- a/gcc/cgraph.h
7978 +++ b/gcc/cgraph.h
7979 @@ -178,6 +178,8 @@ struct cgraph_node GTY((chain_next ("%h.
7980 unsigned output : 1;
7981 /* Set for aliases once they got through assemble_alias. */
7982 unsigned alias : 1;
7983 + /* Set if the function is a nested function or has nested functions. */
7984 + unsigned ever_was_nested : 1;
7985
7986 /* In non-unit-at-a-time mode the function body of inline candidates is saved
7987 into clone before compiling so the function in original form can be
7988 --- a/gcc/collect2.c
7989 +++ b/gcc/collect2.c
7990 @@ -605,11 +605,7 @@ find_a_file (struct path_prefix *pprefix
7991
7992 /* Determine the filename to execute (special case for absolute paths). */
7993
7994 - if (*name == '/'
7995 -#ifdef HAVE_DOS_BASED_FILE_SYSTEM
7996 - || (*name && name[1] == ':')
7997 -#endif
7998 - )
7999 + if (IS_ABSOLUTE_PATH (name))
8000 {
8001 if (access (name, X_OK) == 0)
8002 {
8003 --- a/gcc/combine.c
8004 +++ b/gcc/combine.c
8005 @@ -3989,14 +3989,18 @@ find_split_point (rtx *loc, rtx insn)
8006 return &XEXP (XEXP (x, 0), 0);
8007 }
8008
8009 +#if 0
8010 /* If we have a PLUS whose first operand is complex, try computing it
8011 - separately by making a split there. */
8012 + separately by making a split there.
8013 + This causes non-canonical RTL to be created, at least on ARM.
8014 + See CSL issue #4085. */
8015 if (GET_CODE (XEXP (x, 0)) == PLUS
8016 && ! memory_address_p (GET_MODE (x), XEXP (x, 0))
8017 && ! OBJECT_P (XEXP (XEXP (x, 0), 0))
8018 && ! (GET_CODE (XEXP (XEXP (x, 0), 0)) == SUBREG
8019 && OBJECT_P (SUBREG_REG (XEXP (XEXP (x, 0), 0)))))
8020 return &XEXP (XEXP (x, 0), 0);
8021 +#endif
8022 break;
8023
8024 case SET:
8025 @@ -5876,6 +5880,7 @@ simplify_set (rtx x)
8026 zero_extend to avoid the reload that would otherwise be required. */
8027
8028 if (GET_CODE (src) == SUBREG && subreg_lowpart_p (src)
8029 + && GET_MODE_CLASS (GET_MODE (SUBREG_REG (src))) == MODE_INT
8030 && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (src))) != UNKNOWN
8031 && SUBREG_BYTE (src) == 0
8032 && (GET_MODE_SIZE (GET_MODE (src))
8033 --- a/gcc/common.opt
8034 +++ b/gcc/common.opt
8035 @@ -142,6 +142,10 @@ Wpadded
8036 Common Var(warn_padded) Warning
8037 Warn when padding is required to align structure members
8038
8039 +Wpoison-system-directories
8040 +Common Var(flag_poison_system_directories) Init(1)
8041 +Warn for -I and -L options using system directories if cross compiling
8042 +
8043 Wshadow
8044 Common Var(warn_shadow) Warning
8045 Warn when one local variable shadows another
8046 @@ -259,6 +263,12 @@ Common Separate
8047 fabi-version=
8048 Common Joined UInteger Var(flag_abi_version) Init(2)
8049
8050 +falign-arrays
8051 +Target Report Var(flag_align_arrays)
8052 +Set the minimum alignment for array variables to be the largest power
8053 +of two less than or equal to their total storage size, or the biggest
8054 +alignment used on the machine, whichever is smaller.
8055 +
8056 falign-functions
8057 Common Report Var(align_functions,0)
8058 Align the start of functions
8059 @@ -444,6 +454,10 @@ fearly-inlining
8060 Common Report Var(flag_early_inlining) Init(1) Optimization
8061 Perform early inlining
8062
8063 +feglibc=
8064 +Common Report Joined Undocumented
8065 +EGLIBC configuration specifier, serves multilib purposes.
8066 +
8067 feliminate-dwarf2-dups
8068 Common Report Var(flag_eliminate_dwarf2_dups)
8069 Perform DWARF2 duplicate elimination
8070 @@ -805,6 +819,10 @@ fprofile-values
8071 Common Report Var(flag_profile_values)
8072 Insert code to profile values of expressions
8073
8074 +fpromote-loop-indices
8075 +Common Report Var(flag_promote_loop_indices) Optimization
8076 +Promote loop indices to word-sized indices when safe
8077 +
8078 frandom-seed
8079 Common
8080
8081 --- a/gcc/config.gcc
8082 +++ b/gcc/config.gcc
8083 @@ -70,6 +70,10 @@
8084 # This helps to keep OS specific stuff out of the CPU
8085 # defining header ${cpu_type}/${cpu_type.h}.
8086 #
8087 +# It is possible to include automatically-generated
8088 +# build-directory files by prefixing them with "./".
8089 +# All other files should relative to $srcdir/config.
8090 +#
8091 # tm_p_file Location of file with declarations for functions
8092 # in $out_file.
8093 #
8094 @@ -751,32 +755,62 @@ arm*-*-linux*) # ARM GNU/Linux with EL
8095 need_64bit_hwint=yes
8096 # The EABI requires the use of __cxa_atexit.
8097 default_use_cxa_atexit=yes
8098 + case ${target} in
8099 + arm-timesys-linux-gnueabi)
8100 + tmake_file="${tmake_file} arm/t-timesys"
8101 + tm_file="$tm_file ./sysroot-suffix.h"
8102 + tmake_file="$tmake_file t-sysroot-suffix"
8103 + ;;
8104 + arm-wrs-linux-gnueabi)
8105 + tm_file="$tm_file arm/wrs-linux.h"
8106 + tmake_file="$tmake_file arm/t-wrs-linux"
8107 + tm_defines="$tm_defines TARGET_FLEXLM"
8108 + ;;
8109 + arm-montavista*-linux-gnueabi)
8110 + tm_file="$tm_file arm/montavista-linux.h"
8111 + tmake_file="$tmake_file arm/t-montavista-linux"
8112 + ;;
8113 + *)
8114 + if test x$enable_extra_asa_multilibs = xyes; then
8115 + tmake_file="${tmake_file} arm/t-asa"
8116 + elif test x$enable_extra_sgxx_multilibs = xyes; then
8117 + tmake_file="${tmake_file} arm/t-cs-linux"
8118 + fi
8119 + tm_file="$tm_file ./sysroot-suffix.h"
8120 + tmake_file="$tmake_file t-sysroot-suffix"
8121 + ;;
8122 + esac
8123 ;;
8124 *)
8125 tmake_file="$tmake_file arm/t-linux"
8126 ;;
8127 esac
8128 tm_file="$tm_file arm/aout.h arm/arm.h"
8129 + tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
8130 ;;
8131 arm*-*-uclinux*) # ARM ucLinux
8132 - tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h arm/uclinux-elf.h"
8133 + tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h"
8134 tmake_file="arm/t-arm arm/t-arm-elf"
8135 case ${target} in
8136 - arm*-*-uclinux-*eabi)
8137 + arm*-*-uclinux*eabi)
8138 tm_file="$tm_file arm/bpabi.h arm/uclinux-eabi.h"
8139 - tmake_file="$tmake_file arm/t-bpabi"
8140 + tmake_file="$tmake_file arm/t-bpabi arm/t-uclinux-eabi"
8141 # The BPABI long long divmod functions return a 128-bit value in
8142 # registers r0-r3. Correctly modeling that requires the use of
8143 # TImode.
8144 need_64bit_hwint=yes
8145 # The EABI requires the use of __cxa_atexit.
8146 default_use_cxa_atexit=yes
8147 + tm_file="$tm_file ./sysroot-suffix.h"
8148 + tmake_file="$tmake_file t-sysroot-suffix"
8149 esac
8150 + tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
8151 tm_file="$tm_file arm/aout.h arm/arm.h"
8152 ;;
8153 arm*-*-ecos-elf)
8154 tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/ecos-elf.h"
8155 tmake_file="arm/t-arm arm/t-arm-elf"
8156 + tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
8157 ;;
8158 arm*-*-eabi* | arm*-*-symbianelf* )
8159 # The BPABI long long divmod functions return a 128-bit value in
8160 @@ -788,7 +822,11 @@ arm*-*-eabi* | arm*-*-symbianelf* )
8161 tmake_file="arm/t-arm arm/t-arm-elf"
8162 case ${target} in
8163 arm*-*-eabi*)
8164 + tm_file="${tm_file} arm/nocrt0.h"
8165 tmake_file="${tmake_file} arm/t-bpabi"
8166 + if test x$enable_extra_sgxx_multilibs = xyes; then
8167 + tmake_file="${tmake_file} arm/t-cs-eabi"
8168 + fi
8169 ;;
8170 arm*-*-symbianelf*)
8171 tm_file="${tm_file} arm/symbian.h"
8172 @@ -798,14 +836,17 @@ arm*-*-eabi* | arm*-*-symbianelf* )
8173 ;;
8174 esac
8175 tm_file="${tm_file} arm/aout.h arm/arm.h"
8176 + tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
8177 ;;
8178 arm*-*-rtems*)
8179 tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/rtems-elf.h rtems.h"
8180 tmake_file="arm/t-arm arm/t-arm-elf t-rtems arm/t-rtems"
8181 + tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
8182 ;;
8183 arm*-*-elf | ep9312-*-elf)
8184 tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h"
8185 tmake_file="arm/t-arm arm/t-arm-elf"
8186 + tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
8187 ;;
8188 arm*-wince-pe*)
8189 tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h arm/wince-pe.h"
8190 @@ -822,6 +863,7 @@ arm-*-pe*)
8191 arm*-*-kaos*)
8192 tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h kaos.h arm/kaos-arm.h"
8193 tmake_file="arm/t-arm arm/t-arm-elf"
8194 + tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
8195 ;;
8196 avr-*-rtems*)
8197 tm_file="avr/avr.h dbxelf.h avr/rtems.h rtems.h"
8198 @@ -1179,6 +1221,16 @@ i[34567]86-*-linux* | i[34567]86-*-kfree
8199 else
8200 tm_file="${tm_file} i386/linux.h"
8201 fi
8202 + case ${target} in
8203 + *-wrs-linux*)
8204 + tm_defines="${tm_defines} TARGET_FLEXLM"
8205 + ;;
8206 + esac
8207 + if test x$enable_extra_sgxx_multilibs = xyes; then
8208 + tm_file="${tm_file} i386/cs-linux.h"
8209 + tmake_file="${tmake_file} i386/t-cs-linux"
8210 + extra_options="${extra_options} i386/cs-linux.opt"
8211 + fi
8212 ;;
8213 i[34567]86-*-knetbsd*-gnu) tm_file="${tm_file} i386/linux.h knetbsd-gnu.h i386/knetbsd-gnu.h" ;;
8214 i[34567]86-*-kfreebsd*-gnu) tm_file="${tm_file} i386/linux.h kfreebsd-gnu.h i386/kfreebsd-gnu.h" ;;
8215 @@ -1616,9 +1668,11 @@ m68k-*-linux*) # Motorola m68k's runnin
8216 # aka the GNU/Linux C library 6.
8217 default_m68k_cpu=68020
8218 default_cf_cpu=5475
8219 - tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h m68k/linux.h"
8220 + with_arch=${with_arch:-m68k}
8221 + tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h m68k/linux.h ./sysroot-suffix.h"
8222 extra_options="${extra_options} m68k/ieee.opt"
8223 tm_defines="${tm_defines} MOTOROLA=1"
8224 + tmake_file="${tmake_file} m68k/t-floatlib m68k/t-linux m68k/t-mlibs"
8225 # if not configured with --enable-sjlj-exceptions, bump the
8226 # libgcc version number
8227 if test x$sjlj != x1; then
8228 @@ -1646,7 +1700,7 @@ mcore-*-pe*)
8229 mips-sgi-irix[56]*)
8230 tm_file="elfos.h ${tm_file} mips/iris.h"
8231 tmake_file="mips/t-iris mips/t-slibgcc-irix"
8232 - target_cpu_default="MASK_ABICALLS"
8233 + tm_defines="${tm_defines} TARGET_ABICALLS_DEFAULT=1"
8234 case ${target} in
8235 *-*-irix5*)
8236 tm_file="${tm_file} mips/iris5.h"
8237 @@ -1672,31 +1726,77 @@ mips-sgi-irix[56]*)
8238 use_fixproto=yes
8239 ;;
8240 mips*-*-netbsd*) # NetBSD/mips, either endian.
8241 - target_cpu_default="MASK_ABICALLS"
8242 + tm_defines="${tm_defines} TARGET_ABICALLS_DEFAULT=1"
8243 tm_file="elfos.h ${tm_file} mips/elf.h netbsd.h netbsd-elf.h mips/netbsd.h"
8244 ;;
8245 mips64*-*-linux*)
8246 tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h mips/linux64.h"
8247 + tm_defines="${tm_defines} TARGET_ABICALLS_DEFAULT=1"
8248 tmake_file="${tmake_file} mips/t-linux64"
8249 - tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
8250 + if test x${enable_mips_nonpic}; then
8251 + tm_defines="${tm_defines} TARGET_ABICALLS_NONPIC=1"
8252 + fi
8253 + case "$with_abi" in
8254 + "" | "n32" )
8255 + tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
8256 + ;;
8257 + 64 )
8258 + tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_64"
8259 + ;;
8260 + *)
8261 + echo "Unknown ABI used in --with-abi=$with_abi"
8262 + exit 1
8263 + ;;
8264 + esac
8265 + case ${target} in
8266 + mips64el-sicortex-linux-gnu)
8267 + tm_file="${tm_file} mips/sicortex.h"
8268 + tmake_file="${tmake_file} mips/t-sicortex"
8269 + ;;
8270 + esac
8271 + tmake_file="$tmake_file mips/t-crtfm"
8272 gnu_ld=yes
8273 gas=yes
8274 test x$with_llsc != x || with_llsc=yes
8275 ;;
8276 mips*-*-linux*) # Linux MIPS, either endian.
8277 tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
8278 + tm_defines="${tm_defines} TARGET_ABICALLS_DEFAULT=1"
8279 + if test x${enable_mips_nonpic}; then
8280 + tm_defines="${tm_defines} TARGET_ABICALLS_NONPIC=1"
8281 + fi
8282 case ${target} in
8283 mipsisa32r2*)
8284 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33"
8285 ;;
8286 mipsisa32*)
8287 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
8288 + ;;
8289 + mips-wrs-linux-gnu)
8290 + tmake_file="$tmake_file mips/t-linux64 mips/t-wrs-linux"
8291 + tm_file="$tm_file mips/linux64.h mips/octeon.h mips/wrs-linux.h"
8292 + tm_defines="$tm_defines TARGET_FLEXLM"
8293 + ;;
8294 + mips-montavista*-linux-gnu)
8295 + tmake_file="$tmake_file mips/t-linux64 mips/t-montavista-linux"
8296 + tm_file="$tm_file mips/linux64.h mips/octeon.h mips/montavista-linux.h"
8297 + ;;
8298 + *)
8299 + if test x$enable_extra_sgxx_multilibs = xyes; then
8300 + tmake_file="$tmake_file mips/t-sgxx-linux"
8301 + tm_file="$tm_file mips/cs-sgxx-linux.h"
8302 + elif test x$enable_extra_sgxxlite_multilibs = xyes; then
8303 + tmake_file="$tmake_file mips/t-sgxxlite-linux"
8304 + tm_file="$tm_file mips/cs-sgxxlite-linux.h"
8305 + fi
8306 + ;;
8307 esac
8308 test x$with_llsc != x || with_llsc=yes
8309 + tmake_file="$tmake_file mips/t-crtfm"
8310 ;;
8311 mips*-*-openbsd*)
8312 tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS"
8313 - target_cpu_default="MASK_ABICALLS"
8314 + tm_defines="${tm_defines} TARGET_ABICALLS_DEFAULT=1"
8315 tm_file="mips/mips.h openbsd.h mips/openbsd.h mips/sdb.h"
8316 case ${target} in
8317 mips*el-*-openbsd*)
8318 @@ -1707,15 +1807,15 @@ mips*-*-openbsd*)
8319 mips*-sde-elf*)
8320 tm_file="elfos.h ${tm_file} mips/elf.h mips/sde.h"
8321 tmake_file="mips/t-sde mips/t-libgcc-mips16"
8322 + tm_file="$tm_file mips/sdemtk.h"
8323 + extra_options="$extra_options mips/sdemtk.opt"
8324 case "${with_newlib}" in
8325 yes)
8326 - # newlib / libgloss.
8327 + # newlib
8328 + # FIXME: threading?
8329 ;;
8330 *)
8331 - # MIPS toolkit libraries.
8332 - tm_file="$tm_file mips/sdemtk.h"
8333 - tmake_file="$tmake_file mips/t-sdemtk"
8334 - extra_options="$extra_options mips/sdemtk.opt"
8335 + tmake_file="$tmake_file mips/t-sdelib"
8336 case ${enable_threads} in
8337 "" | yes | mipssde)
8338 thread_file='mipssde'
8339 @@ -1734,6 +1834,23 @@ mips*-sde-elf*)
8340 tm_defines="MIPS_ISA_DEFAULT=64 MIPS_ABI_DEFAULT=ABI_N32"
8341 ;;
8342 esac
8343 + if [ "$enable_sgxx_sde_multilibs" = "yes" ]; then
8344 + tmake_file="$tmake_file mips/t-sgxx-sde"
8345 + # SourceryG++ is configured --with-arch=mips32r2.
8346 + tm_defines="MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
8347 + fi
8348 + ;;
8349 +mips64octeon*-wrs-elf*)
8350 + tm_file="elfos.h ${tm_file} mips/elf.h mips/octeon.h mips/octeon-elf.h"
8351 + tmake_file=mips/t-octeon-elf
8352 + tm_defines="MIPS_ABI_DEFAULT=ABI_EABI MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\" TARGET_FLEXLM"
8353 + default_use_cxa_atexit=no
8354 + ;;
8355 +mips64octeon*-montavista-elf*)
8356 + tm_file="elfos.h ${tm_file} mips/elf.h mips/octeon.h mips/octeon-elf.h"
8357 + tmake_file="mips/t-octeon-elf mips/t-montavista-elf"
8358 + tm_defines="MIPS_ABI_DEFAULT=ABI_EABI MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
8359 + default_use_cxa_atexit=no
8360 ;;
8361 mipsisa32-*-elf* | mipsisa32el-*-elf* | \
8362 mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \
8363 @@ -1767,10 +1884,11 @@ mipsisa64-*-elf* | mipsisa64el-*-elf*)
8364 ;;
8365 mipsisa64sr71k-*-elf*)
8366 tm_file="elfos.h ${tm_file} mips/elf.h"
8367 - tmake_file=mips/t-sr71k
8368 + tmake_file="mips/t-sr71k"
8369 target_cpu_default="MASK_64BIT|MASK_FLOAT64"
8370 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sr71000\\\" MIPS_ABI_DEFAULT=ABI_EABI"
8371 use_fixproto=yes
8372 + tmake_file="$tmake_file"
8373 ;;
8374 mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
8375 tm_file="elfos.h ${tm_file} mips/elf.h"
8376 @@ -1793,7 +1911,7 @@ mips64-*-elf* | mips64el-*-elf*)
8377 ;;
8378 mips64vr-*-elf* | mips64vrel-*-elf*)
8379 tm_file="mips/vr.h elfos.h ${tm_file} mips/elf.h"
8380 - tmake_file=mips/t-vr
8381 + tmake_file="mips/t-vr"
8382 use_fixproto=yes
8383 ;;
8384 mips64orion-*-elf* | mips64orionel-*-elf*)
8385 @@ -1926,15 +2044,18 @@ powerpc-*-eabisimaltivec*)
8386 tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcendian rs6000/t-ppccomm"
8387 ;;
8388 powerpc-*-eabisim*)
8389 - tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/eabisim.h"
8390 + tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/eabisim.h"
8391 extra_options="${extra_options} rs6000/sysv4.opt"
8392 tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
8393 ;;
8394 powerpc-*-elf*)
8395 - tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h"
8396 + tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h freebsd-spec.h rs6000/sysv4.h"
8397 extra_options="${extra_options} rs6000/sysv4.opt"
8398 tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
8399 - use_fixproto=yes
8400 + if test x$enable_powerpc_e500mc_elf = xyes; then
8401 + tm_file="${tm_file} rs6000/e500mc.h"
8402 + tmake_file="${tmake_file} rs6000/t-ppc-e500mc"
8403 + fi
8404 ;;
8405 powerpc-*-eabialtivec*)
8406 tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/eabialtivec.h"
8407 @@ -1942,9 +2063,12 @@ powerpc-*-eabialtivec*)
8408 tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcendian rs6000/t-ppccomm"
8409 ;;
8410 powerpc-*-eabi*)
8411 - tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h"
8412 + tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h"
8413 extra_options="${extra_options} rs6000/sysv4.opt"
8414 tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
8415 + if test x$enable_extra_sgxx_multilibs = xyes; then
8416 + tmake_file="${tmake_file} rs6000/t-cs-eabi"
8417 + fi
8418 ;;
8419 powerpc-*-rtems*)
8420 tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/rtems.h rtems.h"
8421 @@ -1959,7 +2083,7 @@ powerpc-*-linux*altivec*)
8422 powerpc-*-linux*spe*)
8423 tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxspe.h rs6000/e500.h"
8424 extra_options="${extra_options} rs6000/sysv4.opt"
8425 - tmake_file="rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
8426 + tmake_file="t-dfprules rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
8427 ;;
8428 powerpc-*-linux*paired*)
8429 tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/750cl.h"
8430 @@ -1980,12 +2104,28 @@ powerpc-*-linux*)
8431 extra_options="${extra_options} rs6000/linux64.opt"
8432 ;;
8433 *)
8434 - tm_file="${tm_file} rs6000/linux.h"
8435 + tm_file="${tm_file} rs6000/linux.h rs6000/e500.h"
8436 + tmake_file="$tmake_file rs6000/t-linux"
8437 ;;
8438 esac
8439 if test x${enable_secureplt} = xyes; then
8440 tm_file="rs6000/secureplt.h ${tm_file}"
8441 fi
8442 + case ${target} in
8443 + powerpc-wrs-linux-gnu)
8444 + tm_file="$tm_file rs6000/wrs-linux.h rs6000/e500.h"
8445 + tmake_file="$tmake_file rs6000/t-wrs-linux"
8446 + tm_defines="$tm_defines TARGET_FLEXLM"
8447 + ;;
8448 + powerpc-montavista*-linux-gnu)
8449 + tm_file="$tm_file rs6000/montavista-linux.h"
8450 + tmake_file="$tmake_file rs6000/t-montavista-linux"
8451 + ;;
8452 + powerpc-timesys-linux-gnu*)
8453 + tmake_file="${tmake_file} rs6000/t-timesys"
8454 + tm_file="${tm_file} rs6000/timesys-linux.h"
8455 + ;;
8456 + esac
8457 ;;
8458 powerpc-*-gnu-gnualtivec*)
8459 tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxaltivec.h rs6000/gnu.h"
8460 @@ -2019,7 +2159,7 @@ powerpc-wrs-vxworks|powerpc-wrs-vxworksa
8461 esac
8462 ;;
8463 powerpc-wrs-windiss*) # Instruction-level simulator for VxWorks.
8464 - tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/windiss.h"
8465 + tm_file="${tm_file} elfos.h usegas.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/windiss.h"
8466 tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
8467 extra_options="${extra_options} rs6000/sysv4.opt"
8468 thread_file=""
8469 @@ -2043,28 +2183,28 @@ powerpcle-*-sysv*)
8470 use_fixproto=yes
8471 ;;
8472 powerpcle-*-elf*)
8473 - tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h"
8474 + tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h"
8475 tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
8476 extra_options="${extra_options} rs6000/sysv4.opt"
8477 use_fixproto=yes
8478 ;;
8479 powerpcle-*-eabisim*)
8480 - tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/e500.h rs6000/eabisim.h"
8481 + tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/e500.h rs6000/eabisim.h"
8482 tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
8483 extra_options="${extra_options} rs6000/sysv4.opt"
8484 ;;
8485 powerpcle-*-eabi*)
8486 - tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/e500.h"
8487 + tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/e500.h"
8488 tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
8489 extra_options="${extra_options} rs6000/sysv4.opt"
8490 ;;
8491 powerpc-*-kaos*)
8492 - tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h kaos.h rs6000/kaos-ppc.h"
8493 + tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h freebsd-spec.h rs6000/sysv4.h kaos.h rs6000/kaos-ppc.h"
8494 tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
8495 extra_options="${extra_options} rs6000/sysv4.opt"
8496 ;;
8497 powerpcle-*-kaos*)
8498 - tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h kaos.h rs6000/kaos-ppc.h"
8499 + tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h kaos.h rs6000/kaos-ppc.h"
8500 tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
8501 extra_options="${extra_options} rs6000/sysv4.opt"
8502 ;;
8503 @@ -2162,8 +2302,10 @@ sh-*-symbianelf* | sh[12346l]*-*-symbian
8504 esac
8505 fi
8506 case ${with_endian} in
8507 - big|little) tmake_file="${tmake_file} sh/t-1e" ;;
8508 - big,little|little,big) ;;
8509 + big) TM_ENDIAN_CONFIG=mb ;;
8510 + little) TM_ENDIAN_CONFIG=ml ;;
8511 + big,little) TM_ENDIAN_CONFIG="mb ml" ;;
8512 + little,big) TM_ENDIAN_CONFIG="ml mb" ;;
8513 *) echo "with_endian=${with_endian} not supported."; exit 1 ;;
8514 esac
8515 case ${with_endian} in
8516 @@ -2288,29 +2430,40 @@ sh-*-symbianelf* | sh[12346l]*-*-symbian
8517 fi
8518 target_cpu_default=SELECT_`echo ${sh_cpu_default}|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`
8519 tm_defines=${tm_defines}' SH_MULTILIB_CPU_DEFAULT=\"'`echo $sh_cpu_default|sed s/sh/m/`'\"'
8520 - sh_multilibs=`echo $sh_multilibs,$sh_cpu_default | sed -e 's/[ ,/][ ,]*/ /g' -e 's/ $//' -e 's/^m/sh/' -e 's/ m/ sh/g' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-`
8521 + tm_defines="$tm_defines SUPPORT_`echo $sh_cpu_default | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
8522 + sh_multilibs=`echo $sh_multilibs | sed -e 's/,/ /g' -e 's/^sh/m/i' -e 's/ sh/ m/gi' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-`
8523 for sh_multilib in ${sh_multilibs}; do
8524 case ${sh_multilib} in
8525 - sh1 | sh2 | sh2e | sh3 | sh3e | \
8526 - sh4 | sh4-single | sh4-single-only | sh4-nofpu | sh4-300 |\
8527 - sh4a | sh4a-single | sh4a-single-only | sh4a-nofpu | sh4al | \
8528 - sh2a | sh2a-single | sh2a-single-only | sh2a-nofpu | \
8529 - sh5-64media | sh5-64media-nofpu | \
8530 - sh5-32media | sh5-32media-nofpu | \
8531 - sh5-compact | sh5-compact-nofpu)
8532 - tmake_file="${tmake_file} sh/t-mlib-${sh_multilib}"
8533 - tm_defines="$tm_defines SUPPORT_`echo $sh_multilib|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
8534 + m1 | m2 | m2e | m3 | m3e | \
8535 + m4 | m4-single | m4-single-only | m4-nofpu | m4-300 |\
8536 + m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al | \
8537 + m2a | m2a-single | m2a-single-only | m2a-nofpu | \
8538 + m5-64media | m5-64media-nofpu | \
8539 + m5-32media | m5-32media-nofpu | \
8540 + m5-compact | m5-compact-nofpu)
8541 + TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG}/${sh_multilib}"
8542 + tm_defines="$tm_defines SUPPORT_`echo $sh_multilib | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
8543 ;;
8544 + !*) TM_MULTILIB_EXCEPTIONS_CONFIG="${TM_MULTILIB_EXCEPTIONS_CONFIG} ${sh_multilib#!}" ;;
8545 + none) ;;
8546 *)
8547 echo "with_multilib_list=${sh_multilib} not supported."
8548 exit 1
8549 ;;
8550 esac
8551 done
8552 + TM_MULTILIB_CONFIG=${TM_MULTILIB_CONFIG#/}
8553 if test x${enable_incomplete_targets} = xyes ; then
8554 tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1 SUPPORT_SH5_32MEDIA=1 SUPPORT_SH5_32MEDIA_NOFPU=1 SUPPORT_SH5_64MEDIA=1 SUPPORT_SH5_64MEDIA_NOFPU=1"
8555 fi
8556 - use_fixproto=yes
8557 + if test x$enable_extra_sgxxlite_multilibs = xyes \
8558 + || test x$enable_extra_sgxx_multilibs = xyes; then
8559 + # SG++ and Lite do not differ, as yet, so use the Lite files for both
8560 + tm_file="$tm_file sh/cs-sgxxlite-linux.h"
8561 + tmake_file="$tmake_file sh/t-sgxxlite-linux"
8562 + fi
8563 + tm_file="$tm_file ./sysroot-suffix.h"
8564 + tmake_file="$tmake_file t-sysroot-suffix"
8565 ;;
8566 sh-*-rtems*)
8567 tmake_file="sh/t-sh sh/t-elf t-rtems sh/t-rtems"
8568 @@ -2340,6 +2493,13 @@ sparc-*-elf*)
8569 extra_parts="crti.o crtn.o crtbegin.o crtend.o"
8570 use_fixproto=yes
8571 ;;
8572 +sparc-wrs-linux*)
8573 + tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux64.h"
8574 + extra_options="${extra_options} sparc/long-double-switch.opt"
8575 + tmake_file="${tmake_file} sparc/t-linux sparc/t-linux64 sparc/t-crtfm"
8576 + tm_defines="${tm_defines} BIARCH_32BIT_DEFAULT TARGET_FLEXLM"
8577 + need_64bit_hwint=yes
8578 + ;;
8579 sparc-*-linux*) # SPARC's running GNU/Linux, libc6
8580 tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux.h"
8581 extra_options="${extra_options} sparc/long-double-switch.opt"
8582 @@ -2882,7 +3042,8 @@ case "${target}" in
8583 "" \
8584 | armv[23456] | armv2a | armv3m | armv4t | armv5t \
8585 | armv5te | armv6j |armv6k | armv6z | armv6zk \
8586 - | iwmmxt | ep9312)
8587 + | armv6-m | armv7-a | armv7-r | armv7-m \
8588 + | iwmmxt | ep9312 | marvell-f )
8589 # OK
8590 ;;
8591 *)
8592 @@ -3017,8 +3178,8 @@ case "${target}" in
8593 ;;
8594
8595 i[34567]86-*-* | x86_64-*-*)
8596 - supported_defaults="arch cpu tune"
8597 - for which in arch cpu tune; do
8598 + supported_defaults="arch arch32 arch64 cpu tune"
8599 + for which in arch arch32 arch64 cpu tune; do
8600 eval "val=\$with_$which"
8601 case ${val} in
8602 i386 | i486 \
8603 @@ -3029,8 +3190,10 @@ case "${target}" in
8604 | prescott | pentium-m | pentium4m | pentium3m)
8605 case "${target}" in
8606 x86_64-*-*)
8607 - echo "CPU given in --with-$which=$val doesn't support 64bit mode." 1>&2
8608 - exit 1
8609 + if [ "x$which" != "xarch32" ]; then
8610 + echo "CPU given in --with-$which=$val doesn't support 64bit mode." 1>&2
8611 + exit 1
8612 + fi
8613 ;;
8614 esac
8615 # OK
8616 @@ -3047,7 +3210,7 @@ case "${target}" in
8617 ;;
8618
8619 mips*-*-*)
8620 - supported_defaults="abi arch float tune divide llsc"
8621 + supported_defaults="abi arch arch32 arch64 float tune tune32 tune64 divide llsc"
8622
8623 case ${with_float} in
8624 "" | soft | hard)
8625 @@ -3079,6 +3242,21 @@ case "${target}" in
8626 ;;
8627 esac
8628
8629 + for fix in ice9a; do
8630 + supported_defaults="$supported_defaults fix-$fix"
8631 + eval "val=\$with_fix_$fix"
8632 + case $val in
8633 + "" | off)
8634 + eval "\$with_fix_$fix="
8635 + ;;
8636 + on)
8637 + ;;
8638 + *)
8639 + echo "Unknown argument to --with-fix-$fix: $val"
8640 + ;;
8641 + esac
8642 + done
8643 +
8644 case ${with_llsc} in
8645 yes)
8646 with_llsc=llsc
8647 @@ -3116,9 +3294,9 @@ case "${target}" in
8648 ;;
8649
8650 powerpc*-*-* | rs6000-*-*)
8651 - supported_defaults="cpu float tune"
8652 + supported_defaults="cpu cpu32 cpu64 float tune"
8653
8654 - for which in cpu tune; do
8655 + for which in cpu cpu32 cpu64 tune; do
8656 eval "val=\$with_$which"
8657 case ${val} in
8658 default32 | default64)
8659 @@ -3134,8 +3312,8 @@ case "${target}" in
8660 | rios | rios1 | rios2 | rsc | rsc1 | rs64a \
8661 | 401 | 403 | 405 | 405fp | 440 | 440fp | 505 \
8662 | 601 | 602 | 603 | 603e | ec603e | 604 \
8663 - | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \
8664 - | 854[08] | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5 | cell)
8665 + | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 |e300c[23] \
8666 + | 854[08] | e500mc | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5 | cell)
8667 # OK
8668 ;;
8669 *)
8670 @@ -3356,11 +3534,28 @@ case ${target} in
8671 ;;
8672 esac
8673
8674 +case ${target} in
8675 + *-eglibc-*-*)
8676 + tmake_file="${tmake_file} t-eglibc"
8677 +
8678 + case ${target} in
8679 + arm-*)
8680 + # ARM already includes below.
8681 + ;;
8682 + *)
8683 + tmake_file="${tmake_file} t-sysroot-suffix"
8684 + tm_file="${tm_file} ./sysroot-suffix.h"
8685 + ;;
8686 + esac
8687 + ;;
8688 +esac
8689 +
8690 t=
8691 -all_defaults="abi cpu arch tune schedule float mode fpu divide llsc"
8692 +all_defaults="abi cpu cpu32 cpu64 arch arch32 arch64 tune tune32 tune64 schedule float mode fpu divide fix-ice9a llsc"
8693 for option in $all_defaults
8694 do
8695 - eval "val=\$with_$option"
8696 + underscoreoption=`echo $option | sed -e s/-/_/g`
8697 + eval "val=\$with_$underscoreoption"
8698 if test -n "$val"; then
8699 case " $supported_defaults " in
8700 *" $option "*)
8701 --- a/gcc/config.in
8702 +++ b/gcc/config.in
8703 @@ -100,6 +100,12 @@
8704 #endif
8705
8706
8707 +/* Define to warn for use of native system header directories */
8708 +#ifndef USED_FOR_TARGET
8709 +#undef ENABLE_POISON_SYSTEM_DIRECTORIES
8710 +#endif
8711 +
8712 +
8713 /* Define if you want all operations on RTL (the basic data structure of the
8714 optimizer and back end) to be checked for dynamic type safety at runtime.
8715 This is quite expensive. */
8716 @@ -1369,37 +1375,37 @@
8717 #endif
8718
8719
8720 -/* The size of `int', as computed by sizeof. */
8721 +/* The size of a `int', as computed by sizeof. */
8722 #ifndef USED_FOR_TARGET
8723 #undef SIZEOF_INT
8724 #endif
8725
8726
8727 -/* The size of `long', as computed by sizeof. */
8728 +/* The size of a `long', as computed by sizeof. */
8729 #ifndef USED_FOR_TARGET
8730 #undef SIZEOF_LONG
8731 #endif
8732
8733
8734 -/* The size of `long long', as computed by sizeof. */
8735 +/* The size of a `long long', as computed by sizeof. */
8736 #ifndef USED_FOR_TARGET
8737 #undef SIZEOF_LONG_LONG
8738 #endif
8739
8740
8741 -/* The size of `short', as computed by sizeof. */
8742 +/* The size of a `short', as computed by sizeof. */
8743 #ifndef USED_FOR_TARGET
8744 #undef SIZEOF_SHORT
8745 #endif
8746
8747
8748 -/* The size of `void *', as computed by sizeof. */
8749 +/* The size of a `void *', as computed by sizeof. */
8750 #ifndef USED_FOR_TARGET
8751 #undef SIZEOF_VOID_P
8752 #endif
8753
8754
8755 -/* The size of `__int64', as computed by sizeof. */
8756 +/* The size of a `__int64', as computed by sizeof. */
8757 #ifndef USED_FOR_TARGET
8758 #undef SIZEOF___INT64
8759 #endif
8760 --- a/gcc/config/arm/aout.h
8761 +++ b/gcc/config/arm/aout.h
8762 @@ -191,9 +191,6 @@
8763 }
8764 #endif
8765
8766 -/* Arm Assembler barfs on dollars. */
8767 -#define DOLLARS_IN_IDENTIFIERS 0
8768 -
8769 #ifndef NO_DOLLAR_IN_LABEL
8770 #define NO_DOLLAR_IN_LABEL 1
8771 #endif
8772 --- a/gcc/config/arm/arm-cores.def
8773 +++ b/gcc/config/arm/arm-cores.def
8774 @@ -102,6 +102,8 @@ ARM_CORE("arm1020e", arm1020e, 5TE,
8775 ARM_CORE("arm1022e", arm1022e, 5TE, FL_LDSCHED, fastmul)
8776 ARM_CORE("xscale", xscale, 5TE, FL_LDSCHED | FL_STRONG | FL_XSCALE, xscale)
8777 ARM_CORE("iwmmxt", iwmmxt, 5TE, FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT, xscale)
8778 +ARM_CORE("iwmmxt2", iwmmxt2, 5TE, FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT, xscale)
8779 +ARM_CORE("marvell-f", marvell_f, 5TE, FL_LDSCHED | FL_MARVELL_F | FL_VFPV2, 9e)
8780
8781 /* V5TEJ Architecture Processors */
8782 ARM_CORE("arm926ej-s", arm926ejs, 5TEJ, FL_LDSCHED, 9e)
8783 @@ -115,6 +117,12 @@ ARM_CORE("arm1176jzf-s", arm1176jzfs, 6
8784 ARM_CORE("mpcorenovfp", mpcorenovfp, 6K, FL_LDSCHED, 9e)
8785 ARM_CORE("mpcore", mpcore, 6K, FL_LDSCHED | FL_VFPV2, 9e)
8786 ARM_CORE("arm1156t2-s", arm1156t2s, 6T2, FL_LDSCHED, 9e)
8787 +
8788 +/* V7 Architecture Processors */
8789 ARM_CORE("cortex-a8", cortexa8, 7A, FL_LDSCHED, 9e)
8790 +ARM_CORE("cortex-a9", cortexa9, 7A, FL_LDSCHED, 9e)
8791 ARM_CORE("cortex-r4", cortexr4, 7R, FL_LDSCHED, 9e)
8792 +ARM_CORE("cortex-r4f", cortexr4f, 7R, FL_LDSCHED, 9e)
8793 ARM_CORE("cortex-m3", cortexm3, 7M, FL_LDSCHED, 9e)
8794 +ARM_CORE("cortex-m1", cortexm1, 6M, FL_LDSCHED, 9e)
8795 +ARM_CORE("cortex-m0", cortexm0, 6M, FL_LDSCHED, 9e)
8796 --- a/gcc/config/arm/arm-modes.def
8797 +++ b/gcc/config/arm/arm-modes.def
8798 @@ -25,6 +25,11 @@
8799 FIXME What format is this? */
8800 FLOAT_MODE (XF, 12, 0);
8801
8802 +/* Half-precision floating point */
8803 +FLOAT_MODE (HF, 2, 0);
8804 +ADJUST_FLOAT_FORMAT (HF, ((arm_fp16_format == ARM_FP16_FORMAT_ALTERNATIVE)
8805 + ? &arm_half_format : &ieee_half_format));
8806 +
8807 /* CCFPEmode should be used with floating inequalities,
8808 CCFPmode should be used with floating equalities.
8809 CC_NOOVmode should be used with SImode integer equalities.
8810 @@ -62,6 +67,4 @@ VECTOR_MODES (FLOAT, 16); /* V
8811 INT_MODE (EI, 24);
8812 INT_MODE (OI, 32);
8813 INT_MODE (CI, 48);
8814 -/* ??? This should actually have 512 bits but the precision only has 9
8815 - bits. */
8816 -FRACTIONAL_INT_MODE (XI, 511, 64);
8817 +INT_MODE (XI, 64);
8818 --- a/gcc/config/arm/arm-protos.h
8819 +++ b/gcc/config/arm/arm-protos.h
8820 @@ -24,6 +24,7 @@
8821 #define GCC_ARM_PROTOS_H
8822
8823 extern void arm_override_options (void);
8824 +extern void arm_optimization_options (int, int);
8825 extern int use_return_insn (int, rtx);
8826 extern int arm_regno_class (int);
8827 extern void arm_load_pic_register (unsigned long);
8828 @@ -42,9 +43,6 @@ extern unsigned int arm_dbx_register_num
8829 extern void arm_output_fn_unwind (FILE *, bool);
8830
8831
8832 -#ifdef TREE_CODE
8833 -extern int arm_return_in_memory (const_tree);
8834 -#endif
8835 #ifdef RTX_CODE
8836 extern bool arm_vector_mode_supported_p (enum machine_mode);
8837 extern int arm_hard_regno_mode_ok (unsigned int, enum machine_mode);
8838 @@ -90,7 +88,7 @@ extern bool arm_cannot_force_const_mem (
8839
8840 extern int cirrus_memory_offset (rtx);
8841 extern int arm_coproc_mem_operand (rtx, bool);
8842 -extern int neon_vector_mem_operand (rtx, bool);
8843 +extern int neon_vector_mem_operand (rtx, int);
8844 extern int neon_struct_mem_operand (rtx);
8845 extern int arm_no_early_store_addr_dep (rtx, rtx);
8846 extern int arm_no_early_alu_shift_dep (rtx, rtx);
8847 @@ -125,6 +123,7 @@ extern const char *fp_immediate_constant
8848 extern void arm_emit_call_insn (rtx, rtx);
8849 extern const char *output_call (rtx *);
8850 extern const char *output_call_mem (rtx *);
8851 +void arm_emit_movpair (rtx, rtx);
8852 extern const char *output_mov_long_double_fpa_from_arm (rtx *);
8853 extern const char *output_mov_long_double_arm_from_fpa (rtx *);
8854 extern const char *output_mov_long_double_arm_from_arm (rtx *);
8855 @@ -145,6 +144,7 @@ extern void arm_final_prescan_insn (rtx)
8856 extern int arm_debugger_arg_offset (int, rtx);
8857 extern bool arm_is_long_call_p (tree);
8858 extern int arm_emit_vector_const (FILE *, rtx);
8859 +extern void arm_emit_fp16_const (rtx c);
8860 extern const char * arm_output_load_gr (rtx *);
8861 extern const char *vfp_output_fstmd (rtx *);
8862 extern void arm_set_return_address (rtx, rtx);
8863 @@ -155,13 +155,15 @@ extern bool arm_output_addr_const_extra
8864
8865 #if defined TREE_CODE
8866 extern rtx arm_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
8867 +extern void arm_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
8868 + tree, bool);
8869 extern void arm_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree);
8870 extern bool arm_pad_arg_upward (enum machine_mode, const_tree);
8871 extern bool arm_pad_reg_upward (enum machine_mode, tree, int);
8872 extern bool arm_needs_doubleword_align (enum machine_mode, tree);
8873 -extern rtx arm_function_value(const_tree, const_tree);
8874 #endif
8875 extern int arm_apply_result_size (void);
8876 +extern rtx aapcs_libcall_value (enum machine_mode);
8877
8878 #endif /* RTX_CODE */
8879
8880 @@ -208,6 +210,7 @@ extern void arm_pr_no_long_calls (struct
8881 extern void arm_pr_long_calls_off (struct cpp_reader *);
8882
8883 extern void arm_lang_object_attributes_init(void);
8884 +extern void arm_adjust_reg_alloc_order (int *);
8885
8886 extern const char *arm_mangle_type (const_tree);
8887
8888 --- a/gcc/config/arm/arm-tune.md
8889 +++ b/gcc/config/arm/arm-tune.md
8890 @@ -1,5 +1,5 @@
8891 ;; -*- buffer-read-only: t -*-
8892 ;; Generated automatically by gentune.sh from arm-cores.def
8893 (define_attr "tune"
8894 - "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore,arm1156t2s,cortexa8,cortexr4,cortexm3"
8895 + "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,iwmmxt2,marvell_f,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore,arm1156t2s,cortexa8,cortexa9,cortexr4,cortexr4f,cortexm3,cortexm1,cortexm0"
8896 (const (symbol_ref "arm_tune")))
8897 --- a/gcc/config/arm/arm.c
8898 +++ b/gcc/config/arm/arm.c
8899 @@ -1,6 +1,6 @@
8900 /* Output routines for GCC for ARM.
8901 Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
8902 - 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
8903 + 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
8904 Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
8905 and Martin Simmons (@harleqn.co.uk).
8906 More major hacks by Richard Earnshaw (rearnsha@arm.com).
8907 @@ -42,6 +42,7 @@
8908 #include "optabs.h"
8909 #include "toplev.h"
8910 #include "recog.h"
8911 +#include "cgraph.h"
8912 #include "ggc.h"
8913 #include "except.h"
8914 #include "c-pragma.h"
8915 @@ -52,6 +53,7 @@
8916 #include "debug.h"
8917 #include "langhooks.h"
8918 #include "df.h"
8919 +#include "intl.h"
8920
8921 /* Forward definitions of types. */
8922 typedef struct minipool_node Mnode;
8923 @@ -62,6 +64,7 @@ const struct attribute_spec arm_attribut
8924 void (*arm_lang_output_object_attributes_hook)(void);
8925
8926 /* Forward function declarations. */
8927 +static int arm_compute_static_chain_stack_bytes (void);
8928 static arm_stack_offsets *arm_get_frame_offsets (void);
8929 static void arm_add_gc_roots (void);
8930 static int arm_gen_constant (enum rtx_code, enum machine_mode, rtx,
8931 @@ -74,7 +77,6 @@ static int thumb1_base_register_rtx_p (r
8932 inline static int thumb1_index_register_rtx_p (rtx, int);
8933 static int thumb_far_jump_used_p (void);
8934 static bool thumb_force_lr_save (void);
8935 -static unsigned long thumb1_compute_save_reg_mask (void);
8936 static int const_ok_for_op (HOST_WIDE_INT, enum rtx_code);
8937 static rtx emit_sfm (int, int);
8938 static unsigned arm_size_return_regs (void);
8939 @@ -109,6 +111,7 @@ static unsigned long arm_compute_save_re
8940 static unsigned long arm_isr_value (tree);
8941 static unsigned long arm_compute_func_type (void);
8942 static tree arm_handle_fndecl_attribute (tree *, tree, tree, int, bool *);
8943 +static tree arm_handle_pcs_attribute (tree *, tree, tree, int, bool *);
8944 static tree arm_handle_isr_attribute (tree *, tree, tree, int, bool *);
8945 #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
8946 static tree arm_handle_notshared_attribute (tree *, tree, tree, int, bool *);
8947 @@ -122,15 +125,20 @@ static int arm_adjust_cost (rtx, rtx, rt
8948 static int count_insns_for_constant (HOST_WIDE_INT, int);
8949 static int arm_get_strip_length (int);
8950 static bool arm_function_ok_for_sibcall (tree, tree);
8951 +static bool arm_return_in_memory (const_tree, const_tree);
8952 +static rtx arm_function_value (const_tree, const_tree, bool);
8953 +static rtx arm_libcall_value (enum machine_mode, rtx);
8954 +
8955 static void arm_internal_label (FILE *, const char *, unsigned long);
8956 static void arm_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT,
8957 tree);
8958 -static int arm_rtx_costs_1 (rtx, enum rtx_code, enum rtx_code);
8959 +static bool arm_rtx_costs_1 (rtx, enum rtx_code, int*);
8960 static bool arm_size_rtx_costs (rtx, int, int, int *);
8961 -static bool arm_slowmul_rtx_costs (rtx, int, int, int *);
8962 -static bool arm_fastmul_rtx_costs (rtx, int, int, int *);
8963 -static bool arm_xscale_rtx_costs (rtx, int, int, int *);
8964 -static bool arm_9e_rtx_costs (rtx, int, int, int *);
8965 +static bool arm_slowmul_rtx_costs (rtx, enum rtx_code, enum rtx_code, int *);
8966 +static bool arm_fastmul_rtx_costs (rtx, enum rtx_code, enum rtx_code, int *);
8967 +static bool arm_xscale_rtx_costs (rtx, enum rtx_code, enum rtx_code, int *);
8968 +static bool arm_9e_rtx_costs (rtx, enum rtx_code, enum rtx_code, int *);
8969 +static bool arm_rtx_costs (rtx, int, int, int *);
8970 static int arm_address_cost (rtx);
8971 static bool arm_memory_load_p (rtx);
8972 static bool arm_cirrus_insn_p (rtx);
8973 @@ -146,6 +154,9 @@ static void emit_constant_insn (rtx cond
8974 static rtx emit_set_insn (rtx, rtx);
8975 static int arm_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
8976 tree, bool);
8977 +static rtx aapcs_allocate_return_reg (enum machine_mode, const_tree,
8978 + const_tree);
8979 +static int aapcs_select_return_coproc (const_tree, const_tree);
8980
8981 #ifdef OBJECT_FORMAT_ELF
8982 static void arm_elf_asm_constructor (rtx, int) ATTRIBUTE_UNUSED;
8983 @@ -167,11 +178,13 @@ static bool arm_default_short_enums (voi
8984 static bool arm_align_anon_bitfield (void);
8985 static bool arm_return_in_msb (const_tree);
8986 static bool arm_must_pass_in_stack (enum machine_mode, const_tree);
8987 +static bool arm_return_in_memory (const_tree, const_tree);
8988 #ifdef TARGET_UNWIND_INFO
8989 static void arm_unwind_emit (FILE *, rtx);
8990 static bool arm_output_ttype (rtx);
8991 #endif
8992 static void arm_dwarf_handle_frame_unspec (const char *, rtx, int);
8993 +static rtx arm_dwarf_register_span(rtx);
8994
8995 static tree arm_cxx_guard_type (void);
8996 static bool arm_cxx_guard_mask_bit (void);
8997 @@ -183,12 +196,22 @@ static void arm_cxx_determine_class_data
8998 static bool arm_cxx_class_data_always_comdat (void);
8999 static bool arm_cxx_use_aeabi_atexit (void);
9000 static void arm_init_libfuncs (void);
9001 +static tree arm_build_builtin_va_list (void);
9002 +static void arm_expand_builtin_va_start (tree, rtx);
9003 +static tree arm_gimplify_va_arg_expr (tree, tree, tree *, tree *);
9004 static bool arm_handle_option (size_t, const char *, int);
9005 static void arm_target_help (void);
9006 static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode);
9007 static bool arm_cannot_copy_insn_p (rtx);
9008 static bool arm_tls_symbol_p (rtx x);
9009 static void arm_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED;
9010 +static bool arm_allocate_stack_slots_for_args (void);
9011 +static int arm_issue_rate (void);
9012 +static int arm_multipass_dfa_lookahead (void);
9013 +static const char *arm_invalid_parameter_type (const_tree t);
9014 +static const char *arm_invalid_return_type (const_tree t);
9015 +static tree arm_promoted_type (const_tree t);
9016 +static tree arm_convert_to_type (tree type, tree expr);
9017
9018 \f
9019 /* Initialize the GCC target structure. */
9020 @@ -248,14 +271,19 @@ static void arm_output_dwarf_dtprel (FIL
9021 #undef TARGET_FUNCTION_OK_FOR_SIBCALL
9022 #define TARGET_FUNCTION_OK_FOR_SIBCALL arm_function_ok_for_sibcall
9023
9024 +#undef TARGET_FUNCTION_VALUE
9025 +#define TARGET_FUNCTION_VALUE arm_function_value
9026 +
9027 +#undef TARGET_LIBCALL_VALUE
9028 +#define TARGET_LIBCALL_VALUE arm_libcall_value
9029 +
9030 #undef TARGET_ASM_OUTPUT_MI_THUNK
9031 #define TARGET_ASM_OUTPUT_MI_THUNK arm_output_mi_thunk
9032 #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
9033 #define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall
9034
9035 -/* This will be overridden in arm_override_options. */
9036 #undef TARGET_RTX_COSTS
9037 -#define TARGET_RTX_COSTS arm_slowmul_rtx_costs
9038 +#define TARGET_RTX_COSTS arm_rtx_costs
9039 #undef TARGET_ADDRESS_COST
9040 #define TARGET_ADDRESS_COST arm_address_cost
9041
9042 @@ -289,6 +317,9 @@ static void arm_output_dwarf_dtprel (FIL
9043 #undef TARGET_SETUP_INCOMING_VARARGS
9044 #define TARGET_SETUP_INCOMING_VARARGS arm_setup_incoming_varargs
9045
9046 +#undef TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS
9047 +#define TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS arm_allocate_stack_slots_for_args
9048 +
9049 #undef TARGET_DEFAULT_SHORT_ENUMS
9050 #define TARGET_DEFAULT_SHORT_ENUMS arm_default_short_enums
9051
9052 @@ -329,6 +360,9 @@ static void arm_output_dwarf_dtprel (FIL
9053 #undef TARGET_RETURN_IN_MSB
9054 #define TARGET_RETURN_IN_MSB arm_return_in_msb
9055
9056 +#undef TARGET_RETURN_IN_MEMORY
9057 +#define TARGET_RETURN_IN_MEMORY arm_return_in_memory
9058 +
9059 #undef TARGET_MUST_PASS_IN_STACK
9060 #define TARGET_MUST_PASS_IN_STACK arm_must_pass_in_stack
9061
9062 @@ -347,6 +381,9 @@ static void arm_output_dwarf_dtprel (FIL
9063 #undef TARGET_DWARF_HANDLE_FRAME_UNSPEC
9064 #define TARGET_DWARF_HANDLE_FRAME_UNSPEC arm_dwarf_handle_frame_unspec
9065
9066 +#undef TARGET_DWARF_REGISTER_SPAN
9067 +#define TARGET_DWARF_REGISTER_SPAN arm_dwarf_register_span
9068 +
9069 #undef TARGET_CANNOT_COPY_INSN_P
9070 #define TARGET_CANNOT_COPY_INSN_P arm_cannot_copy_insn_p
9071
9072 @@ -355,17 +392,54 @@ static void arm_output_dwarf_dtprel (FIL
9073 #define TARGET_HAVE_TLS true
9074 #endif
9075
9076 +#undef TARGET_ADJUST_REG_ALLOC_ORDER
9077 +#define TARGET_ADJUST_REG_ALLOC_ORDER arm_adjust_reg_alloc_order
9078 +
9079 #undef TARGET_CANNOT_FORCE_CONST_MEM
9080 #define TARGET_CANNOT_FORCE_CONST_MEM arm_cannot_force_const_mem
9081
9082 #undef TARGET_MANGLE_TYPE
9083 #define TARGET_MANGLE_TYPE arm_mangle_type
9084
9085 +#undef TARGET_BUILD_BUILTIN_VA_LIST
9086 +#define TARGET_BUILD_BUILTIN_VA_LIST arm_build_builtin_va_list
9087 +#undef TARGET_EXPAND_BUILTIN_VA_START
9088 +#define TARGET_EXPAND_BUILTIN_VA_START arm_expand_builtin_va_start
9089 +#undef TARGET_GIMPLIFY_VA_ARG_EXPR
9090 +#define TARGET_GIMPLIFY_VA_ARG_EXPR arm_gimplify_va_arg_expr
9091 +
9092 #ifdef HAVE_AS_TLS
9093 #undef TARGET_ASM_OUTPUT_DWARF_DTPREL
9094 #define TARGET_ASM_OUTPUT_DWARF_DTPREL arm_output_dwarf_dtprel
9095 #endif
9096
9097 +#undef TARGET_MAX_ANCHOR_OFFSET
9098 +#define TARGET_MAX_ANCHOR_OFFSET 4095
9099 +
9100 +/* The minimum is set such that the total size of the block
9101 + for a particular anchor is -4088 + 1 + 4095 bytes, which is
9102 + divisible by eight, ensuring natural spacing of anchors. */
9103 +#undef TARGET_MIN_ANCHOR_OFFSET
9104 +#define TARGET_MIN_ANCHOR_OFFSET -4088
9105 +
9106 +#undef TARGET_SCHED_ISSUE_RATE
9107 +#define TARGET_SCHED_ISSUE_RATE arm_issue_rate
9108 +
9109 +#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
9110 +#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD arm_multipass_dfa_lookahead
9111 +
9112 +#undef TARGET_INVALID_PARAMETER_TYPE
9113 +#define TARGET_INVALID_PARAMETER_TYPE arm_invalid_parameter_type
9114 +
9115 +#undef TARGET_INVALID_RETURN_TYPE
9116 +#define TARGET_INVALID_RETURN_TYPE arm_invalid_return_type
9117 +
9118 +#undef TARGET_PROMOTED_TYPE
9119 +#define TARGET_PROMOTED_TYPE arm_promoted_type
9120 +
9121 +#undef TARGET_CONVERT_TO_TYPE
9122 +#define TARGET_CONVERT_TO_TYPE arm_convert_to_type
9123 +
9124 struct gcc_target targetm = TARGET_INITIALIZER;
9125 \f
9126 /* Obstack for minipool constant handling. */
9127 @@ -403,6 +477,9 @@ enum fputype arm_fpu_tune;
9128 /* Whether to use floating point hardware. */
9129 enum float_abi_type arm_float_abi;
9130
9131 +/* Which __fp16 format to use. */
9132 +enum arm_fp16_format_type arm_fp16_format;
9133 +
9134 /* Which ABI to use. */
9135 enum arm_abi_type arm_abi;
9136
9137 @@ -441,9 +518,18 @@ static int thumb_call_reg_needed;
9138 #define FL_DIV (1 << 18) /* Hardware divide. */
9139 #define FL_VFPV3 (1 << 19) /* Vector Floating Point V3. */
9140 #define FL_NEON (1 << 20) /* Neon instructions. */
9141 +#define FL_MARVELL_F (1 << 21) /* Marvell Feroceon. */
9142
9143 #define FL_IWMMXT (1 << 29) /* XScale v2 or "Intel Wireless MMX technology". */
9144
9145 +/* Some flags are ignored when comparing -mcpu and -march:
9146 + FL_MARVELL_F so that -mcpu=marvell-f -march=v5te works.
9147 + FL_LDSCHED and FL_WBUF only effect tuning,
9148 + FL_CO_PROC, FL_VFPV2, FL_VFPV3 and FL_NEON because FP
9149 + coprocessors are handled separately. */
9150 +#define FL_COMPAT (FL_MARVELL_F | FL_LDSCHED | FL_WBUF | FL_CO_PROC | \
9151 + FL_VFPV2 | FL_VFPV3 | FL_NEON)
9152 +
9153 #define FL_FOR_ARCH2 FL_NOTM
9154 #define FL_FOR_ARCH3 (FL_FOR_ARCH2 | FL_MODE32)
9155 #define FL_FOR_ARCH3M (FL_FOR_ARCH3 | FL_ARCH3M)
9156 @@ -460,6 +546,7 @@ static int thumb_call_reg_needed;
9157 #define FL_FOR_ARCH6Z FL_FOR_ARCH6
9158 #define FL_FOR_ARCH6ZK FL_FOR_ARCH6K
9159 #define FL_FOR_ARCH6T2 (FL_FOR_ARCH6 | FL_THUMB2)
9160 +#define FL_FOR_ARCH6M (FL_FOR_ARCH6 & ~FL_NOTM)
9161 #define FL_FOR_ARCH7 (FL_FOR_ARCH6T2 &~ FL_NOTM)
9162 #define FL_FOR_ARCH7A (FL_FOR_ARCH7 | FL_NOTM)
9163 #define FL_FOR_ARCH7R (FL_FOR_ARCH7A | FL_DIV)
9164 @@ -518,13 +605,22 @@ int arm_arch_xscale = 0;
9165 /* Nonzero if tuning for XScale */
9166 int arm_tune_xscale = 0;
9167
9168 +/* Nonzero if tuning for Marvell Feroceon. */
9169 +int arm_tune_marvell_f = 0;
9170 +
9171 /* Nonzero if we want to tune for stores that access the write-buffer.
9172 This typically means an ARM6 or ARM7 with MMU or MPU. */
9173 int arm_tune_wbuf = 0;
9174
9175 +/* Nonzero if tuning for Cortex-A9. */
9176 +int arm_tune_cortex_a9 = 0;
9177 +
9178 /* Nonzero if generating Thumb instructions. */
9179 int thumb_code = 0;
9180
9181 +/* Nonzero if generating code for Janus2. */
9182 +int janus2_code = 0;
9183 +
9184 /* Nonzero if we should define __THUMB_INTERWORK__ in the
9185 preprocessor.
9186 XXX This is a bit of a hack, it's intended to help work around
9187 @@ -557,6 +653,8 @@ static int after_arm_reorg = 0;
9188 /* The maximum number of insns to be used when loading a constant. */
9189 static int arm_constant_limit = 3;
9190
9191 +static enum arm_pcs arm_pcs_default;
9192 +
9193 /* For an explanation of these variables, see final_prescan_insn below. */
9194 int arm_ccfsm_state;
9195 /* arm_current_cc is also used for Thumb-2 cond_exec blocks. */
9196 @@ -593,7 +691,7 @@ struct processors
9197 enum processor_type core;
9198 const char *arch;
9199 const unsigned long flags;
9200 - bool (* rtx_costs) (rtx, int, int, int *);
9201 + bool (* rtx_costs) (rtx, enum rtx_code, enum rtx_code, int *);
9202 };
9203
9204 /* Not all of these give usefully different compilation alternatives,
9205 @@ -632,12 +730,14 @@ static const struct processors all_archi
9206 {"armv6z", arm1176jzs, "6Z", FL_CO_PROC | FL_FOR_ARCH6Z, NULL},
9207 {"armv6zk", arm1176jzs, "6ZK", FL_CO_PROC | FL_FOR_ARCH6ZK, NULL},
9208 {"armv6t2", arm1156t2s, "6T2", FL_CO_PROC | FL_FOR_ARCH6T2, NULL},
9209 + {"armv6-m", cortexm1, "6M", FL_FOR_ARCH6M, NULL},
9210 {"armv7", cortexa8, "7", FL_CO_PROC | FL_FOR_ARCH7, NULL},
9211 {"armv7-a", cortexa8, "7A", FL_CO_PROC | FL_FOR_ARCH7A, NULL},
9212 {"armv7-r", cortexr4, "7R", FL_CO_PROC | FL_FOR_ARCH7R, NULL},
9213 {"armv7-m", cortexm3, "7M", FL_CO_PROC | FL_FOR_ARCH7M, NULL},
9214 {"ep9312", ep9312, "4T", FL_LDSCHED | FL_CIRRUS | FL_FOR_ARCH4, NULL},
9215 {"iwmmxt", iwmmxt, "5TE", FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT , NULL},
9216 + {"iwmmxt2", iwmmxt2, "5TE", FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT , NULL},
9217 {NULL, arm_none, NULL, 0 , NULL}
9218 };
9219
9220 @@ -667,7 +767,8 @@ static struct arm_cpu_select arm_select[
9221
9222 /* The name of the preprocessor macro to define for this architecture. */
9223
9224 -char arm_arch_name[] = "__ARM_ARCH_0UNK__";
9225 +#define ARM_ARCH_NAME_SIZE 25
9226 +char arm_arch_name[ARM_ARCH_NAME_SIZE] = "__ARM_ARCH_0UNK__";
9227
9228 struct fpu_desc
9229 {
9230 @@ -680,13 +781,16 @@ struct fpu_desc
9231
9232 static const struct fpu_desc all_fpus[] =
9233 {
9234 - {"fpa", FPUTYPE_FPA},
9235 - {"fpe2", FPUTYPE_FPA_EMU2},
9236 - {"fpe3", FPUTYPE_FPA_EMU2},
9237 - {"maverick", FPUTYPE_MAVERICK},
9238 - {"vfp", FPUTYPE_VFP},
9239 - {"vfp3", FPUTYPE_VFP3},
9240 - {"neon", FPUTYPE_NEON}
9241 + {"fpa", FPUTYPE_FPA},
9242 + {"fpe2", FPUTYPE_FPA_EMU2},
9243 + {"fpe3", FPUTYPE_FPA_EMU2},
9244 + {"maverick", FPUTYPE_MAVERICK},
9245 + {"vfp", FPUTYPE_VFP},
9246 + {"vfp3", FPUTYPE_VFP3},
9247 + {"vfpv3", FPUTYPE_VFP3},
9248 + {"vfpv3-d16", FPUTYPE_VFP3D16},
9249 + {"neon", FPUTYPE_NEON},
9250 + {"neon-fp16", FPUTYPE_NEON_FP16}
9251 };
9252
9253
9254 @@ -702,8 +806,10 @@ static const enum fputype fp_model_for_f
9255 ARM_FP_MODEL_FPA, /* FPUTYPE_FPA_EMU3 */
9256 ARM_FP_MODEL_MAVERICK, /* FPUTYPE_MAVERICK */
9257 ARM_FP_MODEL_VFP, /* FPUTYPE_VFP */
9258 + ARM_FP_MODEL_VFP, /* FPUTYPE_VFP3D16 */
9259 ARM_FP_MODEL_VFP, /* FPUTYPE_VFP3 */
9260 - ARM_FP_MODEL_VFP /* FPUTYPE_NEON */
9261 + ARM_FP_MODEL_VFP, /* FPUTYPE_NEON */
9262 + ARM_FP_MODEL_VFP /* FPUTYPE_NEON_FP16 */
9263 };
9264
9265
9266 @@ -724,6 +830,23 @@ static const struct float_abi all_float_
9267 };
9268
9269
9270 +struct fp16_format
9271 +{
9272 + const char *name;
9273 + enum arm_fp16_format_type fp16_format_type;
9274 +};
9275 +
9276 +
9277 +/* Available values for -mfp16-format=. */
9278 +
9279 +static const struct fp16_format all_fp16_formats[] =
9280 +{
9281 + {"none", ARM_FP16_FORMAT_NONE},
9282 + {"ieee", ARM_FP16_FORMAT_IEEE},
9283 + {"alternative", ARM_FP16_FORMAT_ALTERNATIVE}
9284 +};
9285 +
9286 +
9287 struct abi_name
9288 {
9289 const char *name;
9290 @@ -881,6 +1004,131 @@ arm_init_libfuncs (void)
9291 set_optab_libfunc (umod_optab, DImode, NULL);
9292 set_optab_libfunc (smod_optab, SImode, NULL);
9293 set_optab_libfunc (umod_optab, SImode, NULL);
9294 +
9295 + /* Half-precision float operations. The compiler handles all operations
9296 + with NULL libfuncs by converting the SFmode. */
9297 + switch (arm_fp16_format)
9298 + {
9299 + case ARM_FP16_FORMAT_IEEE:
9300 + case ARM_FP16_FORMAT_ALTERNATIVE:
9301 +
9302 + /* Conversions. */
9303 + set_conv_libfunc (trunc_optab, HFmode, SFmode,
9304 + (arm_fp16_format == ARM_FP16_FORMAT_IEEE
9305 + ? "__gnu_f2h_ieee"
9306 + : "__gnu_f2h_alternative"));
9307 + set_conv_libfunc (sext_optab, SFmode, HFmode,
9308 + (arm_fp16_format == ARM_FP16_FORMAT_IEEE
9309 + ? "__gnu_h2f_ieee"
9310 + : "__gnu_h2f_alternative"));
9311 +
9312 + /* Arithmetic. */
9313 + set_optab_libfunc (add_optab, HFmode, NULL);
9314 + set_optab_libfunc (sdiv_optab, HFmode, NULL);
9315 + set_optab_libfunc (smul_optab, HFmode, NULL);
9316 + set_optab_libfunc (neg_optab, HFmode, NULL);
9317 + set_optab_libfunc (sub_optab, HFmode, NULL);
9318 +
9319 + /* Comparisons. */
9320 + set_optab_libfunc (eq_optab, HFmode, NULL);
9321 + set_optab_libfunc (ne_optab, HFmode, NULL);
9322 + set_optab_libfunc (lt_optab, HFmode, NULL);
9323 + set_optab_libfunc (le_optab, HFmode, NULL);
9324 + set_optab_libfunc (ge_optab, HFmode, NULL);
9325 + set_optab_libfunc (gt_optab, HFmode, NULL);
9326 + set_optab_libfunc (unord_optab, HFmode, NULL);
9327 + break;
9328 +
9329 + default:
9330 + break;
9331 + }
9332 +}
9333 +
9334 +/* On AAPCS systems, this is the "struct __va_list". */
9335 +static GTY(()) tree va_list_type;
9336 +
9337 +/* Return the type to use as __builtin_va_list. */
9338 +static tree
9339 +arm_build_builtin_va_list (void)
9340 +{
9341 + tree va_list_name;
9342 + tree ap_field;
9343 +
9344 + if (!TARGET_AAPCS_BASED)
9345 + return std_build_builtin_va_list ();
9346 +
9347 + /* AAPCS \S 7.1.4 requires that va_list be a typedef for a type
9348 + defined as:
9349 +
9350 + struct __va_list
9351 + {
9352 + void *__ap;
9353 + };
9354 +
9355 + The C Library ABI further reinforces this definition in \S
9356 + 4.1.
9357 +
9358 + We must follow this definition exactly. The structure tag
9359 + name is visible in C++ mangled names, and thus forms a part
9360 + of the ABI. The field name may be used by people who
9361 + #include <stdarg.h>. */
9362 + /* Create the type. */
9363 + va_list_type = lang_hooks.types.make_type (RECORD_TYPE);
9364 + /* Give it the required name. */
9365 + va_list_name = build_decl (TYPE_DECL,
9366 + get_identifier ("__va_list"),
9367 + va_list_type);
9368 + DECL_ARTIFICIAL (va_list_name) = 1;
9369 + TYPE_NAME (va_list_type) = va_list_name;
9370 + /* Create the __ap field. */
9371 + ap_field = build_decl (FIELD_DECL,
9372 + get_identifier ("__ap"),
9373 + ptr_type_node);
9374 + DECL_ARTIFICIAL (ap_field) = 1;
9375 + DECL_FIELD_CONTEXT (ap_field) = va_list_type;
9376 + TYPE_FIELDS (va_list_type) = ap_field;
9377 + /* Compute its layout. */
9378 + layout_type (va_list_type);
9379 +
9380 + return va_list_type;
9381 +}
9382 +
9383 +/* Return an expression of type "void *" pointing to the next
9384 + available argument in a variable-argument list. VALIST is the
9385 + user-level va_list object, of type __builtin_va_list. */
9386 +static tree
9387 +arm_extract_valist_ptr (tree valist)
9388 +{
9389 + if (TREE_TYPE (valist) == error_mark_node)
9390 + return error_mark_node;
9391 +
9392 + /* On an AAPCS target, the pointer is stored within "struct
9393 + va_list". */
9394 + if (TARGET_AAPCS_BASED)
9395 + {
9396 + tree ap_field = TYPE_FIELDS (TREE_TYPE (valist));
9397 + valist = build3 (COMPONENT_REF, TREE_TYPE (ap_field),
9398 + valist, ap_field, NULL_TREE);
9399 + }
9400 +
9401 + return valist;
9402 +}
9403 +
9404 +/* Implement TARGET_EXPAND_BUILTIN_VA_START. */
9405 +static void
9406 +arm_expand_builtin_va_start (tree valist, rtx nextarg)
9407 +{
9408 + valist = arm_extract_valist_ptr (valist);
9409 + std_expand_builtin_va_start (valist, nextarg);
9410 +}
9411 +
9412 +/* Implement TARGET_GIMPLIFY_VA_ARG_EXPR. */
9413 +static tree
9414 +arm_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
9415 + tree *post_p)
9416 +{
9417 + valist = arm_extract_valist_ptr (valist);
9418 + return std_gimplify_va_arg_expr (valist, type, pre_p, post_p);
9419 }
9420
9421 /* Implement TARGET_HANDLE_OPTION. */
9422 @@ -1007,7 +1255,9 @@ void
9423 arm_override_options (void)
9424 {
9425 unsigned i;
9426 + int len;
9427 enum processor_type target_arch_cpu = arm_none;
9428 + enum processor_type selected_cpu = arm_none;
9429
9430 /* Set up the flags based on the cpu/architecture selected by the user. */
9431 for (i = ARRAY_SIZE (arm_select); i--;)
9432 @@ -1023,7 +1273,11 @@ arm_override_options (void)
9433 {
9434 /* Set the architecture define. */
9435 if (i != ARM_OPT_SET_TUNE)
9436 - sprintf (arm_arch_name, "__ARM_ARCH_%s__", sel->arch);
9437 + {
9438 + len = snprintf (arm_arch_name, ARM_ARCH_NAME_SIZE,
9439 + "__ARM_ARCH_%s__", sel->arch);
9440 + gcc_assert (len < ARM_ARCH_NAME_SIZE);
9441 + }
9442
9443 /* Determine the processor core for which we should
9444 tune code-generation. */
9445 @@ -1040,14 +1294,17 @@ arm_override_options (void)
9446 if (i == ARM_OPT_SET_ARCH)
9447 target_arch_cpu = sel->core;
9448
9449 + if (i == ARM_OPT_SET_CPU)
9450 + selected_cpu = (enum processor_type) (sel - ptr->processors);
9451 +
9452 if (i != ARM_OPT_SET_TUNE)
9453 {
9454 /* If we have been given an architecture and a processor
9455 make sure that they are compatible. We only generate
9456 a warning though, and we prefer the CPU over the
9457 architecture. */
9458 - if (insn_flags != 0 && (insn_flags ^ sel->flags))
9459 - warning (0, "switch -mcpu=%s conflicts with -march= switch",
9460 + if (insn_flags != 0 && ((insn_flags ^ sel->flags) & ~FL_COMPAT))
9461 + warning (0, "switch -mcpu=%s conflicts with -march= switch, assuming CPU feature set",
9462 ptr->string);
9463
9464 insn_flags = sel->flags;
9465 @@ -1070,21 +1327,20 @@ arm_override_options (void)
9466 {
9467 const struct processors * sel;
9468 unsigned int sought;
9469 - enum processor_type cpu;
9470
9471 - cpu = TARGET_CPU_DEFAULT;
9472 - if (cpu == arm_none)
9473 + selected_cpu = TARGET_CPU_DEFAULT;
9474 + if (selected_cpu == arm_none)
9475 {
9476 #ifdef SUBTARGET_CPU_DEFAULT
9477 /* Use the subtarget default CPU if none was specified by
9478 configure. */
9479 - cpu = SUBTARGET_CPU_DEFAULT;
9480 + selected_cpu = SUBTARGET_CPU_DEFAULT;
9481 #endif
9482 /* Default to ARM6. */
9483 - if (cpu == arm_none)
9484 - cpu = arm6;
9485 + if (selected_cpu == arm_none)
9486 + selected_cpu = arm6;
9487 }
9488 - sel = &all_cores[cpu];
9489 + sel = &all_cores[selected_cpu];
9490
9491 insn_flags = sel->flags;
9492
9493 @@ -1148,7 +1404,11 @@ arm_override_options (void)
9494
9495 insn_flags = sel->flags;
9496 }
9497 - sprintf (arm_arch_name, "__ARM_ARCH_%s__", sel->arch);
9498 +
9499 + len = snprintf (arm_arch_name, ARM_ARCH_NAME_SIZE,
9500 + "__ARM_ARCH_%s__", sel->arch);
9501 + gcc_assert (len < ARM_ARCH_NAME_SIZE);
9502 +
9503 arm_default_cpu = (enum processor_type) (sel - all_cores);
9504 if (arm_tune == arm_none)
9505 arm_tune = arm_default_cpu;
9506 @@ -1158,18 +1418,59 @@ arm_override_options (void)
9507 chosen. */
9508 gcc_assert (arm_tune != arm_none);
9509
9510 + if (arm_tune == cortexa8 && optimize >= 3)
9511 + {
9512 + /* These alignments were experimentally determined to improve SPECint
9513 + performance on SPECCPU 2000. */
9514 + if (align_functions <= 0)
9515 + align_functions = 16;
9516 + if (align_jumps <= 0)
9517 + align_jumps = 16;
9518 + }
9519 +
9520 tune_flags = all_cores[(int)arm_tune].flags;
9521 - if (optimize_size)
9522 - targetm.rtx_costs = arm_size_rtx_costs;
9523 +
9524 + if (target_fp16_format_name)
9525 + {
9526 + for (i = 0; i < ARRAY_SIZE (all_fp16_formats); i++)
9527 + {
9528 + if (streq (all_fp16_formats[i].name, target_fp16_format_name))
9529 + {
9530 + arm_fp16_format = all_fp16_formats[i].fp16_format_type;
9531 + break;
9532 + }
9533 + }
9534 + if (i == ARRAY_SIZE (all_fp16_formats))
9535 + error ("invalid __fp16 format option: -mfp16-format=%s",
9536 + target_fp16_format_name);
9537 + }
9538 + else
9539 + arm_fp16_format = ARM_FP16_FORMAT_NONE;
9540 +
9541 + if (target_abi_name)
9542 + {
9543 + for (i = 0; i < ARRAY_SIZE (arm_all_abis); i++)
9544 + {
9545 + if (streq (arm_all_abis[i].name, target_abi_name))
9546 + {
9547 + arm_abi = arm_all_abis[i].abi_type;
9548 + break;
9549 + }
9550 + }
9551 + if (i == ARRAY_SIZE (arm_all_abis))
9552 + error ("invalid ABI option: -mabi=%s", target_abi_name);
9553 + }
9554 else
9555 - targetm.rtx_costs = all_cores[(int)arm_tune].rtx_costs;
9556 + arm_abi = ARM_DEFAULT_ABI;
9557
9558 /* Make sure that the processor choice does not conflict with any of the
9559 other command line choices. */
9560 if (TARGET_ARM && !(insn_flags & FL_NOTM))
9561 error ("target CPU does not support ARM mode");
9562
9563 - if (TARGET_INTERWORK && !(insn_flags & FL_THUMB))
9564 + /* BPABI targets use linker tricks to allow interworking on cores
9565 + without thumb support. */
9566 + if (TARGET_INTERWORK && !((insn_flags & FL_THUMB) || TARGET_BPABI))
9567 {
9568 warning (0, "target CPU does not support interworking" );
9569 target_flags &= ~MASK_INTERWORK;
9570 @@ -1245,10 +1546,45 @@ arm_override_options (void)
9571 arm_ld_sched = (tune_flags & FL_LDSCHED) != 0;
9572 arm_tune_strongarm = (tune_flags & FL_STRONG) != 0;
9573 thumb_code = (TARGET_ARM == 0);
9574 + janus2_code = (TARGET_FIX_JANUS != 0);
9575 + if (janus2_code && TARGET_THUMB2)
9576 + error ("janus2 fix is not applicable when targeting a thumb2 core");
9577 arm_tune_wbuf = (tune_flags & FL_WBUF) != 0;
9578 arm_tune_xscale = (tune_flags & FL_XSCALE) != 0;
9579 + arm_tune_marvell_f = (tune_flags & FL_MARVELL_F) != 0;
9580 + arm_tune_cortex_a9 = (arm_tune == cortexa9) != 0;
9581 arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0;
9582 - arm_arch_hwdiv = (insn_flags & FL_DIV) != 0;
9583 +
9584 + /* Hardware integer division is supported by some variants of the ARM
9585 + architecture in Thumb-2 mode. In addition some (but not all) Marvell
9586 + CPUs support their own hardware integer division instructions.
9587 + The assembler will pick the correct encoding. */
9588 + if (TARGET_MARVELL_DIV && (insn_flags & FL_MARVELL_F) == 0)
9589 + error ("-mmarvell-div is only supported when targeting a Marvell core");
9590 +
9591 + arm_arch_hwdiv = (TARGET_ARM && TARGET_MARVELL_DIV)
9592 + || (TARGET_THUMB2 && (insn_flags & FL_DIV) != 0);
9593 +
9594 + /* If we are not using the default (ARM mode) section anchor offset
9595 + ranges, then set the correct ranges now. */
9596 + if (TARGET_THUMB1)
9597 + {
9598 + /* Thumb-1 LDR instructions cannot have negative offsets.
9599 + Permissible positive offset ranges are 5-bit (for byte loads),
9600 + 6-bit (for halfword loads), or 7-bit (for word loads).
9601 + Empirical results suggest a 7-bit anchor range gives the best
9602 + overall code size. */
9603 + targetm.min_anchor_offset = 0;
9604 + targetm.max_anchor_offset = 127;
9605 + }
9606 + else if (TARGET_THUMB2)
9607 + {
9608 + /* The minimum is set such that the total size of the block
9609 + for a particular anchor is 248 + 1 + 4095 bytes, which is
9610 + divisible by eight, ensuring natural spacing of anchors. */
9611 + targetm.min_anchor_offset = -248;
9612 + targetm.max_anchor_offset = 4095;
9613 + }
9614
9615 /* V5 code we generate is completely interworking capable, so we turn off
9616 TARGET_INTERWORK here to avoid many tests later on. */
9617 @@ -1261,22 +1597,6 @@ arm_override_options (void)
9618 if (arm_arch5)
9619 target_flags &= ~MASK_INTERWORK;
9620
9621 - if (target_abi_name)
9622 - {
9623 - for (i = 0; i < ARRAY_SIZE (arm_all_abis); i++)
9624 - {
9625 - if (streq (arm_all_abis[i].name, target_abi_name))
9626 - {
9627 - arm_abi = arm_all_abis[i].abi_type;
9628 - break;
9629 - }
9630 - }
9631 - if (i == ARRAY_SIZE (arm_all_abis))
9632 - error ("invalid ABI option: -mabi=%s", target_abi_name);
9633 - }
9634 - else
9635 - arm_abi = ARM_DEFAULT_ABI;
9636 -
9637 if (TARGET_IWMMXT && !ARM_DOUBLEWORD_ALIGN)
9638 error ("iwmmxt requires an AAPCS compatible ABI for proper operation");
9639
9640 @@ -1354,9 +1674,6 @@ arm_override_options (void)
9641 else
9642 arm_float_abi = TARGET_DEFAULT_FLOAT_ABI;
9643
9644 - if (arm_float_abi == ARM_FLOAT_ABI_HARD && TARGET_VFP)
9645 - sorry ("-mfloat-abi=hard and VFP");
9646 -
9647 /* FPA and iWMMXt are incompatible because the insn encodings overlap.
9648 VFP and iWMMXt can theoretically coexist, but it's unlikely such silicon
9649 will ever exist. GCC makes no attempt to support this combination. */
9650 @@ -1367,10 +1684,36 @@ arm_override_options (void)
9651 if (TARGET_THUMB2 && TARGET_IWMMXT)
9652 sorry ("Thumb-2 iWMMXt");
9653
9654 + /* __fp16 support currently assumes the core has ldrh. */
9655 + if (!arm_arch4 && arm_fp16_format != ARM_FP16_FORMAT_NONE)
9656 + sorry ("__fp16 and no ldrh");
9657 +
9658 /* If soft-float is specified then don't use FPU. */
9659 if (TARGET_SOFT_FLOAT)
9660 arm_fpu_arch = FPUTYPE_NONE;
9661
9662 + if (TARGET_AAPCS_BASED)
9663 + {
9664 + if (arm_abi == ARM_ABI_IWMMXT)
9665 + arm_pcs_default = ARM_PCS_AAPCS_IWMMXT;
9666 + else if (arm_float_abi == ARM_FLOAT_ABI_HARD
9667 + && TARGET_HARD_FLOAT
9668 + && TARGET_VFP)
9669 + arm_pcs_default = ARM_PCS_AAPCS_VFP;
9670 + else
9671 + arm_pcs_default = ARM_PCS_AAPCS;
9672 + }
9673 + else
9674 + {
9675 + if (arm_float_abi == ARM_FLOAT_ABI_HARD && TARGET_VFP)
9676 + sorry ("-mfloat-abi=hard and VFP");
9677 +
9678 + if (arm_abi == ARM_ABI_APCS)
9679 + arm_pcs_default = ARM_PCS_APCS;
9680 + else
9681 + arm_pcs_default = ARM_PCS_ATPCS;
9682 + }
9683 +
9684 /* For arm2/3 there is no need to do any scheduling if there is only
9685 a floating point emulator, or we are doing software floating-point. */
9686 if ((TARGET_SOFT_FLOAT
9687 @@ -1456,6 +1799,15 @@ arm_override_options (void)
9688 arm_pic_register = pic_register;
9689 }
9690
9691 + /* Enable -mfix-cortex-m3-ldrd by default for Cortex-M3 cores. */
9692 + if (fix_cm3_ldrd == 2)
9693 + {
9694 + if (selected_cpu == cortexm3)
9695 + fix_cm3_ldrd = 1;
9696 + else
9697 + fix_cm3_ldrd = 0;
9698 + }
9699 +
9700 /* ??? We might want scheduling for thumb2. */
9701 if (TARGET_THUMB && flag_schedule_insns)
9702 {
9703 @@ -1493,6 +1845,13 @@ arm_override_options (void)
9704
9705 /* Register global variables with the garbage collector. */
9706 arm_add_gc_roots ();
9707 +
9708 + if (low_irq_latency && TARGET_THUMB)
9709 + {
9710 + warning (0,
9711 + "-low-irq-latency has no effect when compiling for the Thumb");
9712 + low_irq_latency = 0;
9713 + }
9714 }
9715
9716 static void
9717 @@ -1614,6 +1973,14 @@ arm_current_func_type (void)
9718
9719 return cfun->machine->func_type;
9720 }
9721 +
9722 +bool
9723 +arm_allocate_stack_slots_for_args (void)
9724 +{
9725 + /* Naked functions should not allocate stack slots for arguments. */
9726 + return !IS_NAKED (arm_current_func_type ());
9727 +}
9728 +
9729 \f
9730 /* Return 1 if it is possible to return using a single instruction.
9731 If SIBLING is non-null, this is a test for a return before a sibling
9732 @@ -1656,10 +2023,11 @@ use_return_insn (int iscond, rtx sibling
9733 || current_function_calls_alloca
9734 /* Or if there is a stack adjustment. However, if the stack pointer
9735 is saved on the stack, we can use a pre-incrementing stack load. */
9736 - || !(stack_adjust == 0 || (frame_pointer_needed && stack_adjust == 4)))
9737 + || !(stack_adjust == 0 || (TARGET_APCS_FRAME && frame_pointer_needed
9738 + && stack_adjust == 4)))
9739 return 0;
9740
9741 - saved_int_regs = arm_compute_save_reg_mask ();
9742 + saved_int_regs = offsets->saved_regs_mask;
9743
9744 /* Unfortunately, the insn
9745
9746 @@ -1812,6 +2180,24 @@ const_ok_for_op (HOST_WIDE_INT i, enum r
9747 switch (code)
9748 {
9749 case PLUS:
9750 + case COMPARE:
9751 + case EQ:
9752 + case NE:
9753 + case GT:
9754 + case LE:
9755 + case LT:
9756 + case GE:
9757 + case GEU:
9758 + case LTU:
9759 + case GTU:
9760 + case LEU:
9761 + case UNORDERED:
9762 + case ORDERED:
9763 + case UNEQ:
9764 + case UNGE:
9765 + case UNLT:
9766 + case UNGT:
9767 + case UNLE:
9768 return const_ok_for_arm (ARM_SIGN_EXTEND (-i));
9769
9770 case MINUS: /* Should only occur with (MINUS I reg) => rsb */
9771 @@ -1872,14 +2258,22 @@ arm_split_constant (enum rtx_code code,
9772 {
9773 /* Currently SET is the only monadic value for CODE, all
9774 the rest are diadic. */
9775 - emit_set_insn (target, GEN_INT (val));
9776 + if (TARGET_USE_MOVT)
9777 + arm_emit_movpair (target, GEN_INT (val));
9778 + else
9779 + emit_set_insn (target, GEN_INT (val));
9780 +
9781 return 1;
9782 }
9783 else
9784 {
9785 rtx temp = subtargets ? gen_reg_rtx (mode) : target;
9786
9787 - emit_set_insn (temp, GEN_INT (val));
9788 + if (TARGET_USE_MOVT)
9789 + arm_emit_movpair (temp, GEN_INT (val));
9790 + else
9791 + emit_set_insn (temp, GEN_INT (val));
9792 +
9793 /* For MINUS, the value is subtracted from, since we never
9794 have subtraction of a constant. */
9795 if (code == MINUS)
9796 @@ -2678,14 +3072,19 @@ arm_canonicalize_comparison (enum rtx_co
9797
9798 /* Define how to find the value returned by a function. */
9799
9800 -rtx
9801 -arm_function_value(const_tree type, const_tree func ATTRIBUTE_UNUSED)
9802 +static rtx
9803 +arm_function_value(const_tree type, const_tree func,
9804 + bool outgoing ATTRIBUTE_UNUSED)
9805 {
9806 enum machine_mode mode;
9807 int unsignedp ATTRIBUTE_UNUSED;
9808 rtx r ATTRIBUTE_UNUSED;
9809
9810 mode = TYPE_MODE (type);
9811 +
9812 + if (TARGET_AAPCS_BASED)
9813 + return aapcs_allocate_return_reg (mode, type, func);
9814 +
9815 /* Promote integer types. */
9816 if (INTEGRAL_TYPE_P (type))
9817 PROMOTE_FUNCTION_MODE (mode, unsignedp, type);
9818 @@ -2702,7 +3101,36 @@ arm_function_value(const_tree type, cons
9819 }
9820 }
9821
9822 - return LIBCALL_VALUE(mode);
9823 + return LIBCALL_VALUE (mode);
9824 +}
9825 +
9826 +rtx
9827 +arm_libcall_value (enum machine_mode mode, rtx libcall)
9828 +{
9829 + if (TARGET_AAPCS_BASED && arm_pcs_default != ARM_PCS_AAPCS
9830 + && GET_MODE_CLASS (mode) == MODE_FLOAT)
9831 + {
9832 + /* The following libcalls return their result in integer registers,
9833 + even though they return a floating point value. */
9834 + if (rtx_equal_p (libcall,
9835 + convert_optab_libfunc (sfloat_optab, mode, SImode))
9836 + || rtx_equal_p (libcall,
9837 + convert_optab_libfunc (ufloat_optab, mode, SImode))
9838 + || rtx_equal_p (libcall,
9839 + convert_optab_libfunc (sfloat_optab, mode, DImode))
9840 + || rtx_equal_p (libcall,
9841 + convert_optab_libfunc (ufloat_optab, mode, DImode))
9842 + || rtx_equal_p (libcall,
9843 + convert_optab_libfunc (trunc_optab, HFmode, SFmode))
9844 + || rtx_equal_p (libcall,
9845 + convert_optab_libfunc (sext_optab, SFmode, HFmode)))
9846 + return gen_rtx_REG (mode, ARG_REGISTER(1));
9847 +
9848 + /* XXX There are other libcalls that return in integer registers,
9849 + but I think they are all handled by hard insns. */
9850 + }
9851 +
9852 + return LIBCALL_VALUE (mode);
9853 }
9854
9855 /* Determine the amount of memory needed to store the possible return
9856 @@ -2712,10 +3140,12 @@ arm_apply_result_size (void)
9857 {
9858 int size = 16;
9859
9860 - if (TARGET_ARM)
9861 + if (TARGET_32BIT)
9862 {
9863 if (TARGET_HARD_FLOAT_ABI)
9864 {
9865 + if (TARGET_VFP)
9866 + size += 32;
9867 if (TARGET_FPA)
9868 size += 12;
9869 if (TARGET_MAVERICK)
9870 @@ -2728,27 +3158,56 @@ arm_apply_result_size (void)
9871 return size;
9872 }
9873
9874 -/* Decide whether a type should be returned in memory (true)
9875 - or in a register (false). This is called by the macro
9876 - RETURN_IN_MEMORY. */
9877 -int
9878 -arm_return_in_memory (const_tree type)
9879 +/* Decide whether TYPE should be returned in memory (true)
9880 + or in a register (false). FNTYPE is the type of the function making
9881 + the call. */
9882 +static bool
9883 +arm_return_in_memory (const_tree type, const_tree fntype)
9884 {
9885 HOST_WIDE_INT size;
9886
9887 - size = int_size_in_bytes (type);
9888 + size = int_size_in_bytes (type); /* Negative if not fixed size. */
9889 +
9890 + if (TARGET_AAPCS_BASED)
9891 + {
9892 + /* Simple, non-aggregate types (ie not including vectors and
9893 + complex) are always returned in a register (or registers).
9894 + We don't care about which register here, so we can short-cut
9895 + some of the detail. */
9896 + if (!AGGREGATE_TYPE_P (type)
9897 + && TREE_CODE (type) != VECTOR_TYPE
9898 + && TREE_CODE (type) != COMPLEX_TYPE)
9899 + return false;
9900 +
9901 + /* Any return value that is no larger than one word can be
9902 + returned in r0. */
9903 + if (((unsigned HOST_WIDE_INT) size) <= UNITS_PER_WORD)
9904 + return false;
9905 +
9906 + /* Check any available co-processors to see if they accept the
9907 + type as a register candidate (VFP, for example, can return
9908 + some aggregates in consecutive registers). These aren't
9909 + available if the call is variadic. */
9910 + if (aapcs_select_return_coproc (type, fntype) >= 0)
9911 + return false;
9912 +
9913 + /* Vector values should be returned using ARM registers, not
9914 + memory (unless they're over 16 bytes, which will break since
9915 + we only have four call-clobbered registers to play with). */
9916 + if (TREE_CODE (type) == VECTOR_TYPE)
9917 + return (size < 0 || size > (4 * UNITS_PER_WORD));
9918 +
9919 + /* The rest go in memory. */
9920 + return true;
9921 + }
9922
9923 - /* Vector values should be returned using ARM registers, not memory (unless
9924 - they're over 16 bytes, which will break since we only have four
9925 - call-clobbered registers to play with). */
9926 if (TREE_CODE (type) == VECTOR_TYPE)
9927 return (size < 0 || size > (4 * UNITS_PER_WORD));
9928
9929 if (!AGGREGATE_TYPE_P (type) &&
9930 - !(TARGET_AAPCS_BASED && TREE_CODE (type) == COMPLEX_TYPE))
9931 - /* All simple types are returned in registers.
9932 - For AAPCS, complex types are treated the same as aggregates. */
9933 - return 0;
9934 + (TREE_CODE (type) != VECTOR_TYPE))
9935 + /* All simple types are returned in registers. */
9936 + return false;
9937
9938 if (arm_abi != ARM_ABI_APCS)
9939 {
9940 @@ -2765,7 +3224,7 @@ arm_return_in_memory (const_tree type)
9941 the aggregate is either huge or of variable size, and in either case
9942 we will want to return it via memory and not in a register. */
9943 if (size < 0 || size > UNITS_PER_WORD)
9944 - return 1;
9945 + return true;
9946
9947 if (TREE_CODE (type) == RECORD_TYPE)
9948 {
9949 @@ -2785,18 +3244,18 @@ arm_return_in_memory (const_tree type)
9950 continue;
9951
9952 if (field == NULL)
9953 - return 0; /* An empty structure. Allowed by an extension to ANSI C. */
9954 + return false; /* An empty structure. Allowed by an extension to ANSI C. */
9955
9956 /* Check that the first field is valid for returning in a register. */
9957
9958 /* ... Floats are not allowed */
9959 if (FLOAT_TYPE_P (TREE_TYPE (field)))
9960 - return 1;
9961 + return true;
9962
9963 /* ... Aggregates that are not themselves valid for returning in
9964 a register are not allowed. */
9965 - if (RETURN_IN_MEMORY (TREE_TYPE (field)))
9966 - return 1;
9967 + if (arm_return_in_memory (TREE_TYPE (field), NULL_TREE))
9968 + return true;
9969
9970 /* Now check the remaining fields, if any. Only bitfields are allowed,
9971 since they are not addressable. */
9972 @@ -2808,10 +3267,10 @@ arm_return_in_memory (const_tree type)
9973 continue;
9974
9975 if (!DECL_BIT_FIELD_TYPE (field))
9976 - return 1;
9977 + return true;
9978 }
9979
9980 - return 0;
9981 + return false;
9982 }
9983
9984 if (TREE_CODE (type) == UNION_TYPE)
9985 @@ -2828,18 +3287,18 @@ arm_return_in_memory (const_tree type)
9986 continue;
9987
9988 if (FLOAT_TYPE_P (TREE_TYPE (field)))
9989 - return 1;
9990 + return true;
9991
9992 - if (RETURN_IN_MEMORY (TREE_TYPE (field)))
9993 - return 1;
9994 + if (arm_return_in_memory (TREE_TYPE (field), NULL_TREE))
9995 + return true;
9996 }
9997
9998 - return 0;
9999 + return false;
10000 }
10001 #endif /* not ARM_WINCE */
10002
10003 /* Return all other types in memory. */
10004 - return 1;
10005 + return true;
10006 }
10007
10008 /* Indicate whether or not words of a double are in big-endian order. */
10009 @@ -2864,60 +3323,811 @@ arm_float_words_big_endian (void)
10010 return 1;
10011 }
10012
10013 -/* Initialize a variable CUM of type CUMULATIVE_ARGS
10014 - for a call to a function whose data type is FNTYPE.
10015 - For a library call, FNTYPE is NULL. */
10016 -void
10017 -arm_init_cumulative_args (CUMULATIVE_ARGS *pcum, tree fntype,
10018 - rtx libname ATTRIBUTE_UNUSED,
10019 - tree fndecl ATTRIBUTE_UNUSED)
10020 +const struct pcs_attribute_arg
10021 {
10022 - /* On the ARM, the offset starts at 0. */
10023 - pcum->nregs = 0;
10024 - pcum->iwmmxt_nregs = 0;
10025 - pcum->can_split = true;
10026 -
10027 - /* Varargs vectors are treated the same as long long.
10028 - named_count avoids having to change the way arm handles 'named' */
10029 - pcum->named_count = 0;
10030 - pcum->nargs = 0;
10031 + const char *arg;
10032 + enum arm_pcs value;
10033 +} pcs_attribute_args[] =
10034 + {
10035 + {"aapcs", ARM_PCS_AAPCS},
10036 + {"aapcs-vfp", ARM_PCS_AAPCS_VFP},
10037 + {"aapcs-iwmmxt", ARM_PCS_AAPCS_IWMMXT},
10038 + {"atpcs", ARM_PCS_ATPCS},
10039 + {"apcs", ARM_PCS_APCS},
10040 + {NULL, ARM_PCS_UNKNOWN}
10041 + };
10042
10043 - if (TARGET_REALLY_IWMMXT && fntype)
10044 - {
10045 - tree fn_arg;
10046 +static enum arm_pcs
10047 +arm_pcs_from_attribute (tree attr)
10048 +{
10049 + const struct pcs_attribute_arg *ptr;
10050 + const char *arg;
10051
10052 - for (fn_arg = TYPE_ARG_TYPES (fntype);
10053 - fn_arg;
10054 - fn_arg = TREE_CHAIN (fn_arg))
10055 - pcum->named_count += 1;
10056 + /* Get the value of the argument. */
10057 + if (TREE_VALUE (attr) == NULL_TREE
10058 + || TREE_CODE (TREE_VALUE (attr)) != STRING_CST)
10059 + return ARM_PCS_UNKNOWN;
10060
10061 - if (! pcum->named_count)
10062 - pcum->named_count = INT_MAX;
10063 - }
10064 -}
10065 + arg = TREE_STRING_POINTER (TREE_VALUE (attr));
10066
10067 + /* Check it against the list of known arguments. */
10068 + for (ptr = pcs_attribute_args; ptr->arg != NULL; ptr++)
10069 + if (streq (arg, ptr->arg))
10070 + return ptr->value;
10071
10072 -/* Return true if mode/type need doubleword alignment. */
10073 -bool
10074 -arm_needs_doubleword_align (enum machine_mode mode, tree type)
10075 -{
10076 - return (GET_MODE_ALIGNMENT (mode) > PARM_BOUNDARY
10077 - || (type && TYPE_ALIGN (type) > PARM_BOUNDARY));
10078 + /* An unrecognized interrupt type. */
10079 + return ARM_PCS_UNKNOWN;
10080 }
10081
10082 +/* Get the PCS variant to use for this call. TYPE is the function's type
10083 + specification, DECL is the specific declartion. DECL may be null if
10084 + the call could be indirect or if this is a library call. */
10085 +static enum arm_pcs
10086 +arm_get_pcs_model (const_tree type, const_tree decl)
10087 +{
10088 + bool user_convention = false;
10089 + enum arm_pcs user_pcs = arm_pcs_default;
10090 + tree attr;
10091
10092 -/* Determine where to put an argument to a function.
10093 - Value is zero to push the argument on the stack,
10094 - or a hard register in which to store the argument.
10095 + gcc_assert (type);
10096
10097 - MODE is the argument's machine mode.
10098 - TYPE is the data type of the argument (as a tree).
10099 - This is null for libcalls where that information may
10100 - not be available.
10101 - CUM is a variable of type CUMULATIVE_ARGS which gives info about
10102 - the preceding args and about the function being called.
10103 - NAMED is nonzero if this argument is a named parameter
10104 - (otherwise it is an extra parameter matching an ellipsis). */
10105 + attr = lookup_attribute ("pcs", TYPE_ATTRIBUTES (type));
10106 + if (attr)
10107 + {
10108 + user_pcs = arm_pcs_from_attribute (TREE_VALUE (attr));
10109 + user_convention = true;
10110 + }
10111 +
10112 + if (TARGET_AAPCS_BASED)
10113 + {
10114 + /* Detect varargs functions. These always use the base rules
10115 + (no argument is ever a candidate for a co-processor
10116 + register). */
10117 + bool base_rules = (TYPE_ARG_TYPES (type) != 0
10118 + && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (type)))
10119 + != void_type_node));
10120 +
10121 + if (user_convention)
10122 + {
10123 + if (user_pcs > ARM_PCS_AAPCS_LOCAL)
10124 + sorry ("Non-AAPCS derived PCS variant");
10125 + else if (base_rules && user_pcs != ARM_PCS_AAPCS)
10126 + error ("Variadic functions must use the base AAPCS variant");
10127 + }
10128 +
10129 + if (base_rules)
10130 + return ARM_PCS_AAPCS;
10131 + else if (user_convention)
10132 + return user_pcs;
10133 + else if (decl && flag_unit_at_a_time)
10134 + {
10135 + /* Local functions never leak outside this compilation unit,
10136 + so we are free to use whatever conventions are
10137 + appropriate. */
10138 + /* FIXME: remove CONST_CAST_TREE when cgraph is constified. */
10139 + struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
10140 + if (i && i->local)
10141 + return ARM_PCS_AAPCS_LOCAL;
10142 + }
10143 + }
10144 + else if (user_convention && user_pcs != arm_pcs_default)
10145 + sorry ("PCS variant");
10146 +
10147 + /* For everything else we use the target's default. */
10148 + return arm_pcs_default;
10149 +}
10150 +
10151 +
10152 +static void
10153 +aapcs_vfp_cum_init (CUMULATIVE_ARGS *pcum ATTRIBUTE_UNUSED,
10154 + const_tree fntype ATTRIBUTE_UNUSED,
10155 + rtx libcall ATTRIBUTE_UNUSED,
10156 + const_tree fndecl ATTRIBUTE_UNUSED)
10157 +{
10158 + /* Record the unallocated VFP registers. */
10159 + pcum->aapcs_vfp_regs_free = (1 << NUM_VFP_ARG_REGS) - 1;
10160 + pcum->aapcs_vfp_reg_alloc = 0;
10161 +}
10162 +
10163 +/* Walk down the type tree of TYPE counting consecutive base elements.
10164 + If *MODEP is VOIDmode, then set it to the first valid floating point
10165 + type. If a non-floating point type is found, or if a floating point
10166 + type that doesn't match a non-VOIDmode *MODEP is found, then return -1,
10167 + otherwise return the count in the sub-tree. */
10168 +static int
10169 +aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
10170 +{
10171 + enum machine_mode mode;
10172 + HOST_WIDE_INT size;
10173 +
10174 + switch (TREE_CODE (type))
10175 + {
10176 + case REAL_TYPE:
10177 + mode = TYPE_MODE (type);
10178 + if (mode != DFmode && mode != SFmode)
10179 + return -1;
10180 +
10181 + if (*modep == VOIDmode)
10182 + *modep = mode;
10183 +
10184 + if (*modep == mode)
10185 + return 1;
10186 +
10187 + break;
10188 +
10189 + case COMPLEX_TYPE:
10190 + mode = TYPE_MODE (TREE_TYPE (type));
10191 + if (mode != DFmode && mode != SFmode)
10192 + return -1;
10193 +
10194 + if (*modep == VOIDmode)
10195 + *modep = mode;
10196 +
10197 + if (*modep == mode)
10198 + return 2;
10199 +
10200 + break;
10201 +
10202 + case VECTOR_TYPE:
10203 + /* Use V2SImode and V4SImode as representatives of all 64-bit
10204 + and 128-bit vector types, whether or not those modes are
10205 + supported with the present options. */
10206 + size = int_size_in_bytes (type);
10207 + switch (size)
10208 + {
10209 + case 8:
10210 + mode = V2SImode;
10211 + break;
10212 + case 16:
10213 + mode = V4SImode;
10214 + break;
10215 + default:
10216 + return -1;
10217 + }
10218 +
10219 + if (*modep == VOIDmode)
10220 + *modep = mode;
10221 +
10222 + /* Vector modes are considered to be opaque: two vectors are
10223 + equivalent for the purposes of being homogeneous aggregates
10224 + if they are the same size. */
10225 + if (*modep == mode)
10226 + return 1;
10227 +
10228 + break;
10229 +
10230 + case ARRAY_TYPE:
10231 + {
10232 + int count;
10233 + tree index = TYPE_DOMAIN (type);
10234 +
10235 + /* Can't handle incomplete types. */
10236 + if (!COMPLETE_TYPE_P(type))
10237 + return -1;
10238 +
10239 + count = aapcs_vfp_sub_candidate (TREE_TYPE (type), modep);
10240 + if (count == -1
10241 + || !index
10242 + || !TYPE_MAX_VALUE (index)
10243 + || !host_integerp (TYPE_MAX_VALUE (index), 1)
10244 + || !TYPE_MIN_VALUE (index)
10245 + || !host_integerp (TYPE_MIN_VALUE (index), 1)
10246 + || count < 0)
10247 + return -1;
10248 +
10249 + count *= (1 + tree_low_cst (TYPE_MAX_VALUE (index), 1)
10250 + - tree_low_cst (TYPE_MIN_VALUE (index), 1));
10251 +
10252 + /* There must be no padding. */
10253 + if (!host_integerp (TYPE_SIZE (type), 1)
10254 + || (tree_low_cst (TYPE_SIZE (type), 1)
10255 + != count * GET_MODE_BITSIZE (*modep)))
10256 + return -1;
10257 +
10258 + return count;
10259 + }
10260 +
10261 + case RECORD_TYPE:
10262 + {
10263 + int count = 0;
10264 + int sub_count;
10265 + tree field;
10266 +
10267 + /* Can't handle incomplete types. */
10268 + if (!COMPLETE_TYPE_P(type))
10269 + return -1;
10270 +
10271 + for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
10272 + {
10273 + if (TREE_CODE (field) != FIELD_DECL)
10274 + continue;
10275 +
10276 + sub_count = aapcs_vfp_sub_candidate (TREE_TYPE (field), modep);
10277 + if (sub_count < 0)
10278 + return -1;
10279 + count += sub_count;
10280 + }
10281 +
10282 + /* There must be no padding. */
10283 + if (!host_integerp (TYPE_SIZE (type), 1)
10284 + || (tree_low_cst (TYPE_SIZE (type), 1)
10285 + != count * GET_MODE_BITSIZE (*modep)))
10286 + return -1;
10287 +
10288 + return count;
10289 + }
10290 +
10291 + case UNION_TYPE:
10292 + case QUAL_UNION_TYPE:
10293 + {
10294 + /* These aren't very interesting except in a degenerate case. */
10295 + int count = 0;
10296 + int sub_count;
10297 + tree field;
10298 +
10299 + /* Can't handle incomplete types. */
10300 + if (!COMPLETE_TYPE_P(type))
10301 + return -1;
10302 +
10303 + for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
10304 + {
10305 + if (TREE_CODE (field) != FIELD_DECL)
10306 + continue;
10307 +
10308 + sub_count = aapcs_vfp_sub_candidate (TREE_TYPE (field), modep);
10309 + if (sub_count < 0)
10310 + return -1;
10311 + count = count > sub_count ? count : sub_count;
10312 + }
10313 +
10314 + /* There must be no padding. */
10315 + if (!host_integerp (TYPE_SIZE (type), 1)
10316 + || (tree_low_cst (TYPE_SIZE (type), 1)
10317 + != count * GET_MODE_BITSIZE (*modep)))
10318 + return -1;
10319 +
10320 + return count;
10321 + }
10322 +
10323 + default:
10324 + break;
10325 + }
10326 +
10327 + return -1;
10328 +}
10329 +
10330 +static bool
10331 +aapcs_vfp_is_call_or_return_candidate (enum machine_mode mode, const_tree type,
10332 + int *base_mode,
10333 + int *count)
10334 +{
10335 + if (GET_MODE_CLASS (mode) == MODE_FLOAT
10336 + || GET_MODE_CLASS (mode) == MODE_VECTOR_INT
10337 + || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
10338 + {
10339 + *count = 1;
10340 + *base_mode = mode;
10341 + return true;
10342 + }
10343 + else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
10344 + {
10345 + *count = 2;
10346 + *base_mode = (mode == DCmode ? DFmode : SFmode);
10347 + return true;
10348 + }
10349 + else if (type && (mode == BLKmode || TREE_CODE (type) == VECTOR_TYPE))
10350 + {
10351 + enum machine_mode aggregate_mode = VOIDmode;
10352 + int ag_count = aapcs_vfp_sub_candidate (type, &aggregate_mode);
10353 +
10354 + if (ag_count > 0 && ag_count <= 4)
10355 + {
10356 + *count = ag_count;
10357 + *base_mode = aggregate_mode;
10358 + return true;
10359 + }
10360 + }
10361 + return false;
10362 +}
10363 +
10364 +static bool
10365 +aapcs_vfp_is_return_candidate (enum arm_pcs pcs_variant,
10366 + enum machine_mode mode, const_tree type)
10367 +{
10368 + int count ATTRIBUTE_UNUSED;
10369 + int ag_mode ATTRIBUTE_UNUSED;
10370 +
10371 + if (!(pcs_variant == ARM_PCS_AAPCS_VFP
10372 + || (pcs_variant == ARM_PCS_AAPCS_LOCAL
10373 + && TARGET_32BIT && TARGET_VFP && TARGET_HARD_FLOAT)))
10374 + return false;
10375 + return aapcs_vfp_is_call_or_return_candidate (mode, type, &ag_mode, &count);
10376 +}
10377 +
10378 +static bool
10379 +aapcs_vfp_is_call_candidate (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
10380 + const_tree type)
10381 +{
10382 + if (!(pcum->pcs_variant == ARM_PCS_AAPCS_VFP
10383 + || (pcum->pcs_variant == ARM_PCS_AAPCS_LOCAL
10384 + && TARGET_32BIT && TARGET_VFP && TARGET_HARD_FLOAT)))
10385 + return false;
10386 + return aapcs_vfp_is_call_or_return_candidate (mode, type,
10387 + &pcum->aapcs_vfp_rmode,
10388 + &pcum->aapcs_vfp_rcount);
10389 +}
10390 +
10391 +static bool
10392 +aapcs_vfp_allocate (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
10393 + const_tree type ATTRIBUTE_UNUSED)
10394 +{
10395 + int shift = GET_MODE_SIZE (pcum->aapcs_vfp_rmode) / GET_MODE_SIZE (SFmode);
10396 + unsigned mask = (1 << (shift * pcum->aapcs_vfp_rcount)) - 1;
10397 + int regno;
10398 +
10399 + for (regno = 0; regno < NUM_VFP_ARG_REGS; regno += shift)
10400 + if (((pcum->aapcs_vfp_regs_free >> regno) & mask) == mask)
10401 + {
10402 + pcum->aapcs_vfp_reg_alloc = mask << regno;
10403 + if (mode == BLKmode || (mode == TImode && !TARGET_NEON))
10404 + {
10405 + int i;
10406 + int rcount = pcum->aapcs_vfp_rcount;
10407 + int rshift = shift;
10408 + enum machine_mode rmode = pcum->aapcs_vfp_rmode;
10409 + rtx par;
10410 + if (!TARGET_NEON)
10411 + {
10412 + /* Avoid using unsupported vector modes. */
10413 + if (rmode == V2SImode)
10414 + rmode = DImode;
10415 + else if (rmode == V4SImode)
10416 + {
10417 + rmode = DImode;
10418 + rcount *= 2;
10419 + rshift /= 2;
10420 + }
10421 + }
10422 + par = gen_rtx_PARALLEL (mode, rtvec_alloc (rcount));
10423 + for (i = 0; i < rcount; i++)
10424 + {
10425 + rtx tmp = gen_rtx_REG (rmode,
10426 + FIRST_VFP_REGNUM + regno + i * rshift);
10427 + tmp = gen_rtx_EXPR_LIST
10428 + (VOIDmode, tmp,
10429 + GEN_INT (i * GET_MODE_SIZE (rmode)));
10430 + XVECEXP (par, 0, i) = tmp;
10431 + }
10432 +
10433 + pcum->aapcs_reg = par;
10434 + }
10435 + else
10436 + pcum->aapcs_reg = gen_rtx_REG (mode, FIRST_VFP_REGNUM + regno);
10437 + return true;
10438 + }
10439 + return false;
10440 +}
10441 +
10442 +static rtx
10443 +aapcs_vfp_allocate_return_reg (enum arm_pcs pcs_variant ATTRIBUTE_UNUSED,
10444 + enum machine_mode mode,
10445 + const_tree type ATTRIBUTE_UNUSED)
10446 +{
10447 + if (!(pcs_variant == ARM_PCS_AAPCS_VFP
10448 + || (pcs_variant == ARM_PCS_AAPCS_LOCAL
10449 + && TARGET_32BIT && TARGET_VFP && TARGET_HARD_FLOAT)))
10450 + return false;
10451 + if (mode == BLKmode || (mode == TImode && !TARGET_NEON))
10452 + {
10453 + int count;
10454 + int ag_mode;
10455 + int i;
10456 + rtx par;
10457 + int shift;
10458 +
10459 + aapcs_vfp_is_call_or_return_candidate (mode, type, &ag_mode, &count);
10460 +
10461 + if (!TARGET_NEON)
10462 + {
10463 + if (ag_mode == V2SImode)
10464 + ag_mode = DImode;
10465 + else if (ag_mode == V4SImode)
10466 + {
10467 + ag_mode = DImode;
10468 + count *= 2;
10469 + }
10470 + }
10471 + shift = GET_MODE_SIZE(ag_mode) / GET_MODE_SIZE(SFmode);
10472 + par = gen_rtx_PARALLEL (mode, rtvec_alloc (count));
10473 + for (i = 0; i < count; i++)
10474 + {
10475 + rtx tmp = gen_rtx_REG (ag_mode, FIRST_VFP_REGNUM + i * shift);
10476 + tmp = gen_rtx_EXPR_LIST (VOIDmode, tmp,
10477 + GEN_INT (i * GET_MODE_SIZE (ag_mode)));
10478 + XVECEXP (par, 0, i) = tmp;
10479 + }
10480 +
10481 + return par;
10482 + }
10483 +
10484 + return gen_rtx_REG (mode, FIRST_VFP_REGNUM);
10485 +}
10486 +
10487 +static void
10488 +aapcs_vfp_advance (CUMULATIVE_ARGS *pcum ATTRIBUTE_UNUSED,
10489 + enum machine_mode mode ATTRIBUTE_UNUSED,
10490 + const_tree type ATTRIBUTE_UNUSED)
10491 +{
10492 + pcum->aapcs_vfp_regs_free &= ~pcum->aapcs_vfp_reg_alloc;
10493 + pcum->aapcs_vfp_reg_alloc = 0;
10494 + return;
10495 +}
10496 +
10497 +#define AAPCS_CP(X) \
10498 + { \
10499 + aapcs_ ## X ## _cum_init, \
10500 + aapcs_ ## X ## _is_call_candidate, \
10501 + aapcs_ ## X ## _allocate, \
10502 + aapcs_ ## X ## _is_return_candidate, \
10503 + aapcs_ ## X ## _allocate_return_reg, \
10504 + aapcs_ ## X ## _advance \
10505 + }
10506 +
10507 +/* Table of co-processors that can be used to pass arguments in
10508 + registers. Idealy no arugment should be a candidate for more than
10509 + one co-processor table entry, but the table is processed in order
10510 + and stops after the first match. If that entry then fails to put
10511 + the argument into a co-processor register, the argument will go on
10512 + the stack. */
10513 +static struct
10514 +{
10515 + /* Initialize co-processor related state in CUMULATIVE_ARGS structure. */
10516 + void (*cum_init) (CUMULATIVE_ARGS *, const_tree, rtx, const_tree);
10517 +
10518 + /* Return true if an argument of mode MODE (or type TYPE if MODE is
10519 + BLKmode) is a candidate for this co-processor's registers; this
10520 + function should ignore any position-dependent state in
10521 + CUMULATIVE_ARGS and only use call-type dependent information. */
10522 + bool (*is_call_candidate) (CUMULATIVE_ARGS *, enum machine_mode, const_tree);
10523 +
10524 + /* Return true if the argument does get a co-processor register; it
10525 + should set aapcs_reg to an RTX of the register allocated as is
10526 + required for a return from FUNCTION_ARG. */
10527 + bool (*allocate) (CUMULATIVE_ARGS *, enum machine_mode, const_tree);
10528 +
10529 + /* Return true if a result of mode MODE (or type TYPE if MODE is
10530 + BLKmode) is can be returned in this co-processor's registers. */
10531 + bool (*is_return_candidate) (enum arm_pcs, enum machine_mode, const_tree);
10532 +
10533 + /* Allocate and return an RTX element to hold the return type of a
10534 + call, this routine must not fail and will only be called if
10535 + is_return_candidate returned true with the same parameters. */
10536 + rtx (*allocate_return_reg) (enum arm_pcs, enum machine_mode, const_tree);
10537 +
10538 + /* Finish processing this argument and prepare to start processing
10539 + the next one. */
10540 + void (*advance) (CUMULATIVE_ARGS *, enum machine_mode, const_tree);
10541 +} aapcs_cp_arg_layout[ARM_NUM_COPROC_SLOTS] =
10542 + {
10543 + AAPCS_CP(vfp)
10544 + };
10545 +
10546 +#undef AAPCS_CP
10547 +
10548 +static int
10549 +aapcs_select_call_coproc (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
10550 + tree type)
10551 +{
10552 + int i;
10553 +
10554 + for (i = 0; i < ARM_NUM_COPROC_SLOTS; i++)
10555 + if (aapcs_cp_arg_layout[i].is_call_candidate (pcum, mode, type))
10556 + return i;
10557 +
10558 + return -1;
10559 +}
10560 +
10561 +static int
10562 +aapcs_select_return_coproc (const_tree type, const_tree fntype)
10563 +{
10564 + /* We aren't passed a decl, so we can't check that a call is local.
10565 + However, it isn't clear that that would be a win anyway, since it
10566 + might limit some tail-calling opportunities. */
10567 + enum arm_pcs pcs_variant;
10568 +
10569 + if (fntype)
10570 + {
10571 + const_tree fndecl = NULL_TREE;
10572 +
10573 + if (TREE_CODE (fntype) == FUNCTION_DECL)
10574 + {
10575 + fndecl = fntype;
10576 + fntype = TREE_TYPE (fntype);
10577 + }
10578 +
10579 + pcs_variant = arm_get_pcs_model (fntype, fndecl);
10580 + }
10581 + else
10582 + pcs_variant = arm_pcs_default;
10583 +
10584 + if (pcs_variant != ARM_PCS_AAPCS)
10585 + {
10586 + int i;
10587 +
10588 + for (i = 0; i < ARM_NUM_COPROC_SLOTS; i++)
10589 + if (aapcs_cp_arg_layout[i].is_return_candidate (pcs_variant,
10590 + TYPE_MODE (type),
10591 + type))
10592 + return i;
10593 + }
10594 + return -1;
10595 +}
10596 +
10597 +static rtx
10598 +aapcs_allocate_return_reg (enum machine_mode mode, const_tree type,
10599 + const_tree fntype)
10600 +{
10601 + /* We aren't passed a decl, so we can't check that a call is local.
10602 + However, it isn't clear that that would be a win anyway, since it
10603 + might limit some tail-calling opportunities. */
10604 + enum arm_pcs pcs_variant;
10605 +
10606 + if (fntype)
10607 + {
10608 + const_tree fndecl = NULL_TREE;
10609 +
10610 + if (TREE_CODE (fntype) == FUNCTION_DECL)
10611 + {
10612 + fndecl = fntype;
10613 + fntype = TREE_TYPE (fntype);
10614 + }
10615 +
10616 + pcs_variant = arm_get_pcs_model (fntype, fndecl);
10617 + }
10618 + else
10619 + pcs_variant = arm_pcs_default;
10620 +
10621 + /* Promote integer types. */
10622 + if (type && INTEGRAL_TYPE_P (type))
10623 + PROMOTE_FUNCTION_MODE (mode, unsignedp, type);
10624 +
10625 + if (pcs_variant != ARM_PCS_AAPCS)
10626 + {
10627 + int i;
10628 +
10629 + for (i = 0; i < ARM_NUM_COPROC_SLOTS; i++)
10630 + if (aapcs_cp_arg_layout[i].is_return_candidate (pcs_variant, mode,
10631 + type))
10632 + return aapcs_cp_arg_layout[i].allocate_return_reg (pcs_variant,
10633 + mode, type);
10634 + }
10635 +
10636 + /* Promotes small structs returned in a register to full-word size
10637 + for big-endian AAPCS. */
10638 + if (type && arm_return_in_msb (type))
10639 + {
10640 + HOST_WIDE_INT size = int_size_in_bytes (type);
10641 + if (size % UNITS_PER_WORD != 0)
10642 + {
10643 + size += UNITS_PER_WORD - size % UNITS_PER_WORD;
10644 + mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0);
10645 + }
10646 + }
10647 +
10648 + return gen_rtx_REG (mode, R0_REGNUM);
10649 +}
10650 +
10651 +rtx
10652 +aapcs_libcall_value (enum machine_mode mode)
10653 +{
10654 + return aapcs_allocate_return_reg (mode, NULL_TREE, NULL_TREE);
10655 +}
10656 +
10657 +/* Lay out a function argument using the AAPCS rules. The rule
10658 + numbers referred to here are those in the AAPCS. */
10659 +static void
10660 +aapcs_layout_arg (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
10661 + tree type, int named)
10662 +{
10663 + int nregs, nregs2;
10664 + int ncrn;
10665 +
10666 + /* We only need to do this once per argument. */
10667 + if (pcum->aapcs_arg_processed)
10668 + return;
10669 +
10670 + pcum->aapcs_arg_processed = true;
10671 +
10672 + /* Special case: if named is false then we are handling an incoming
10673 + anonymous argument which is on the stack. */
10674 + if (!named)
10675 + return;
10676 +
10677 + /* Is this a potential co-processor register candidate? */
10678 + if (pcum->pcs_variant != ARM_PCS_AAPCS)
10679 + {
10680 + pcum->aapcs_cprc_slot = aapcs_select_call_coproc (pcum, mode, type);
10681 +
10682 + /* We don't have to apply any of the rules from part B of the
10683 + preparation phase, these are handled elsewhere in the
10684 + compiler. */
10685 +
10686 + if (pcum->aapcs_cprc_slot >= 0)
10687 + {
10688 + if (!pcum->aapcs_cprc_failed[pcum->aapcs_cprc_slot])
10689 + {
10690 + /* C1.cp - Try to allocate the argument to co-processor
10691 + registers. */
10692 + if (aapcs_cp_arg_layout[pcum->aapcs_cprc_slot].allocate (pcum,
10693 + mode,
10694 + type))
10695 + return;
10696 + /* C2.cp - Put the argument on the stack and note that we
10697 + can't assign any more candidates in this slot. We also
10698 + need to note that we have allocated stack space, so that
10699 + we won't later try to split a non-cprc candidate between
10700 + core registers and the stack. */
10701 + pcum->aapcs_cprc_failed[pcum->aapcs_cprc_slot] = true;
10702 + pcum->can_split = false;
10703 + return;
10704 + }
10705 + else
10706 + {
10707 + /* Subsequent cprc candidates after one that was not
10708 + allocated to coprocessor registers cannot go in core
10709 + registers either. */
10710 + pcum->can_split = false;
10711 + return;
10712 + }
10713 + }
10714 + }
10715 +
10716 + /* C3 - For double-word aligned arguments, round the NCRN up to the
10717 + next even number. */
10718 + ncrn = pcum->aapcs_ncrn;
10719 + if ((ncrn & 1) && arm_needs_doubleword_align (mode, type))
10720 + ncrn++;
10721 +
10722 + nregs = ARM_NUM_REGS2(mode, type);
10723 +
10724 + /* Sigh, this test should really assert that nregs > 0, but a GCC
10725 + extension allows empty structs and then gives them empty size; it
10726 + then allows such a structure to be passed by value. For some of
10727 + the code below we have to pretend that such an argument has
10728 + non-zero size so that we 'locate' it correctly either in
10729 + registers or on the stack. */
10730 + gcc_assert (nregs >= 0);
10731 +
10732 + nregs2 = nregs ? nregs : 1;
10733 +
10734 + /* C4 - Argument fits entirely in core registers. */
10735 + if (ncrn + nregs2 <= NUM_ARG_REGS)
10736 + {
10737 + pcum->aapcs_reg = gen_rtx_REG (mode, ncrn);
10738 + pcum->aapcs_next_ncrn = ncrn + nregs;
10739 + return;
10740 + }
10741 +
10742 + /* C5 - Some core registers left and there are no arguments already
10743 + on the stack: split this argument between the remaining core
10744 + registers and the stack. */
10745 + if (ncrn < NUM_ARG_REGS && pcum->can_split)
10746 + {
10747 + pcum->aapcs_reg = gen_rtx_REG (mode, ncrn);
10748 + pcum->aapcs_next_ncrn = NUM_ARG_REGS;
10749 + pcum->aapcs_partial = (NUM_ARG_REGS - ncrn) * UNITS_PER_WORD;
10750 + return;
10751 + }
10752 +
10753 + /* C6 - NCRN is set to 4. */
10754 + pcum->aapcs_next_ncrn = NUM_ARG_REGS;
10755 +
10756 + /* C7,C8 - arugment goes on the stack. We have nothing to do here. */
10757 + return;
10758 +}
10759 +
10760 +/* Initialize a variable CUM of type CUMULATIVE_ARGS
10761 + for a call to a function whose data type is FNTYPE.
10762 + For a library call, FNTYPE is NULL. */
10763 +void
10764 +arm_init_cumulative_args (CUMULATIVE_ARGS *pcum, tree fntype,
10765 + rtx libname,
10766 + tree fndecl ATTRIBUTE_UNUSED)
10767 +{
10768 + /* Long call handling. */
10769 + if (fntype)
10770 + pcum->pcs_variant = arm_get_pcs_model (fntype, fndecl);
10771 + else
10772 + pcum->pcs_variant = arm_pcs_default;
10773 +
10774 + if (pcum->pcs_variant <= ARM_PCS_AAPCS_LOCAL)
10775 + {
10776 + /* XXX We should also detect some library calls here and handle
10777 + them using the base rules too; for example the floating point
10778 + support functions always work this way. */
10779 +
10780 + if (rtx_equal_p (libname,
10781 + convert_optab_libfunc (sfix_optab, DImode, DFmode))
10782 + || rtx_equal_p (libname,
10783 + convert_optab_libfunc (ufix_optab, DImode, DFmode))
10784 + || rtx_equal_p (libname,
10785 + convert_optab_libfunc (sfix_optab, DImode, SFmode))
10786 + || rtx_equal_p (libname,
10787 + convert_optab_libfunc (ufix_optab, DImode, SFmode))
10788 + || rtx_equal_p (libname,
10789 + convert_optab_libfunc (trunc_optab, HFmode, SFmode))
10790 + || rtx_equal_p (libname,
10791 + convert_optab_libfunc (sext_optab, SFmode, HFmode)))
10792 + pcum->pcs_variant = ARM_PCS_AAPCS;
10793 +
10794 + pcum->aapcs_ncrn = pcum->aapcs_next_ncrn = 0;
10795 + pcum->aapcs_reg = NULL_RTX;
10796 + pcum->aapcs_partial = 0;
10797 + pcum->aapcs_arg_processed = false;
10798 + pcum->aapcs_cprc_slot = -1;
10799 + pcum->can_split = true;
10800 +
10801 + if (pcum->pcs_variant != ARM_PCS_AAPCS)
10802 + {
10803 + int i;
10804 +
10805 + for (i = 0; i < ARM_NUM_COPROC_SLOTS; i++)
10806 + {
10807 + pcum->aapcs_cprc_failed[i] = false;
10808 + aapcs_cp_arg_layout[i].cum_init (pcum, fntype, libname, fndecl);
10809 + }
10810 + }
10811 + return;
10812 + }
10813 +
10814 + /* Legacy ABIs */
10815 +
10816 + /* On the ARM, the offset starts at 0. */
10817 + pcum->nregs = 0;
10818 + pcum->iwmmxt_nregs = 0;
10819 + pcum->can_split = true;
10820 +
10821 + /* Varargs vectors are treated the same as long long.
10822 + named_count avoids having to change the way arm handles 'named' */
10823 + pcum->named_count = 0;
10824 + pcum->nargs = 0;
10825 +
10826 + if (TARGET_REALLY_IWMMXT && fntype)
10827 + {
10828 + tree fn_arg;
10829 +
10830 + for (fn_arg = TYPE_ARG_TYPES (fntype);
10831 + fn_arg;
10832 + fn_arg = TREE_CHAIN (fn_arg))
10833 + pcum->named_count += 1;
10834 +
10835 + if (! pcum->named_count)
10836 + pcum->named_count = INT_MAX;
10837 + }
10838 +}
10839 +
10840 +
10841 +/* Return true if mode/type need doubleword alignment. */
10842 +bool
10843 +arm_needs_doubleword_align (enum machine_mode mode, tree type)
10844 +{
10845 + return (GET_MODE_ALIGNMENT (mode) > PARM_BOUNDARY
10846 + || (type && TYPE_ALIGN (type) > PARM_BOUNDARY));
10847 +}
10848 +
10849 +
10850 +/* Determine where to put an argument to a function.
10851 + Value is zero to push the argument on the stack,
10852 + or a hard register in which to store the argument.
10853 +
10854 + MODE is the argument's machine mode.
10855 + TYPE is the data type of the argument (as a tree).
10856 + This is null for libcalls where that information may
10857 + not be available.
10858 + CUM is a variable of type CUMULATIVE_ARGS which gives info about
10859 + the preceding args and about the function being called.
10860 + NAMED is nonzero if this argument is a named parameter
10861 + (otherwise it is an extra parameter matching an ellipsis). */
10862
10863 rtx
10864 arm_function_arg (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
10865 @@ -2925,6 +4135,17 @@ arm_function_arg (CUMULATIVE_ARGS *pcum,
10866 {
10867 int nregs;
10868
10869 + /* Handle the special case quickly. Pick an arbitrary value for op2 of
10870 + a call insn (op3 of a call_value insn). */
10871 + if (mode == VOIDmode)
10872 + return const0_rtx;
10873 +
10874 + if (pcum->pcs_variant <= ARM_PCS_AAPCS_LOCAL)
10875 + {
10876 + aapcs_layout_arg (pcum, mode, type, named);
10877 + return pcum->aapcs_reg;
10878 + }
10879 +
10880 /* Varargs vectors are treated the same as long long.
10881 named_count avoids having to change the way arm handles 'named' */
10882 if (TARGET_IWMMXT_ABI
10883 @@ -2966,10 +4187,16 @@ arm_function_arg (CUMULATIVE_ARGS *pcum,
10884
10885 static int
10886 arm_arg_partial_bytes (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
10887 - tree type, bool named ATTRIBUTE_UNUSED)
10888 + tree type, bool named)
10889 {
10890 int nregs = pcum->nregs;
10891
10892 + if (pcum->pcs_variant <= ARM_PCS_AAPCS_LOCAL)
10893 + {
10894 + aapcs_layout_arg (pcum, mode, type, named);
10895 + return pcum->aapcs_partial;
10896 + }
10897 +
10898 if (TARGET_IWMMXT_ABI && arm_vector_mode_supported_p (mode))
10899 return 0;
10900
10901 @@ -2981,6 +4208,39 @@ arm_arg_partial_bytes (CUMULATIVE_ARGS *
10902 return 0;
10903 }
10904
10905 +void
10906 +arm_function_arg_advance (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
10907 + tree type, bool named)
10908 +{
10909 + if (pcum->pcs_variant <= ARM_PCS_AAPCS_LOCAL)
10910 + {
10911 + aapcs_layout_arg (pcum, mode, type, named);
10912 +
10913 + if (pcum->aapcs_cprc_slot >= 0)
10914 + {
10915 + aapcs_cp_arg_layout[pcum->aapcs_cprc_slot].advance (pcum, mode,
10916 + type);
10917 + pcum->aapcs_cprc_slot = -1;
10918 + }
10919 +
10920 + /* Generic stuff. */
10921 + pcum->aapcs_arg_processed = false;
10922 + pcum->aapcs_ncrn = pcum->aapcs_next_ncrn;
10923 + pcum->aapcs_reg = NULL_RTX;
10924 + pcum->aapcs_partial = 0;
10925 + }
10926 + else
10927 + {
10928 + pcum->nargs += 1;
10929 + if (arm_vector_mode_supported_p (mode)
10930 + && pcum->named_count > pcum->nargs
10931 + && TARGET_IWMMXT_ABI)
10932 + pcum->iwmmxt_nregs += 1;
10933 + else
10934 + pcum->nregs += ARM_NUM_REGS2 (mode, type);
10935 + }
10936 +}
10937 +
10938 /* Variable sized types are passed by reference. This is a GCC
10939 extension to the ARM ABI. */
10940
10941 @@ -3031,6 +4291,8 @@ const struct attribute_spec arm_attribut
10942 /* Whereas these functions are always known to reside within the 26 bit
10943 addressing range. */
10944 { "short_call", 0, 0, false, true, true, NULL },
10945 + /* Specify the procedure call conventions for a function. */
10946 + { "pcs", 1, 1, false, true, true, arm_handle_pcs_attribute },
10947 /* Interrupt Service Routines have special prologue and epilogue requirements. */
10948 { "isr", 0, 1, false, false, false, arm_handle_isr_attribute },
10949 { "interrupt", 0, 1, false, false, false, arm_handle_isr_attribute },
10950 @@ -3133,6 +4395,21 @@ arm_handle_isr_attribute (tree *node, tr
10951 return NULL_TREE;
10952 }
10953
10954 +/* Handle a "pcs" attribute; arguments as in struct
10955 + attribute_spec.handler. */
10956 +static tree
10957 +arm_handle_pcs_attribute (tree *node ATTRIBUTE_UNUSED, tree name, tree args,
10958 + int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
10959 +{
10960 + if (arm_pcs_from_attribute (args) == ARM_PCS_UNKNOWN)
10961 + {
10962 + warning (OPT_Wattributes, "%qs attribute ignored",
10963 + IDENTIFIER_POINTER (name));
10964 + *no_add_attrs = true;
10965 + }
10966 + return NULL_TREE;
10967 +}
10968 +
10969 #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
10970 /* Handle the "notshared" attribute. This attribute is another way of
10971 requesting hidden visibility. ARM's compiler supports
10972 @@ -3298,7 +4575,7 @@ arm_is_long_call_p (tree decl)
10973
10974 /* Return nonzero if it is ok to make a tail-call to DECL. */
10975 static bool
10976 -arm_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
10977 +arm_function_ok_for_sibcall (tree decl, tree exp)
10978 {
10979 unsigned long func_type;
10980
10981 @@ -3331,6 +4608,21 @@ arm_function_ok_for_sibcall (tree decl,
10982 if (IS_INTERRUPT (func_type))
10983 return false;
10984
10985 + if (!VOID_TYPE_P (TREE_TYPE (DECL_RESULT (cfun->decl))))
10986 + {
10987 + /* Check that the return value locations are the same. For
10988 + example that we aren't returning a value from the sibling in
10989 + a VFP register but then need to transfer it to a core
10990 + register. */
10991 + rtx a, b;
10992 +
10993 + a = arm_function_value (TREE_TYPE (exp), decl, false);
10994 + b = arm_function_value (TREE_TYPE (DECL_RESULT (cfun->decl)),
10995 + cfun->decl, false);
10996 + if (!rtx_equal_p (a, b))
10997 + return false;
10998 + }
10999 +
11000 /* Never tailcall if function may be called with a misaligned SP. */
11001 if (IS_STACKALIGN (func_type))
11002 return false;
11003 @@ -3472,10 +4764,22 @@ legitimize_pic_address (rtx orig, enum m
11004 && XEXP (XEXP (orig, 0), 0) == cfun->machine->pic_reg)
11005 return orig;
11006
11007 + /* Handle the case where we have: const (UNSPEC_TLS). */
11008 if (GET_CODE (XEXP (orig, 0)) == UNSPEC
11009 && XINT (XEXP (orig, 0), 1) == UNSPEC_TLS)
11010 return orig;
11011
11012 + /* Handle the case where we have:
11013 + const (plus (UNSPEC_TLS) (ADDEND)). The ADDEND must be a
11014 + CONST_INT. */
11015 + if (GET_CODE (XEXP (orig, 0)) == PLUS
11016 + && GET_CODE (XEXP (XEXP (orig, 0), 0)) == UNSPEC
11017 + && XINT (XEXP (XEXP (orig, 0), 0), 1) == UNSPEC_TLS)
11018 + {
11019 + gcc_assert (GET_CODE (XEXP (XEXP (orig, 0), 1)) == CONST_INT);
11020 + return orig;
11021 + }
11022 +
11023 if (reg == 0)
11024 {
11025 gcc_assert (can_create_pseudo_p ());
11026 @@ -3924,6 +5228,7 @@ arm_legitimate_index_p (enum machine_mod
11027 if (GET_MODE_SIZE (mode) <= 4
11028 && ! (arm_arch4
11029 && (mode == HImode
11030 + || mode == HFmode
11031 || (mode == QImode && outer == SIGN_EXTEND))))
11032 {
11033 if (code == MULT)
11034 @@ -3952,13 +5257,15 @@ arm_legitimate_index_p (enum machine_mod
11035 load. */
11036 if (arm_arch4)
11037 {
11038 - if (mode == HImode || (outer == SIGN_EXTEND && mode == QImode))
11039 + if (mode == HImode
11040 + || mode == HFmode
11041 + || (outer == SIGN_EXTEND && mode == QImode))
11042 range = 256;
11043 else
11044 range = 4096;
11045 }
11046 else
11047 - range = (mode == HImode) ? 4095 : 4096;
11048 + range = (mode == HImode || mode == HFmode) ? 4095 : 4096;
11049
11050 return (code == CONST_INT
11051 && INTVAL (index) < range
11052 @@ -4129,7 +5436,8 @@ thumb1_legitimate_address_p (enum machin
11053 return 1;
11054
11055 /* This is PC relative data after arm_reorg runs. */
11056 - else if (GET_MODE_SIZE (mode) >= 4 && reload_completed
11057 + else if ((GET_MODE_SIZE (mode) >= 4 || mode == HFmode)
11058 + && reload_completed
11059 && (GET_CODE (x) == LABEL_REF
11060 || (GET_CODE (x) == CONST
11061 && GET_CODE (XEXP (x, 0)) == PLUS
11062 @@ -4799,121 +6107,255 @@ thumb1_rtx_costs (rtx x, enum rtx_code c
11063 return 99;
11064 }
11065
11066 - default:
11067 - return 99;
11068 - }
11069 -}
11070 + default:
11071 + return 99;
11072 + }
11073 +}
11074 +
11075 +static inline bool
11076 +arm_rtx_costs_1 (rtx x, enum rtx_code outer, int* total)
11077 +{
11078 + enum machine_mode mode = GET_MODE (x);
11079 + enum rtx_code subcode;
11080 + rtx operand;
11081 + enum rtx_code code = GET_CODE (x);
11082 + int extra_cost;
11083 + *total = 0;
11084 +
11085 + switch (code)
11086 + {
11087 + case MEM:
11088 + /* Memory costs quite a lot for the first word, but subsequent words
11089 + load at the equivalent of a single insn each. */
11090 + *total = COSTS_N_INSNS (2 + ARM_NUM_REGS (mode));
11091 + return true;
11092 +
11093 + case DIV:
11094 + case MOD:
11095 + case UDIV:
11096 + case UMOD:
11097 + if (TARGET_HARD_FLOAT && mode == SFmode)
11098 + *total = COSTS_N_INSNS (2);
11099 + else if (TARGET_HARD_FLOAT && mode == DFmode)
11100 + *total = COSTS_N_INSNS (4);
11101 + else
11102 + *total = COSTS_N_INSNS (20);
11103 + return false;
11104 +
11105 + case ROTATE:
11106 + if (GET_CODE (XEXP (x, 1)) == REG)
11107 + *total = COSTS_N_INSNS (1); /* Need to subtract from 32 */
11108 + else if (GET_CODE (XEXP (x, 1)) != CONST_INT)
11109 + *total = rtx_cost (XEXP (x, 1), code);
11110 +
11111 + /* Fall through */
11112 + case ROTATERT:
11113 + if (mode != SImode)
11114 + {
11115 + *total += COSTS_N_INSNS (4);
11116 + return true;
11117 + }
11118 +
11119 + /* Fall through */
11120 + case ASHIFT: case LSHIFTRT: case ASHIFTRT:
11121 + *total += rtx_cost (XEXP (x, 0), code);
11122 + if (mode == DImode)
11123 + {
11124 + *total += COSTS_N_INSNS (3);
11125 + return true;
11126 + }
11127 +
11128 + *total += COSTS_N_INSNS (1);
11129 + /* Increase the cost of complex shifts because they aren't any faster,
11130 + and reduce dual issue opportunities. */
11131 + if (arm_tune_cortex_a9
11132 + && outer != SET && GET_CODE (XEXP (x, 1)) != CONST_INT)
11133 + ++*total;
11134 +
11135 + return true;
11136 +
11137 + case MINUS:
11138 + if (TARGET_THUMB2)
11139 + {
11140 + if (GET_MODE_CLASS (mode) == MODE_FLOAT)
11141 + {
11142 + if (TARGET_HARD_FLOAT && (mode == SFmode || mode == DFmode))
11143 + *total = COSTS_N_INSNS (1);
11144 + else
11145 + *total = COSTS_N_INSNS (20);
11146 + }
11147 + else
11148 + *total = COSTS_N_INSNS (ARM_NUM_REGS (mode));
11149 + /* Thumb2 does not have RSB, so all arguments must be
11150 + registers (subtracting a constant is canonicalized as
11151 + addition of the negated constant). */
11152 + return false;
11153 + }
11154 +
11155 + if (mode == DImode)
11156 + {
11157 + *total = COSTS_N_INSNS (ARM_NUM_REGS (mode));
11158 + if (GET_CODE (XEXP (x, 0)) == CONST_INT
11159 + && const_ok_for_arm (INTVAL (XEXP (x, 0))))
11160 + {
11161 + *total += rtx_cost (XEXP (x, 1), code);
11162 + return true;
11163 + }
11164 +
11165 + if (GET_CODE (XEXP (x, 1)) == CONST_INT
11166 + && const_ok_for_arm (INTVAL (XEXP (x, 1))))
11167 + {
11168 + *total += rtx_cost (XEXP (x, 0), code);
11169 + return true;
11170 + }
11171 +
11172 + return false;
11173 + }
11174 +
11175 + if (GET_MODE_CLASS (mode) == MODE_FLOAT)
11176 + {
11177 + if (TARGET_HARD_FLOAT && (mode == SFmode || mode == DFmode))
11178 + {
11179 + *total = COSTS_N_INSNS (1);
11180 + if (GET_CODE (XEXP (x, 0)) == CONST_DOUBLE
11181 + && arm_const_double_rtx (XEXP (x, 0)))
11182 + {
11183 + *total += rtx_cost (XEXP (x, 1), code);
11184 + return true;
11185 + }
11186 +
11187 + if (GET_CODE (XEXP (x, 1)) == CONST_DOUBLE
11188 + && arm_const_double_rtx (XEXP (x, 1)))
11189 + {
11190 + *total += rtx_cost (XEXP (x, 0), code);
11191 + return true;
11192 + }
11193 +
11194 + return false;
11195 + }
11196 + *total = COSTS_N_INSNS (20);
11197 + return false;
11198 + }
11199 +
11200 + *total = COSTS_N_INSNS (1);
11201 + if (GET_CODE (XEXP (x, 0)) == CONST_INT
11202 + && const_ok_for_arm (INTVAL (XEXP (x, 0))))
11203 + {
11204 + *total += rtx_cost (XEXP (x, 1), code);
11205 + return true;
11206 + }
11207
11208 + subcode = GET_CODE (XEXP (x, 1));
11209 + if (subcode == ASHIFT || subcode == ASHIFTRT
11210 + || subcode == LSHIFTRT
11211 + || subcode == ROTATE || subcode == ROTATERT)
11212 + {
11213 + *total += rtx_cost (XEXP (x, 0), code);
11214 + *total += rtx_cost (XEXP (XEXP (x, 1), 0), subcode);
11215 + return true;
11216 + }
11217
11218 -/* Worker routine for arm_rtx_costs. */
11219 -/* ??? This needs updating for thumb2. */
11220 -static inline int
11221 -arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
11222 -{
11223 - enum machine_mode mode = GET_MODE (x);
11224 - enum rtx_code subcode;
11225 - int extra_cost;
11226 + /* A shift as a part of RSB costs no more than RSB itself. */
11227 + if (GET_CODE (XEXP (x, 0)) == MULT
11228 + && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
11229 + && ((INTVAL (XEXP (XEXP (x, 0), 1))
11230 + & (INTVAL (XEXP (XEXP (x, 0), 1)) - 1)) == 0))
11231 + {
11232 + *total += rtx_cost (XEXP (XEXP (x, 0), 0), code);
11233 + *total += rtx_cost (XEXP (x, 1), code);
11234 + return true;
11235 + }
11236
11237 - switch (code)
11238 - {
11239 - case MEM:
11240 - /* Memory costs quite a lot for the first word, but subsequent words
11241 - load at the equivalent of a single insn each. */
11242 - return (10 + 4 * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD)
11243 - + (GET_CODE (x) == SYMBOL_REF
11244 - && CONSTANT_POOL_ADDRESS_P (x) ? 4 : 0));
11245 + if (subcode == MULT
11246 + && GET_CODE (XEXP (XEXP (x, 1), 1)) == CONST_INT
11247 + && ((INTVAL (XEXP (XEXP (x, 1), 1)) &
11248 + (INTVAL (XEXP (XEXP (x, 1), 1)) - 1)) == 0))
11249 + {
11250 + *total += rtx_cost (XEXP (x, 0), code);
11251 + *total += rtx_cost (XEXP (XEXP (x, 1), 0), subcode);
11252 + return true;
11253 + }
11254
11255 - case DIV:
11256 - case MOD:
11257 - case UDIV:
11258 - case UMOD:
11259 - return optimize_size ? COSTS_N_INSNS (2) : 100;
11260 + if (GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) == RTX_COMPARE
11261 + || GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) == RTX_COMM_COMPARE)
11262 + {
11263 + *total = COSTS_N_INSNS (1) + rtx_cost (XEXP (x, 0), code);
11264 + if (GET_CODE (XEXP (XEXP (x, 1), 0)) == REG
11265 + && REGNO (XEXP (XEXP (x, 1), 0)) != CC_REGNUM)
11266 + *total += COSTS_N_INSNS (1);
11267
11268 - case ROTATE:
11269 - if (mode == SImode && GET_CODE (XEXP (x, 1)) == REG)
11270 - return 4;
11271 - /* Fall through */
11272 - case ROTATERT:
11273 - if (mode != SImode)
11274 - return 8;
11275 - /* Fall through */
11276 - case ASHIFT: case LSHIFTRT: case ASHIFTRT:
11277 - if (mode == DImode)
11278 - return (8 + (GET_CODE (XEXP (x, 1)) == CONST_INT ? 0 : 8)
11279 - + ((GET_CODE (XEXP (x, 0)) == REG
11280 - || (GET_CODE (XEXP (x, 0)) == SUBREG
11281 - && GET_CODE (SUBREG_REG (XEXP (x, 0))) == REG))
11282 - ? 0 : 8));
11283 - return (1 + ((GET_CODE (XEXP (x, 0)) == REG
11284 - || (GET_CODE (XEXP (x, 0)) == SUBREG
11285 - && GET_CODE (SUBREG_REG (XEXP (x, 0))) == REG))
11286 - ? 0 : 4)
11287 - + ((GET_CODE (XEXP (x, 1)) == REG
11288 - || (GET_CODE (XEXP (x, 1)) == SUBREG
11289 - && GET_CODE (SUBREG_REG (XEXP (x, 1))) == REG)
11290 - || (GET_CODE (XEXP (x, 1)) == CONST_INT))
11291 - ? 0 : 4));
11292 + return true;
11293 + }
11294
11295 - case MINUS:
11296 - if (GET_CODE (XEXP (x, 1)) == MULT && mode == SImode && arm_arch_thumb2)
11297 + /* MLS is just as expensive as its underlying multiplication.
11298 + Exclude a shift by a constant, which is expressed as a
11299 + multiplication. */
11300 + if (TARGET_32BIT && arm_arch_thumb2
11301 + && GET_CODE (XEXP (x, 1)) == MULT
11302 + && ! (GET_CODE (XEXP (XEXP (x, 1), 1)) == CONST_INT
11303 + && ((INTVAL (XEXP (XEXP (x, 1), 1)) &
11304 + (INTVAL (XEXP (XEXP (x, 1), 1)) - 1)) == 0)))
11305 {
11306 - extra_cost = rtx_cost (XEXP (x, 1), code);
11307 - if (!REG_OR_SUBREG_REG (XEXP (x, 0)))
11308 - extra_cost += 4 * ARM_NUM_REGS (mode);
11309 - return extra_cost;
11310 + /* The cost comes from the cost of the multiply. */
11311 + return false;
11312 }
11313
11314 - if (mode == DImode)
11315 - return (4 + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 8)
11316 - + ((REG_OR_SUBREG_REG (XEXP (x, 0))
11317 - || (GET_CODE (XEXP (x, 0)) == CONST_INT
11318 - && const_ok_for_arm (INTVAL (XEXP (x, 0)))))
11319 - ? 0 : 8));
11320 -
11321 - if (GET_MODE_CLASS (mode) == MODE_FLOAT)
11322 - return (2 + ((REG_OR_SUBREG_REG (XEXP (x, 1))
11323 - || (GET_CODE (XEXP (x, 1)) == CONST_DOUBLE
11324 - && arm_const_double_rtx (XEXP (x, 1))))
11325 - ? 0 : 8)
11326 - + ((REG_OR_SUBREG_REG (XEXP (x, 0))
11327 - || (GET_CODE (XEXP (x, 0)) == CONST_DOUBLE
11328 - && arm_const_double_rtx (XEXP (x, 0))))
11329 - ? 0 : 8));
11330 -
11331 - if (((GET_CODE (XEXP (x, 0)) == CONST_INT
11332 - && const_ok_for_arm (INTVAL (XEXP (x, 0)))
11333 - && REG_OR_SUBREG_REG (XEXP (x, 1))))
11334 - || (((subcode = GET_CODE (XEXP (x, 1))) == ASHIFT
11335 - || subcode == ASHIFTRT || subcode == LSHIFTRT
11336 - || subcode == ROTATE || subcode == ROTATERT
11337 - || (subcode == MULT
11338 - && GET_CODE (XEXP (XEXP (x, 1), 1)) == CONST_INT
11339 - && ((INTVAL (XEXP (XEXP (x, 1), 1)) &
11340 - (INTVAL (XEXP (XEXP (x, 1), 1)) - 1)) == 0)))
11341 - && REG_OR_SUBREG_REG (XEXP (XEXP (x, 1), 0))
11342 - && (REG_OR_SUBREG_REG (XEXP (XEXP (x, 1), 1))
11343 - || GET_CODE (XEXP (XEXP (x, 1), 1)) == CONST_INT)
11344 - && REG_OR_SUBREG_REG (XEXP (x, 0))))
11345 - return 1;
11346 /* Fall through */
11347
11348 case PLUS:
11349 - if (GET_CODE (XEXP (x, 0)) == MULT)
11350 + if (code == PLUS && arm_arch6 && mode == SImode
11351 + && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
11352 + || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND))
11353 + {
11354 + *total = COSTS_N_INSNS (1);
11355 + *total += rtx_cost (XEXP (XEXP (x, 0), 0), GET_CODE (XEXP (x, 0)));
11356 + *total += rtx_cost (XEXP (x, 1), code);
11357 + return true;
11358 + }
11359 +
11360 + /* MLA: All arguments must be registers. We filter out
11361 + multiplication by a power of two, so that we fall down into
11362 + the code below. */
11363 + if (GET_CODE (XEXP (x, 0)) == MULT
11364 + && ! (GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
11365 + && ((INTVAL (XEXP (XEXP (x, 0), 1)) &
11366 + (INTVAL (XEXP (XEXP (x, 0), 1)) - 1)) == 0)))
11367 {
11368 - extra_cost = rtx_cost (XEXP (x, 0), code);
11369 - if (!REG_OR_SUBREG_REG (XEXP (x, 1)))
11370 - extra_cost += 4 * ARM_NUM_REGS (mode);
11371 - return extra_cost;
11372 + /* The cost comes from the cost of the multiply. */
11373 + return false;
11374 }
11375
11376 if (GET_MODE_CLASS (mode) == MODE_FLOAT)
11377 - return (2 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 8)
11378 - + ((REG_OR_SUBREG_REG (XEXP (x, 1))
11379 - || (GET_CODE (XEXP (x, 1)) == CONST_DOUBLE
11380 - && arm_const_double_rtx (XEXP (x, 1))))
11381 - ? 0 : 8));
11382 + {
11383 + if (TARGET_HARD_FLOAT && (mode == SFmode || mode == DFmode))
11384 + {
11385 + *total = COSTS_N_INSNS (1);
11386 + if (GET_CODE (XEXP (x, 1)) == CONST_DOUBLE
11387 + && arm_const_double_rtx (XEXP (x, 1)))
11388 + {
11389 + *total += rtx_cost (XEXP (x, 0), code);
11390 + return true;
11391 + }
11392 +
11393 + return false;
11394 + }
11395 +
11396 + *total = COSTS_N_INSNS (20);
11397 + return false;
11398 + }
11399 +
11400 + if (GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == RTX_COMPARE
11401 + || GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == RTX_COMM_COMPARE)
11402 + {
11403 + *total = COSTS_N_INSNS (1) + rtx_cost (XEXP (x, 1), code);
11404 + if (GET_CODE (XEXP (XEXP (x, 0), 0)) == REG
11405 + && REGNO (XEXP (XEXP (x, 0), 0)) != CC_REGNUM)
11406 + *total += COSTS_N_INSNS (1);
11407 + return true;
11408 + }
11409
11410 /* Fall through */
11411 +
11412 case AND: case XOR: case IOR:
11413 extra_cost = 0;
11414
11415 @@ -4927,37 +6369,56 @@ arm_rtx_costs_1 (rtx x, enum rtx_code co
11416 && GET_CODE (XEXP (x, 1)) != CONST_INT)
11417 || (REG_OR_SUBREG_REG (XEXP (x, 0))
11418 && ARM_FRAME_RTX (REG_OR_SUBREG_RTX (XEXP (x, 0)))))
11419 - extra_cost = 4;
11420 + *total = 4;
11421
11422 if (mode == DImode)
11423 - return (4 + extra_cost + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 8)
11424 - + ((REG_OR_SUBREG_REG (XEXP (x, 1))
11425 - || (GET_CODE (XEXP (x, 1)) == CONST_INT
11426 - && const_ok_for_op (INTVAL (XEXP (x, 1)), code)))
11427 - ? 0 : 8));
11428 -
11429 - if (REG_OR_SUBREG_REG (XEXP (x, 0)))
11430 - return (1 + (GET_CODE (XEXP (x, 1)) == CONST_INT ? 0 : extra_cost)
11431 - + ((REG_OR_SUBREG_REG (XEXP (x, 1))
11432 - || (GET_CODE (XEXP (x, 1)) == CONST_INT
11433 - && const_ok_for_op (INTVAL (XEXP (x, 1)), code)))
11434 - ? 0 : 4));
11435 -
11436 - else if (REG_OR_SUBREG_REG (XEXP (x, 1)))
11437 - return (1 + extra_cost
11438 - + ((((subcode = GET_CODE (XEXP (x, 0))) == ASHIFT
11439 - || subcode == LSHIFTRT || subcode == ASHIFTRT
11440 - || subcode == ROTATE || subcode == ROTATERT
11441 - || (subcode == MULT
11442 - && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
11443 - && ((INTVAL (XEXP (XEXP (x, 0), 1)) &
11444 - (INTVAL (XEXP (XEXP (x, 0), 1)) - 1)) == 0)))
11445 - && (REG_OR_SUBREG_REG (XEXP (XEXP (x, 0), 0)))
11446 - && ((REG_OR_SUBREG_REG (XEXP (XEXP (x, 0), 1)))
11447 - || GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT))
11448 - ? 0 : 4));
11449 + {
11450 + *total += COSTS_N_INSNS (2);
11451 + if (GET_CODE (XEXP (x, 1)) == CONST_INT
11452 + && const_ok_for_op (INTVAL (XEXP (x, 1)), code))
11453 + {
11454 + *total += rtx_cost (XEXP (x, 0), code);
11455 + return true;
11456 + }
11457
11458 - return 8;
11459 + return false;
11460 + }
11461 +
11462 + *total += COSTS_N_INSNS (1);
11463 + if (GET_CODE (XEXP (x, 1)) == CONST_INT
11464 + && const_ok_for_op (INTVAL (XEXP (x, 1)), code))
11465 + {
11466 + *total += rtx_cost (XEXP (x, 0), code);
11467 + return true;
11468 + }
11469 + subcode = GET_CODE (XEXP (x, 0));
11470 + if (subcode == ASHIFT || subcode == ASHIFTRT
11471 + || subcode == LSHIFTRT
11472 + || subcode == ROTATE || subcode == ROTATERT)
11473 + {
11474 + *total += rtx_cost (XEXP (x, 1), code);
11475 + *total += rtx_cost (XEXP (XEXP (x, 0), 0), subcode);
11476 + return true;
11477 + }
11478 +
11479 + if (subcode == MULT
11480 + && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
11481 + && ((INTVAL (XEXP (XEXP (x, 0), 1)) &
11482 + (INTVAL (XEXP (XEXP (x, 0), 1)) - 1)) == 0))
11483 + {
11484 + *total += rtx_cost (XEXP (x, 1), code);
11485 + *total += rtx_cost (XEXP (XEXP (x, 0), 0), subcode);
11486 + return true;
11487 + }
11488 +
11489 + if (subcode == UMIN || subcode == UMAX
11490 + || subcode == SMIN || subcode == SMAX)
11491 + {
11492 + *total = COSTS_N_INSNS (3);
11493 + return true;
11494 + }
11495 +
11496 + return false;
11497
11498 case MULT:
11499 /* This should have been handled by the CPU specific routines. */
11500 @@ -4971,90 +6432,281 @@ arm_rtx_costs_1 (rtx x, enum rtx_code co
11501 == GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 1)))
11502 && (GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 0)) == ZERO_EXTEND
11503 || GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 0)) == SIGN_EXTEND))
11504 - return 8;
11505 - return 99;
11506 + {
11507 + *total = rtx_cost (XEXP (XEXP (x, 0), 0), LSHIFTRT);
11508 + return true;
11509 + }
11510 + *total = COSTS_N_INSNS (2); /* Plus the cost of the MULT */
11511 + return false;
11512
11513 case NEG:
11514 if (GET_MODE_CLASS (mode) == MODE_FLOAT)
11515 - return 4 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 6);
11516 + {
11517 + if (TARGET_HARD_FLOAT && (mode == SFmode || mode == DFmode))
11518 + {
11519 + *total = COSTS_N_INSNS (1);
11520 + return false;
11521 + }
11522 + *total = COSTS_N_INSNS (2);
11523 + return false;
11524 + }
11525 +
11526 /* Fall through */
11527 case NOT:
11528 - if (mode == DImode)
11529 - return 4 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4);
11530 + *total = COSTS_N_INSNS (ARM_NUM_REGS(mode));
11531 + if (mode == SImode && code == NOT)
11532 + {
11533 + subcode = GET_CODE (XEXP (x, 0));
11534 + if (subcode == ASHIFT || subcode == ASHIFTRT
11535 + || subcode == LSHIFTRT
11536 + || subcode == ROTATE || subcode == ROTATERT
11537 + || (subcode == MULT
11538 + && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
11539 + && ((INTVAL (XEXP (XEXP (x, 0), 1)) &
11540 + (INTVAL (XEXP (XEXP (x, 0), 1)) - 1)) == 0)))
11541 + {
11542 + *total += rtx_cost (XEXP (XEXP (x, 0), 0), subcode);
11543 + /* Register shifts cost an extra cycle. */
11544 + if (GET_CODE (XEXP (XEXP (x, 0), 1)) != CONST_INT)
11545 + *total += COSTS_N_INSNS (1) + rtx_cost (XEXP (XEXP (x, 0), 1),
11546 + subcode);
11547 + return true;
11548 + }
11549 + }
11550
11551 - return 1 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4);
11552 + return false;
11553
11554 case IF_THEN_ELSE:
11555 if (GET_CODE (XEXP (x, 1)) == PC || GET_CODE (XEXP (x, 2)) == PC)
11556 - return 14;
11557 - return 2;
11558 + {
11559 + *total = COSTS_N_INSNS (4);
11560 + return true;
11561 + }
11562 +
11563 + operand = XEXP (x, 0);
11564 +
11565 + if (!((GET_RTX_CLASS (GET_CODE (operand)) == RTX_COMPARE
11566 + || GET_RTX_CLASS (GET_CODE (operand)) == RTX_COMM_COMPARE)
11567 + && GET_CODE (XEXP (operand, 0)) == REG
11568 + && REGNO (XEXP (operand, 0)) == CC_REGNUM))
11569 + *total += COSTS_N_INSNS (1);
11570 + *total += (rtx_cost (XEXP (x, 1), code)
11571 + + rtx_cost (XEXP (x, 2), code));
11572 + return true;
11573 +
11574 + case NE:
11575 + if (mode == SImode && XEXP (x, 1) == const0_rtx)
11576 + {
11577 + *total = COSTS_N_INSNS (2) + rtx_cost (XEXP (x, 0), code);
11578 + return true;
11579 + }
11580 + goto scc_insn;
11581 +
11582 + case GE:
11583 + if ((GET_CODE (XEXP (x, 0)) != REG || REGNO (XEXP (x, 0)) != CC_REGNUM)
11584 + && mode == SImode && XEXP (x, 1) == const0_rtx)
11585 + {
11586 + *total = COSTS_N_INSNS (2) + rtx_cost (XEXP (x, 0), code);
11587 + return true;
11588 + }
11589 + goto scc_insn;
11590 +
11591 + case LT:
11592 + if ((GET_CODE (XEXP (x, 0)) != REG || REGNO (XEXP (x, 0)) != CC_REGNUM)
11593 + && mode == SImode && XEXP (x, 1) == const0_rtx)
11594 + {
11595 + *total = COSTS_N_INSNS (1) + rtx_cost (XEXP (x, 0), code);
11596 + return true;
11597 + }
11598 + goto scc_insn;
11599 +
11600 + case EQ:
11601 + case GT:
11602 + case LE:
11603 + case GEU:
11604 + case LTU:
11605 + case GTU:
11606 + case LEU:
11607 + case UNORDERED:
11608 + case ORDERED:
11609 + case UNEQ:
11610 + case UNGE:
11611 + case UNLT:
11612 + case UNGT:
11613 + case UNLE:
11614 + scc_insn:
11615 + /* SCC insns. In the case where the comparison has already been
11616 + performed, then they cost 2 instructions. Otherwise they need
11617 + an additional comparison before them. */
11618 + *total = COSTS_N_INSNS (2);
11619 + if (GET_CODE (XEXP (x, 0)) == REG && REGNO (XEXP (x, 0)) == CC_REGNUM)
11620 + {
11621 + return true;
11622 + }
11623
11624 + /* Fall through */
11625 case COMPARE:
11626 - return 1;
11627 + if (GET_CODE (XEXP (x, 0)) == REG && REGNO (XEXP (x, 0)) == CC_REGNUM)
11628 + {
11629 + *total = 0;
11630 + return true;
11631 + }
11632 +
11633 + *total += COSTS_N_INSNS (1);
11634 + if (GET_CODE (XEXP (x, 1)) == CONST_INT
11635 + && const_ok_for_op (INTVAL (XEXP (x, 1)), code))
11636 + {
11637 + *total += rtx_cost (XEXP (x, 0), code);
11638 + return true;
11639 + }
11640 +
11641 + subcode = GET_CODE (XEXP (x, 0));
11642 + if (subcode == ASHIFT || subcode == ASHIFTRT
11643 + || subcode == LSHIFTRT
11644 + || subcode == ROTATE || subcode == ROTATERT)
11645 + {
11646 + *total += rtx_cost (XEXP (x, 1), code);
11647 + *total += rtx_cost (XEXP (XEXP (x, 0), 0), subcode);
11648 + return true;
11649 + }
11650 +
11651 + if (subcode == MULT
11652 + && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
11653 + && ((INTVAL (XEXP (XEXP (x, 0), 1)) &
11654 + (INTVAL (XEXP (XEXP (x, 0), 1)) - 1)) == 0))
11655 + {
11656 + *total += rtx_cost (XEXP (x, 1), code);
11657 + *total += rtx_cost (XEXP (XEXP (x, 0), 0), subcode);
11658 + return true;
11659 + }
11660 +
11661 + return false;
11662 +
11663 + case UMIN:
11664 + case UMAX:
11665 + case SMIN:
11666 + case SMAX:
11667 + *total = COSTS_N_INSNS (2) + rtx_cost (XEXP (x, 0), code);
11668 + if (GET_CODE (XEXP (x, 1)) != CONST_INT
11669 + || !const_ok_for_arm (INTVAL (XEXP (x, 1))))
11670 + *total += rtx_cost (XEXP (x, 1), code);
11671 + return true;
11672
11673 case ABS:
11674 - return 4 + (mode == DImode ? 4 : 0);
11675 + if (GET_MODE_CLASS (mode == MODE_FLOAT))
11676 + {
11677 + if (TARGET_HARD_FLOAT && (mode == SFmode || mode == DFmode))
11678 + {
11679 + *total = COSTS_N_INSNS (1);
11680 + return false;
11681 + }
11682 + *total = COSTS_N_INSNS (20);
11683 + return false;
11684 + }
11685 + *total = COSTS_N_INSNS (1);
11686 + if (mode == DImode)
11687 + *total += COSTS_N_INSNS (3);
11688 + return false;
11689
11690 case SIGN_EXTEND:
11691 - /* ??? value extensions are cheaper on armv6. */
11692 - if (GET_MODE (XEXP (x, 0)) == QImode)
11693 - return (4 + (mode == DImode ? 4 : 0)
11694 - + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
11695 + if (GET_MODE_CLASS (mode) == MODE_INT)
11696 + {
11697 + *total = 0;
11698 + if (mode == DImode)
11699 + *total += COSTS_N_INSNS (1);
11700 +
11701 + if (GET_MODE (XEXP (x, 0)) != SImode)
11702 + {
11703 + if (arm_arch6)
11704 + {
11705 + if (GET_CODE (XEXP (x, 0)) != MEM)
11706 + *total += COSTS_N_INSNS (1);
11707 + }
11708 + else if (!arm_arch4 || GET_CODE (XEXP (x, 0)) != MEM)
11709 + *total += COSTS_N_INSNS (2);
11710 + }
11711 +
11712 + return false;
11713 + }
11714 +
11715 /* Fall through */
11716 case ZERO_EXTEND:
11717 - switch (GET_MODE (XEXP (x, 0)))
11718 + *total = 0;
11719 + if (GET_MODE_CLASS (mode) == MODE_INT)
11720 {
11721 - case QImode:
11722 - return (1 + (mode == DImode ? 4 : 0)
11723 - + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
11724 + if (mode == DImode)
11725 + *total += COSTS_N_INSNS (1);
11726
11727 - case HImode:
11728 - return (4 + (mode == DImode ? 4 : 0)
11729 - + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
11730 + if (GET_MODE (XEXP (x, 0)) != SImode)
11731 + {
11732 + if (arm_arch6)
11733 + {
11734 + if (GET_CODE (XEXP (x, 0)) != MEM)
11735 + *total += COSTS_N_INSNS (1);
11736 + }
11737 + else if (!arm_arch4 || GET_CODE (XEXP (x, 0)) != MEM)
11738 + *total += COSTS_N_INSNS (GET_MODE (XEXP (x, 0)) == QImode ?
11739 + 1 : 2);
11740 + }
11741
11742 - case SImode:
11743 - return (1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
11744 + return false;
11745 + }
11746
11747 + switch (GET_MODE (XEXP (x, 0)))
11748 + {
11749 case V8QImode:
11750 case V4HImode:
11751 case V2SImode:
11752 case V4QImode:
11753 case V2HImode:
11754 - return 1;
11755 + *total = COSTS_N_INSNS (1);
11756 + return false;
11757
11758 default:
11759 gcc_unreachable ();
11760 }
11761 gcc_unreachable ();
11762
11763 + case ZERO_EXTRACT:
11764 + case SIGN_EXTRACT:
11765 + *total = COSTS_N_INSNS (1) + rtx_cost (XEXP (x, 0), code);
11766 + return true;
11767 +
11768 case CONST_INT:
11769 - if (const_ok_for_arm (INTVAL (x)))
11770 - return outer == SET ? 2 : -1;
11771 - else if (outer == AND
11772 - && const_ok_for_arm (~INTVAL (x)))
11773 - return -1;
11774 - else if ((outer == COMPARE
11775 - || outer == PLUS || outer == MINUS)
11776 - && const_ok_for_arm (-INTVAL (x)))
11777 - return -1;
11778 + if (const_ok_for_arm (INTVAL (x))
11779 + || const_ok_for_arm (~INTVAL (x)))
11780 + *total = COSTS_N_INSNS (1);
11781 else
11782 - return 5;
11783 + *total = COSTS_N_INSNS (arm_gen_constant (SET, mode, NULL_RTX,
11784 + INTVAL (x), NULL_RTX,
11785 + NULL_RTX, 0, 0));
11786 + return true;
11787
11788 case CONST:
11789 case LABEL_REF:
11790 case SYMBOL_REF:
11791 - return 6;
11792 + *total = COSTS_N_INSNS (3);
11793 + return true;
11794 +
11795 + case HIGH:
11796 + *total = COSTS_N_INSNS (1);
11797 + return true;
11798 +
11799 + case LO_SUM:
11800 + *total = COSTS_N_INSNS (1);
11801 + *total += rtx_cost (XEXP (x, 0), code);
11802 + return true;
11803
11804 case CONST_DOUBLE:
11805 - if (arm_const_double_rtx (x) || vfp3_const_double_rtx (x))
11806 - return outer == SET ? 2 : -1;
11807 - else if ((outer == COMPARE || outer == PLUS)
11808 - && neg_const_double_rtx_ok_for_fpa (x))
11809 - return -1;
11810 - return 7;
11811 + if (TARGET_HARD_FLOAT && vfp3_const_double_rtx (x))
11812 + *total = COSTS_N_INSNS (1);
11813 + else
11814 + *total = COSTS_N_INSNS (4);
11815 + return true;
11816
11817 default:
11818 - return 99;
11819 + *total = COSTS_N_INSNS (4);
11820 + return false;
11821 }
11822 }
11823
11824 @@ -5063,14 +6715,14 @@ static bool
11825 arm_size_rtx_costs (rtx x, int code, int outer_code, int *total)
11826 {
11827 enum machine_mode mode = GET_MODE (x);
11828 -
11829 - if (TARGET_THUMB)
11830 + if (TARGET_THUMB1)
11831 {
11832 /* XXX TBD. For now, use the standard costs. */
11833 *total = thumb1_rtx_costs (x, code, outer_code);
11834 return true;
11835 }
11836
11837 + /* FIXME: This makes no attempt to prefer narrow Thumb-2 instructions. */
11838 switch (code)
11839 {
11840 case MEM:
11841 @@ -5181,7 +6833,10 @@ arm_size_rtx_costs (rtx x, int code, int
11842
11843 case NEG:
11844 if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT)
11845 - *total = COSTS_N_INSNS (1);
11846 + {
11847 + *total = COSTS_N_INSNS (1);
11848 + return false;
11849 + }
11850 /* Fall through */
11851 case NOT:
11852 *total = COSTS_N_INSNS (ARM_NUM_REGS (mode));
11853 @@ -5270,6 +6925,13 @@ arm_size_rtx_costs (rtx x, int code, int
11854 *total = COSTS_N_INSNS (4);
11855 return true;
11856
11857 + case HIGH:
11858 + case LO_SUM:
11859 + /* We prefer constant pool entries to MOVW/MOVT pairs, so bump the
11860 + cost of these slightly. */
11861 + *total = COSTS_N_INSNS (1) + 1;
11862 + return true;
11863 +
11864 default:
11865 if (mode != VOIDmode)
11866 *total = COSTS_N_INSNS (ARM_NUM_REGS (mode));
11867 @@ -5279,11 +6941,22 @@ arm_size_rtx_costs (rtx x, int code, int
11868 }
11869 }
11870
11871 +/* RTX costs when optimizing for size. */
11872 +static bool
11873 +arm_rtx_costs (rtx x, int code, int outer_code, int *total)
11874 +{
11875 + if (optimize_size)
11876 + return arm_size_rtx_costs (x, code, outer_code, total);
11877 + else
11878 + return all_cores[(int)arm_tune].rtx_costs (x, code, outer_code, total);
11879 +}
11880 +
11881 /* RTX costs for cores with a slow MUL implementation. Thumb-2 is not
11882 supported on any "slowmul" cores, so it can be ignored. */
11883
11884 static bool
11885 -arm_slowmul_rtx_costs (rtx x, int code, int outer_code, int *total)
11886 +arm_slowmul_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer_code,
11887 + int *total)
11888 {
11889 enum machine_mode mode = GET_MODE (x);
11890
11891 @@ -5299,8 +6972,8 @@ arm_slowmul_rtx_costs (rtx x, int code,
11892 if (GET_MODE_CLASS (mode) == MODE_FLOAT
11893 || mode == DImode)
11894 {
11895 - *total = 30;
11896 - return true;
11897 + *total = COSTS_N_INSNS (20);
11898 + return false;
11899 }
11900
11901 if (GET_CODE (XEXP (x, 1)) == CONST_INT)
11902 @@ -5316,20 +6989,19 @@ arm_slowmul_rtx_costs (rtx x, int code,
11903 for (j = 0; i && j < 32; j += booth_unit_size)
11904 {
11905 i >>= booth_unit_size;
11906 - cost += 2;
11907 + cost++;
11908 }
11909
11910 - *total = cost;
11911 + *total = COSTS_N_INSNS (cost);
11912 + *total += rtx_cost (XEXP (x, 0), code);
11913 return true;
11914 }
11915
11916 - *total = 30 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4)
11917 - + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4);
11918 - return true;
11919 + *total = COSTS_N_INSNS (20);
11920 + return false;
11921
11922 default:
11923 - *total = arm_rtx_costs_1 (x, code, outer_code);
11924 - return true;
11925 + return arm_rtx_costs_1 (x, outer_code, total);;
11926 }
11927 }
11928
11929 @@ -5337,7 +7009,8 @@ arm_slowmul_rtx_costs (rtx x, int code,
11930 /* RTX cost for cores with a fast multiply unit (M variants). */
11931
11932 static bool
11933 -arm_fastmul_rtx_costs (rtx x, int code, int outer_code, int *total)
11934 +arm_fastmul_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer_code,
11935 + int *total)
11936 {
11937 enum machine_mode mode = GET_MODE (x);
11938
11939 @@ -5358,16 +7031,15 @@ arm_fastmul_rtx_costs (rtx x, int code,
11940 && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
11941 || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND))
11942 {
11943 - *total = 8;
11944 - return true;
11945 + *total = COSTS_N_INSNS(2);
11946 + return false;
11947 }
11948
11949
11950 - if (GET_MODE_CLASS (mode) == MODE_FLOAT
11951 - || mode == DImode)
11952 + if (mode == DImode)
11953 {
11954 - *total = 30;
11955 - return true;
11956 + *total = COSTS_N_INSNS (5);
11957 + return false;
11958 }
11959
11960 if (GET_CODE (XEXP (x, 1)) == CONST_INT)
11961 @@ -5383,20 +7055,34 @@ arm_fastmul_rtx_costs (rtx x, int code,
11962 for (j = 0; i && j < 32; j += booth_unit_size)
11963 {
11964 i >>= booth_unit_size;
11965 - cost += 2;
11966 + cost++;
11967 }
11968
11969 - *total = cost;
11970 - return true;
11971 + *total = COSTS_N_INSNS(cost);
11972 + return false;
11973 }
11974
11975 - *total = 8 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4)
11976 - + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4);
11977 - return true;
11978 + if (mode == SImode)
11979 + {
11980 + *total = COSTS_N_INSNS (4);
11981 + return false;
11982 + }
11983 +
11984 + if (GET_MODE_CLASS (mode) == MODE_FLOAT)
11985 + {
11986 + if (TARGET_HARD_FLOAT && (mode == SFmode || mode == DFmode))
11987 + {
11988 + *total = COSTS_N_INSNS (1);
11989 + return false;
11990 + }
11991 + }
11992 +
11993 + /* Requires a lib call */
11994 + *total = COSTS_N_INSNS (20);
11995 + return false;
11996
11997 default:
11998 - *total = arm_rtx_costs_1 (x, code, outer_code);
11999 - return true;
12000 + return arm_rtx_costs_1 (x, outer_code, total);
12001 }
12002 }
12003
12004 @@ -5405,7 +7091,7 @@ arm_fastmul_rtx_costs (rtx x, int code,
12005 so it can be ignored. */
12006
12007 static bool
12008 -arm_xscale_rtx_costs (rtx x, int code, int outer_code, int *total)
12009 +arm_xscale_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer_code, int *total)
12010 {
12011 enum machine_mode mode = GET_MODE (x);
12012
12013 @@ -5417,6 +7103,15 @@ arm_xscale_rtx_costs (rtx x, int code, i
12014
12015 switch (code)
12016 {
12017 + case COMPARE:
12018 + if (GET_CODE (XEXP (x, 0)) != MULT)
12019 + return arm_rtx_costs_1 (x, outer_code, total);
12020 +
12021 + /* A COMPARE of a MULT is slow on XScale; the muls instruction
12022 + will stall until the multiplication is complete. */
12023 + *total = COSTS_N_INSNS (3);
12024 + return false;
12025 +
12026 case MULT:
12027 /* There is no point basing this on the tuning, since it is always the
12028 fast variant if it exists at all. */
12029 @@ -5425,60 +7120,58 @@ arm_xscale_rtx_costs (rtx x, int code, i
12030 && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
12031 || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND))
12032 {
12033 - *total = 8;
12034 - return true;
12035 + *total = COSTS_N_INSNS (2);
12036 + return false;
12037 }
12038
12039
12040 - if (GET_MODE_CLASS (mode) == MODE_FLOAT
12041 - || mode == DImode)
12042 + if (mode == DImode)
12043 {
12044 - *total = 30;
12045 - return true;
12046 + *total = COSTS_N_INSNS (5);
12047 + return false;
12048 }
12049
12050 if (GET_CODE (XEXP (x, 1)) == CONST_INT)
12051 {
12052 - unsigned HOST_WIDE_INT i = (INTVAL (XEXP (x, 1))
12053 - & (unsigned HOST_WIDE_INT) 0xffffffff);
12054 - int cost, const_ok = const_ok_for_arm (i);
12055 + /* If operand 1 is a constant we can more accurately
12056 + calculate the cost of the multiply. The multiplier can
12057 + retire 15 bits on the first cycle and a further 12 on the
12058 + second. We do, of course, have to load the constant into
12059 + a register first. */
12060 + unsigned HOST_WIDE_INT i = INTVAL (XEXP (x, 1));
12061 + /* There's a general overhead of one cycle. */
12062 + int cost = 1;
12063 unsigned HOST_WIDE_INT masked_const;
12064
12065 - /* The cost will be related to two insns.
12066 - First a load of the constant (MOV or LDR), then a multiply. */
12067 - cost = 2;
12068 - if (! const_ok)
12069 - cost += 1; /* LDR is probably more expensive because
12070 - of longer result latency. */
12071 + if (i & 0x80000000)
12072 + i = ~i;
12073 +
12074 + i &= (unsigned HOST_WIDE_INT) 0xffffffff;
12075 +
12076 masked_const = i & 0xffff8000;
12077 - if (masked_const != 0 && masked_const != 0xffff8000)
12078 + if (masked_const != 0)
12079 {
12080 + cost++;
12081 masked_const = i & 0xf8000000;
12082 - if (masked_const == 0 || masked_const == 0xf8000000)
12083 - cost += 1;
12084 - else
12085 - cost += 2;
12086 + if (masked_const != 0)
12087 + cost++;
12088 }
12089 - *total = cost;
12090 - return true;
12091 + *total = COSTS_N_INSNS (cost);
12092 + return false;
12093 }
12094
12095 - *total = 8 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4)
12096 - + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4);
12097 - return true;
12098 + if (mode == SImode)
12099 + {
12100 + *total = COSTS_N_INSNS (3);
12101 + return false;
12102 + }
12103
12104 - case COMPARE:
12105 - /* A COMPARE of a MULT is slow on XScale; the muls instruction
12106 - will stall until the multiplication is complete. */
12107 - if (GET_CODE (XEXP (x, 0)) == MULT)
12108 - *total = 4 + rtx_cost (XEXP (x, 0), code);
12109 - else
12110 - *total = arm_rtx_costs_1 (x, code, outer_code);
12111 - return true;
12112 + /* Requires a lib call */
12113 + *total = COSTS_N_INSNS (20);
12114 + return false;
12115
12116 default:
12117 - *total = arm_rtx_costs_1 (x, code, outer_code);
12118 - return true;
12119 + return arm_rtx_costs_1 (x, outer_code, total);
12120 }
12121 }
12122
12123 @@ -5486,11 +7179,9 @@ arm_xscale_rtx_costs (rtx x, int code, i
12124 /* RTX costs for 9e (and later) cores. */
12125
12126 static bool
12127 -arm_9e_rtx_costs (rtx x, int code, int outer_code, int *total)
12128 +arm_9e_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer_code, int *total)
12129 {
12130 enum machine_mode mode = GET_MODE (x);
12131 - int nonreg_cost;
12132 - int cost;
12133
12134 if (TARGET_THUMB1)
12135 {
12136 @@ -5516,35 +7207,37 @@ arm_9e_rtx_costs (rtx x, int code, int o
12137 && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
12138 || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND))
12139 {
12140 - *total = 3;
12141 - return true;
12142 + *total = COSTS_N_INSNS (2);
12143 + return false;
12144 }
12145
12146
12147 - if (GET_MODE_CLASS (mode) == MODE_FLOAT)
12148 - {
12149 - *total = 30;
12150 - return true;
12151 - }
12152 if (mode == DImode)
12153 {
12154 - cost = 7;
12155 - nonreg_cost = 8;
12156 + *total = COSTS_N_INSNS (5);
12157 + return false;
12158 }
12159 - else
12160 +
12161 + if (mode == SImode)
12162 {
12163 - cost = 2;
12164 - nonreg_cost = 4;
12165 + *total = COSTS_N_INSNS (2);
12166 + return false;
12167 }
12168
12169 + if (GET_MODE_CLASS (mode) == MODE_FLOAT)
12170 + {
12171 + if (TARGET_HARD_FLOAT && (mode == SFmode || mode == DFmode))
12172 + {
12173 + *total = COSTS_N_INSNS (1);
12174 + return false;
12175 + }
12176 + }
12177
12178 - *total = cost + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : nonreg_cost)
12179 - + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : nonreg_cost);
12180 - return true;
12181 + *total = COSTS_N_INSNS (20);
12182 + return false;
12183
12184 default:
12185 - *total = arm_rtx_costs_1 (x, code, outer_code);
12186 - return true;
12187 + return arm_rtx_costs_1 (x, outer_code, total);
12188 }
12189 }
12190 /* All address computations that can be done are free, but rtx cost returns
12191 @@ -6356,10 +8049,13 @@ arm_coproc_mem_operand (rtx op, bool wb)
12192 }
12193
12194 /* Return TRUE if OP is a memory operand which we can load or store a vector
12195 - to/from. If CORE is true, we're moving from ARM registers not Neon
12196 - registers. */
12197 + to/from. TYPE is one of the following values:
12198 + 0 - Vector load/stor (vldr)
12199 + 1 - Core registers (ldm)
12200 + 2 - Element/structure loads (vld1)
12201 + */
12202 int
12203 -neon_vector_mem_operand (rtx op, bool core)
12204 +neon_vector_mem_operand (rtx op, int type)
12205 {
12206 rtx ind;
12207
12208 @@ -6392,23 +8088,15 @@ neon_vector_mem_operand (rtx op, bool co
12209 return arm_address_register_rtx_p (ind, 0);
12210
12211 /* Allow post-increment with Neon registers. */
12212 - if (!core && GET_CODE (ind) == POST_INC)
12213 + if (type != 1 && (GET_CODE (ind) == POST_INC || GET_CODE (ind) == PRE_DEC))
12214 return arm_address_register_rtx_p (XEXP (ind, 0), 0);
12215
12216 -#if 0
12217 - /* FIXME: We can support this too if we use VLD1/VST1. */
12218 - if (!core
12219 - && GET_CODE (ind) == POST_MODIFY
12220 - && arm_address_register_rtx_p (XEXP (ind, 0), 0)
12221 - && GET_CODE (XEXP (ind, 1)) == PLUS
12222 - && rtx_equal_p (XEXP (XEXP (ind, 1), 0), XEXP (ind, 0)))
12223 - ind = XEXP (ind, 1);
12224 -#endif
12225 + /* FIXME: vld1 allows register post-modify. */
12226
12227 /* Match:
12228 (plus (reg)
12229 (const)). */
12230 - if (!core
12231 + if (type == 0
12232 && GET_CODE (ind) == PLUS
12233 && GET_CODE (XEXP (ind, 0)) == REG
12234 && REG_MODE_OK_FOR_BASE_P (XEXP (ind, 0), VOIDmode)
12235 @@ -6475,10 +8163,17 @@ arm_eliminable_register (rtx x)
12236 enum reg_class
12237 coproc_secondary_reload_class (enum machine_mode mode, rtx x, bool wb)
12238 {
12239 + if (mode == HFmode)
12240 + {
12241 + if (s_register_operand (x, mode) || neon_vector_mem_operand (x, 2))
12242 + return NO_REGS;
12243 + return GENERAL_REGS;
12244 + }
12245 +
12246 if (TARGET_NEON
12247 && (GET_MODE_CLASS (mode) == MODE_VECTOR_INT
12248 || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
12249 - && neon_vector_mem_operand (x, FALSE))
12250 + && neon_vector_mem_operand (x, 0))
12251 return NO_REGS;
12252
12253 if (arm_coproc_mem_operand (x, wb) || s_register_operand (x, mode))
12254 @@ -6875,6 +8570,9 @@ load_multiple_sequence (rtx *operands, i
12255 int base_reg = -1;
12256 int i;
12257
12258 + if (low_irq_latency)
12259 + return 0;
12260 +
12261 /* Can only handle 2, 3, or 4 insns at present,
12262 though could be easily extended if required. */
12263 gcc_assert (nops >= 2 && nops <= 4);
12264 @@ -7102,6 +8800,9 @@ store_multiple_sequence (rtx *operands,
12265 int base_reg = -1;
12266 int i;
12267
12268 + if (low_irq_latency)
12269 + return 0;
12270 +
12271 /* Can only handle 2, 3, or 4 insns at present, though could be easily
12272 extended if required. */
12273 gcc_assert (nops >= 2 && nops <= 4);
12274 @@ -7307,7 +9008,7 @@ arm_gen_load_multiple (int base_regno, i
12275
12276 As a compromise, we use ldr for counts of 1 or 2 regs, and ldm
12277 for counts of 3 or 4 regs. */
12278 - if (arm_tune_xscale && count <= 2 && ! optimize_size)
12279 + if (low_irq_latency || (arm_tune_xscale && count <= 2 && ! optimize_size))
12280 {
12281 rtx seq;
12282
12283 @@ -7370,7 +9071,7 @@ arm_gen_store_multiple (int base_regno,
12284
12285 /* See arm_gen_load_multiple for discussion of
12286 the pros/cons of ldm/stm usage for XScale. */
12287 - if (arm_tune_xscale && count <= 2 && ! optimize_size)
12288 + if (low_irq_latency || (arm_tune_xscale && count <= 2 && ! optimize_size))
12289 {
12290 rtx seq;
12291
12292 @@ -8739,17 +10440,20 @@ add_minipool_backward_ref (Mfix *fix)
12293 its maximum address (which can happen if we have
12294 re-located a forwards fix); force the new fix to come
12295 after it. */
12296 - min_mp = mp;
12297 - min_address = mp->min_address + fix->fix_size;
12298 + if (ARM_DOUBLEWORD_ALIGN
12299 + && fix->fix_size >= 8 && mp->fix_size < 8)
12300 + return NULL;
12301 + else
12302 + {
12303 + min_mp = mp;
12304 + min_address = mp->min_address + fix->fix_size;
12305 + }
12306 }
12307 - /* If we are inserting an 8-bytes aligned quantity and
12308 - we have not already found an insertion point, then
12309 - make sure that all such 8-byte aligned quantities are
12310 - placed at the start of the pool. */
12311 + /* Do not insert a non-8-byte aligned quantity before 8-byte
12312 + aligned quantities. */
12313 else if (ARM_DOUBLEWORD_ALIGN
12314 - && min_mp == NULL
12315 - && fix->fix_size >= 8
12316 - && mp->fix_size < 8)
12317 + && fix->fix_size < 8
12318 + && mp->fix_size >= 8)
12319 {
12320 min_mp = mp;
12321 min_address = mp->min_address + fix->fix_size;
12322 @@ -8985,7 +10689,10 @@ create_fix_barrier (Mfix *fix, HOST_WIDE
12323 gcc_assert (GET_CODE (from) != BARRIER);
12324
12325 /* Count the length of this insn. */
12326 - count += get_attr_length (from);
12327 + if (LABEL_P (from) && (align_jumps > 0 || align_loops > 0))
12328 + count += MAX (align_jumps, align_loops);
12329 + else
12330 + count += get_attr_length (from);
12331
12332 /* If there is a jump table, add its length. */
12333 tmp = is_jump_table (from);
12334 @@ -9297,6 +11004,8 @@ arm_reorg (void)
12335 insn = table;
12336 }
12337 }
12338 + else if (LABEL_P (insn) && (align_jumps > 0 || align_loops > 0))
12339 + address += MAX (align_jumps, align_loops);
12340 }
12341
12342 fix = minipool_fix_head;
12343 @@ -9502,6 +11211,21 @@ static void
12344 vfp_output_fldmd (FILE * stream, unsigned int base, int reg, int count)
12345 {
12346 int i;
12347 + int offset;
12348 +
12349 + if (low_irq_latency)
12350 + {
12351 + /* Output a sequence of FLDD instructions. */
12352 + offset = 0;
12353 + for (i = reg; i < reg + count; ++i, offset += 8)
12354 + {
12355 + fputc ('\t', stream);
12356 + asm_fprintf (stream, "fldd\td%d, [%r,#%d]\n", i, base, offset);
12357 + }
12358 + asm_fprintf (stream, "\tadd\tsp, sp, #%d\n", count * 8);
12359 + return;
12360 + }
12361 +
12362
12363 /* Workaround ARM10 VFPr1 bug. */
12364 if (count == 2 && !arm_arch6)
12365 @@ -9572,6 +11296,53 @@ vfp_emit_fstmd (int base_reg, int count)
12366 rtx tmp, reg;
12367 int i;
12368
12369 + if (low_irq_latency)
12370 + {
12371 + if (!count)
12372 + return 0;
12373 +
12374 + int saved_size = count * GET_MODE_SIZE (DFmode);
12375 +
12376 + /* Since fstd does not have postdecrement addressing mode,
12377 + we first decrement stack pointer and then use base+offset
12378 + stores for VFP registers. The ARM EABI unwind information
12379 + can't easily describe base+offset loads, so we attach
12380 + a note for the effects of the whole block in the first insn,
12381 + and avoid marking the subsequent instructions
12382 + with RTX_FRAME_RELATED_P. */
12383 + rtx sp_insn = gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
12384 + GEN_INT (-saved_size));
12385 + sp_insn = emit_insn (sp_insn);
12386 + RTX_FRAME_RELATED_P (sp_insn) = 1;
12387 +
12388 + dwarf = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (count + 1));
12389 + XVECEXP (dwarf, 0, 0) =
12390 + gen_rtx_SET (VOIDmode, stack_pointer_rtx,
12391 + plus_constant (stack_pointer_rtx, -saved_size));
12392 +
12393 + /* push double VFP registers to stack */
12394 + for (i = 0; i < count; ++i )
12395 + {
12396 + rtx reg;
12397 + rtx mem;
12398 + rtx addr;
12399 + rtx insn;
12400 + reg = gen_rtx_REG (DFmode, base_reg + 2*i);
12401 + addr = (i == 0) ? stack_pointer_rtx
12402 + : gen_rtx_PLUS (SImode, stack_pointer_rtx,
12403 + GEN_INT (i * GET_MODE_SIZE (DFmode)));
12404 + mem = gen_frame_mem (DFmode, addr);
12405 + insn = emit_move_insn (mem, reg);
12406 + XVECEXP (dwarf, 0, i+1) =
12407 + gen_rtx_SET (VOIDmode, mem, reg);
12408 + }
12409 +
12410 + REG_NOTES (sp_insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
12411 + REG_NOTES (sp_insn));
12412 +
12413 + return saved_size;
12414 + }
12415 +
12416 /* Workaround ARM10 VFPr1 bug. Data corruption can occur when exactly two
12417 register pairs are stored by a store multiple insn. We avoid this
12418 by pushing an extra pair. */
12419 @@ -9729,6 +11500,14 @@ output_call_mem (rtx *operands)
12420 }
12421
12422
12423 +/* Emit a MOVW/MOVT pair. */
12424 +void arm_emit_movpair (rtx dest, rtx src)
12425 +{
12426 + emit_set_insn (dest, gen_rtx_HIGH (SImode, src));
12427 + emit_set_insn (dest, gen_rtx_LO_SUM (SImode, dest, src));
12428 +}
12429 +
12430 +
12431 /* Output a move from arm registers to an fpa registers.
12432 OPERANDS[0] is an fpa register.
12433 OPERANDS[1] is the first registers of an arm register pair. */
12434 @@ -9862,7 +11641,11 @@ output_move_double (rtx *operands)
12435 switch (GET_CODE (XEXP (operands[1], 0)))
12436 {
12437 case REG:
12438 - output_asm_insn ("ldm%(ia%)\t%m1, %M0", operands);
12439 + if (TARGET_LDRD
12440 + && !(fix_cm3_ldrd && reg0 == REGNO(XEXP (operands[1], 0))))
12441 + output_asm_insn ("ldr%(d%)\t%0, [%m1]", operands);
12442 + else
12443 + output_asm_insn ("ldm%(ia%)\t%m1, %M0", operands);
12444 break;
12445
12446 case PRE_INC:
12447 @@ -9878,7 +11661,10 @@ output_move_double (rtx *operands)
12448 break;
12449
12450 case POST_INC:
12451 - output_asm_insn ("ldm%(ia%)\t%m1!, %M0", operands);
12452 + if (TARGET_LDRD)
12453 + output_asm_insn ("ldr%(d%)\t%0, [%m1], #8", operands);
12454 + else
12455 + output_asm_insn ("ldm%(ia%)\t%m1!, %M0", operands);
12456 break;
12457
12458 case POST_DEC:
12459 @@ -9888,6 +11674,10 @@ output_move_double (rtx *operands)
12460
12461 case PRE_MODIFY:
12462 case POST_MODIFY:
12463 + /* Autoicrement addressing modes should never have overlapping
12464 + base and destination registers, and overlapping index registers
12465 + are already prohibited, so this doesn't need to worry about
12466 + fix_cm3_ldrd. */
12467 otherops[0] = operands[0];
12468 otherops[1] = XEXP (XEXP (XEXP (operands[1], 0), 1), 0);
12469 otherops[2] = XEXP (XEXP (XEXP (operands[1], 0), 1), 1);
12470 @@ -9902,9 +11692,9 @@ output_move_double (rtx *operands)
12471 }
12472 else
12473 {
12474 - /* IWMMXT allows offsets larger than ldrd can handle,
12475 + /* IWMMXT allows offsets larger than ARM ldrd can handle,
12476 fix these up with a pair of ldr. */
12477 - if (GET_CODE (otherops[2]) == CONST_INT
12478 + if (TARGET_ARM && GET_CODE (otherops[2]) == CONST_INT
12479 && (INTVAL(otherops[2]) <= -256
12480 || INTVAL(otherops[2]) >= 256))
12481 {
12482 @@ -9918,9 +11708,9 @@ output_move_double (rtx *operands)
12483 }
12484 else
12485 {
12486 - /* IWMMXT allows offsets larger than ldrd can handle,
12487 + /* IWMMXT allows offsets larger than ARM ldrd can handle,
12488 fix these up with a pair of ldr. */
12489 - if (GET_CODE (otherops[2]) == CONST_INT
12490 + if (TARGET_ARM && GET_CODE (otherops[2]) == CONST_INT
12491 && (INTVAL(otherops[2]) <= -256
12492 || INTVAL(otherops[2]) >= 256))
12493 {
12494 @@ -9937,8 +11727,15 @@ output_move_double (rtx *operands)
12495
12496 case LABEL_REF:
12497 case CONST:
12498 - output_asm_insn ("adr%?\t%0, %1", operands);
12499 - output_asm_insn ("ldm%(ia%)\t%0, %M0", operands);
12500 + /* Use the second register of the pair to avoid problematic
12501 + overlap. */
12502 + otherops[1] = operands[1];
12503 + output_asm_insn ("adr%?\t%0, %1", otherops);
12504 + operands[1] = otherops[0];
12505 + if (TARGET_LDRD)
12506 + output_asm_insn ("ldr%(d%)\t%0, [%1]", operands);
12507 + else
12508 + output_asm_insn ("ldm%(ia%)\t%1, %M0", operands);
12509 break;
12510
12511 /* ??? This needs checking for thumb2. */
12512 @@ -9952,7 +11749,7 @@ output_move_double (rtx *operands)
12513
12514 if (GET_CODE (XEXP (operands[1], 0)) == PLUS)
12515 {
12516 - if (GET_CODE (otherops[2]) == CONST_INT)
12517 + if (GET_CODE (otherops[2]) == CONST_INT && !TARGET_LDRD)
12518 {
12519 switch ((int) INTVAL (otherops[2]))
12520 {
12521 @@ -9971,30 +11768,37 @@ output_move_double (rtx *operands)
12522 return "";
12523 }
12524 }
12525 + otherops[0] = gen_rtx_REG(SImode, REGNO(operands[0]) + 1);
12526 + operands[1] = otherops[0];
12527 if (TARGET_LDRD
12528 && (GET_CODE (otherops[2]) == REG
12529 || (GET_CODE (otherops[2]) == CONST_INT
12530 && INTVAL (otherops[2]) > -256
12531 && INTVAL (otherops[2]) < 256)))
12532 {
12533 - if (reg_overlap_mentioned_p (otherops[0],
12534 + if (reg_overlap_mentioned_p (operands[0],
12535 otherops[2]))
12536 {
12537 + rtx tmp;
12538 /* Swap base and index registers over to
12539 avoid a conflict. */
12540 - otherops[1] = XEXP (XEXP (operands[1], 0), 1);
12541 - otherops[2] = XEXP (XEXP (operands[1], 0), 0);
12542 + tmp = otherops[1];
12543 + otherops[1] = otherops[2];
12544 + otherops[2] = tmp;
12545 }
12546 /* If both registers conflict, it will usually
12547 have been fixed by a splitter. */
12548 - if (reg_overlap_mentioned_p (otherops[0], otherops[2]))
12549 + if (reg_overlap_mentioned_p (operands[0], otherops[2])
12550 + || (fix_cm3_ldrd && reg0 == REGNO (otherops[1])))
12551 {
12552 - output_asm_insn ("add%?\t%1, %1, %2", otherops);
12553 - output_asm_insn ("ldr%(d%)\t%0, [%1]",
12554 - otherops);
12555 + output_asm_insn ("add%?\t%0, %1, %2", otherops);
12556 + output_asm_insn ("ldr%(d%)\t%0, [%1]", operands);
12557 }
12558 else
12559 - output_asm_insn ("ldr%(d%)\t%0, [%1, %2]", otherops);
12560 + {
12561 + otherops[0] = operands[0];
12562 + output_asm_insn ("ldr%(d%)\t%0, [%1, %2]", otherops);
12563 + }
12564 return "";
12565 }
12566
12567 @@ -10011,7 +11815,10 @@ output_move_double (rtx *operands)
12568 else
12569 output_asm_insn ("sub%?\t%0, %1, %2", otherops);
12570
12571 - return "ldm%(ia%)\t%0, %M0";
12572 + if (TARGET_LDRD)
12573 + return "ldr%(d%)\t%0, [%1]";
12574 +
12575 + return "ldm%(ia%)\t%1, %M0";
12576 }
12577 else
12578 {
12579 @@ -10039,7 +11846,10 @@ output_move_double (rtx *operands)
12580 switch (GET_CODE (XEXP (operands[0], 0)))
12581 {
12582 case REG:
12583 - output_asm_insn ("stm%(ia%)\t%m0, %M1", operands);
12584 + if (TARGET_LDRD)
12585 + output_asm_insn ("str%(d%)\t%1, [%m0]", operands);
12586 + else
12587 + output_asm_insn ("stm%(ia%)\t%m0, %M1", operands);
12588 break;
12589
12590 case PRE_INC:
12591 @@ -10055,7 +11865,10 @@ output_move_double (rtx *operands)
12592 break;
12593
12594 case POST_INC:
12595 - output_asm_insn ("stm%(ia%)\t%m0!, %M1", operands);
12596 + if (TARGET_LDRD)
12597 + output_asm_insn ("str%(d%)\t%1, [%m0], #8", operands);
12598 + else
12599 + output_asm_insn ("stm%(ia%)\t%m0!, %M1", operands);
12600 break;
12601
12602 case POST_DEC:
12603 @@ -10069,9 +11882,9 @@ output_move_double (rtx *operands)
12604 otherops[1] = XEXP (XEXP (XEXP (operands[0], 0), 1), 0);
12605 otherops[2] = XEXP (XEXP (XEXP (operands[0], 0), 1), 1);
12606
12607 - /* IWMMXT allows offsets larger than ldrd can handle,
12608 + /* IWMMXT allows offsets larger than ARM ldrd can handle,
12609 fix these up with a pair of ldr. */
12610 - if (GET_CODE (otherops[2]) == CONST_INT
12611 + if (TARGET_ARM && GET_CODE (otherops[2]) == CONST_INT
12612 && (INTVAL(otherops[2]) <= -256
12613 || INTVAL(otherops[2]) >= 256))
12614 {
12615 @@ -10099,7 +11912,7 @@ output_move_double (rtx *operands)
12616
12617 case PLUS:
12618 otherops[2] = XEXP (XEXP (operands[0], 0), 1);
12619 - if (GET_CODE (otherops[2]) == CONST_INT)
12620 + if (GET_CODE (otherops[2]) == CONST_INT && !TARGET_LDRD)
12621 {
12622 switch ((int) INTVAL (XEXP (XEXP (operands[0], 0), 1)))
12623 {
12624 @@ -10145,7 +11958,7 @@ output_move_double (rtx *operands)
12625 }
12626
12627 /* Output a move, load or store for quad-word vectors in ARM registers. Only
12628 - handles MEMs accepted by neon_vector_mem_operand with CORE=true. */
12629 + handles MEMs accepted by neon_vector_mem_operand with TYPE=1. */
12630
12631 const char *
12632 output_move_quad (rtx *operands)
12633 @@ -10343,6 +12156,13 @@ output_move_neon (rtx *operands)
12634 ops[1] = reg;
12635 break;
12636
12637 + case PRE_DEC:
12638 + /* FIXME: We should be using vld1/vst1 here in BE mode? */
12639 + template = "v%smdb%%?\t%%0!, %%h1";
12640 + ops[0] = XEXP (addr, 0);
12641 + ops[1] = reg;
12642 + break;
12643 +
12644 case POST_MODIFY:
12645 /* FIXME: Not currently enabled in neon_vector_mem_operand. */
12646 gcc_unreachable ();
12647 @@ -10700,25 +12520,14 @@ arm_compute_save_reg0_reg12_mask (void)
12648 }
12649 else
12650 {
12651 - /* In arm mode we handle r11 (FP) as a special case. */
12652 - unsigned last_reg = TARGET_ARM ? 10 : 11;
12653 -
12654 /* In the normal case we only need to save those registers
12655 which are call saved and which are used by this function. */
12656 - for (reg = 0; reg <= last_reg; reg++)
12657 + for (reg = 0; reg <= 11; reg++)
12658 if (df_regs_ever_live_p (reg) && ! call_used_regs[reg])
12659 save_reg_mask |= (1 << reg);
12660
12661 /* Handle the frame pointer as a special case. */
12662 - if (! TARGET_APCS_FRAME
12663 - && ! frame_pointer_needed
12664 - && df_regs_ever_live_p (HARD_FRAME_POINTER_REGNUM)
12665 - && ! call_used_regs[HARD_FRAME_POINTER_REGNUM])
12666 - save_reg_mask |= 1 << HARD_FRAME_POINTER_REGNUM;
12667 - else if (! TARGET_APCS_FRAME
12668 - && ! frame_pointer_needed
12669 - && df_regs_ever_live_p (HARD_FRAME_POINTER_REGNUM)
12670 - && ! call_used_regs[HARD_FRAME_POINTER_REGNUM])
12671 + if (frame_pointer_needed)
12672 save_reg_mask |= 1 << HARD_FRAME_POINTER_REGNUM;
12673
12674 /* If we aren't loading the PIC register,
12675 @@ -10753,8 +12562,27 @@ arm_compute_save_reg0_reg12_mask (void)
12676 }
12677
12678
12679 +/* Compute the number of bytes used to store the static chain register on the
12680 + stack, above the stack frame. We need to know this accurately to get the
12681 + alignment of the rest of the stack frame correct. */
12682 +
12683 +static int arm_compute_static_chain_stack_bytes (void)
12684 +{
12685 + unsigned long func_type = arm_current_func_type ();
12686 + int static_chain_stack_bytes = 0;
12687 +
12688 + if (TARGET_APCS_FRAME && frame_pointer_needed && TARGET_ARM &&
12689 + IS_NESTED (func_type) &&
12690 + df_regs_ever_live_p (3) && current_function_pretend_args_size == 0)
12691 + static_chain_stack_bytes = 4;
12692 +
12693 + return static_chain_stack_bytes;
12694 +}
12695 +
12696 +
12697 /* Compute a bit mask of which registers need to be
12698 - saved on the stack for the current function. */
12699 + saved on the stack for the current function.
12700 + This is used by arm_get_frame_offsets, which may add extra registers. */
12701
12702 static unsigned long
12703 arm_compute_save_reg_mask (void)
12704 @@ -10769,7 +12597,7 @@ arm_compute_save_reg_mask (void)
12705
12706 /* If we are creating a stack frame, then we must save the frame pointer,
12707 IP (which will hold the old stack pointer), LR and the PC. */
12708 - if (frame_pointer_needed && TARGET_ARM)
12709 + if (TARGET_APCS_FRAME && frame_pointer_needed && TARGET_ARM)
12710 save_reg_mask |=
12711 (1 << ARM_HARD_FRAME_POINTER_REGNUM)
12712 | (1 << IP_REGNUM)
12713 @@ -10804,7 +12632,9 @@ arm_compute_save_reg_mask (void)
12714
12715 if (TARGET_REALLY_IWMMXT
12716 && ((bit_count (save_reg_mask)
12717 - + ARM_NUM_INTS (current_function_pretend_args_size)) % 2) != 0)
12718 + + ARM_NUM_INTS (current_function_pretend_args_size +
12719 + arm_compute_static_chain_stack_bytes())
12720 + ) % 2) != 0)
12721 {
12722 /* The total number of registers that are going to be pushed
12723 onto the stack is odd. We need to ensure that the stack
12724 @@ -10882,13 +12712,33 @@ thumb1_compute_save_reg_mask (void)
12725 reg = thumb_find_work_register (1 << LAST_LO_REGNUM);
12726 /* Make sure the register returned by thumb_find_work_register is
12727 not part of the return value. */
12728 - if (reg * UNITS_PER_WORD <= arm_size_return_regs ())
12729 + if (reg * UNITS_PER_WORD <= (unsigned) arm_size_return_regs ())
12730 reg = LAST_LO_REGNUM;
12731
12732 if (! call_used_regs[reg])
12733 mask |= 1 << reg;
12734 }
12735
12736 + /* The 504 below is 8 bytes less than 512 because there are two possible
12737 + alignment words. We can't tell here if they will be present or not so we
12738 + have to play it safe and assume that they are. */
12739 + if ((CALLER_INTERWORKING_SLOT_SIZE +
12740 + ROUND_UP_WORD (get_frame_size ()) +
12741 + current_function_outgoing_args_size) >= 504)
12742 + {
12743 + /* This is the same as the code in thumb1_expand_prologue() which
12744 + determines which register to use for stack decrement. */
12745 + for (reg = LAST_ARG_REGNUM + 1; reg <= LAST_LO_REGNUM; reg++)
12746 + if (mask & (1 << reg))
12747 + break;
12748 +
12749 + if (reg > LAST_LO_REGNUM)
12750 + {
12751 + /* Make sure we have a register available for stack decrement. */
12752 + mask |= 1 << LAST_LO_REGNUM;
12753 + }
12754 + }
12755 +
12756 return mask;
12757 }
12758
12759 @@ -10916,7 +12766,7 @@ arm_get_vfp_saved_size (void)
12760 if (count > 0)
12761 {
12762 /* Workaround ARM10 VFPr1 bug. */
12763 - if (count == 2 && !arm_arch6)
12764 + if (count == 2 && !arm_arch6 && !low_irq_latency)
12765 count++;
12766 saved += count * 8;
12767 }
12768 @@ -10979,7 +12829,8 @@ output_return_instruction (rtx operand,
12769
12770 return_used_this_function = 1;
12771
12772 - live_regs_mask = arm_compute_save_reg_mask ();
12773 + offsets = arm_get_frame_offsets ();
12774 + live_regs_mask = offsets->saved_regs_mask;
12775
12776 if (live_regs_mask)
12777 {
12778 @@ -11041,7 +12892,6 @@ output_return_instruction (rtx operand,
12779 {
12780 unsigned HOST_WIDE_INT stack_adjust;
12781
12782 - offsets = arm_get_frame_offsets ();
12783 stack_adjust = offsets->outgoing_args - offsets->saved_regs;
12784 gcc_assert (stack_adjust == 0 || stack_adjust == 4);
12785
12786 @@ -11245,6 +13095,41 @@ arm_output_function_prologue (FILE *f, H
12787 return_used_this_function = 0;
12788 }
12789
12790 +/* Generate to STREAM a code sequence that pops registers identified
12791 + in REGS_MASK from SP. SP is incremented as the result.
12792 +*/
12793 +static void
12794 +print_pop_reg_by_ldr (FILE *stream, int regs_mask, int rfe)
12795 +{
12796 + int reg;
12797 +
12798 + gcc_assert (! (regs_mask & (1 << SP_REGNUM)));
12799 +
12800 + for (reg = 0; reg < PC_REGNUM; ++reg)
12801 + if (regs_mask & (1 << reg))
12802 + asm_fprintf (stream, "\tldr\t%r, [%r], #4\n",
12803 + reg, SP_REGNUM);
12804 +
12805 + if (regs_mask & (1 << PC_REGNUM))
12806 + {
12807 + if (rfe)
12808 + /* When returning from exception, we need to
12809 + copy SPSR to CPSR. There are two ways to do
12810 + that: the ldm instruction with "^" suffix,
12811 + and movs instruction. The latter would
12812 + require that we load from stack to some
12813 + scratch register, and then move to PC.
12814 + Therefore, we'd need extra instruction and
12815 + have to make sure we actually have a spare
12816 + register. Using ldm with a single register
12817 + is simler. */
12818 + asm_fprintf (stream, "\tldm\tsp!, {pc}^\n");
12819 + else
12820 + asm_fprintf (stream, "\tldr\t%r, [%r], #4\n",
12821 + PC_REGNUM, SP_REGNUM);
12822 + }
12823 +}
12824 +
12825 const char *
12826 arm_output_epilogue (rtx sibling)
12827 {
12828 @@ -11289,7 +13174,7 @@ arm_output_epilogue (rtx sibling)
12829 gcc_assert (!current_function_calls_eh_return || really_return);
12830
12831 offsets = arm_get_frame_offsets ();
12832 - saved_regs_mask = arm_compute_save_reg_mask ();
12833 + saved_regs_mask = offsets->saved_regs_mask;
12834
12835 if (TARGET_IWMMXT)
12836 lrm_count = bit_count (saved_regs_mask);
12837 @@ -11300,7 +13185,7 @@ arm_output_epilogue (rtx sibling)
12838 if (saved_regs_mask & (1 << reg))
12839 floats_offset += 4;
12840
12841 - if (frame_pointer_needed && TARGET_ARM)
12842 + if (TARGET_APCS_FRAME && frame_pointer_needed && TARGET_ARM)
12843 {
12844 /* This variable is for the Virtual Frame Pointer, not VFP regs. */
12845 int vfp_offset = offsets->frame;
12846 @@ -11446,32 +13331,88 @@ arm_output_epilogue (rtx sibling)
12847 }
12848 else
12849 {
12850 + /* This branch is executed for ARM mode (non-apcs frames) and
12851 + Thumb-2 mode. Frame layout is essentially the same for those
12852 + cases, except that in ARM mode frame pointer points to the
12853 + first saved register, while in Thumb-2 mode the frame pointer points
12854 + to the last saved register.
12855 +
12856 + It is possible to make frame pointer point to last saved
12857 + register in both cases, and remove some conditionals below.
12858 + That means that fp setup in prologue would be just "mov fp, sp"
12859 + and sp restore in epilogue would be just "mov sp, fp", whereas
12860 + now we have to use add/sub in those cases. However, the value
12861 + of that would be marginal, as both mov and add/sub are 32-bit
12862 + in ARM mode, and it would require extra conditionals
12863 + in arm_expand_prologue to distingish ARM-apcs-frame case
12864 + (where frame pointer is required to point at first register)
12865 + and ARM-non-apcs-frame. Therefore, such change is postponed
12866 + until real need arise. */
12867 HOST_WIDE_INT amount;
12868 int rfe;
12869 /* Restore stack pointer if necessary. */
12870 - if (frame_pointer_needed)
12871 + if (TARGET_ARM && frame_pointer_needed)
12872 {
12873 - /* For Thumb-2 restore sp from the frame pointer.
12874 - Operand restrictions mean we have to increment FP, then copy
12875 - to SP. */
12876 - amount = offsets->locals_base - offsets->saved_regs;
12877 - operands[0] = hard_frame_pointer_rtx;
12878 + operands[0] = stack_pointer_rtx;
12879 + operands[1] = hard_frame_pointer_rtx;
12880 +
12881 + operands[2] = GEN_INT (offsets->frame - offsets->saved_regs);
12882 + output_add_immediate (operands);
12883 }
12884 else
12885 {
12886 - operands[0] = stack_pointer_rtx;
12887 - amount = offsets->outgoing_args - offsets->saved_regs;
12888 - }
12889 + if (frame_pointer_needed)
12890 + {
12891 + /* For Thumb-2 restore sp from the frame pointer.
12892 + Operand restrictions mean we have to incrememnt FP, then copy
12893 + to SP. */
12894 + amount = offsets->locals_base - offsets->saved_regs;
12895 + operands[0] = hard_frame_pointer_rtx;
12896 + }
12897 + else
12898 + {
12899 + unsigned long count;
12900 + operands[0] = stack_pointer_rtx;
12901 + amount = offsets->outgoing_args - offsets->saved_regs;
12902 + /* Pop call clobbered registers if it avoids a
12903 + separate stack adjustment. */
12904 + count = offsets->saved_regs - offsets->saved_args;
12905 + if (optimize_size
12906 + && count != 0
12907 + && !current_function_calls_eh_return
12908 + && bit_count (saved_regs_mask) * 4 == count
12909 + && !IS_INTERRUPT (func_type)
12910 + && !cfun->tail_call_emit)
12911 + {
12912 + unsigned long mask;
12913 + mask = (1 << (arm_size_return_regs () / 4)) - 1;
12914 + mask ^= 0xf;
12915 + mask &= ~saved_regs_mask;
12916 + reg = 0;
12917 + while (bit_count (mask) * 4 > amount)
12918 + {
12919 + while ((mask & (1 << reg)) == 0)
12920 + reg++;
12921 + mask &= ~(1 << reg);
12922 + }
12923 + if (bit_count (mask) * 4 == amount)
12924 + {
12925 + amount = 0;
12926 + saved_regs_mask |= mask;
12927 + }
12928 + }
12929 + }
12930
12931 - if (amount)
12932 - {
12933 - operands[1] = operands[0];
12934 - operands[2] = GEN_INT (amount);
12935 - output_add_immediate (operands);
12936 + if (amount)
12937 + {
12938 + operands[1] = operands[0];
12939 + operands[2] = GEN_INT (amount);
12940 + output_add_immediate (operands);
12941 + }
12942 + if (frame_pointer_needed)
12943 + asm_fprintf (f, "\tmov\t%r, %r\n",
12944 + SP_REGNUM, HARD_FRAME_POINTER_REGNUM);
12945 }
12946 - if (frame_pointer_needed)
12947 - asm_fprintf (f, "\tmov\t%r, %r\n",
12948 - SP_REGNUM, HARD_FRAME_POINTER_REGNUM);
12949
12950 if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
12951 {
12952 @@ -11557,22 +13498,19 @@ arm_output_epilogue (rtx sibling)
12953 to load use the LDR instruction - it is faster. For Thumb-2
12954 always use pop and the assembler will pick the best instruction.*/
12955 if (TARGET_ARM && saved_regs_mask == (1 << LR_REGNUM)
12956 - && !IS_INTERRUPT(func_type))
12957 + && !IS_INTERRUPT (func_type))
12958 {
12959 asm_fprintf (f, "\tldr\t%r, [%r], #4\n", LR_REGNUM, SP_REGNUM);
12960 }
12961 else if (saved_regs_mask)
12962 {
12963 - if (saved_regs_mask & (1 << SP_REGNUM))
12964 - /* Note - write back to the stack register is not enabled
12965 - (i.e. "ldmfd sp!..."). We know that the stack pointer is
12966 - in the list of registers and if we add writeback the
12967 - instruction becomes UNPREDICTABLE. */
12968 - print_multi_reg (f, "ldmfd\t%r, ", SP_REGNUM, saved_regs_mask,
12969 - rfe);
12970 - else if (TARGET_ARM)
12971 - print_multi_reg (f, "ldmfd\t%r!, ", SP_REGNUM, saved_regs_mask,
12972 - rfe);
12973 + gcc_assert ( ! (saved_regs_mask & (1 << SP_REGNUM)));
12974 + if (TARGET_ARM)
12975 + if (low_irq_latency)
12976 + print_pop_reg_by_ldr (f, saved_regs_mask, rfe);
12977 + else
12978 + print_multi_reg (f, "ldmfd\t%r!, ", SP_REGNUM, saved_regs_mask,
12979 + rfe);
12980 else
12981 print_multi_reg (f, "pop\t", SP_REGNUM, saved_regs_mask, 0);
12982 }
12983 @@ -11693,6 +13631,32 @@ emit_multi_reg_push (unsigned long mask)
12984
12985 gcc_assert (num_regs && num_regs <= 16);
12986
12987 + if (low_irq_latency)
12988 + {
12989 + rtx insn = 0;
12990 +
12991 + /* Emit a series of ldr instructions rather rather than a single ldm. */
12992 + /* TODO: Use ldrd where possible. */
12993 + gcc_assert (! (mask & (1 << SP_REGNUM)));
12994 +
12995 + for (i = LAST_ARM_REGNUM; i >= 0; --i)
12996 + {
12997 + if (mask & (1 << i))
12998 +
12999 + {
13000 + rtx reg, where, mem;
13001 +
13002 + reg = gen_rtx_REG (SImode, i);
13003 + where = gen_rtx_PRE_DEC (SImode, stack_pointer_rtx);
13004 + mem = gen_rtx_MEM (SImode, where);
13005 + insn = emit_move_insn (mem, reg);
13006 + RTX_FRAME_RELATED_P (insn) = 1;
13007 + }
13008 + }
13009 +
13010 + return insn;
13011 + }
13012 +
13013 /* We don't record the PC in the dwarf frame information. */
13014 num_dwarf_regs = num_regs;
13015 if (mask & (1 << PC_REGNUM))
13016 @@ -11930,7 +13894,8 @@ thumb_force_lr_save (void)
13017
13018
13019 /* Calculate stack offsets. These are used to calculate register elimination
13020 - offsets and in prologue/epilogue code. */
13021 + offsets and in prologue/epilogue code. Also calculates which registers
13022 + should be saved. */
13023
13024 static arm_stack_offsets *
13025 arm_get_frame_offsets (void)
13026 @@ -11939,7 +13904,9 @@ arm_get_frame_offsets (void)
13027 unsigned long func_type;
13028 int leaf;
13029 int saved;
13030 + int core_saved;
13031 HOST_WIDE_INT frame_size;
13032 + int i;
13033
13034 offsets = &cfun->machine->stack_offsets;
13035
13036 @@ -11966,13 +13933,16 @@ arm_get_frame_offsets (void)
13037 offsets->saved_args = current_function_pretend_args_size;
13038
13039 /* In Thumb mode this is incorrect, but never used. */
13040 - offsets->frame = offsets->saved_args + (frame_pointer_needed ? 4 : 0);
13041 + offsets->frame = offsets->saved_args + (frame_pointer_needed ? 4 : 0) +
13042 + arm_compute_static_chain_stack_bytes();
13043
13044 if (TARGET_32BIT)
13045 {
13046 unsigned int regno;
13047
13048 - saved = bit_count (arm_compute_save_reg_mask ()) * 4;
13049 + offsets->saved_regs_mask = arm_compute_save_reg_mask ();
13050 + core_saved = bit_count (offsets->saved_regs_mask) * 4;
13051 + saved = core_saved;
13052
13053 /* We know that SP will be doubleword aligned on entry, and we must
13054 preserve that condition at any subroutine call. We also require the
13055 @@ -12003,13 +13973,16 @@ arm_get_frame_offsets (void)
13056 }
13057 else /* TARGET_THUMB1 */
13058 {
13059 - saved = bit_count (thumb1_compute_save_reg_mask ()) * 4;
13060 + offsets->saved_regs_mask = thumb1_compute_save_reg_mask ();
13061 + core_saved = bit_count (offsets->saved_regs_mask) * 4;
13062 + saved = core_saved;
13063 if (TARGET_BACKTRACE)
13064 saved += 16;
13065 }
13066
13067 /* Saved registers include the stack frame. */
13068 - offsets->saved_regs = offsets->saved_args + saved;
13069 + offsets->saved_regs = offsets->saved_args + saved +
13070 + arm_compute_static_chain_stack_bytes();
13071 offsets->soft_frame = offsets->saved_regs + CALLER_INTERWORKING_SLOT_SIZE;
13072 /* A leaf function does not need any stack alignment if it has nothing
13073 on the stack. */
13074 @@ -12023,7 +13996,39 @@ arm_get_frame_offsets (void)
13075 /* Ensure SFP has the correct alignment. */
13076 if (ARM_DOUBLEWORD_ALIGN
13077 && (offsets->soft_frame & 7))
13078 - offsets->soft_frame += 4;
13079 + {
13080 + offsets->soft_frame += 4;
13081 + /* Try to align stack by pushing an extra reg. Don't bother doing this
13082 + when there is a stack frame as the alignment will be rolled into
13083 + the normal stack adjustment. */
13084 + if (frame_size + current_function_outgoing_args_size == 0)
13085 + {
13086 + int reg = -1;
13087 +
13088 + for (i = 4; i <= (TARGET_THUMB1 ? LAST_LO_REGNUM : 11); i++)
13089 + {
13090 + if ((offsets->saved_regs_mask & (1 << i)) == 0)
13091 + {
13092 + reg = i;
13093 + break;
13094 + }
13095 + }
13096 +
13097 + if (reg == -1 && arm_size_return_regs () <= 12
13098 + && !cfun->tail_call_emit)
13099 + {
13100 + /* Push/pop an argument register (r3) if all callee saved
13101 + registers are already being pushed. */
13102 + reg = 3;
13103 + }
13104 +
13105 + if (reg != -1)
13106 + {
13107 + offsets->saved_regs += 4;
13108 + offsets->saved_regs_mask |= (1 << reg);
13109 + }
13110 + }
13111 + }
13112
13113 offsets->locals_base = offsets->soft_frame + frame_size;
13114 offsets->outgoing_args = (offsets->locals_base
13115 @@ -12069,14 +14074,9 @@ arm_compute_initial_elimination_offset (
13116 return offsets->soft_frame - offsets->saved_args;
13117
13118 case ARM_HARD_FRAME_POINTER_REGNUM:
13119 - /* If there is no stack frame then the hard
13120 - frame pointer and the arg pointer coincide. */
13121 - if (offsets->frame == offsets->saved_regs)
13122 - return 0;
13123 - /* FIXME: Not sure about this. Maybe we should always return 0 ? */
13124 - return (frame_pointer_needed
13125 - && cfun->static_chain_decl != NULL
13126 - && ! cfun->machine->uses_anonymous_args) ? 4 : 0;
13127 + /* This is only non-zero in the case where the static chain register
13128 + is stored above the frame. */
13129 + return offsets->frame - offsets->saved_args - 4;
13130
13131 case STACK_POINTER_REGNUM:
13132 /* If nothing has been pushed on the stack at all
13133 @@ -12229,9 +14229,20 @@ thumb_set_frame_pointer (arm_stack_offse
13134 else
13135 {
13136 emit_insn (gen_movsi (hard_frame_pointer_rtx, GEN_INT (amount)));
13137 - insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx,
13138 - hard_frame_pointer_rtx,
13139 - stack_pointer_rtx));
13140 + /* Thumb-2 RTL patterns expect sp as the first input. Thumb-1
13141 + expects the first two operands to be the same. */
13142 + if (TARGET_THUMB2)
13143 + {
13144 + insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx,
13145 + stack_pointer_rtx,
13146 + hard_frame_pointer_rtx));
13147 + }
13148 + else
13149 + {
13150 + insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx,
13151 + hard_frame_pointer_rtx,
13152 + stack_pointer_rtx));
13153 + }
13154 dwarf = gen_rtx_SET (VOIDmode, hard_frame_pointer_rtx,
13155 plus_constant (stack_pointer_rtx, amount));
13156 RTX_FRAME_RELATED_P (dwarf) = 1;
13157 @@ -12268,7 +14279,8 @@ arm_expand_prologue (void)
13158 args_to_push = current_function_pretend_args_size;
13159
13160 /* Compute which register we will have to save onto the stack. */
13161 - live_regs_mask = arm_compute_save_reg_mask ();
13162 + offsets = arm_get_frame_offsets ();
13163 + live_regs_mask = offsets->saved_regs_mask;
13164
13165 ip_rtx = gen_rtx_REG (SImode, IP_REGNUM);
13166
13167 @@ -12292,7 +14304,9 @@ arm_expand_prologue (void)
13168
13169 r0 = gen_rtx_REG (SImode, 0);
13170 r1 = gen_rtx_REG (SImode, 1);
13171 - dwarf = gen_rtx_UNSPEC (SImode, NULL_RTVEC, UNSPEC_STACK_ALIGN);
13172 + /* Use a real rtvec rather than NULL_RTVEC so the rest of the
13173 + compiler won't choke. */
13174 + dwarf = gen_rtx_UNSPEC (SImode, rtvec_alloc (0), UNSPEC_STACK_ALIGN);
13175 dwarf = gen_rtx_SET (VOIDmode, r0, dwarf);
13176 insn = gen_movsi (r0, stack_pointer_rtx);
13177 RTX_FRAME_RELATED_P (insn) = 1;
13178 @@ -12303,7 +14317,10 @@ arm_expand_prologue (void)
13179 emit_insn (gen_movsi (stack_pointer_rtx, r1));
13180 }
13181
13182 - if (frame_pointer_needed && TARGET_ARM)
13183 + /* For APCS frames, if IP register is clobbered
13184 + when creating frame, save that register in a special
13185 + way. */
13186 + if (TARGET_APCS_FRAME && frame_pointer_needed && TARGET_ARM)
13187 {
13188 if (IS_INTERRUPT (func_type))
13189 {
13190 @@ -12347,6 +14364,9 @@ arm_expand_prologue (void)
13191 insn = emit_set_insn (gen_rtx_REG (SImode, 3), ip_rtx);
13192 else if (args_to_push == 0)
13193 {
13194 + gcc_assert(arm_compute_static_chain_stack_bytes() == 4);
13195 + saved_regs += 4;
13196 +
13197 rtx dwarf;
13198
13199 insn = gen_rtx_PRE_DEC (SImode, stack_pointer_rtx);
13200 @@ -12402,13 +14422,13 @@ arm_expand_prologue (void)
13201 }
13202
13203 /* If this is an interrupt service routine, and the link register
13204 - is going to be pushed, and we are not creating a stack frame,
13205 - (which would involve an extra push of IP and a pop in the epilogue)
13206 + is going to be pushed, and we're not generating extra
13207 + push of IP (needed when frame is needed and frame layout if apcs),
13208 subtracting four from LR now will mean that the function return
13209 can be done with a single instruction. */
13210 if ((func_type == ARM_FT_ISR || func_type == ARM_FT_FIQ)
13211 && (live_regs_mask & (1 << LR_REGNUM)) != 0
13212 - && ! frame_pointer_needed
13213 + && !(frame_pointer_needed && TARGET_APCS_FRAME)
13214 && TARGET_ARM)
13215 {
13216 rtx lr = gen_rtx_REG (SImode, LR_REGNUM);
13217 @@ -12418,8 +14438,28 @@ arm_expand_prologue (void)
13218
13219 if (live_regs_mask)
13220 {
13221 - insn = emit_multi_reg_push (live_regs_mask);
13222 saved_regs += bit_count (live_regs_mask) * 4;
13223 + if (optimize_size && !frame_pointer_needed
13224 + && saved_regs == offsets->saved_regs - offsets->saved_args)
13225 + {
13226 + /* If no coprocessor registers are being pushed and we don't have
13227 + to worry about a frame pointer then push extra registers to
13228 + create the stack frame. This is done is a way that does not
13229 + alter teh frame layout, so is independent of the epilogue. */
13230 + int n;
13231 + int frame;
13232 + n = 0;
13233 + while (n < 8 && (live_regs_mask & (1 << n)) == 0)
13234 + n++;
13235 + frame = offsets->outgoing_args - (offsets->saved_args + saved_regs);
13236 + if (frame && n * 4 >= frame)
13237 + {
13238 + n = frame / 4;
13239 + live_regs_mask |= (1 << n) - 1;
13240 + saved_regs += frame;
13241 + }
13242 + }
13243 + insn = emit_multi_reg_push (live_regs_mask);
13244 RTX_FRAME_RELATED_P (insn) = 1;
13245 }
13246
13247 @@ -12429,6 +14469,7 @@ arm_expand_prologue (void)
13248 if (frame_pointer_needed && TARGET_ARM)
13249 {
13250 /* Create the new frame pointer. */
13251 + if (TARGET_APCS_FRAME)
13252 {
13253 insn = GEN_INT (-(4 + args_to_push + fp_offset));
13254 insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx, ip_rtx, insn));
13255 @@ -12450,9 +14491,15 @@ arm_expand_prologue (void)
13256 emit_insn (gen_prologue_use (ip_rtx));
13257 }
13258 }
13259 + else
13260 + {
13261 + insn = GEN_INT (saved_regs - 4);
13262 + insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx,
13263 + stack_pointer_rtx, insn));
13264 + RTX_FRAME_RELATED_P (insn) = 1;
13265 + }
13266 }
13267
13268 - offsets = arm_get_frame_offsets ();
13269 if (offsets->outgoing_args != offsets->saved_args + saved_regs)
13270 {
13271 /* This add can produce multiple insns for a large constant, so we
13272 @@ -12633,10 +14680,21 @@ arm_print_operand (FILE *stream, rtx x,
13273 }
13274 return;
13275
13276 - /* An integer without a preceding # sign. */
13277 + /* An integer or symbol address without a preceding # sign. */
13278 case 'c':
13279 - gcc_assert (GET_CODE (x) == CONST_INT);
13280 - fprintf (stream, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
13281 + switch (GET_CODE (x))
13282 + {
13283 + case CONST_INT:
13284 + fprintf (stream, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
13285 + break;
13286 +
13287 + case SYMBOL_REF:
13288 + output_addr_const (stream, x);
13289 + break;
13290 +
13291 + default:
13292 + gcc_unreachable ();
13293 + }
13294 return;
13295
13296 case 'B':
13297 @@ -12693,7 +14751,11 @@ arm_print_operand (FILE *stream, rtx x,
13298 {
13299 fprintf (stream, ", %s ", shift);
13300 if (val == -1)
13301 - arm_print_operand (stream, XEXP (x, 1), 0);
13302 + {
13303 + arm_print_operand (stream, XEXP (x, 1), 0);
13304 + if (janus2_code)
13305 + fprintf(stream, "\n\tnop");
13306 + }
13307 else
13308 fprintf (stream, "#" HOST_WIDE_INT_PRINT_DEC, val);
13309 }
13310 @@ -13031,6 +15093,49 @@ arm_print_operand (FILE *stream, rtx x,
13311 }
13312 return;
13313
13314 + /* Memory operand for vld1/vst1 instruction. */
13315 + case 'A':
13316 + {
13317 + rtx addr;
13318 + bool postinc = FALSE;
13319 + gcc_assert (GET_CODE (x) == MEM);
13320 + addr = XEXP (x, 0);
13321 + if (GET_CODE (addr) == POST_INC)
13322 + {
13323 + postinc = 1;
13324 + addr = XEXP (addr, 0);
13325 + }
13326 + asm_fprintf (stream, "[%r]", REGNO (addr));
13327 + if (postinc)
13328 + fputs("!", stream);
13329 + }
13330 + return;
13331 +
13332 + /* Register specifier for vld1.16/vst1.16. Translate the S register
13333 + number into a D register number and element index. */
13334 + case 'z':
13335 + {
13336 + int mode = GET_MODE (x);
13337 + int regno;
13338 +
13339 + if (GET_MODE_SIZE (mode) != 2 || GET_CODE (x) != REG)
13340 + {
13341 + output_operand_lossage ("invalid operand for code '%c'", code);
13342 + return;
13343 + }
13344 +
13345 + regno = REGNO (x);
13346 + if (!VFP_REGNO_OK_FOR_SINGLE (regno))
13347 + {
13348 + output_operand_lossage ("invalid operand for code '%c'", code);
13349 + return;
13350 + }
13351 +
13352 + regno = regno - FIRST_VFP_REGNUM;
13353 + fprintf (stream, "d%d[%d]", regno/2, ((regno % 2) ? 2 : 0));
13354 + }
13355 + return;
13356 +
13357 default:
13358 if (x == 0)
13359 {
13360 @@ -13064,6 +15169,12 @@ arm_print_operand (FILE *stream, rtx x,
13361 default:
13362 gcc_assert (GET_CODE (x) != NEG);
13363 fputc ('#', stream);
13364 + if (GET_CODE (x) == HIGH)
13365 + {
13366 + fputs (":lower16:", stream);
13367 + x = XEXP (x, 0);
13368 + }
13369 +
13370 output_addr_const (stream, x);
13371 break;
13372 }
13373 @@ -13104,28 +15215,16 @@ arm_assemble_integer (rtx x, unsigned in
13374 if (arm_vector_mode_supported_p (mode))
13375 {
13376 int i, units;
13377 - unsigned int invmask = 0, parts_per_word;
13378
13379 gcc_assert (GET_CODE (x) == CONST_VECTOR);
13380
13381 units = CONST_VECTOR_NUNITS (x);
13382 size = GET_MODE_SIZE (GET_MODE_INNER (mode));
13383
13384 - /* For big-endian Neon vectors, we must permute the vector to the form
13385 - which, when loaded by a VLDR or VLDM instruction, will give a vector
13386 - with the elements in the right order. */
13387 - if (TARGET_NEON && WORDS_BIG_ENDIAN)
13388 - {
13389 - parts_per_word = UNITS_PER_WORD / size;
13390 - /* FIXME: This might be wrong for 64-bit vector elements, but we don't
13391 - support those anywhere yet. */
13392 - invmask = (parts_per_word == 0) ? 0 : (1 << (parts_per_word - 1)) - 1;
13393 - }
13394 -
13395 if (GET_MODE_CLASS (mode) == MODE_VECTOR_INT)
13396 for (i = 0; i < units; i++)
13397 {
13398 - rtx elt = CONST_VECTOR_ELT (x, i ^ invmask);
13399 + rtx elt = CONST_VECTOR_ELT (x, i);
13400 assemble_integer
13401 (elt, size, i == 0 ? BIGGEST_ALIGNMENT : size * BITS_PER_UNIT, 1);
13402 }
13403 @@ -13467,6 +15566,10 @@ arm_final_prescan_insn (rtx insn)
13404 first insn after the following code_label if REVERSE is true. */
13405 rtx start_insn = insn;
13406
13407 + /* Don't do this if we're not considering conditional execution. */
13408 + if (TARGET_NO_SINGLE_COND_EXEC)
13409 + return;
13410 +
13411 /* If in state 4, check if the target branch is reached, in order to
13412 change back to state 0. */
13413 if (arm_ccfsm_state == 4)
13414 @@ -13840,6 +15943,12 @@ arm_hard_regno_mode_ok (unsigned int reg
13415 if (mode == DFmode)
13416 return VFP_REGNO_OK_FOR_DOUBLE (regno);
13417
13418 + /* VFP registers can hold HFmode values, but there is no point in
13419 + putting them there unless we have the NEON extensions for
13420 + loading/storing them, too. */
13421 + if (mode == HFmode)
13422 + return TARGET_NEON_FP16 && VFP_REGNO_OK_FOR_SINGLE (regno);
13423 +
13424 if (TARGET_NEON)
13425 return (VALID_NEON_DREG_MODE (mode) && VFP_REGNO_OK_FOR_DOUBLE (regno))
13426 || (VALID_NEON_QREG_MODE (mode)
13427 @@ -13859,16 +15968,16 @@ arm_hard_regno_mode_ok (unsigned int reg
13428 return mode == SImode;
13429
13430 if (IS_IWMMXT_REGNUM (regno))
13431 - return VALID_IWMMXT_REG_MODE (mode);
13432 + return VALID_IWMMXT_REG_MODE (mode) && mode != SImode;
13433 }
13434
13435 - /* We allow any value to be stored in the general registers.
13436 + /* We allow almost any value to be stored in the general registers.
13437 Restrict doubleword quantities to even register pairs so that we can
13438 - use ldrd. Do not allow Neon structure opaque modes in general registers;
13439 - they would use too many. */
13440 + use ldrd. Do not allow very large Neon structure opaque modes in
13441 + general registers; they would use too many. */
13442 if (regno <= LAST_ARM_REGNUM)
13443 return !(TARGET_LDRD && GET_MODE_SIZE (mode) > 4 && (regno & 1) != 0)
13444 - && !VALID_NEON_STRUCT_MODE (mode);
13445 + && ARM_NUM_REGS (mode) <= 4;
13446
13447 if (regno == FRAME_POINTER_REGNUM
13448 || regno == ARG_POINTER_REGNUM)
13449 @@ -14913,6 +17022,24 @@ arm_init_neon_builtins (void)
13450 TYPE_PRECISION (neon_float_type_node) = FLOAT_TYPE_SIZE;
13451 layout_type (neon_float_type_node);
13452
13453 + /* Define typedefs which exactly correspond to the modes we are basing vector
13454 + types on. If you change these names you'll need to change
13455 + the table used by arm_mangle_type too. */
13456 + (*lang_hooks.types.register_builtin_type) (neon_intQI_type_node,
13457 + "__builtin_neon_qi");
13458 + (*lang_hooks.types.register_builtin_type) (neon_intHI_type_node,
13459 + "__builtin_neon_hi");
13460 + (*lang_hooks.types.register_builtin_type) (neon_intSI_type_node,
13461 + "__builtin_neon_si");
13462 + (*lang_hooks.types.register_builtin_type) (neon_float_type_node,
13463 + "__builtin_neon_sf");
13464 + (*lang_hooks.types.register_builtin_type) (neon_intDI_type_node,
13465 + "__builtin_neon_di");
13466 + (*lang_hooks.types.register_builtin_type) (neon_polyQI_type_node,
13467 + "__builtin_neon_poly8");
13468 + (*lang_hooks.types.register_builtin_type) (neon_polyHI_type_node,
13469 + "__builtin_neon_poly16");
13470 +
13471 intQI_pointer_node = build_pointer_type (neon_intQI_type_node);
13472 intHI_pointer_node = build_pointer_type (neon_intHI_type_node);
13473 intSI_pointer_node = build_pointer_type (neon_intSI_type_node);
13474 @@ -14965,12 +17092,32 @@ arm_init_neon_builtins (void)
13475 intUSI_type_node = make_unsigned_type (GET_MODE_PRECISION (SImode));
13476 intUDI_type_node = make_unsigned_type (GET_MODE_PRECISION (DImode));
13477
13478 + (*lang_hooks.types.register_builtin_type) (intUQI_type_node,
13479 + "__builtin_neon_uqi");
13480 + (*lang_hooks.types.register_builtin_type) (intUHI_type_node,
13481 + "__builtin_neon_uhi");
13482 + (*lang_hooks.types.register_builtin_type) (intUSI_type_node,
13483 + "__builtin_neon_usi");
13484 + (*lang_hooks.types.register_builtin_type) (intUDI_type_node,
13485 + "__builtin_neon_udi");
13486 +
13487 /* Opaque integer types for structures of vectors. */
13488 intEI_type_node = make_signed_type (GET_MODE_PRECISION (EImode));
13489 intOI_type_node = make_signed_type (GET_MODE_PRECISION (OImode));
13490 intCI_type_node = make_signed_type (GET_MODE_PRECISION (CImode));
13491 intXI_type_node = make_signed_type (GET_MODE_PRECISION (XImode));
13492
13493 + (*lang_hooks.types.register_builtin_type) (intTI_type_node,
13494 + "__builtin_neon_ti");
13495 + (*lang_hooks.types.register_builtin_type) (intEI_type_node,
13496 + "__builtin_neon_ei");
13497 + (*lang_hooks.types.register_builtin_type) (intOI_type_node,
13498 + "__builtin_neon_oi");
13499 + (*lang_hooks.types.register_builtin_type) (intCI_type_node,
13500 + "__builtin_neon_ci");
13501 + (*lang_hooks.types.register_builtin_type) (intXI_type_node,
13502 + "__builtin_neon_xi");
13503 +
13504 /* Pointers to vector types. */
13505 V8QI_pointer_node = build_pointer_type (V8QI_type_node);
13506 V4HI_pointer_node = build_pointer_type (V4HI_type_node);
13507 @@ -15014,44 +17161,6 @@ arm_init_neon_builtins (void)
13508 build_function_type_list (void_type_node, V2DI_pointer_node, V2DI_type_node,
13509 V2DI_type_node, NULL);
13510
13511 - /* Define typedefs which exactly correspond to the modes we are basing vector
13512 - types on. If you change these names you'll need to change
13513 - the table used by arm_mangle_type too. */
13514 - (*lang_hooks.types.register_builtin_type) (neon_intQI_type_node,
13515 - "__builtin_neon_qi");
13516 - (*lang_hooks.types.register_builtin_type) (neon_intHI_type_node,
13517 - "__builtin_neon_hi");
13518 - (*lang_hooks.types.register_builtin_type) (neon_intSI_type_node,
13519 - "__builtin_neon_si");
13520 - (*lang_hooks.types.register_builtin_type) (neon_float_type_node,
13521 - "__builtin_neon_sf");
13522 - (*lang_hooks.types.register_builtin_type) (neon_intDI_type_node,
13523 - "__builtin_neon_di");
13524 -
13525 - (*lang_hooks.types.register_builtin_type) (neon_polyQI_type_node,
13526 - "__builtin_neon_poly8");
13527 - (*lang_hooks.types.register_builtin_type) (neon_polyHI_type_node,
13528 - "__builtin_neon_poly16");
13529 - (*lang_hooks.types.register_builtin_type) (intUQI_type_node,
13530 - "__builtin_neon_uqi");
13531 - (*lang_hooks.types.register_builtin_type) (intUHI_type_node,
13532 - "__builtin_neon_uhi");
13533 - (*lang_hooks.types.register_builtin_type) (intUSI_type_node,
13534 - "__builtin_neon_usi");
13535 - (*lang_hooks.types.register_builtin_type) (intUDI_type_node,
13536 - "__builtin_neon_udi");
13537 -
13538 - (*lang_hooks.types.register_builtin_type) (intTI_type_node,
13539 - "__builtin_neon_ti");
13540 - (*lang_hooks.types.register_builtin_type) (intEI_type_node,
13541 - "__builtin_neon_ei");
13542 - (*lang_hooks.types.register_builtin_type) (intOI_type_node,
13543 - "__builtin_neon_oi");
13544 - (*lang_hooks.types.register_builtin_type) (intCI_type_node,
13545 - "__builtin_neon_ci");
13546 - (*lang_hooks.types.register_builtin_type) (intXI_type_node,
13547 - "__builtin_neon_xi");
13548 -
13549 dreg_types[0] = V8QI_type_node;
13550 dreg_types[1] = V4HI_type_node;
13551 dreg_types[2] = V2SI_type_node;
13552 @@ -15325,6 +17434,15 @@ arm_init_neon_builtins (void)
13553 }
13554
13555 static void
13556 +arm_init_fp16_builtins (void)
13557 +{
13558 + tree fp16_type = make_node (REAL_TYPE);
13559 + TYPE_PRECISION (fp16_type) = 16;
13560 + layout_type (fp16_type);
13561 + (*lang_hooks.types.register_builtin_type) (fp16_type, "__fp16");
13562 +}
13563 +
13564 +static void
13565 arm_init_builtins (void)
13566 {
13567 arm_init_tls_builtins ();
13568 @@ -15334,6 +17452,52 @@ arm_init_builtins (void)
13569
13570 if (TARGET_NEON)
13571 arm_init_neon_builtins ();
13572 +
13573 + if (arm_fp16_format)
13574 + arm_init_fp16_builtins ();
13575 +}
13576 +
13577 +/* Implement TARGET_INVALID_PARAMETER_TYPE. */
13578 +
13579 +static const char *
13580 +arm_invalid_parameter_type (const_tree t)
13581 +{
13582 + if (SCALAR_FLOAT_TYPE_P (t) && TYPE_PRECISION (t) == 16)
13583 + return N_("function parameters cannot have __fp16 type");
13584 + return NULL;
13585 +}
13586 +
13587 +/* Implement TARGET_INVALID_PARAMETER_TYPE. */
13588 +
13589 +static const char *
13590 +arm_invalid_return_type (const_tree t)
13591 +{
13592 + if (SCALAR_FLOAT_TYPE_P (t) && TYPE_PRECISION (t) == 16)
13593 + return N_("functions cannot return __fp16 type");
13594 + return NULL;
13595 +}
13596 +
13597 +/* Implement TARGET_PROMOTED_TYPE. */
13598 +
13599 +static tree
13600 +arm_promoted_type (const_tree t)
13601 +{
13602 + if (SCALAR_FLOAT_TYPE_P (t) && TYPE_PRECISION (t) == 16)
13603 + return float_type_node;
13604 + return NULL_TREE;
13605 +}
13606 +
13607 +/* Implement TARGET_CONVERT_TO_TYPE. */
13608 +static tree
13609 +arm_convert_to_type (tree type, tree expr)
13610 +{
13611 + tree fromtype = TREE_TYPE (expr);
13612 + if (!SCALAR_FLOAT_TYPE_P (fromtype) || !SCALAR_FLOAT_TYPE_P (type))
13613 + return NULL_TREE;
13614 + if ((TYPE_PRECISION (fromtype) == 16 && TYPE_PRECISION (type) > 32)
13615 + || (TYPE_PRECISION (type) == 16 && TYPE_PRECISION (fromtype) > 32))
13616 + return convert (type, convert (float_type_node, expr));
13617 + return NULL_TREE;
13618 }
13619
13620 /* Errors in the source file can cause expand_expr to return const0_rtx
13621 @@ -16514,6 +18678,7 @@ is_called_in_ARM_mode (tree func)
13622 const char *
13623 thumb_unexpanded_epilogue (void)
13624 {
13625 + arm_stack_offsets *offsets;
13626 int regno;
13627 unsigned long live_regs_mask = 0;
13628 int high_regs_pushed = 0;
13629 @@ -16526,7 +18691,8 @@ thumb_unexpanded_epilogue (void)
13630 if (IS_NAKED (arm_current_func_type ()))
13631 return "";
13632
13633 - live_regs_mask = thumb1_compute_save_reg_mask ();
13634 + offsets = arm_get_frame_offsets ();
13635 + live_regs_mask = offsets->saved_regs_mask;
13636 high_regs_pushed = bit_count (live_regs_mask & 0x0f00);
13637
13638 /* If we can deduce the registers used from the function's return value.
13639 @@ -16788,7 +18954,8 @@ thumb1_expand_prologue (void)
13640 return;
13641 }
13642
13643 - live_regs_mask = thumb1_compute_save_reg_mask ();
13644 + offsets = arm_get_frame_offsets ();
13645 + live_regs_mask = offsets->saved_regs_mask;
13646 /* Load the pic register before setting the frame pointer,
13647 so we can use r7 as a temporary work register. */
13648 if (flag_pic && arm_pic_register != INVALID_REGNUM)
13649 @@ -16798,7 +18965,6 @@ thumb1_expand_prologue (void)
13650 emit_move_insn (gen_rtx_REG (Pmode, ARM_HARD_FRAME_POINTER_REGNUM),
13651 stack_pointer_rtx);
13652
13653 - offsets = arm_get_frame_offsets ();
13654 amount = offsets->outgoing_args - offsets->saved_regs;
13655 if (amount)
13656 {
13657 @@ -16827,62 +18993,25 @@ thumb1_expand_prologue (void)
13658 been pushed at the start of the prologue and so we can corrupt
13659 it now. */
13660 for (regno = LAST_ARG_REGNUM + 1; regno <= LAST_LO_REGNUM; regno++)
13661 - if (live_regs_mask & (1 << regno)
13662 - && !(frame_pointer_needed
13663 - && (regno == THUMB_HARD_FRAME_POINTER_REGNUM)))
13664 + if (live_regs_mask & (1 << regno))
13665 break;
13666
13667 - if (regno > LAST_LO_REGNUM) /* Very unlikely. */
13668 - {
13669 - rtx spare = gen_rtx_REG (SImode, IP_REGNUM);
13670 -
13671 - /* Choose an arbitrary, non-argument low register. */
13672 - reg = gen_rtx_REG (SImode, LAST_LO_REGNUM);
13673 -
13674 - /* Save it by copying it into a high, scratch register. */
13675 - emit_insn (gen_movsi (spare, reg));
13676 - /* Add a USE to stop propagate_one_insn() from barfing. */
13677 - emit_insn (gen_prologue_use (spare));
13678 + gcc_assert(regno <= LAST_LO_REGNUM);
13679
13680 - /* Decrement the stack. */
13681 - emit_insn (gen_movsi (reg, GEN_INT (- amount)));
13682 - insn = emit_insn (gen_addsi3 (stack_pointer_rtx,
13683 - stack_pointer_rtx, reg));
13684 - RTX_FRAME_RELATED_P (insn) = 1;
13685 - dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
13686 - plus_constant (stack_pointer_rtx,
13687 - -amount));
13688 - RTX_FRAME_RELATED_P (dwarf) = 1;
13689 - REG_NOTES (insn)
13690 - = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
13691 - REG_NOTES (insn));
13692 -
13693 - /* Restore the low register's original value. */
13694 - emit_insn (gen_movsi (reg, spare));
13695 -
13696 - /* Emit a USE of the restored scratch register, so that flow
13697 - analysis will not consider the restore redundant. The
13698 - register won't be used again in this function and isn't
13699 - restored by the epilogue. */
13700 - emit_insn (gen_prologue_use (reg));
13701 - }
13702 - else
13703 - {
13704 - reg = gen_rtx_REG (SImode, regno);
13705 + reg = gen_rtx_REG (SImode, regno);
13706
13707 - emit_insn (gen_movsi (reg, GEN_INT (- amount)));
13708 + emit_insn (gen_movsi (reg, GEN_INT (- amount)));
13709
13710 - insn = emit_insn (gen_addsi3 (stack_pointer_rtx,
13711 - stack_pointer_rtx, reg));
13712 - RTX_FRAME_RELATED_P (insn) = 1;
13713 - dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
13714 - plus_constant (stack_pointer_rtx,
13715 - -amount));
13716 - RTX_FRAME_RELATED_P (dwarf) = 1;
13717 - REG_NOTES (insn)
13718 - = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
13719 - REG_NOTES (insn));
13720 - }
13721 + insn = emit_insn (gen_addsi3 (stack_pointer_rtx,
13722 + stack_pointer_rtx, reg));
13723 + RTX_FRAME_RELATED_P (insn) = 1;
13724 + dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
13725 + plus_constant (stack_pointer_rtx,
13726 + -amount));
13727 + RTX_FRAME_RELATED_P (dwarf) = 1;
13728 + REG_NOTES (insn)
13729 + = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
13730 + REG_NOTES (insn));
13731 }
13732 }
13733
13734 @@ -16960,6 +19089,7 @@ thumb1_expand_epilogue (void)
13735 static void
13736 thumb1_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
13737 {
13738 + arm_stack_offsets *offsets;
13739 unsigned long live_regs_mask = 0;
13740 unsigned long l_mask;
13741 unsigned high_regs_pushed = 0;
13742 @@ -17044,7 +19174,8 @@ thumb1_output_function_prologue (FILE *f
13743 }
13744
13745 /* Get the registers we are going to push. */
13746 - live_regs_mask = thumb1_compute_save_reg_mask ();
13747 + offsets = arm_get_frame_offsets ();
13748 + live_regs_mask = offsets->saved_regs_mask;
13749 /* Extract a mask of the ones we can give to the Thumb's push instruction. */
13750 l_mask = live_regs_mask & 0x40ff;
13751 /* Then count how many other high registers will need to be pushed. */
13752 @@ -17551,14 +19682,22 @@ arm_file_start (void)
13753 fpu_name = "vfp";
13754 set_float_abi_attributes = 1;
13755 break;
13756 + case FPUTYPE_VFP3D16:
13757 + fpu_name = "vfpv3-d16";
13758 + set_float_abi_attributes = 1;
13759 + break;
13760 case FPUTYPE_VFP3:
13761 - fpu_name = "vfp3";
13762 + fpu_name = "vfpv3";
13763 set_float_abi_attributes = 1;
13764 break;
13765 case FPUTYPE_NEON:
13766 fpu_name = "neon";
13767 set_float_abi_attributes = 1;
13768 break;
13769 + case FPUTYPE_NEON_FP16:
13770 + fpu_name = "neon-fp16";
13771 + set_float_abi_attributes = 1;
13772 + break;
13773 default:
13774 abort();
13775 }
13776 @@ -17612,6 +19751,11 @@ arm_file_start (void)
13777 val = 6;
13778 asm_fprintf (asm_out_file, "\t.eabi_attribute 30, %d\n", val);
13779
13780 + /* Tag_ABI_FP_16bit_format. */
13781 + if (arm_fp16_format)
13782 + asm_fprintf (asm_out_file, "\t.eabi_attribute 38, %d\n",
13783 + (int)arm_fp16_format);
13784 +
13785 if (arm_lang_output_object_attributes_hook)
13786 arm_lang_output_object_attributes_hook();
13787 }
13788 @@ -17694,12 +19838,23 @@ arm_output_mi_thunk (FILE *file, tree th
13789 ? 1 : 0);
13790 if (mi_delta < 0)
13791 mi_delta = - mi_delta;
13792 - /* When generating 16-bit thumb code, thunks are entered in arm mode. */
13793 +
13794 if (TARGET_THUMB1)
13795 {
13796 int labelno = thunk_label++;
13797 ASM_GENERATE_INTERNAL_LABEL (label, "LTHUMBFUNC", labelno);
13798 - fputs ("\tldr\tr12, ", file);
13799 + /* Thunks are entered in arm mode when avaiable. */
13800 + if (TARGET_THUMB1_ONLY)
13801 + {
13802 + /* push r3 so we can use it as a temporary. */
13803 + /* TODO: Omit this save if r3 is not used. */
13804 + fputs ("\tpush {r3}\n", file);
13805 + fputs ("\tldr\tr3, ", file);
13806 + }
13807 + else
13808 + {
13809 + fputs ("\tldr\tr12, ", file);
13810 + }
13811 assemble_name (file, label);
13812 fputc ('\n', file);
13813 if (flag_pic)
13814 @@ -17713,29 +19868,63 @@ arm_output_mi_thunk (FILE *file, tree th
13815
13816 Note that we have "+ 1" because some versions of GNU ld
13817 don't set the low bit of the result for R_ARM_REL32
13818 - relocations against thumb function symbols. */
13819 + relocations against thumb function symbols.
13820 + On ARMV6M this is +4, not +8. */
13821 ASM_GENERATE_INTERNAL_LABEL (labelpc, "LTHUNKPC", labelno);
13822 assemble_name (file, labelpc);
13823 fputs (":\n", file);
13824 - fputs ("\tadd\tr12, pc, r12\n", file);
13825 + if (TARGET_THUMB1_ONLY)
13826 + {
13827 + /* This is 2 insns after the start of the thunk, so we know it
13828 + is 4-byte aligned. */
13829 + fputs ("\tadd\tr3, pc, r3\n", file);
13830 + fputs ("\tmov r12, r3\n", file);
13831 + }
13832 + else
13833 + fputs ("\tadd\tr12, pc, r12\n", file);
13834 }
13835 + else if (TARGET_THUMB1_ONLY)
13836 + fputs ("\tmov r12, r3\n", file);
13837 }
13838 - /* TODO: Use movw/movt for large constants when available. */
13839 - while (mi_delta != 0)
13840 + if (TARGET_THUMB1_ONLY)
13841 {
13842 - if ((mi_delta & (3 << shift)) == 0)
13843 - shift += 2;
13844 - else
13845 - {
13846 - asm_fprintf (file, "\t%s\t%r, %r, #%d\n",
13847 - mi_op, this_regno, this_regno,
13848 - mi_delta & (0xff << shift));
13849 - mi_delta &= ~(0xff << shift);
13850 - shift += 8;
13851 - }
13852 + if (mi_delta > 255)
13853 + {
13854 + fputs ("\tldr\tr3, ", file);
13855 + assemble_name (file, label);
13856 + fputs ("+4\n", file);
13857 + asm_fprintf (file, "\t%s\t%r, %r, r3\n",
13858 + mi_op, this_regno, this_regno);
13859 + }
13860 + else if (mi_delta != 0)
13861 + {
13862 + asm_fprintf (file, "\t%s\t%r, %r, #%d\n",
13863 + mi_op, this_regno, this_regno,
13864 + mi_delta);
13865 + }
13866 + }
13867 + else
13868 + {
13869 + /* TODO: Use movw/movt for large constants when available. */
13870 + while (mi_delta != 0)
13871 + {
13872 + if ((mi_delta & (3 << shift)) == 0)
13873 + shift += 2;
13874 + else
13875 + {
13876 + asm_fprintf (file, "\t%s\t%r, %r, #%d\n",
13877 + mi_op, this_regno, this_regno,
13878 + mi_delta & (0xff << shift));
13879 + mi_delta &= ~(0xff << shift);
13880 + shift += 8;
13881 + }
13882 + }
13883 }
13884 if (TARGET_THUMB1)
13885 {
13886 + if (TARGET_THUMB1_ONLY)
13887 + fputs ("\tpop\t{r3}\n", file);
13888 +
13889 fprintf (file, "\tbx\tr12\n");
13890 ASM_OUTPUT_ALIGN (file, 2);
13891 assemble_name (file, label);
13892 @@ -17754,6 +19943,9 @@ arm_output_mi_thunk (FILE *file, tree th
13893 else
13894 /* Output ".word .LTHUNKn". */
13895 assemble_integer (XEXP (DECL_RTL (function), 0), 4, BITS_PER_WORD, 1);
13896 +
13897 + if (TARGET_THUMB1_ONLY && mi_delta > 255)
13898 + assemble_integer (GEN_INT(mi_delta), 4, BITS_PER_WORD, 1);
13899 }
13900 else
13901 {
13902 @@ -17793,6 +19985,23 @@ arm_emit_vector_const (FILE *file, rtx x
13903 return 1;
13904 }
13905
13906 +/* Emit a fp16 constant appropriately padded to occupy a 4-byte word.
13907 + HFmode constant pool entries are actually loaded with ldr. */
13908 +void
13909 +arm_emit_fp16_const (rtx c)
13910 +{
13911 + REAL_VALUE_TYPE r;
13912 + long bits;
13913 +
13914 + REAL_VALUE_FROM_CONST_DOUBLE (r, c);
13915 + bits = real_to_target (NULL, &r, HFmode);
13916 + if (WORDS_BIG_ENDIAN)
13917 + assemble_zeros (2);
13918 + assemble_integer (GEN_INT (bits), 2, BITS_PER_WORD, 1);
13919 + if (!WORDS_BIG_ENDIAN)
13920 + assemble_zeros (2);
13921 +}
13922 +
13923 const char *
13924 arm_output_load_gr (rtx *operands)
13925 {
13926 @@ -17830,19 +20039,24 @@ arm_output_load_gr (rtx *operands)
13927 that way. */
13928
13929 static void
13930 -arm_setup_incoming_varargs (CUMULATIVE_ARGS *cum,
13931 +arm_setup_incoming_varargs (CUMULATIVE_ARGS *pcum,
13932 enum machine_mode mode,
13933 tree type,
13934 int *pretend_size,
13935 int second_time ATTRIBUTE_UNUSED)
13936 {
13937 - int nregs = cum->nregs;
13938 - if (nregs & 1
13939 - && ARM_DOUBLEWORD_ALIGN
13940 - && arm_needs_doubleword_align (mode, type))
13941 - nregs++;
13942 -
13943 + int nregs;
13944 +
13945 cfun->machine->uses_anonymous_args = 1;
13946 + if (pcum->pcs_variant <= ARM_PCS_AAPCS_LOCAL)
13947 + {
13948 + nregs = pcum->aapcs_ncrn;
13949 + if ((nregs & 1) && arm_needs_doubleword_align (mode, type))
13950 + nregs++;
13951 + }
13952 + else
13953 + nregs = pcum->nregs;
13954 +
13955 if (nregs < NUM_ARG_REGS)
13956 *pretend_size = (NUM_ARG_REGS - nregs) * UNITS_PER_WORD;
13957 }
13958 @@ -17956,8 +20170,14 @@ arm_no_early_mul_dep (rtx producer, rtx
13959 op = XVECEXP (op, 0, 0);
13960 op = XEXP (op, 1);
13961
13962 - return (GET_CODE (op) == PLUS
13963 - && !reg_overlap_mentioned_p (value, XEXP (op, 0)));
13964 + if (GET_CODE (op) == PLUS || GET_CODE (op) == MINUS)
13965 + {
13966 + if (GET_CODE (XEXP (op, 0)) == MULT)
13967 + return !reg_overlap_mentioned_p (value, XEXP (op, 0));
13968 + else
13969 + return !reg_overlap_mentioned_p (value, XEXP (op, 1));
13970 + }
13971 + return 0;
13972 }
13973
13974 /* We can't rely on the caller doing the proper promotion when
13975 @@ -18084,7 +20304,8 @@ arm_cxx_key_method_may_be_inline (void)
13976 static void
13977 arm_cxx_determine_class_data_visibility (tree decl)
13978 {
13979 - if (!TARGET_AAPCS_BASED)
13980 + if (!TARGET_AAPCS_BASED
13981 + || !TARGET_DLLIMPORT_DECL_ATTRIBUTES)
13982 return;
13983
13984 /* In general, \S 3.2.5.5 of the ARM EABI requires that class data
13985 @@ -18124,7 +20345,8 @@ arm_set_return_address (rtx source, rtx
13986 rtx addr;
13987 unsigned long saved_regs;
13988
13989 - saved_regs = arm_compute_save_reg_mask ();
13990 + offsets = arm_get_frame_offsets ();
13991 + saved_regs = offsets->saved_regs_mask;
13992
13993 if ((saved_regs & (1 << LR_REGNUM)) == 0)
13994 emit_move_insn (gen_rtx_REG (Pmode, LR_REGNUM), source);
13995 @@ -18135,7 +20357,6 @@ arm_set_return_address (rtx source, rtx
13996 else
13997 {
13998 /* LR will be the first saved register. */
13999 - offsets = arm_get_frame_offsets ();
14000 delta = offsets->outgoing_args - (offsets->frame + 4);
14001
14002
14003 @@ -18168,11 +20389,10 @@ thumb_set_return_address (rtx source, rt
14004
14005 emit_insn (gen_rtx_USE (VOIDmode, source));
14006
14007 - mask = thumb1_compute_save_reg_mask ();
14008 + offsets = arm_get_frame_offsets ();
14009 + mask = offsets->saved_regs_mask;
14010 if (mask & (1 << LR_REGNUM))
14011 {
14012 - offsets = arm_get_frame_offsets ();
14013 -
14014 limit = 1024;
14015 /* Find the saved regs. */
14016 if (frame_pointer_needed)
14017 @@ -18219,9 +20439,10 @@ arm_vector_mode_supported_p (enum machin
14018 || mode == V16QImode || mode == V4SFmode || mode == V2DImode))
14019 return true;
14020
14021 - if ((mode == V2SImode)
14022 - || (mode == V4HImode)
14023 - || (mode == V8QImode))
14024 + if ((TARGET_NEON || TARGET_IWMMXT)
14025 + && ((mode == V2SImode)
14026 + || (mode == V4HImode)
14027 + || (mode == V8QImode)))
14028 return true;
14029
14030 return false;
14031 @@ -18252,9 +20473,14 @@ arm_dbx_register_number (unsigned int re
14032 if (IS_FPA_REGNUM (regno))
14033 return (TARGET_AAPCS_BASED ? 96 : 16) + regno - FIRST_FPA_REGNUM;
14034
14035 - /* FIXME: VFPv3 register numbering. */
14036 if (IS_VFP_REGNUM (regno))
14037 - return 64 + regno - FIRST_VFP_REGNUM;
14038 + {
14039 + /* See comment in arm_dwarf_register_span. */
14040 + if (VFP_REGNO_OK_FOR_SINGLE (regno))
14041 + return 64 + regno - FIRST_VFP_REGNUM;
14042 + else
14043 + return 256 + (regno - FIRST_VFP_REGNUM) / 2;
14044 + }
14045
14046 if (IS_IWMMXT_GR_REGNUM (regno))
14047 return 104 + regno - FIRST_IWMMXT_GR_REGNUM;
14048 @@ -18265,6 +20491,39 @@ arm_dbx_register_number (unsigned int re
14049 gcc_unreachable ();
14050 }
14051
14052 +/* Dwarf models VFPv3 registers as 32 64-bit registers.
14053 + GCC models tham as 64 32-bit registers, so we need to describe this to
14054 + the DWARF generation code. Other registers can use the default. */
14055 +static rtx
14056 +arm_dwarf_register_span(rtx rtl)
14057 +{
14058 + unsigned regno;
14059 + int nregs;
14060 + int i;
14061 + rtx p;
14062 +
14063 + regno = REGNO (rtl);
14064 + if (!IS_VFP_REGNUM (regno))
14065 + return NULL_RTX;
14066 +
14067 + /* The EABI defines two VFP register ranges:
14068 + 64-95: Legacy VFPv2 numbering for S0-S31 (obsolescent)
14069 + 256-287: D0-D31
14070 + The recommended encodings for s0-s31 is a DW_OP_bit_piece of the
14071 + corresponding D register. However gdb6.6 does not support this, so
14072 + we use the legacy encodings. We also use these encodings for D0-D15
14073 + for compatibility with older debuggers. */
14074 + if (VFP_REGNO_OK_FOR_SINGLE (regno))
14075 + return NULL_RTX;
14076 +
14077 + nregs = GET_MODE_SIZE (GET_MODE (rtl)) / 8;
14078 + p = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc(nregs));
14079 + regno = (regno - FIRST_VFP_REGNUM) / 2;
14080 + for (i = 0; i < nregs; i++)
14081 + XVECEXP (p, 0, i) = gen_rtx_REG (DImode, 256 + regno + i);
14082 +
14083 + return p;
14084 +}
14085
14086 #ifdef TARGET_UNWIND_INFO
14087 /* Emit unwind directives for a store-multiple instruction or stack pointer
14088 @@ -18483,6 +20742,11 @@ arm_unwind_emit (FILE * asm_out_file, rt
14089 if (!ARM_EABI_UNWIND_TABLES)
14090 return;
14091
14092 + if (!(flag_unwind_tables || cfun->uses_eh_lsda)
14093 + && (TREE_NOTHROW (current_function_decl)
14094 + || cfun->all_throwers_are_sibcalls))
14095 + return;
14096 +
14097 if (GET_CODE (insn) == NOTE || !RTX_FRAME_RELATED_P (insn))
14098 return;
14099
14100 @@ -18563,7 +20827,17 @@ arm_output_fn_unwind (FILE * f, bool pro
14101 if (prologue)
14102 fputs ("\t.fnstart\n", f);
14103 else
14104 - fputs ("\t.fnend\n", f);
14105 + {
14106 + /* If this function will never be unwound, then mark it as such.
14107 + The came condition is used in arm_unwind_emit to suppress
14108 + the frame annotations. */
14109 + if (!(flag_unwind_tables || cfun->uses_eh_lsda)
14110 + && (TREE_NOTHROW (current_function_decl)
14111 + || cfun->all_throwers_are_sibcalls))
14112 + fputs("\t.cantunwind\n", f);
14113 +
14114 + fputs ("\t.fnend\n", f);
14115 + }
14116 }
14117
14118 static bool
14119 @@ -18757,6 +21031,17 @@ arm_mangle_type (const_tree type)
14120 {
14121 arm_mangle_map_entry *pos = arm_mangle_map;
14122
14123 + /* Half-precision float. */
14124 + if (TREE_CODE (type) == REAL_TYPE && TYPE_PRECISION (type) == 16)
14125 + return "Dh";
14126 +
14127 + /* Although the ARM ABI documents do not specifically say that
14128 + "__va_list" has to be managled as if it is in the "std"
14129 + namespace, that is what RealView does. */
14130 + if (TARGET_AAPCS_BASED
14131 + && lang_hooks.types_compatible_p (type, va_list_type))
14132 + return "St9__va_list";
14133 +
14134 if (TREE_CODE (type) != VECTOR_TYPE)
14135 return NULL;
14136
14137 @@ -18779,5 +21064,91 @@ arm_mangle_type (const_tree type)
14138 vector types. */
14139 return NULL;
14140 }
14141 +
14142 +/* Return how many instructions the machine can issue per cycle. */
14143 +static int
14144 +arm_issue_rate (void)
14145 +{
14146 + switch (arm_tune)
14147 + {
14148 + case marvell_f:
14149 + case cortexr4:
14150 + case cortexr4f:
14151 + case cortexa8:
14152 + case cortexa9:
14153 + return 2;
14154 + default:
14155 + return 1;
14156 + }
14157 +}
14158 +
14159 +/* Return how many instructions to look ahead for better insn
14160 + scheduling. */
14161 +static int
14162 +arm_multipass_dfa_lookahead (void)
14163 +{
14164 + return (arm_tune == marvell_f) ? 4 : 0;
14165 +}
14166 +
14167 +/* Set default optimization options. */
14168 +void
14169 +arm_optimization_options (int level, int size ATTRIBUTE_UNUSED)
14170 +{
14171 + /* Enable section anchors by default at -O1 or higher. */
14172 + flag_section_anchors = (level > 0 ? 1 : 0);
14173 +
14174 + if (size)
14175 + {
14176 + /* Select optimizations that are a win for code size.
14177 +
14178 + The inlining options set below have two important
14179 + consequences for functions not explicitly marked
14180 + inline:
14181 + - Static functions used once are inlined if
14182 + sufficiently small. Static functions used twice
14183 + are not inlined.
14184 + - Non-static functions are never inlined.
14185 + So in effect, inlining will never cause two copies
14186 + of function bodies to be created. */
14187 + /* Empirical results show that these options benefit code
14188 + size on arm. */
14189 + /* FIXME: -fsee seems to be broken for Thumb-2. */
14190 + /* flag_see = 1; */
14191 + flag_move_loop_invariants = 0;
14192 + /* In Thumb mode the function call code size overhead is typically very
14193 + small, and narrow branch instructions have very limited range.
14194 + Inlining even medium sized functions tends to bloat the caller and
14195 + require the use of long branch instructions. On average the long
14196 + branches cost more than eliminating the function call overhead saves,
14197 + so we use extremely restrictive automatic inlining heuristics. In ARM
14198 + mode the results are fairly neutral, probably due to better constant
14199 + pool placement. */
14200 + set_param_value ("max-inline-insns-single", 1);
14201 + set_param_value ("max-inline-insns-auto", 1);
14202 + }
14203 +}
14204 +
14205 +/* Order of allocation of core registers for Thumb: this allocation is
14206 + written over the corresponding initial entries of the array
14207 + initialized with REG_ALLOC_ORDER. We allocate all low registers
14208 + first. Saving and restoring a low register is usually cheaper than
14209 + using a call-clobbered high register. */
14210 +
14211 +static const int thumb_core_reg_alloc_order[] =
14212 +{
14213 + 3, 2, 1, 0, 4, 5, 6, 7,
14214 + 14, 12, 8, 9, 10, 11, 13, 15
14215 +};
14216 +
14217 +/* Adjust register allocation order when compiling for Thumb. */
14218 +
14219 +void
14220 +arm_adjust_reg_alloc_order (int *order)
14221 +{
14222 + if (TARGET_THUMB)
14223 + memcpy (order, thumb_core_reg_alloc_order,
14224 + sizeof (thumb_core_reg_alloc_order));
14225 +}
14226
14227 #include "gt-arm.h"
14228 +
14229 --- a/gcc/config/arm/arm.h
14230 +++ b/gcc/config/arm/arm.h
14231 @@ -84,6 +84,10 @@ extern char arm_arch_name[];
14232 builtin_define ("__IWMMXT__"); \
14233 if (TARGET_AAPCS_BASED) \
14234 builtin_define ("__ARM_EABI__"); \
14235 + if (arm_tune_marvell_f) \
14236 + builtin_define ("__ARM_TUNE_MARVELL_F__"); \
14237 + if (low_irq_latency) \
14238 + builtin_define ("__low_irq_latency__"); \
14239 } while (0)
14240
14241 /* The various ARM cores. */
14242 @@ -198,6 +202,13 @@ extern void (*arm_lang_output_object_att
14243 #define TARGET_AAPCS_BASED \
14244 (arm_abi != ARM_ABI_APCS && arm_abi != ARM_ABI_ATPCS)
14245
14246 +/* True if we should avoid generating conditional execution instructions. */
14247 +#define TARGET_NO_COND_EXEC (arm_tune_marvell_f && !optimize_size)
14248 +/* Avoid most conditional instructions, but allow pairs with opposite
14249 + conditions and the same destination. */
14250 +#define TARGET_NO_SINGLE_COND_EXEC \
14251 + ((arm_tune_cortex_a9 || arm_tune_marvell_f) && !optimize_size)
14252 +
14253 #define TARGET_HARD_TP (target_thread_pointer == TP_CP15)
14254 #define TARGET_SOFT_TP (target_thread_pointer == TP_SOFT)
14255
14256 @@ -207,24 +218,36 @@ extern void (*arm_lang_output_object_att
14257 #define TARGET_32BIT (TARGET_ARM || arm_arch_thumb2)
14258 /* 32-bit Thumb-2 code. */
14259 #define TARGET_THUMB2 (TARGET_THUMB && arm_arch_thumb2)
14260 +/* Thumb-1 only. */
14261 +#define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm)
14262
14263 /* The following two macros concern the ability to execute coprocessor
14264 - instructions for VFPv3 or NEON. TARGET_VFP3 is currently only ever
14265 - tested when we know we are generating for VFP hardware; we need to
14266 - be more careful with TARGET_NEON as noted below. */
14267 + instructions for VFPv3 or NEON. TARGET_VFP3/TARGET_VFPD32 are currently
14268 + only ever tested when we know we are generating for VFP hardware; we need
14269 + to be more careful with TARGET_NEON as noted below. */
14270 +
14271 +/* FPU is has the full VFPv3/NEON register file of 32 D registers. */
14272 +#define TARGET_VFPD32 (arm_fp_model == ARM_FP_MODEL_VFP \
14273 + && (arm_fpu_arch == FPUTYPE_VFP3 \
14274 + || arm_fpu_arch == FPUTYPE_NEON \
14275 + || arm_fpu_arch == FPUTYPE_NEON_FP16))
14276
14277 -/* FPU is VFPv3 (with twice the number of D registers). Setting the FPU to
14278 - Neon automatically enables VFPv3 too. */
14279 +/* FPU supports VFPv3 instructions. */
14280 #define TARGET_VFP3 (arm_fp_model == ARM_FP_MODEL_VFP \
14281 - && (arm_fpu_arch == FPUTYPE_VFP3 \
14282 - || arm_fpu_arch == FPUTYPE_NEON))
14283 + && (arm_fpu_arch == FPUTYPE_VFP3D16 \
14284 + || TARGET_VFPD32))
14285 +
14286 +/* FPU supports NEON/VFP half-precision floating-point. */
14287 +#define TARGET_NEON_FP16 (arm_fpu_arch == FPUTYPE_NEON_FP16)
14288 +
14289 /* FPU supports Neon instructions. The setting of this macro gets
14290 revealed via __ARM_NEON__ so we add extra guards upon TARGET_32BIT
14291 and TARGET_HARD_FLOAT to ensure that NEON instructions are
14292 available. */
14293 #define TARGET_NEON (TARGET_32BIT && TARGET_HARD_FLOAT \
14294 && arm_fp_model == ARM_FP_MODEL_VFP \
14295 - && arm_fpu_arch == FPUTYPE_NEON)
14296 + && (arm_fpu_arch == FPUTYPE_NEON \
14297 + || arm_fpu_arch == FPUTYPE_NEON_FP16))
14298
14299 /* "DSP" multiply instructions, eg. SMULxy. */
14300 #define TARGET_DSP_MULTIPLY \
14301 @@ -233,6 +256,9 @@ extern void (*arm_lang_output_object_att
14302 #define TARGET_INT_SIMD \
14303 (TARGET_32BIT && arm_arch6 && arm_arch_notm)
14304
14305 +/* Should MOVW/MOVT be used in preference to a constant pool. */
14306 +#define TARGET_USE_MOVT (arm_arch_thumb2 && !optimize_size)
14307 +
14308 /* We could use unified syntax for arm mode, but for now we just use it
14309 for Thumb-2. */
14310 #define TARGET_UNIFIED_ASM TARGET_THUMB2
14311 @@ -296,10 +322,14 @@ enum fputype
14312 FPUTYPE_MAVERICK,
14313 /* VFP. */
14314 FPUTYPE_VFP,
14315 + /* VFPv3-D16. */
14316 + FPUTYPE_VFP3D16,
14317 /* VFPv3. */
14318 FPUTYPE_VFP3,
14319 /* Neon. */
14320 - FPUTYPE_NEON
14321 + FPUTYPE_NEON,
14322 + /* Neon with half-precision float extensions. */
14323 + FPUTYPE_NEON_FP16
14324 };
14325
14326 /* Recast the floating point class to be the floating point attribute. */
14327 @@ -324,6 +354,21 @@ extern enum float_abi_type arm_float_abi
14328 #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
14329 #endif
14330
14331 +/* Which __fp16 format to use.
14332 + The enumeration values correspond to the numbering for the
14333 + Tag_ABI_FP_16bit_format attribute.
14334 + */
14335 +enum arm_fp16_format_type
14336 +{
14337 + ARM_FP16_FORMAT_NONE = 0,
14338 + ARM_FP16_FORMAT_IEEE = 1,
14339 + ARM_FP16_FORMAT_ALTERNATIVE = 2
14340 +};
14341 +
14342 +extern enum arm_fp16_format_type arm_fp16_format;
14343 +#define LARGEST_EXPONENT_IS_NORMAL(bits) \
14344 + ((bits) == 16 && arm_fp16_format == ARM_FP16_FORMAT_ALTERNATIVE)
14345 +
14346 /* Which ABI to use. */
14347 enum arm_abi_type
14348 {
14349 @@ -376,6 +421,9 @@ extern int arm_ld_sched;
14350 /* Nonzero if generating thumb code. */
14351 extern int thumb_code;
14352
14353 +/* Nonzero if generating Janus2 code. */
14354 +extern int janus2_code;
14355 +
14356 /* Nonzero if this chip is a StrongARM. */
14357 extern int arm_tune_strongarm;
14358
14359 @@ -391,9 +439,15 @@ extern int arm_arch_xscale;
14360 /* Nonzero if tuning for XScale. */
14361 extern int arm_tune_xscale;
14362
14363 +/* Nonzero if tuning for Marvell Feroceon. */
14364 +extern int arm_tune_marvell_f;
14365 +
14366 /* Nonzero if tuning for stores via the write buffer. */
14367 extern int arm_tune_wbuf;
14368
14369 +/* Nonzero if tuning for Cortex-A9. */
14370 +extern int arm_tune_cortex_a9;
14371 +
14372 /* Nonzero if we should define __THUMB_INTERWORK__ in the
14373 preprocessor.
14374 XXX This is a bit of a hack, it's intended to help work around
14375 @@ -407,6 +461,10 @@ extern int arm_arch_thumb2;
14376 /* Nonzero if chip supports integer division instruction. */
14377 extern int arm_arch_hwdiv;
14378
14379 +/* Nonzero if we should minimize interrupt latency of the
14380 + generated code. */
14381 +extern int low_irq_latency;
14382 +
14383 #ifndef TARGET_DEFAULT
14384 #define TARGET_DEFAULT (MASK_APCS_FRAME)
14385 #endif
14386 @@ -417,6 +475,9 @@ extern int arm_arch_hwdiv;
14387
14388 #define OVERRIDE_OPTIONS arm_override_options ()
14389
14390 +#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
14391 + arm_optimization_options ((LEVEL), (SIZE))
14392 +
14393 /* Nonzero if PIC code requires explicit qualifiers to generate
14394 PLT and GOT relocs rather than the assembler doing so implicitly.
14395 Subtargets can override these if required. */
14396 @@ -725,12 +786,11 @@ extern int arm_structure_size_boundary;
14397 fixed_regs[regno] = call_used_regs[regno] = 1; \
14398 } \
14399 \
14400 - if (TARGET_THUMB && optimize_size) \
14401 - { \
14402 - /* When optimizing for size, it's better not to use \
14403 - the HI regs, because of the overhead of stacking \
14404 - them. */ \
14405 - /* ??? Is this still true for thumb2? */ \
14406 + if (TARGET_THUMB1 && optimize_size) \
14407 + { \
14408 + /* When optimizing for size on Thumb-1, it's better not \
14409 + to use the HI regs, because of the overhead of \
14410 + stacking them. */ \
14411 for (regno = FIRST_HI_REGNUM; \
14412 regno <= LAST_HI_REGNUM; ++regno) \
14413 fixed_regs[regno] = call_used_regs[regno] = 1; \
14414 @@ -849,6 +909,9 @@ extern int arm_structure_size_boundary;
14415 /* The number of (integer) argument register available. */
14416 #define NUM_ARG_REGS 4
14417
14418 +/* And similarly for the VFP. */
14419 +#define NUM_VFP_ARG_REGS 16
14420 +
14421 /* Return the register number of the N'th (integer) argument. */
14422 #define ARG_REGISTER(N) (N - 1)
14423
14424 @@ -942,7 +1005,7 @@ extern int arm_structure_size_boundary;
14425 #define FIRST_VFP_REGNUM 63
14426 #define D7_VFP_REGNUM 78 /* Registers 77 and 78 == VFP reg D7. */
14427 #define LAST_VFP_REGNUM \
14428 - (TARGET_VFP3 ? LAST_HI_VFP_REGNUM : LAST_LO_VFP_REGNUM)
14429 + (TARGET_VFPD32 ? LAST_HI_VFP_REGNUM : LAST_LO_VFP_REGNUM)
14430
14431 #define IS_VFP_REGNUM(REGNUM) \
14432 (((REGNUM) >= FIRST_VFP_REGNUM) && ((REGNUM) <= LAST_VFP_REGNUM))
14433 @@ -1027,7 +1090,7 @@ extern int arm_structure_size_boundary;
14434 (GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2))
14435
14436 #define VALID_IWMMXT_REG_MODE(MODE) \
14437 - (arm_vector_mode_supported_p (MODE) || (MODE) == DImode)
14438 + (arm_vector_mode_supported_p (MODE) || (MODE) == DImode || (MODE) == SImode)
14439
14440 /* Modes valid for Neon D registers. */
14441 #define VALID_NEON_DREG_MODE(MODE) \
14442 @@ -1053,7 +1116,10 @@ extern int arm_structure_size_boundary;
14443 For VFP/VFPv3, allocate D16-D31 first, then caller-saved registers (D0-D7),
14444 then D8-D15. The reason for doing this is to attempt to reduce register
14445 pressure when both single- and double-precision registers are used in a
14446 - function. */
14447 + function.
14448 +
14449 + The allocation order for Thumb differs from that given here:
14450 + see arm.c:adjust_reg_alloc_order. */
14451
14452 #define REG_ALLOC_ORDER \
14453 { \
14454 @@ -1106,6 +1172,7 @@ enum reg_class
14455 CC_REG,
14456 VFPCC_REG,
14457 GENERAL_REGS,
14458 + CORE_REGS,
14459 ALL_REGS,
14460 LIM_REG_CLASSES
14461 };
14462 @@ -1131,6 +1198,7 @@ enum reg_class
14463 "CC_REG", \
14464 "VFPCC_REG", \
14465 "GENERAL_REGS", \
14466 + "CORE_REGS", \
14467 "ALL_REGS", \
14468 }
14469
14470 @@ -1151,10 +1219,11 @@ enum reg_class
14471 { 0x000000FF, 0x00000000, 0x00000000, 0x00000000 }, /* LO_REGS */ \
14472 { 0x00002000, 0x00000000, 0x00000000, 0x00000000 }, /* STACK_REG */ \
14473 { 0x000020FF, 0x00000000, 0x00000000, 0x00000000 }, /* BASE_REGS */ \
14474 - { 0x0000FF00, 0x00000000, 0x00000000, 0x00000000 }, /* HI_REGS */ \
14475 + { 0x0000DF00, 0x00000000, 0x00000000, 0x00000000 }, /* HI_REGS */ \
14476 { 0x01000000, 0x00000000, 0x00000000, 0x00000000 }, /* CC_REG */ \
14477 { 0x00000000, 0x00000000, 0x00000000, 0x80000000 }, /* VFPCC_REG */ \
14478 - { 0x0200FFFF, 0x00000000, 0x00000000, 0x00000000 }, /* GENERAL_REGS */ \
14479 + { 0x0200DFFF, 0x00000000, 0x00000000, 0x00000000 }, /* GENERAL_REGS */ \
14480 + { 0x0200FFFF, 0x00000000, 0x00000000, 0x00000000 }, /* CORE_REGS */ \
14481 { 0xFAFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x7FFFFFFF } /* ALL_REGS */ \
14482 }
14483
14484 @@ -1178,22 +1247,25 @@ enum reg_class
14485 || reg_classes_intersect_p (VFP_REGS, (CLASS)) \
14486 : 0)
14487
14488 -/* We need to define this for LO_REGS on thumb. Otherwise we can end up
14489 - using r0-r4 for function arguments, r7 for the stack frame and don't
14490 - have enough left over to do doubleword arithmetic. */
14491 +/* We need to define this for LO_REGS on Thumb-1. Otherwise we can end up
14492 + using r0-r4 for function arguments, r7 for the stack frame and don't have
14493 + enough left over to do doubleword arithmetic. For Thumb-2 all the
14494 + potentially problematic instructions accept high registers so this is not
14495 + necessary. Care needs to be taken to avoid adding new Thumb-2 patterns
14496 + that require many low registers. */
14497 #define CLASS_LIKELY_SPILLED_P(CLASS) \
14498 - ((TARGET_THUMB && (CLASS) == LO_REGS) \
14499 + ((TARGET_THUMB1 && (CLASS) == LO_REGS) \
14500 || (CLASS) == CC_REG)
14501
14502 /* The class value for index registers, and the one for base regs. */
14503 #define INDEX_REG_CLASS (TARGET_THUMB1 ? LO_REGS : GENERAL_REGS)
14504 -#define BASE_REG_CLASS (TARGET_THUMB1 ? LO_REGS : GENERAL_REGS)
14505 +#define BASE_REG_CLASS (TARGET_THUMB1 ? LO_REGS : CORE_REGS)
14506
14507 /* For the Thumb the high registers cannot be used as base registers
14508 when addressing quantities in QI or HI mode; if we don't know the
14509 mode, then we must be conservative. */
14510 #define MODE_BASE_REG_CLASS(MODE) \
14511 - (TARGET_32BIT ? GENERAL_REGS : \
14512 + (TARGET_32BIT ? (TARGET_THUMB2 ? LO_REGS : CORE_REGS) : \
14513 (((MODE) == SImode) ? BASE_REGS : LO_REGS))
14514
14515 /* For Thumb we can not support SP+reg addressing, so we return LO_REGS
14516 @@ -1213,7 +1285,8 @@ enum reg_class
14517 #define PREFERRED_RELOAD_CLASS(X, CLASS) \
14518 (TARGET_ARM ? (CLASS) : \
14519 ((CLASS) == GENERAL_REGS || (CLASS) == HI_REGS \
14520 - || (CLASS) == NO_REGS ? LO_REGS : (CLASS)))
14521 + || (CLASS) == NO_REGS || (CLASS) == STACK_REG \
14522 + ? LO_REGS : (CLASS)))
14523
14524 /* Must leave BASE_REGS reloads alone */
14525 #define THUMB_SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \
14526 @@ -1293,6 +1366,9 @@ enum reg_class
14527 else if (TARGET_MAVERICK && TARGET_HARD_FLOAT) \
14528 /* Need to be careful, -256 is not a valid offset. */ \
14529 low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \
14530 + else if (TARGET_REALLY_IWMMXT && MODE == SImode) \
14531 + /* Need to be careful, -1024 is not a valid offset. */ \
14532 + low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff); \
14533 else if (MODE == SImode \
14534 || (MODE == SFmode && TARGET_SOFT_FLOAT) \
14535 || ((MODE == HImode || MODE == QImode) && ! arm_arch4)) \
14536 @@ -1438,9 +1514,10 @@ do { \
14537
14538 /* Define how to find the value returned by a library function
14539 assuming the value has mode MODE. */
14540 -#define LIBCALL_VALUE(MODE) \
14541 - (TARGET_32BIT && TARGET_HARD_FLOAT_ABI && TARGET_FPA \
14542 - && GET_MODE_CLASS (MODE) == MODE_FLOAT \
14543 +#define LIBCALL_VALUE(MODE) \
14544 + (TARGET_AAPCS_BASED ? aapcs_libcall_value (MODE) \
14545 + : (TARGET_32BIT && TARGET_HARD_FLOAT_ABI && TARGET_FPA \
14546 + && GET_MODE_CLASS (MODE) == MODE_FLOAT) \
14547 ? gen_rtx_REG (MODE, FIRST_FPA_REGNUM) \
14548 : TARGET_32BIT && TARGET_HARD_FLOAT_ABI && TARGET_MAVERICK \
14549 && GET_MODE_CLASS (MODE) == MODE_FLOAT \
14550 @@ -1449,33 +1526,22 @@ do { \
14551 ? gen_rtx_REG (MODE, FIRST_IWMMXT_REGNUM) \
14552 : gen_rtx_REG (MODE, ARG_REGISTER (1)))
14553
14554 -/* Define how to find the value returned by a function.
14555 - VALTYPE is the data type of the value (as a tree).
14556 - If the precise function being called is known, FUNC is its FUNCTION_DECL;
14557 - otherwise, FUNC is 0. */
14558 -#define FUNCTION_VALUE(VALTYPE, FUNC) \
14559 - arm_function_value (VALTYPE, FUNC);
14560 -
14561 -/* 1 if N is a possible register number for a function value.
14562 - On the ARM, only r0 and f0 can return results. */
14563 -/* On a Cirrus chip, mvf0 can return results. */
14564 -#define FUNCTION_VALUE_REGNO_P(REGNO) \
14565 - ((REGNO) == ARG_REGISTER (1) \
14566 - || (TARGET_32BIT && ((REGNO) == FIRST_CIRRUS_FP_REGNUM) \
14567 - && TARGET_HARD_FLOAT_ABI && TARGET_MAVERICK) \
14568 - || ((REGNO) == FIRST_IWMMXT_REGNUM && TARGET_IWMMXT_ABI) \
14569 - || (TARGET_32BIT && ((REGNO) == FIRST_FPA_REGNUM) \
14570 +/* 1 if REGNO is a possible register number for a function value. */
14571 +#define FUNCTION_VALUE_REGNO_P(REGNO) \
14572 + ((REGNO) == ARG_REGISTER (1) \
14573 + || (TARGET_AAPCS_BASED && TARGET_32BIT \
14574 + && TARGET_VFP && TARGET_HARD_FLOAT \
14575 + && (REGNO) == FIRST_VFP_REGNUM) \
14576 + || (TARGET_32BIT && ((REGNO) == FIRST_CIRRUS_FP_REGNUM) \
14577 + && TARGET_HARD_FLOAT_ABI && TARGET_MAVERICK) \
14578 + || ((REGNO) == FIRST_IWMMXT_REGNUM && TARGET_IWMMXT_ABI) \
14579 + || (TARGET_32BIT && ((REGNO) == FIRST_FPA_REGNUM) \
14580 && TARGET_HARD_FLOAT_ABI && TARGET_FPA))
14581
14582 /* Amount of memory needed for an untyped call to save all possible return
14583 registers. */
14584 #define APPLY_RESULT_SIZE arm_apply_result_size()
14585
14586 -/* How large values are returned */
14587 -/* A C expression which can inhibit the returning of certain function values
14588 - in registers, based on the type of value. */
14589 -#define RETURN_IN_MEMORY(TYPE) arm_return_in_memory (TYPE)
14590 -
14591 /* Define DEFAULT_PCC_STRUCT_RETURN to 1 if all structure and union return
14592 values must be in memory. On the ARM, they need only do so if larger
14593 than a word, or if they contain elements offset from zero in the struct. */
14594 @@ -1531,6 +1597,7 @@ typedef struct arm_stack_offsets GTY(())
14595 int soft_frame; /* FRAME_POINTER_REGNUM. */
14596 int locals_base; /* THUMB_HARD_FRAME_POINTER_REGNUM. */
14597 int outgoing_args; /* STACK_POINTER_REGNUM. */
14598 + unsigned int saved_regs_mask;
14599 }
14600 arm_stack_offsets;
14601
14602 @@ -1568,9 +1635,27 @@ machine_function;
14603 that is in text_section. */
14604 extern GTY(()) rtx thumb_call_via_label[14];
14605
14606 +/* The number of potential ways of assigning to a co-processor. */
14607 +#define ARM_NUM_COPROC_SLOTS 1
14608 +
14609 +/* Enumeration of procedure calling standard variants. We don't really
14610 + support all of these yet. */
14611 +enum arm_pcs
14612 +{
14613 + ARM_PCS_AAPCS, /* Base standard AAPCS. */
14614 + ARM_PCS_AAPCS_VFP, /* Use VFP registers for floating point values. */
14615 + ARM_PCS_AAPCS_IWMMXT, /* Use iWMMXT registers for vectors. */
14616 + /* This must be the last AAPCS variant. */
14617 + ARM_PCS_AAPCS_LOCAL, /* Private call within this compilation unit. */
14618 + ARM_PCS_ATPCS, /* ATPCS. */
14619 + ARM_PCS_APCS, /* APCS (legacy Linux etc). */
14620 + ARM_PCS_UNKNOWN
14621 +};
14622 +
14623 +/* We can't define this inside a generator file because it needs enum
14624 + machine_mode. */
14625 /* A C type for declaring a variable that is used as the first argument of
14626 - `FUNCTION_ARG' and other related values. For some target machines, the
14627 - type `int' suffices and can hold the number of bytes of argument so far. */
14628 + `FUNCTION_ARG' and other related values. */
14629 typedef struct
14630 {
14631 /* This is the number of registers of arguments scanned so far. */
14632 @@ -1579,9 +1664,33 @@ typedef struct
14633 int iwmmxt_nregs;
14634 int named_count;
14635 int nargs;
14636 - int can_split;
14637 + /* Which procedure call variant to use for this call. */
14638 + enum arm_pcs pcs_variant;
14639 +
14640 + /* AAPCS related state tracking. */
14641 + int aapcs_arg_processed; /* No need to lay out this argument again. */
14642 + int aapcs_cprc_slot; /* Index of co-processor rules to handle
14643 + this argument, or -1 if using core
14644 + registers. */
14645 + int aapcs_ncrn;
14646 + int aapcs_next_ncrn;
14647 + rtx aapcs_reg; /* Register assigned to this argument. */
14648 + int aapcs_partial; /* How many bytes are passed in regs (if
14649 + split between core regs and stack.
14650 + Zero otherwise. */
14651 + int aapcs_cprc_failed[ARM_NUM_COPROC_SLOTS];
14652 + int can_split; /* Argument can be split between core regs
14653 + and the stack. */
14654 + /* Private data for tracking VFP register allocation */
14655 + unsigned aapcs_vfp_regs_free;
14656 + unsigned aapcs_vfp_reg_alloc;
14657 + int aapcs_vfp_rcount;
14658 + /* Can't include insn-modes.h because this header is needed before we
14659 + generate it. */
14660 + int /* enum machine_mode */ aapcs_vfp_rmode;
14661 } CUMULATIVE_ARGS;
14662
14663 +
14664 /* Define where to put the arguments to a function.
14665 Value is zero to push the argument on the stack,
14666 or a hard register in which to store the argument.
14667 @@ -1625,13 +1734,7 @@ typedef struct
14668 of mode MODE and data type TYPE.
14669 (TYPE is null for libcalls where that information may not be available.) */
14670 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
14671 - (CUM).nargs += 1; \
14672 - if (arm_vector_mode_supported_p (MODE) \
14673 - && (CUM).named_count > (CUM).nargs \
14674 - && TARGET_IWMMXT_ABI) \
14675 - (CUM).iwmmxt_nregs += 1; \
14676 - else \
14677 - (CUM).nregs += ARM_NUM_REGS2 (MODE, TYPE)
14678 + arm_function_arg_advance (&(CUM), (MODE), (TYPE), (NAMED))
14679
14680 /* If defined, a C expression that gives the alignment boundary, in bits, of an
14681 argument with the specified mode and type. If it is not defined,
14682 @@ -1643,9 +1746,11 @@ typedef struct
14683
14684 /* 1 if N is a possible register number for function argument passing.
14685 On the ARM, r0-r3 are used to pass args. */
14686 -#define FUNCTION_ARG_REGNO_P(REGNO) \
14687 - (IN_RANGE ((REGNO), 0, 3) \
14688 - || (TARGET_IWMMXT_ABI \
14689 +#define FUNCTION_ARG_REGNO_P(REGNO) \
14690 + (IN_RANGE ((REGNO), 0, 3) \
14691 + || (TARGET_AAPCS_BASED && TARGET_VFP && TARGET_HARD_FLOAT \
14692 + && IN_RANGE ((REGNO), FIRST_VFP_REGNUM, FIRST_VFP_REGNUM + 15)) \
14693 + || (TARGET_IWMMXT_ABI \
14694 && IN_RANGE ((REGNO), FIRST_IWMMXT_REGNUM, FIRST_IWMMXT_REGNUM + 9)))
14695
14696 \f
14697 @@ -1908,12 +2013,13 @@ typedef struct
14698 /* Nonzero if X can be the base register in a reg+reg addressing mode.
14699 For Thumb, we can not use SP + reg, so reject SP. */
14700 #define REGNO_MODE_OK_FOR_REG_BASE_P(X, MODE) \
14701 - REGNO_OK_FOR_INDEX_P (X)
14702 + REGNO_MODE_OK_FOR_BASE_P (X, QImode)
14703
14704 /* For ARM code, we don't care about the mode, but for Thumb, the index
14705 must be suitable for use in a QImode load. */
14706 #define REGNO_OK_FOR_INDEX_P(REGNO) \
14707 - REGNO_MODE_OK_FOR_BASE_P (REGNO, QImode)
14708 + (REGNO_MODE_OK_FOR_BASE_P (REGNO, QImode) \
14709 + && !TEST_REGNO (REGNO, ==, STACK_POINTER_REGNUM))
14710
14711 /* Maximum number of registers that can appear in a valid memory address.
14712 Shifts in addresses can't be by a register. */
14713 @@ -1931,6 +2037,11 @@ typedef struct
14714 SYMBOL's section. */
14715 #define ARM_OFFSETS_MUST_BE_WITHIN_SECTIONS_P 0
14716
14717 +/* Nonzero if all target requires all absolute relocations be R_ARM_ABS32. */
14718 +#ifndef TARGET_DEFAULT_WORD_RELOCATIONS
14719 +#define TARGET_DEFAULT_WORD_RELOCATIONS 0
14720 +#endif
14721 +
14722 /* Nonzero if the constant value X is a legitimate general operand.
14723 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.
14724
14725 @@ -2051,6 +2162,13 @@ typedef struct
14726 || REGNO (X) == FRAME_POINTER_REGNUM \
14727 || REGNO (X) == ARG_POINTER_REGNUM)
14728
14729 +#define ARM_REG_OK_FOR_INDEX_P(X) \
14730 + ((REGNO (X) <= LAST_ARM_REGNUM \
14731 + && REGNO (X) != STACK_POINTER_REGNUM) \
14732 + || REGNO (X) >= FIRST_PSEUDO_REGISTER \
14733 + || REGNO (X) == FRAME_POINTER_REGNUM \
14734 + || REGNO (X) == ARG_POINTER_REGNUM)
14735 +
14736 #define THUMB1_REG_MODE_OK_FOR_BASE_P(X, MODE) \
14737 (REGNO (X) <= LAST_LO_REGNUM \
14738 || REGNO (X) >= FIRST_PSEUDO_REGISTER \
14739 @@ -2066,6 +2184,9 @@ typedef struct
14740 #define ARM_REG_OK_FOR_BASE_P(X) \
14741 ARM_REGNO_OK_FOR_BASE_P (REGNO (X))
14742
14743 +#define ARM_REG_OK_FOR_INDEX_P(X) \
14744 + ARM_REGNO_OK_FOR_INDEX_P (REGNO (X))
14745 +
14746 #define THUMB1_REG_MODE_OK_FOR_BASE_P(X, MODE) \
14747 THUMB1_REGNO_MODE_OK_FOR_BASE_P (REGNO (X), MODE)
14748
14749 @@ -2080,8 +2201,6 @@ typedef struct
14750 ? THUMB1_REG_MODE_OK_FOR_BASE_P (X, MODE) \
14751 : ARM_REG_OK_FOR_BASE_P (X))
14752
14753 -#define ARM_REG_OK_FOR_INDEX_P(X) ARM_REG_OK_FOR_BASE_P (X)
14754 -
14755 /* For 16-bit Thumb, a valid index register is anything that can be used in
14756 a byte load instruction. */
14757 #define THUMB1_REG_OK_FOR_INDEX_P(X) \
14758 @@ -2259,7 +2378,8 @@ do { \
14759 /* Try to generate sequences that don't involve branches, we can then use
14760 conditional instructions */
14761 #define BRANCH_COST \
14762 - (TARGET_32BIT ? 4 : (optimize > 0 ? 2 : 0))
14763 + (TARGET_32BIT ? (TARGET_THUMB2 && optimize_size ? 1 : 4) \
14764 + : (optimize > 0 ? 2 : 0))
14765 \f
14766 /* Position Independent Code. */
14767 /* We decide which register to use based on the compilation options and
14768 @@ -2339,6 +2459,19 @@ extern int making_const_table;
14769 if (TARGET_ARM) \
14770 asm_fprintf (STREAM,"\tstmfd\t%r!,{%r}\n", \
14771 STACK_POINTER_REGNUM, REGNO); \
14772 + else if (TARGET_THUMB1 \
14773 + && (REGNO) == STATIC_CHAIN_REGNUM) \
14774 + { \
14775 + /* We can't push STATIC_CHAIN_REGNUM (r12) directly with Thumb-1.
14776 + We know that ASM_OUTPUT_REG_PUSH will be matched with
14777 + ASM_OUTPUT_REG_POP, and that r7 isn't used by the function
14778 + profiler, so we can use it as a scratch reg. WARNING: This isn't
14779 + safe in the general case! It may be sensitive to future changes
14780 + in final.c:profile_function. */ \
14781 + asm_fprintf (STREAM, "\tpush\t{r7}\n"); \
14782 + asm_fprintf (STREAM, "\tmov\tr7, %r\n", REGNO);\
14783 + asm_fprintf (STREAM, "\tpush\t{r7}\n"); \
14784 + } \
14785 else \
14786 asm_fprintf (STREAM, "\tpush {%r}\n", REGNO); \
14787 } while (0)
14788 @@ -2350,6 +2483,14 @@ extern int making_const_table;
14789 if (TARGET_ARM) \
14790 asm_fprintf (STREAM, "\tldmfd\t%r!,{%r}\n", \
14791 STACK_POINTER_REGNUM, REGNO); \
14792 + else if (TARGET_THUMB1 \
14793 + && (REGNO) == STATIC_CHAIN_REGNUM) \
14794 + { \
14795 + /* See comment in ASM_OUTPUT_REG_PUSH. */ \
14796 + asm_fprintf (STREAM, "\tpop\t{r7}\n"); \
14797 + asm_fprintf (STREAM, "\tmov\t%r, r7\n", REGNO);\
14798 + asm_fprintf (STREAM, "\tpop\t{r7}\n"); \
14799 + } \
14800 else \
14801 asm_fprintf (STREAM, "\tpop {%r}\n", REGNO); \
14802 } while (0)
14803 @@ -2384,7 +2525,8 @@ extern int making_const_table;
14804 if (TARGET_THUMB) \
14805 { \
14806 if (is_called_in_ARM_mode (DECL) \
14807 - || (TARGET_THUMB1 && current_function_is_thunk)) \
14808 + || (TARGET_THUMB1 && !TARGET_THUMB1_ONLY \
14809 + && current_function_is_thunk)) \
14810 fprintf (STREAM, "\t.code 32\n") ; \
14811 else if (TARGET_THUMB1) \
14812 fprintf (STREAM, "\t.code\t16\n\t.thumb_func\n") ; \
14813 @@ -2479,10 +2621,12 @@ extern int making_const_table;
14814 rtx base = XEXP (X, 0); \
14815 rtx index = XEXP (X, 1); \
14816 HOST_WIDE_INT offset = 0; \
14817 - if (GET_CODE (base) != REG) \
14818 + if (GET_CODE (base) != REG \
14819 + || (GET_CODE (index) == REG && REGNO (index) == SP_REGNUM)) \
14820 { \
14821 /* Ensure that BASE is a register. */ \
14822 /* (one of them must be). */ \
14823 + /* Also ensure the SP is not used as in index register. */ \
14824 rtx temp = base; \
14825 base = index; \
14826 index = temp; \
14827 --- a/gcc/config/arm/arm.md
14828 +++ b/gcc/config/arm/arm.md
14829 @@ -93,9 +93,9 @@
14830 (UNSPEC_TLS 20) ; A symbol that has been treated properly for TLS usage.
14831 (UNSPEC_PIC_LABEL 21) ; A label used for PIC access that does not appear in the
14832 ; instruction stream.
14833 - (UNSPEC_STACK_ALIGN 20) ; Doubleword aligned stack pointer. Used to
14834 + (UNSPEC_STACK_ALIGN 22) ; Doubleword aligned stack pointer. Used to
14835 ; generate correct unwind information.
14836 - (UNSPEC_PIC_OFFSET 22) ; A symbolic 12-bit OFFSET that has been treated
14837 + (UNSPEC_PIC_OFFSET 23) ; A symbolic 12-bit OFFSET that has been treated
14838 ; correctly for PIC usage.
14839 ]
14840 )
14841 @@ -129,6 +129,8 @@
14842 (VUNSPEC_WCMP_EQ 12) ; Used by the iWMMXt WCMPEQ instructions
14843 (VUNSPEC_WCMP_GTU 13) ; Used by the iWMMXt WCMPGTU instructions
14844 (VUNSPEC_WCMP_GT 14) ; Used by the iwMMXT WCMPGT instructions
14845 + (VUNSPEC_ALIGN16 15) ; Used to force 16-byte alignment.
14846 + (VUNSPEC_ALIGN32 16) ; Used to force 32-byte alignment.
14847 (VUNSPEC_EH_RETURN 20); Use to override the return address for exception
14848 ; handling.
14849 ]
14850 @@ -142,6 +144,10 @@
14851 ; patterns that share the same RTL in both ARM and Thumb code.
14852 (define_attr "is_thumb" "no,yes" (const (symbol_ref "thumb_code")))
14853
14854 +; FIX_JANUS is set to 'yes' when compiling for Janus2, it causes to
14855 +; add a nop after shifts, in order to work around a Janus2 bug
14856 +(define_attr "fix_janus" "no,yes" (const (symbol_ref "janus2_code")))
14857 +
14858 ; IS_STRONGARM is set to 'yes' when compiling for StrongARM, it affects
14859 ; scheduling decisions for the load unit and the multiplier.
14860 (define_attr "is_strongarm" "no,yes" (const (symbol_ref "arm_tune_strongarm")))
14861 @@ -156,7 +162,7 @@
14862 ; Floating Point Unit. If we only have floating point emulation, then there
14863 ; is no point in scheduling the floating point insns. (Well, for best
14864 ; performance we should try and group them together).
14865 -(define_attr "fpu" "none,fpa,fpe2,fpe3,maverick,vfp"
14866 +(define_attr "fpu" "none,fpa,fpe2,fpe3,maverick,vfp,vfpv3d16,vfpv3,neon,neon_fp16"
14867 (const (symbol_ref "arm_fpu_attr")))
14868
14869 ; LENGTH of an instruction (in bytes)
14870 @@ -183,7 +189,7 @@
14871 ;; scheduling information.
14872
14873 (define_attr "insn"
14874 - "mov,mvn,smulxy,smlaxy,smlalxy,smulwy,smlawx,mul,muls,mla,mlas,umull,umulls,umlal,umlals,smull,smulls,smlal,smlals,smlawy,smuad,smuadx,smlad,smladx,smusd,smusdx,smlsd,smlsdx,smmul,smmulr,smmla,umaal,smlald,smlsld,clz,mrs,msr,xtab,other"
14875 + "mov,mvn,and,orr,eor,smulxy,smlaxy,smlalxy,smulwy,smlawx,mul,muls,mla,mlas,umull,umulls,umlal,umlals,smull,smulls,smlal,smlals,smlawy,smuad,smuadx,smlad,smladx,smusd,smusdx,smlsd,smlsdx,smmul,smmulr,smmla,smmls,umaal,smlald,smlsld,clz,mrs,msr,xtab,sdiv,udiv,other"
14876 (const_string "other"))
14877
14878 ; TYPE attribute is used to detect floating point instructions which, if
14879 @@ -192,6 +198,8 @@
14880 ; scheduling of writes.
14881
14882 ; Classification of each insn
14883 +; Note: vfp.md has different meanings for some of these, and some further
14884 +; types as well. See that file for details.
14885 ; alu any alu instruction that doesn't hit memory or fp
14886 ; regs or have a shifted source operand
14887 ; alu_shift any data instruction that doesn't hit memory or fp
14888 @@ -236,7 +244,7 @@
14889 ;
14890
14891 (define_attr "type"
14892 - "alu,alu_shift,alu_shift_reg,mult,block,float,fdivx,fdivd,fdivs,fmul,fmuls,fmuld,fmacs,fmacd,ffmul,farith,ffarith,f_flag,float_em,f_load,f_store,f_loads,f_loadd,f_stores,f_stored,f_mem_r,r_mem_f,f_2_r,r_2_f,f_cvt,branch,call,load_byte,load1,load2,load3,load4,store1,store2,store3,store4,mav_farith,mav_dmult"
14893 + "alu,alu_shift,alu_shift_reg,mult,block,float,fdivx,fdivd,fdivs,fmul,fmuls,fmuld,fmacs,fmacd,ffmul,farith,ffarith,f_flag,float_em,f_load,f_store,f_loads,f_loadd,f_stores,f_stored,f_mem_r,r_mem_f,f_2_r,r_2_f,f_cvt,branch,call,load_byte,load1,load2,load3,load4,store1,store2,store3,store4,mav_farith,mav_dmult,fconsts,fconstd,fadds,faddd,ffariths,ffarithd,fcmps,fcmpd,fcpys"
14894 (if_then_else
14895 (eq_attr "insn" "smulxy,smlaxy,smlalxy,smulwy,smlawx,mul,muls,mla,mlas,umull,umulls,umlal,umlals,smull,smulls,smlal,smlals")
14896 (const_string "mult")
14897 @@ -246,6 +254,73 @@
14898 ; initialized by arm_override_options()
14899 (define_attr "ldsched" "no,yes" (const (symbol_ref "arm_ld_sched")))
14900
14901 +;; Classification of NEON instructions for scheduling purposes.
14902 +(define_attr "neon_type"
14903 + "neon_int_1,\
14904 + neon_int_2,\
14905 + neon_int_3,\
14906 + neon_int_4,\
14907 + neon_int_5,\
14908 + neon_vqneg_vqabs,\
14909 + neon_vmov,\
14910 + neon_vaba,\
14911 + neon_vsma,\
14912 + neon_vaba_qqq,\
14913 + neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\
14914 + neon_mul_qqq_8_16_32_ddd_32,\
14915 + neon_mul_qdd_64_32_long_qqd_16_ddd_32_scalar_64_32_long_scalar,\
14916 + neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\
14917 + neon_mla_qqq_8_16,\
14918 + neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long,\
14919 + neon_mla_qqq_32_qqd_32_scalar,\
14920 + neon_mul_ddd_16_scalar_32_16_long_scalar,\
14921 + neon_mul_qqd_32_scalar,\
14922 + neon_mla_ddd_16_scalar_qdd_32_16_long_scalar,\
14923 + neon_shift_1,\
14924 + neon_shift_2,\
14925 + neon_shift_3,\
14926 + neon_vshl_ddd,\
14927 + neon_vqshl_vrshl_vqrshl_qqq,\
14928 + neon_vsra_vrsra,\
14929 + neon_fp_vadd_ddd_vabs_dd,\
14930 + neon_fp_vadd_qqq_vabs_qq,\
14931 + neon_fp_vsum,\
14932 + neon_fp_vmul_ddd,\
14933 + neon_fp_vmul_qqd,\
14934 + neon_fp_vmla_ddd,\
14935 + neon_fp_vmla_qqq,\
14936 + neon_fp_vmla_ddd_scalar,\
14937 + neon_fp_vmla_qqq_scalar,\
14938 + neon_fp_vrecps_vrsqrts_ddd,\
14939 + neon_fp_vrecps_vrsqrts_qqq,\
14940 + neon_bp_simple,\
14941 + neon_bp_2cycle,\
14942 + neon_bp_3cycle,\
14943 + neon_ldr,\
14944 + neon_str,\
14945 + neon_vld1_1_2_regs,\
14946 + neon_vld1_3_4_regs,\
14947 + neon_vld2_2_regs_vld1_vld2_all_lanes,\
14948 + neon_vld2_4_regs,\
14949 + neon_vld3_vld4,\
14950 + neon_vst1_1_2_regs_vst2_2_regs,\
14951 + neon_vst1_3_4_regs,\
14952 + neon_vst2_4_regs_vst3_vst4,\
14953 + neon_vst3_vst4,\
14954 + neon_vld1_vld2_lane,\
14955 + neon_vld3_vld4_lane,\
14956 + neon_vst1_vst2_lane,\
14957 + neon_vst3_vst4_lane,\
14958 + neon_vld3_vld4_all_lanes,\
14959 + neon_mcr,\
14960 + neon_mcr_2_mcrr,\
14961 + neon_mrc,\
14962 + neon_mrrc,\
14963 + neon_ldm_2,\
14964 + neon_stm_2,\
14965 + none"
14966 + (const_string "none"))
14967 +
14968 ; condition codes: this one is used by final_prescan_insn to speed up
14969 ; conditionalizing instructions. It saves having to scan the rtl to see if
14970 ; it uses or alters the condition codes.
14971 @@ -263,13 +338,17 @@
14972 ; JUMP_CLOB is used when the condition cannot be represented by a single
14973 ; instruction (UNEQ and LTGT). These cannot be predicated.
14974 ;
14975 +; UNCONDITIONAL means the instions can not be conditionally executed.
14976 +;
14977 ; NOCOND means that the condition codes are neither altered nor affect the
14978 ; output of this insn
14979
14980 -(define_attr "conds" "use,set,clob,jump_clob,nocond"
14981 +(define_attr "conds" "use,set,clob,jump_clob,unconditional,nocond"
14982 (if_then_else (eq_attr "type" "call")
14983 (const_string "clob")
14984 - (const_string "nocond")))
14985 + (if_then_else (eq_attr "neon_type" "none")
14986 + (const_string "nocond")
14987 + (const_string "unconditional"))))
14988
14989 ; Predicable means that the insn can be conditionally executed based on
14990 ; an automatically added predicate (additional patterns are generated by
14991 @@ -328,18 +407,26 @@
14992 ;; Processor type. This is created automatically from arm-cores.def.
14993 (include "arm-tune.md")
14994
14995 +(define_attr "tune_cortexr4" "yes,no"
14996 + (const (if_then_else
14997 + (eq_attr "tune" "cortexr4,cortexr4f")
14998 + (const_string "yes")
14999 + (const_string "no"))))
15000 +
15001 ;; True if the generic scheduling description should be used.
15002
15003 (define_attr "generic_sched" "yes,no"
15004 (const (if_then_else
15005 - (eq_attr "tune" "arm926ejs,arm1020e,arm1026ejs,arm1136js,arm1136jfs,cortexa8")
15006 + (ior (eq_attr "tune" "arm926ejs,arm1020e,arm1026ejs,arm1136js,arm1136jfs,marvell_f,cortexa8,cortexa9")
15007 + (eq_attr "tune_cortexr4" "yes"))
15008 (const_string "no")
15009 (const_string "yes"))))
15010
15011 (define_attr "generic_vfp" "yes,no"
15012 (const (if_then_else
15013 (and (eq_attr "fpu" "vfp")
15014 - (eq_attr "tune" "!arm1020e,arm1022e,cortexa8"))
15015 + (eq_attr "tune" "!arm1020e,arm1022e,marvell_f,cortexa8,cortexa9")
15016 + (eq_attr "tune_cortexr4" "no"))
15017 (const_string "yes")
15018 (const_string "no"))))
15019
15020 @@ -348,7 +435,13 @@
15021 (include "arm1020e.md")
15022 (include "arm1026ejs.md")
15023 (include "arm1136jfs.md")
15024 +(include "marvell-f.md")
15025 +(include "marvell-f-vfp.md")
15026 (include "cortex-a8.md")
15027 +(include "cortex-a9.md")
15028 +(include "cortex-r4.md")
15029 +(include "cortex-r4f.md")
15030 +(include "vfp11.md")
15031
15032 \f
15033 ;;---------------------------------------------------------------------------
15034 @@ -516,13 +609,19 @@
15035 ""
15036 )
15037
15038 +;; The r/r/k alternative is required when reloading the address
15039 +;; (plus (reg rN) (reg sp)) into (reg rN). In this case reload will
15040 +;; put the duplicated register first, and not try the commutative version.
15041 (define_insn_and_split "*arm_addsi3"
15042 - [(set (match_operand:SI 0 "s_register_operand" "=r,r,r")
15043 - (plus:SI (match_operand:SI 1 "s_register_operand" "%r,r,r")
15044 - (match_operand:SI 2 "reg_or_int_operand" "rI,L,?n")))]
15045 + [(set (match_operand:SI 0 "s_register_operand" "=r, !k, r,r, !k,r")
15046 + (plus:SI (match_operand:SI 1 "s_register_operand" "%rk,!k, r,rk,!k,rk")
15047 + (match_operand:SI 2 "reg_or_int_operand" "rI, rI,!k,L, L,?n")))]
15048 "TARGET_32BIT"
15049 "@
15050 add%?\\t%0, %1, %2
15051 + add%?\\t%0, %1, %2
15052 + add%?\\t%0, %2, %1
15053 + sub%?\\t%0, %1, #%n2
15054 sub%?\\t%0, %1, #%n2
15055 #"
15056 "TARGET_32BIT &&
15057 @@ -536,7 +635,7 @@
15058 operands[1], 0);
15059 DONE;
15060 "
15061 - [(set_attr "length" "4,4,16")
15062 + [(set_attr "length" "4,4,4,4,4,16")
15063 (set_attr "predicable" "yes")]
15064 )
15065
15066 @@ -545,9 +644,9 @@
15067 ;; so never allow those alternatives to match if reloading is needed.
15068
15069 (define_insn "*thumb1_addsi3"
15070 - [(set (match_operand:SI 0 "register_operand" "=l,l,l,*r,*h,l,!k")
15071 + [(set (match_operand:SI 0 "register_operand" "=l,l,l,*rk,*hk,l,!k")
15072 (plus:SI (match_operand:SI 1 "register_operand" "%0,0,l,*0,*0,!k,!k")
15073 - (match_operand:SI 2 "nonmemory_operand" "I,J,lL,*h,*r,!M,!O")))]
15074 + (match_operand:SI 2 "nonmemory_operand" "I,J,lL,*hk,*rk,!M,!O")))]
15075 "TARGET_THUMB1"
15076 "*
15077 static const char * const asms[] =
15078 @@ -759,7 +858,11 @@
15079 [(set_attr "conds" "use")
15080 (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "")
15081 (const_string "alu_shift")
15082 - (const_string "alu_shift_reg")))]
15083 + (const_string "alu_shift_reg")))
15084 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
15085 + (eq_attr "fix_janus" "yes"))
15086 + (const_int 8)
15087 + (const_int 4)))]
15088 )
15089
15090 (define_insn "*addsi3_carryin_alt1"
15091 @@ -991,12 +1094,13 @@
15092
15093 ; ??? Check Thumb-2 split length
15094 (define_insn_and_split "*arm_subsi3_insn"
15095 - [(set (match_operand:SI 0 "s_register_operand" "=r,r")
15096 - (minus:SI (match_operand:SI 1 "reg_or_int_operand" "rI,?n")
15097 - (match_operand:SI 2 "s_register_operand" "r,r")))]
15098 + [(set (match_operand:SI 0 "s_register_operand" "=r,rk,r")
15099 + (minus:SI (match_operand:SI 1 "reg_or_int_operand" "rI,!k,?n")
15100 + (match_operand:SI 2 "s_register_operand" "r, r, r")))]
15101 "TARGET_32BIT"
15102 "@
15103 rsb%?\\t%0, %2, %1
15104 + sub%?\\t%0, %1, %2
15105 #"
15106 "TARGET_32BIT
15107 && GET_CODE (operands[1]) == CONST_INT
15108 @@ -1007,7 +1111,7 @@
15109 INTVAL (operands[1]), operands[0], operands[2], 0);
15110 DONE;
15111 "
15112 - [(set_attr "length" "4,16")
15113 + [(set_attr "length" "4,4,16")
15114 (set_attr "predicable" "yes")]
15115 )
15116
15117 @@ -1236,6 +1340,49 @@
15118 (set_attr "predicable" "yes")]
15119 )
15120
15121 +; The combiner cannot combine the first and last insns in the
15122 +; following sequence because of the intervening insn, so help the
15123 +; combiner with this splitter. The combiner does attempt to split
15124 +; this particular combination but does not know this exact split.
15125 +; Note that the combiner puts the constant at the outermost operation
15126 +; as a part of canonicalization.
15127 +;
15128 +; mul r3, r2, r1
15129 +; <add/sub> r3, r3, <constant>
15130 +; add r3, r3, r4
15131 +
15132 +(define_split
15133 + [(set (match_operand:SI 0 "s_register_operand" "")
15134 + (match_operator:SI 1 "plusminus_operator"
15135 + [(plus:SI (mult:SI (match_operand:SI 2 "s_register_operand" "")
15136 + (match_operand:SI 3 "s_register_operand" ""))
15137 + (match_operand:SI 4 "s_register_operand" ""))
15138 + (match_operand:SI 5 "arm_immediate_operand" "")]))]
15139 + "TARGET_32BIT"
15140 + [(set (match_dup 0)
15141 + (plus:SI (mult:SI (match_dup 2) (match_dup 3))
15142 + (match_dup 4)))
15143 + (set (match_dup 0)
15144 + (match_op_dup:SI 1 [(match_dup 0) (match_dup 5)]))]
15145 + "")
15146 +
15147 +; Likewise for MLS. MLS is available only on select architectures.
15148 +
15149 +(define_split
15150 + [(set (match_operand:SI 0 "s_register_operand" "")
15151 + (match_operator:SI 1 "plusminus_operator"
15152 + [(minus:SI (match_operand:SI 2 "s_register_operand" "")
15153 + (mult:SI (match_operand:SI 3 "s_register_operand" "")
15154 + (match_operand:SI 4 "s_register_operand" "")))
15155 + (match_operand:SI 5 "arm_immediate_operand" "")]))]
15156 + "TARGET_32BIT && arm_arch_thumb2"
15157 + [(set (match_dup 0)
15158 + (minus:SI (match_dup 2)
15159 + (mult:SI (match_dup 3) (match_dup 4))))
15160 + (set (match_dup 0)
15161 + (match_op_dup:SI 1 [(match_dup 0) (match_dup 5)]))]
15162 + "")
15163 +
15164 (define_insn "*mulsi3addsi_compare0"
15165 [(set (reg:CC_NOOV CC_REGNUM)
15166 (compare:CC_NOOV
15167 @@ -1864,6 +2011,7 @@
15168 DONE;
15169 "
15170 [(set_attr "length" "4,4,16")
15171 + (set_attr "insn" "and")
15172 (set_attr "predicable" "yes")]
15173 )
15174
15175 @@ -1873,7 +2021,8 @@
15176 (match_operand:SI 2 "register_operand" "l")))]
15177 "TARGET_THUMB1"
15178 "and\\t%0, %0, %2"
15179 - [(set_attr "length" "2")]
15180 + [(set_attr "length" "2")
15181 + (set_attr "insn" "and")]
15182 )
15183
15184 (define_insn "*andsi3_compare0"
15185 @@ -1888,7 +2037,8 @@
15186 "@
15187 and%.\\t%0, %1, %2
15188 bic%.\\t%0, %1, #%B2"
15189 - [(set_attr "conds" "set")]
15190 + [(set_attr "conds" "set")
15191 + (set_attr "insn" "and,*")]
15192 )
15193
15194 (define_insn "*andsi3_compare0_scratch"
15195 @@ -2140,13 +2290,12 @@
15196 ;;; the value before we insert. This loses some of the advantage of having
15197 ;;; this insv pattern, so this pattern needs to be reevalutated.
15198
15199 -; ??? Use Thumb-2 bitfield insert/extract instructions
15200 (define_expand "insv"
15201 [(set (zero_extract:SI (match_operand:SI 0 "s_register_operand" "")
15202 (match_operand:SI 1 "general_operand" "")
15203 (match_operand:SI 2 "general_operand" ""))
15204 (match_operand:SI 3 "reg_or_int_operand" ""))]
15205 - "TARGET_ARM"
15206 + "TARGET_ARM || arm_arch_thumb2"
15207 "
15208 {
15209 int start_bit = INTVAL (operands[2]);
15210 @@ -2154,7 +2303,38 @@
15211 HOST_WIDE_INT mask = (((HOST_WIDE_INT)1) << width) - 1;
15212 rtx target, subtarget;
15213
15214 - target = operands[0];
15215 + if (arm_arch_thumb2)
15216 + {
15217 + bool use_bfi = TRUE;
15218 +
15219 + if (GET_CODE (operands[3]) == CONST_INT)
15220 + {
15221 + HOST_WIDE_INT val = INTVAL (operands[3]) & mask;
15222 +
15223 + if (val == 0)
15224 + {
15225 + emit_insn (gen_insv_zero (operands[0], operands[1],
15226 + operands[2]));
15227 + DONE;
15228 + }
15229 +
15230 + /* See if the set can be done with a single orr instruction. */
15231 + if (val == mask && const_ok_for_arm (val << start_bit))
15232 + use_bfi = FALSE;
15233 + }
15234 +
15235 + if (use_bfi)
15236 + {
15237 + if (GET_CODE (operands[3]) != REG)
15238 + operands[3] = force_reg (SImode, operands[3]);
15239 +
15240 + emit_insn (gen_insv_t2 (operands[0], operands[1], operands[2],
15241 + operands[3]));
15242 + DONE;
15243 + }
15244 + }
15245 +
15246 + target = copy_rtx (operands[0]);
15247 /* Avoid using a subreg as a subtarget, and avoid writing a paradoxical
15248 subreg as the final target. */
15249 if (GET_CODE (target) == SUBREG)
15250 @@ -2277,6 +2457,28 @@
15251 }"
15252 )
15253
15254 +(define_insn "insv_zero"
15255 + [(set (zero_extract:SI (match_operand:SI 0 "s_register_operand" "+r")
15256 + (match_operand:SI 1 "const_int_operand" "M")
15257 + (match_operand:SI 2 "const_int_operand" "M"))
15258 + (const_int 0))]
15259 + "arm_arch_thumb2"
15260 + "bfc%?\t%0, %2, %1"
15261 + [(set_attr "length" "4")
15262 + (set_attr "predicable" "yes")]
15263 +)
15264 +
15265 +(define_insn "insv_t2"
15266 + [(set (zero_extract:SI (match_operand:SI 0 "s_register_operand" "+r")
15267 + (match_operand:SI 1 "const_int_operand" "M")
15268 + (match_operand:SI 2 "const_int_operand" "M"))
15269 + (match_operand:SI 3 "s_register_operand" "r"))]
15270 + "arm_arch_thumb2"
15271 + "bfi%?\t%0, %3, %2, %1"
15272 + [(set_attr "length" "4")
15273 + (set_attr "predicable" "yes")]
15274 +)
15275 +
15276 ; constants for op 2 will never be given to these patterns.
15277 (define_insn_and_split "*anddi_notdi_di"
15278 [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
15279 @@ -2380,7 +2582,11 @@
15280 (set_attr "shift" "2")
15281 (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "")
15282 (const_string "alu_shift")
15283 - (const_string "alu_shift_reg")))]
15284 + (const_string "alu_shift_reg")))
15285 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
15286 + (eq_attr "fix_janus" "yes"))
15287 + (const_int 8)
15288 + (const_int 4)))]
15289 )
15290
15291 (define_insn "*andsi_notsi_si_compare0"
15292 @@ -2428,6 +2634,7 @@
15293 orr%?\\t%Q0, %Q1, %2
15294 #"
15295 [(set_attr "length" "4,8")
15296 + (set_attr "insn" "orr")
15297 (set_attr "predicable" "yes")]
15298 )
15299
15300 @@ -2490,7 +2697,8 @@
15301 (match_operand:SI 2 "register_operand" "l")))]
15302 "TARGET_THUMB1"
15303 "orr\\t%0, %0, %2"
15304 - [(set_attr "length" "2")]
15305 + [(set_attr "length" "2")
15306 + (set_attr "insn" "orr")]
15307 )
15308
15309 (define_peephole2
15310 @@ -2515,7 +2723,8 @@
15311 (ior:SI (match_dup 1) (match_dup 2)))]
15312 "TARGET_32BIT"
15313 "orr%.\\t%0, %1, %2"
15314 - [(set_attr "conds" "set")]
15315 + [(set_attr "conds" "set")
15316 + (set_attr "insn" "orr")]
15317 )
15318
15319 (define_insn "*iorsi3_compare0_scratch"
15320 @@ -2526,7 +2735,8 @@
15321 (clobber (match_scratch:SI 0 "=r"))]
15322 "TARGET_32BIT"
15323 "orr%.\\t%0, %1, %2"
15324 - [(set_attr "conds" "set")]
15325 + [(set_attr "conds" "set")
15326 + (set_attr "insn" "orr")]
15327 )
15328
15329 (define_insn "xordi3"
15330 @@ -2549,7 +2759,8 @@
15331 eor%?\\t%Q0, %Q1, %2
15332 #"
15333 [(set_attr "length" "4,8")
15334 - (set_attr "predicable" "yes")]
15335 + (set_attr "predicable" "yes")
15336 + (set_attr "insn" "eor")]
15337 )
15338
15339 (define_insn "*xordi_sesidi_di"
15340 @@ -2580,7 +2791,8 @@
15341 (match_operand:SI 2 "arm_rhs_operand" "rI")))]
15342 "TARGET_32BIT"
15343 "eor%?\\t%0, %1, %2"
15344 - [(set_attr "predicable" "yes")]
15345 + [(set_attr "predicable" "yes")
15346 + (set_attr "insn" "eor")]
15347 )
15348
15349 (define_insn "*thumb1_xorsi3"
15350 @@ -2589,7 +2801,8 @@
15351 (match_operand:SI 2 "register_operand" "l")))]
15352 "TARGET_THUMB1"
15353 "eor\\t%0, %0, %2"
15354 - [(set_attr "length" "2")]
15355 + [(set_attr "length" "2")
15356 + (set_attr "insn" "eor")]
15357 )
15358
15359 (define_insn "*xorsi3_compare0"
15360 @@ -2601,7 +2814,8 @@
15361 (xor:SI (match_dup 1) (match_dup 2)))]
15362 "TARGET_32BIT"
15363 "eor%.\\t%0, %1, %2"
15364 - [(set_attr "conds" "set")]
15365 + [(set_attr "conds" "set")
15366 + (set_attr "insn" "eor")]
15367 )
15368
15369 (define_insn "*xorsi3_compare0_scratch"
15370 @@ -2758,7 +2972,7 @@
15371 (smax:SI (match_operand:SI 1 "s_register_operand" "")
15372 (match_operand:SI 2 "arm_rhs_operand" "")))
15373 (clobber (reg:CC CC_REGNUM))])]
15374 - "TARGET_32BIT"
15375 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
15376 "
15377 if (operands[2] == const0_rtx || operands[2] == constm1_rtx)
15378 {
15379 @@ -2785,7 +2999,8 @@
15380 (const_int -1)))]
15381 "TARGET_32BIT"
15382 "orr%?\\t%0, %1, %1, asr #31"
15383 - [(set_attr "predicable" "yes")]
15384 + [(set_attr "predicable" "yes")
15385 + (set_attr "insn" "orr")]
15386 )
15387
15388 (define_insn "*arm_smax_insn"
15389 @@ -2793,7 +3008,7 @@
15390 (smax:SI (match_operand:SI 1 "s_register_operand" "%0,?r")
15391 (match_operand:SI 2 "arm_rhs_operand" "rI,rI")))
15392 (clobber (reg:CC CC_REGNUM))]
15393 - "TARGET_ARM"
15394 + "TARGET_ARM && !TARGET_NO_COND_EXEC"
15395 "@
15396 cmp\\t%1, %2\;movlt\\t%0, %2
15397 cmp\\t%1, %2\;movge\\t%0, %1\;movlt\\t%0, %2"
15398 @@ -2807,7 +3022,7 @@
15399 (smin:SI (match_operand:SI 1 "s_register_operand" "")
15400 (match_operand:SI 2 "arm_rhs_operand" "")))
15401 (clobber (reg:CC CC_REGNUM))])]
15402 - "TARGET_32BIT"
15403 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
15404 "
15405 if (operands[2] == const0_rtx)
15406 {
15407 @@ -2825,7 +3040,8 @@
15408 (const_int 0)))]
15409 "TARGET_32BIT"
15410 "and%?\\t%0, %1, %1, asr #31"
15411 - [(set_attr "predicable" "yes")]
15412 + [(set_attr "predicable" "yes")
15413 + (set_attr "insn" "and")]
15414 )
15415
15416 (define_insn "*arm_smin_insn"
15417 @@ -2833,7 +3049,7 @@
15418 (smin:SI (match_operand:SI 1 "s_register_operand" "%0,?r")
15419 (match_operand:SI 2 "arm_rhs_operand" "rI,rI")))
15420 (clobber (reg:CC CC_REGNUM))]
15421 - "TARGET_ARM"
15422 + "TARGET_ARM && !TARGET_NO_COND_EXEC"
15423 "@
15424 cmp\\t%1, %2\;movge\\t%0, %2
15425 cmp\\t%1, %2\;movlt\\t%0, %1\;movge\\t%0, %2"
15426 @@ -2847,7 +3063,7 @@
15427 (umax:SI (match_operand:SI 1 "s_register_operand" "")
15428 (match_operand:SI 2 "arm_rhs_operand" "")))
15429 (clobber (reg:CC CC_REGNUM))])]
15430 - "TARGET_32BIT"
15431 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
15432 ""
15433 )
15434
15435 @@ -2856,7 +3072,7 @@
15436 (umax:SI (match_operand:SI 1 "s_register_operand" "0,r,?r")
15437 (match_operand:SI 2 "arm_rhs_operand" "rI,0,rI")))
15438 (clobber (reg:CC CC_REGNUM))]
15439 - "TARGET_ARM"
15440 + "TARGET_ARM && !TARGET_NO_COND_EXEC"
15441 "@
15442 cmp\\t%1, %2\;movcc\\t%0, %2
15443 cmp\\t%1, %2\;movcs\\t%0, %1
15444 @@ -2871,7 +3087,7 @@
15445 (umin:SI (match_operand:SI 1 "s_register_operand" "")
15446 (match_operand:SI 2 "arm_rhs_operand" "")))
15447 (clobber (reg:CC CC_REGNUM))])]
15448 - "TARGET_32BIT"
15449 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
15450 ""
15451 )
15452
15453 @@ -2880,7 +3096,7 @@
15454 (umin:SI (match_operand:SI 1 "s_register_operand" "0,r,?r")
15455 (match_operand:SI 2 "arm_rhs_operand" "rI,0,rI")))
15456 (clobber (reg:CC CC_REGNUM))]
15457 - "TARGET_ARM"
15458 + "TARGET_ARM && !TARGET_NO_COND_EXEC"
15459 "@
15460 cmp\\t%1, %2\;movcs\\t%0, %2
15461 cmp\\t%1, %2\;movcc\\t%0, %1
15462 @@ -2895,7 +3111,7 @@
15463 [(match_operand:SI 1 "s_register_operand" "r")
15464 (match_operand:SI 2 "s_register_operand" "r")]))
15465 (clobber (reg:CC CC_REGNUM))]
15466 - "TARGET_32BIT"
15467 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
15468 "*
15469 operands[3] = gen_rtx_fmt_ee (minmax_code (operands[3]), SImode,
15470 operands[1], operands[2]);
15471 @@ -3015,11 +3231,23 @@
15472 [(set (match_operand:SI 0 "register_operand" "=l,l")
15473 (ashift:SI (match_operand:SI 1 "register_operand" "l,0")
15474 (match_operand:SI 2 "nonmemory_operand" "N,l")))]
15475 - "TARGET_THUMB1"
15476 + "TARGET_THUMB1 && !janus2_code"
15477 "lsl\\t%0, %1, %2"
15478 [(set_attr "length" "2")]
15479 )
15480
15481 +(define_insn "*thumb1_ashlsi3_janus2"
15482 + [(set (match_operand:SI 0 "register_operand" "=l,l")
15483 + (ashift:SI (match_operand:SI 1 "register_operand" "l,0")
15484 + (match_operand:SI 2 "nonmemory_operand" "N,l")))]
15485 + "TARGET_THUMB1 && janus2_code"
15486 + "@
15487 + lsl\\t%0, %1, %2
15488 + lsl\\t%0, %1, %2\;nop"
15489 + [(set_attr "length" "2,4")]
15490 +)
15491 +
15492 +
15493 (define_expand "ashrdi3"
15494 [(set (match_operand:DI 0 "s_register_operand" "")
15495 (ashiftrt:DI (match_operand:DI 1 "s_register_operand" "")
15496 @@ -3052,6 +3280,7 @@
15497 "TARGET_32BIT"
15498 "movs\\t%R0, %R1, asr #1\;mov\\t%Q0, %Q1, rrx"
15499 [(set_attr "conds" "clob")
15500 + (set_attr "insn" "mov")
15501 (set_attr "length" "8")]
15502 )
15503
15504 @@ -3071,11 +3300,22 @@
15505 [(set (match_operand:SI 0 "register_operand" "=l,l")
15506 (ashiftrt:SI (match_operand:SI 1 "register_operand" "l,0")
15507 (match_operand:SI 2 "nonmemory_operand" "N,l")))]
15508 - "TARGET_THUMB1"
15509 + "TARGET_THUMB1 && !janus2_code"
15510 "asr\\t%0, %1, %2"
15511 [(set_attr "length" "2")]
15512 )
15513
15514 +(define_insn "*thumb1_ashrsi3_janus2"
15515 + [(set (match_operand:SI 0 "register_operand" "=l,l")
15516 + (ashiftrt:SI (match_operand:SI 1 "register_operand" "l,0")
15517 + (match_operand:SI 2 "nonmemory_operand" "N,l")))]
15518 + "TARGET_THUMB1 && janus2_code"
15519 + "@
15520 + asr\\t%0, %1, %2
15521 + asr\\t%0, %1, %2\;nop"
15522 + [(set_attr "length" "2,4")]
15523 +)
15524 +
15525 (define_expand "lshrdi3"
15526 [(set (match_operand:DI 0 "s_register_operand" "")
15527 (lshiftrt:DI (match_operand:DI 1 "s_register_operand" "")
15528 @@ -3108,6 +3348,7 @@
15529 "TARGET_32BIT"
15530 "movs\\t%R0, %R1, lsr #1\;mov\\t%Q0, %Q1, rrx"
15531 [(set_attr "conds" "clob")
15532 + (set_attr "insn" "mov")
15533 (set_attr "length" "8")]
15534 )
15535
15536 @@ -3130,11 +3371,22 @@
15537 [(set (match_operand:SI 0 "register_operand" "=l,l")
15538 (lshiftrt:SI (match_operand:SI 1 "register_operand" "l,0")
15539 (match_operand:SI 2 "nonmemory_operand" "N,l")))]
15540 - "TARGET_THUMB1"
15541 + "TARGET_THUMB1 && !janus2_code"
15542 "lsr\\t%0, %1, %2"
15543 [(set_attr "length" "2")]
15544 )
15545
15546 +(define_insn "*thumb1_lshrsi3_janus2"
15547 + [(set (match_operand:SI 0 "register_operand" "=l,l")
15548 + (lshiftrt:SI (match_operand:SI 1 "register_operand" "l,0")
15549 + (match_operand:SI 2 "nonmemory_operand" "N,l")))]
15550 + "TARGET_THUMB1 && janus2_code"
15551 + "@
15552 + lsr\\t%0, %1, %2
15553 + lsr\\t%0, %1, %2; nop"
15554 + [(set_attr "length" "2,4")]
15555 +)
15556 +
15557 (define_expand "rotlsi3"
15558 [(set (match_operand:SI 0 "s_register_operand" "")
15559 (rotatert:SI (match_operand:SI 1 "s_register_operand" "")
15560 @@ -3176,11 +3428,20 @@
15561 [(set (match_operand:SI 0 "register_operand" "=l")
15562 (rotatert:SI (match_operand:SI 1 "register_operand" "0")
15563 (match_operand:SI 2 "register_operand" "l")))]
15564 - "TARGET_THUMB1"
15565 + "TARGET_THUMB1 && !janus2_code"
15566 "ror\\t%0, %0, %2"
15567 [(set_attr "length" "2")]
15568 )
15569
15570 +(define_insn "*thumb1_rotrsi3_janus2"
15571 + [(set (match_operand:SI 0 "register_operand" "=l")
15572 + (rotatert:SI (match_operand:SI 1 "register_operand" "0")
15573 + (match_operand:SI 2 "register_operand" "l")))]
15574 + "TARGET_THUMB1 && janus2_code"
15575 + "ror\\t%0, %0, %2; nop"
15576 + [(set_attr "length" "4")]
15577 +)
15578 +
15579 (define_insn "*arm_shiftsi3"
15580 [(set (match_operand:SI 0 "s_register_operand" "=r")
15581 (match_operator:SI 3 "shift_operator"
15582 @@ -3192,7 +3453,11 @@
15583 (set_attr "shift" "1")
15584 (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
15585 (const_string "alu_shift")
15586 - (const_string "alu_shift_reg")))]
15587 + (const_string "alu_shift_reg")))
15588 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
15589 + (eq_attr "fix_janus" "yes"))
15590 + (const_int 8)
15591 + (const_int 4)))]
15592 )
15593
15594 (define_insn "*shiftsi3_compare0"
15595 @@ -3209,7 +3474,11 @@
15596 (set_attr "shift" "1")
15597 (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
15598 (const_string "alu_shift")
15599 - (const_string "alu_shift_reg")))]
15600 + (const_string "alu_shift_reg")))
15601 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
15602 + (eq_attr "fix_janus" "yes"))
15603 + (const_int 8)
15604 + (const_int 4)))]
15605 )
15606
15607 (define_insn "*shiftsi3_compare0_scratch"
15608 @@ -3222,7 +3491,11 @@
15609 "TARGET_32BIT"
15610 "* return arm_output_shift(operands, 1);"
15611 [(set_attr "conds" "set")
15612 - (set_attr "shift" "1")]
15613 + (set_attr "shift" "1")
15614 + (set (attr "length") (if_then_else (and (match_operand 2 "s_register_operand" "")
15615 + (eq_attr "fix_janus" "yes"))
15616 + (const_int 8)
15617 + (const_int 4)))]
15618 )
15619
15620 (define_insn "*arm_notsi_shiftsi"
15621 @@ -3234,9 +3507,14 @@
15622 "mvn%?\\t%0, %1%S3"
15623 [(set_attr "predicable" "yes")
15624 (set_attr "shift" "1")
15625 + (set_attr "insn" "mvn")
15626 (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
15627 (const_string "alu_shift")
15628 - (const_string "alu_shift_reg")))]
15629 + (const_string "alu_shift_reg")))
15630 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
15631 + (eq_attr "fix_janus" "yes"))
15632 + (const_int 8)
15633 + (const_int 4)))]
15634 )
15635
15636 (define_insn "*arm_notsi_shiftsi_compare0"
15637 @@ -3251,9 +3529,14 @@
15638 "mvn%.\\t%0, %1%S3"
15639 [(set_attr "conds" "set")
15640 (set_attr "shift" "1")
15641 + (set_attr "insn" "mvn")
15642 (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
15643 (const_string "alu_shift")
15644 - (const_string "alu_shift_reg")))]
15645 + (const_string "alu_shift_reg")))
15646 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
15647 + (eq_attr "fix_janus" "yes"))
15648 + (const_int 8)
15649 + (const_int 4)))]
15650 )
15651
15652 (define_insn "*arm_not_shiftsi_compare0_scratch"
15653 @@ -3267,9 +3550,14 @@
15654 "mvn%.\\t%0, %1%S3"
15655 [(set_attr "conds" "set")
15656 (set_attr "shift" "1")
15657 + (set_attr "insn" "mvn")
15658 (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
15659 (const_string "alu_shift")
15660 - (const_string "alu_shift_reg")))]
15661 + (const_string "alu_shift_reg")))
15662 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
15663 + (eq_attr "fix_janus" "yes"))
15664 + (const_int 8)
15665 + (const_int 4)))]
15666 )
15667
15668 ;; We don't really have extzv, but defining this using shifts helps
15669 @@ -3282,12 +3570,19 @@
15670 (set (match_operand:SI 0 "register_operand" "")
15671 (lshiftrt:SI (match_dup 4)
15672 (match_operand:SI 3 "const_int_operand" "")))]
15673 - "TARGET_THUMB1"
15674 + "TARGET_THUMB1 || arm_arch_thumb2"
15675 "
15676 {
15677 HOST_WIDE_INT lshift = 32 - INTVAL (operands[2]) - INTVAL (operands[3]);
15678 HOST_WIDE_INT rshift = 32 - INTVAL (operands[2]);
15679
15680 + if (arm_arch_thumb2)
15681 + {
15682 + emit_insn (gen_extzv_t2 (operands[0], operands[1], operands[2],
15683 + operands[3]));
15684 + DONE;
15685 + }
15686 +
15687 operands[3] = GEN_INT (rshift);
15688
15689 if (lshift == 0)
15690 @@ -3301,6 +3596,28 @@
15691 }"
15692 )
15693
15694 +(define_insn "extv"
15695 + [(set (match_operand:SI 0 "s_register_operand" "=r")
15696 + (sign_extract:SI (match_operand:SI 1 "s_register_operand" "r")
15697 + (match_operand:SI 2 "const_int_operand" "M")
15698 + (match_operand:SI 3 "const_int_operand" "M")))]
15699 + "arm_arch_thumb2"
15700 + "sbfx%?\t%0, %1, %3, %2"
15701 + [(set_attr "length" "4")
15702 + (set_attr "predicable" "yes")]
15703 +)
15704 +
15705 +(define_insn "extzv_t2"
15706 + [(set (match_operand:SI 0 "s_register_operand" "=r")
15707 + (zero_extract:SI (match_operand:SI 1 "s_register_operand" "r")
15708 + (match_operand:SI 2 "const_int_operand" "M")
15709 + (match_operand:SI 3 "const_int_operand" "M")))]
15710 + "arm_arch_thumb2"
15711 + "ubfx%?\t%0, %1, %3, %2"
15712 + [(set_attr "length" "4")
15713 + (set_attr "predicable" "yes")]
15714 +)
15715 +
15716 \f
15717 ;; Unary arithmetic insns
15718
15719 @@ -3378,7 +3695,7 @@
15720
15721 ;; abssi2 doesn't really clobber the condition codes if a different register
15722 ;; is being set. To keep things simple, assume during rtl manipulations that
15723 -;; it does, but tell the final scan operator the truth. Similarly for
15724 +;; it does, and the splitter will eliminate it. Similarly for
15725 ;; (neg (abs...))
15726
15727 (define_expand "abssi2"
15728 @@ -3390,22 +3707,28 @@
15729 "
15730 if (TARGET_THUMB1)
15731 operands[2] = gen_rtx_SCRATCH (SImode);
15732 + else if (TARGET_NO_SINGLE_COND_EXEC)
15733 + {
15734 + emit_insn(gen_rtx_SET(VOIDmode, operands[0],
15735 + gen_rtx_ABS(SImode, operands[1])));
15736 + DONE;
15737 + }
15738 else
15739 operands[2] = gen_rtx_REG (CCmode, CC_REGNUM);
15740 ")
15741
15742 (define_insn "*arm_abssi2"
15743 - [(set (match_operand:SI 0 "s_register_operand" "=r,&r")
15744 - (abs:SI (match_operand:SI 1 "s_register_operand" "0,r")))
15745 + [(set (match_operand:SI 0 "s_register_operand" "=r")
15746 + (abs:SI (match_operand:SI 1 "s_register_operand" "r")))
15747 (clobber (reg:CC CC_REGNUM))]
15748 - "TARGET_ARM"
15749 - "@
15750 - cmp\\t%0, #0\;rsblt\\t%0, %0, #0
15751 - eor%?\\t%0, %1, %1, asr #31\;sub%?\\t%0, %0, %1, asr #31"
15752 - [(set_attr "conds" "clob,*")
15753 - (set_attr "shift" "1")
15754 + "TARGET_32BIT && !TARGET_NO_SINGLE_COND_EXEC"
15755 + "#"
15756 + [(set_attr "shift" "1")
15757 ;; predicable can't be set based on the variant, so left as no
15758 - (set_attr "length" "8")]
15759 + (set (attr "length")
15760 + (if_then_else (eq_attr "is_thumb" "yes")
15761 + (const_int 10)
15762 + (const_int 8)))]
15763 )
15764
15765 (define_insn_and_split "*thumb1_abssi2"
15766 @@ -3423,17 +3746,17 @@
15767 )
15768
15769 (define_insn "*arm_neg_abssi2"
15770 - [(set (match_operand:SI 0 "s_register_operand" "=r,&r")
15771 - (neg:SI (abs:SI (match_operand:SI 1 "s_register_operand" "0,r"))))
15772 + [(set (match_operand:SI 0 "s_register_operand" "=r")
15773 + (neg:SI (abs:SI (match_operand:SI 1 "s_register_operand" "r"))))
15774 (clobber (reg:CC CC_REGNUM))]
15775 - "TARGET_ARM"
15776 - "@
15777 - cmp\\t%0, #0\;rsbgt\\t%0, %0, #0
15778 - eor%?\\t%0, %1, %1, asr #31\;rsb%?\\t%0, %0, %1, asr #31"
15779 - [(set_attr "conds" "clob,*")
15780 - (set_attr "shift" "1")
15781 + "TARGET_32BIT && !TARGET_NO_SINGLE_COND_EXEC"
15782 + "#"
15783 + [(set_attr "shift" "1")
15784 ;; predicable can't be set based on the variant, so left as no
15785 - (set_attr "length" "8")]
15786 + (set (attr "length")
15787 + (if_then_else (eq_attr "is_thumb" "yes")
15788 + (const_int 10)
15789 + (const_int 8)))]
15790 )
15791
15792 (define_insn_and_split "*thumb1_neg_abssi2"
15793 @@ -3450,6 +3773,93 @@
15794 [(set_attr "length" "6")]
15795 )
15796
15797 +;; Simplified version for when avoiding conditional execution
15798 +(define_insn "*arm_nocond_abssi2"
15799 + [(set (match_operand:SI 0 "s_register_operand" "=&r")
15800 + (abs:SI (match_operand:SI 1 "s_register_operand" "r")))]
15801 + "TARGET_32BIT && TARGET_NO_SINGLE_COND_EXEC"
15802 + "#"
15803 + [(set_attr "shift" "1")
15804 + (set_attr "length" "8")
15805 + (set_attr "predicable" "yes")]
15806 +)
15807 +
15808 +(define_insn "*arm_nocond_neg_abssi2"
15809 + [(set (match_operand:SI 0 "s_register_operand" "=&r")
15810 + (neg:SI (abs:SI (match_operand:SI 1 "s_register_operand" "r"))))]
15811 + "TARGET_32BIT && TARGET_NO_SINGLE_COND_EXEC"
15812 + "#"
15813 + [(set_attr "shift" "1")
15814 + (set_attr "length" "8")
15815 + (set_attr "predicable" "yes")]
15816 +)
15817 +
15818 +;; Splitters for ABS patterns.
15819 +
15820 +(define_split
15821 + [(set (match_operand:SI 0 "s_register_operand" "")
15822 + (abs:SI (match_operand:SI 1 "s_register_operand" "")))
15823 + (clobber (reg:CC CC_REGNUM))]
15824 + "TARGET_32BIT && reload_completed && rtx_equal_p(operands[0], operands[1])"
15825 + [(set (reg:CC CC_REGNUM) (compare:CC (match_dup 1) (const_int 0)))
15826 + (cond_exec (lt (reg:CC CC_REGNUM) (const_int 0))
15827 + (set (match_dup 0) (neg:SI (match_dup 1))))]
15828 +)
15829 +
15830 +(define_split
15831 + [(set (match_operand:SI 0 "s_register_operand" "")
15832 + (neg:SI (abs:SI (match_operand:SI 1 "s_register_operand" ""))))
15833 + (clobber (reg:CC CC_REGNUM))]
15834 + "TARGET_32BIT && reload_completed && rtx_equal_p(operands[0], operands[1])"
15835 + [(set (reg:CC CC_REGNUM) (compare:CC (match_dup 1) (const_int 0)))
15836 + (cond_exec (gt (reg:CC CC_REGNUM) (const_int 0))
15837 + (set (match_dup 0) (neg:SI (match_dup 1))))]
15838 +)
15839 +
15840 +;; GCC does not add/remove clobbers when matching splitters, so we need
15841 +;; variants with and without the CC clobber.
15842 +(define_split
15843 + [(set (match_operand:SI 0 "s_register_operand" "")
15844 + (abs:SI (match_operand:SI 1 "s_register_operand" "")))]
15845 + "TARGET_32BIT && reload_completed && !rtx_equal_p(operands[0], operands[1])"
15846 + [(set (match_dup 0) (xor:SI (ashiftrt:SI (match_dup 1) (const_int 31))
15847 + (match_dup 1)))
15848 + (set (match_dup 0) (minus:SI (match_dup 0)
15849 + (ashiftrt:SI (match_dup 1) (const_int 31))))]
15850 +)
15851 +
15852 +(define_split
15853 + [(set (match_operand:SI 0 "s_register_operand" "")
15854 + (abs:SI (match_operand:SI 1 "s_register_operand" "")))
15855 + (clobber (reg:CC CC_REGNUM))]
15856 + "TARGET_32BIT && reload_completed && !rtx_equal_p(operands[0], operands[1])"
15857 + [(set (match_dup 0) (xor:SI (ashiftrt:SI (match_dup 1) (const_int 31))
15858 + (match_dup 1)))
15859 + (set (match_dup 0) (minus:SI (match_dup 0)
15860 + (ashiftrt:SI (match_dup 1) (const_int 31))))]
15861 +)
15862 +
15863 +(define_split
15864 + [(set (match_operand:SI 0 "s_register_operand" "")
15865 + (neg:SI (abs:SI (match_operand:SI 1 "s_register_operand" ""))))]
15866 + "TARGET_32BIT && reload_completed && !rtx_equal_p(operands[0], operands[1])"
15867 + [(set (match_dup 0) (xor:SI (ashiftrt:SI (match_dup 1) (const_int 31))
15868 + (match_dup 1)))
15869 + (set (match_dup 0) (minus:SI (ashiftrt:SI (match_dup 1) (const_int 31))
15870 + (match_dup 0)))]
15871 +)
15872 +
15873 +(define_split
15874 + [(set (match_operand:SI 0 "s_register_operand" "")
15875 + (neg:SI (abs:SI (match_operand:SI 1 "s_register_operand" ""))))
15876 + (clobber (reg:CC CC_REGNUM))]
15877 + "TARGET_32BIT && reload_completed && !rtx_equal_p(operands[0], operands[1])"
15878 + [(set (match_dup 0) (xor:SI (ashiftrt:SI (match_dup 1) (const_int 31))
15879 + (match_dup 1)))
15880 + (set (match_dup 0) (minus:SI (ashiftrt:SI (match_dup 1) (const_int 31))
15881 + (match_dup 0)))]
15882 +)
15883 +
15884 (define_expand "abssf2"
15885 [(set (match_operand:SF 0 "s_register_operand" "")
15886 (abs:SF (match_operand:SF 1 "s_register_operand" "")))]
15887 @@ -3505,7 +3915,8 @@
15888 (not:SI (match_operand:SI 1 "s_register_operand" "r")))]
15889 "TARGET_32BIT"
15890 "mvn%?\\t%0, %1"
15891 - [(set_attr "predicable" "yes")]
15892 + [(set_attr "predicable" "yes")
15893 + (set_attr "insn" "mvn")]
15894 )
15895
15896 (define_insn "*thumb1_one_cmplsi2"
15897 @@ -3513,7 +3924,8 @@
15898 (not:SI (match_operand:SI 1 "register_operand" "l")))]
15899 "TARGET_THUMB1"
15900 "mvn\\t%0, %1"
15901 - [(set_attr "length" "2")]
15902 + [(set_attr "length" "2")
15903 + (set_attr "insn" "mvn")]
15904 )
15905
15906 (define_insn "*notsi_compare0"
15907 @@ -3524,7 +3936,8 @@
15908 (not:SI (match_dup 1)))]
15909 "TARGET_32BIT"
15910 "mvn%.\\t%0, %1"
15911 - [(set_attr "conds" "set")]
15912 + [(set_attr "conds" "set")
15913 + (set_attr "insn" "mvn")]
15914 )
15915
15916 (define_insn "*notsi_compare0_scratch"
15917 @@ -3534,11 +3947,40 @@
15918 (clobber (match_scratch:SI 0 "=r"))]
15919 "TARGET_32BIT"
15920 "mvn%.\\t%0, %1"
15921 - [(set_attr "conds" "set")]
15922 + [(set_attr "conds" "set")
15923 + (set_attr "insn" "mvn")]
15924 )
15925 \f
15926 ;; Fixed <--> Floating conversion insns
15927
15928 +(define_expand "floatsihf2"
15929 + [(set (match_operand:HF 0 "general_operand" "")
15930 + (float:HF (match_operand:SI 1 "general_operand" "")))]
15931 + "TARGET_EITHER"
15932 + "
15933 + {
15934 + rtx op1 = gen_reg_rtx (SFmode);
15935 + expand_float (op1, operands[1], 0);
15936 + op1 = convert_to_mode (HFmode, op1, 0);
15937 + emit_move_insn (operands[0], op1);
15938 + DONE;
15939 + }"
15940 +)
15941 +
15942 +(define_expand "floatdihf2"
15943 + [(set (match_operand:HF 0 "general_operand" "")
15944 + (float:HF (match_operand:DI 1 "general_operand" "")))]
15945 + "TARGET_EITHER"
15946 + "
15947 + {
15948 + rtx op1 = gen_reg_rtx (SFmode);
15949 + expand_float (op1, operands[1], 0);
15950 + op1 = convert_to_mode (HFmode, op1, 0);
15951 + emit_move_insn (operands[0], op1);
15952 + DONE;
15953 + }"
15954 +)
15955 +
15956 (define_expand "floatsisf2"
15957 [(set (match_operand:SF 0 "s_register_operand" "")
15958 (float:SF (match_operand:SI 1 "s_register_operand" "")))]
15959 @@ -3563,6 +4005,30 @@
15960 }
15961 ")
15962
15963 +(define_expand "fix_trunchfsi2"
15964 + [(set (match_operand:SI 0 "general_operand" "")
15965 + (fix:SI (fix:HF (match_operand:HF 1 "general_operand" ""))))]
15966 + "TARGET_EITHER"
15967 + "
15968 + {
15969 + rtx op1 = convert_to_mode (SFmode, operands[1], 0);
15970 + expand_fix (operands[0], op1, 0);
15971 + DONE;
15972 + }"
15973 +)
15974 +
15975 +(define_expand "fix_trunchfdi2"
15976 + [(set (match_operand:DI 0 "general_operand" "")
15977 + (fix:DI (fix:HF (match_operand:HF 1 "general_operand" ""))))]
15978 + "TARGET_EITHER"
15979 + "
15980 + {
15981 + rtx op1 = convert_to_mode (SFmode, operands[1], 0);
15982 + expand_fix (operands[0], op1, 0);
15983 + DONE;
15984 + }"
15985 +)
15986 +
15987 (define_expand "fix_truncsfsi2"
15988 [(set (match_operand:SI 0 "s_register_operand" "")
15989 (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" ""))))]
15990 @@ -3602,6 +4068,22 @@
15991 "TARGET_32BIT && TARGET_HARD_FLOAT"
15992 ""
15993 )
15994 +
15995 +/* DFmode -> HFmode conversions have to go through SFmode. */
15996 +(define_expand "truncdfhf2"
15997 + [(set (match_operand:HF 0 "general_operand" "")
15998 + (float_truncate:HF
15999 + (match_operand:DF 1 "general_operand" "")))]
16000 + "TARGET_EITHER"
16001 + "
16002 + {
16003 + rtx op1;
16004 + op1 = convert_to_mode (SFmode, operands[1], 0);
16005 + op1 = convert_to_mode (HFmode, op1, 0);
16006 + emit_move_insn (operands[0], op1);
16007 + DONE;
16008 + }"
16009 +)
16010 \f
16011 ;; Zero and sign extension instructions.
16012
16013 @@ -3623,6 +4105,7 @@
16014 return \"mov%?\\t%R0, #0\";
16015 "
16016 [(set_attr "length" "8")
16017 + (set_attr "insn" "mov")
16018 (set_attr "predicable" "yes")]
16019 )
16020
16021 @@ -3666,6 +4149,7 @@
16022 "
16023 [(set_attr "length" "8")
16024 (set_attr "shift" "1")
16025 + (set_attr "insn" "mov")
16026 (set_attr "predicable" "yes")]
16027 )
16028
16029 @@ -4464,6 +4948,21 @@
16030 "TARGET_32BIT && TARGET_HARD_FLOAT"
16031 ""
16032 )
16033 +
16034 +/* HFmode -> DFmode conversions have to go through SFmode. */
16035 +(define_expand "extendhfdf2"
16036 + [(set (match_operand:DF 0 "general_operand" "")
16037 + (float_extend:DF (match_operand:HF 1 "general_operand" "")))]
16038 + "TARGET_EITHER"
16039 + "
16040 + {
16041 + rtx op1;
16042 + op1 = convert_to_mode (SFmode, operands[1], 0);
16043 + op1 = convert_to_mode (DFmode, op1, 0);
16044 + emit_insn (gen_movdf (operands[0], op1));
16045 + DONE;
16046 + }"
16047 +)
16048 \f
16049 ;; Move insns (including loads and stores)
16050
16051 @@ -4699,6 +5198,7 @@
16052 }"
16053 [(set_attr "length" "4,4,6,2,2,6,4,4")
16054 (set_attr "type" "*,*,*,load2,store2,load2,store2,*")
16055 + (set_attr "insn" "*,mov,*,*,*,*,*,mov")
16056 (set_attr "pool_range" "*,*,*,*,*,1020,*,*")]
16057 )
16058
16059 @@ -4785,23 +5285,38 @@
16060 "
16061 )
16062
16063 +;; The ARM LO_SUM and HIGH are backwards - HIGH sets the low bits, and
16064 +;; LO_SUM adds in the high bits. Fortunately these are opaque opearsions
16065 +;; so this does not matter.
16066 +(define_insn "*arm_movt"
16067 + [(set (match_operand:SI 0 "nonimmediate_operand" "=r")
16068 + (lo_sum:SI (match_operand:SI 1 "nonimmediate_operand" "0")
16069 + (match_operand:SI 2 "general_operand" "i")))]
16070 + "TARGET_32BIT"
16071 + "movt%?\t%0, #:upper16:%c2"
16072 + [(set_attr "predicable" "yes")
16073 + (set_attr "length" "4")]
16074 +)
16075 +
16076 (define_insn "*arm_movsi_insn"
16077 - [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,r, m")
16078 - (match_operand:SI 1 "general_operand" "rI,K,N,mi,r"))]
16079 + [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r,rk,m")
16080 + (match_operand:SI 1 "general_operand" " rk,I,K,j,mi,rk"))]
16081 "TARGET_ARM && ! TARGET_IWMMXT
16082 && !(TARGET_HARD_FLOAT && TARGET_VFP)
16083 && ( register_operand (operands[0], SImode)
16084 || register_operand (operands[1], SImode))"
16085 "@
16086 mov%?\\t%0, %1
16087 + mov%?\\t%0, %1
16088 mvn%?\\t%0, #%B1
16089 movw%?\\t%0, %1
16090 ldr%?\\t%0, %1
16091 str%?\\t%1, %0"
16092 - [(set_attr "type" "*,*,*,load1,store1")
16093 + [(set_attr "type" "*,*,*,*,load1,store1")
16094 + (set_attr "insn" "mov,mov,mvn,mov,*,*")
16095 (set_attr "predicable" "yes")
16096 - (set_attr "pool_range" "*,*,*,4096,*")
16097 - (set_attr "neg_pool_range" "*,*,*,4084,*")]
16098 + (set_attr "pool_range" "*,*,*,*,4096,*")
16099 + (set_attr "neg_pool_range" "*,*,*,*,4084,*")]
16100 )
16101
16102 (define_split
16103 @@ -4818,9 +5333,22 @@
16104 "
16105 )
16106
16107 +(define_split
16108 + [(set (match_operand:SI 0 "arm_general_register_operand" "")
16109 + (match_operand:SI 1 "general_operand" ""))]
16110 + "TARGET_32BIT
16111 + && TARGET_USE_MOVT && GET_CODE (operands[1]) == SYMBOL_REF
16112 + && !flag_pic && !target_word_relocations
16113 + && !arm_tls_referenced_p (operands[1])"
16114 + [(clobber (const_int 0))]
16115 +{
16116 + arm_emit_movpair (operands[0], operands[1]);
16117 + DONE;
16118 +})
16119 +
16120 (define_insn "*thumb1_movsi_insn"
16121 - [(set (match_operand:SI 0 "nonimmediate_operand" "=l,l,l,l,l,>,l, m,*lh")
16122 - (match_operand:SI 1 "general_operand" "l, I,J,K,>,l,mi,l,*lh"))]
16123 + [(set (match_operand:SI 0 "nonimmediate_operand" "=l,l,l,l,l,>,l, m,*lhk")
16124 + (match_operand:SI 1 "general_operand" "l, I,J,K,>,l,mi,l,*lhk"))]
16125 "TARGET_THUMB1
16126 && ( register_operand (operands[0], SImode)
16127 || register_operand (operands[1], SImode))"
16128 @@ -5418,6 +5946,7 @@
16129 ldr%(h%)\\t%0, %1\\t%@ movhi"
16130 [(set_attr "type" "*,*,store1,load1")
16131 (set_attr "predicable" "yes")
16132 + (set_attr "insn" "mov,mvn,*,*")
16133 (set_attr "pool_range" "*,*,*,256")
16134 (set_attr "neg_pool_range" "*,*,*,244")]
16135 )
16136 @@ -5429,7 +5958,8 @@
16137 "@
16138 mov%?\\t%0, %1\\t%@ movhi
16139 mvn%?\\t%0, #%B1\\t%@ movhi"
16140 - [(set_attr "predicable" "yes")]
16141 + [(set_attr "predicable" "yes")
16142 + (set_attr "insn" "mov,mvn")]
16143 )
16144
16145 (define_expand "thumb_movhi_clobber"
16146 @@ -5560,6 +6090,7 @@
16147 ldr%(b%)\\t%0, %1
16148 str%(b%)\\t%1, %0"
16149 [(set_attr "type" "*,*,load1,store1")
16150 + (set_attr "insn" "mov,mvn,*,*")
16151 (set_attr "predicable" "yes")]
16152 )
16153
16154 @@ -5578,9 +6109,111 @@
16155 mov\\t%0, %1"
16156 [(set_attr "length" "2")
16157 (set_attr "type" "*,load1,store1,*,*,*")
16158 + (set_attr "insn" "*,*,*,mov,mov,mov")
16159 (set_attr "pool_range" "*,32,*,*,*,*")]
16160 )
16161
16162 +;; HFmode moves
16163 +(define_expand "movhf"
16164 + [(set (match_operand:HF 0 "general_operand" "")
16165 + (match_operand:HF 1 "general_operand" ""))]
16166 + "TARGET_EITHER"
16167 + "
16168 + if (TARGET_32BIT)
16169 + {
16170 + if (GET_CODE (operands[0]) == MEM)
16171 + operands[1] = force_reg (HFmode, operands[1]);
16172 + }
16173 + else /* TARGET_THUMB1 */
16174 + {
16175 + if (can_create_pseudo_p ())
16176 + {
16177 + if (GET_CODE (operands[0]) != REG)
16178 + operands[1] = force_reg (HFmode, operands[1]);
16179 + }
16180 + }
16181 + "
16182 +)
16183 +
16184 +(define_insn "*arm32_movhf"
16185 + [(set (match_operand:HF 0 "nonimmediate_operand" "=r,m,r,r")
16186 + (match_operand:HF 1 "general_operand" " m,r,r,F"))]
16187 + "TARGET_32BIT && !(TARGET_HARD_FLOAT && TARGET_NEON_FP16)
16188 + && ( s_register_operand (operands[0], HFmode)
16189 + || s_register_operand (operands[1], HFmode))"
16190 + "*
16191 + switch (which_alternative)
16192 + {
16193 + case 0: /* ARM register from memory */
16194 + return \"ldr%(h%)\\t%0, %1\\t%@ __fp16\";
16195 + case 1: /* memory from ARM register */
16196 + return \"str%(h%)\\t%1, %0\\t%@ __fp16\";
16197 + case 2: /* ARM register from ARM register */
16198 + return \"mov%?\\t%0, %1\\t%@ __fp16\";
16199 + case 3: /* ARM register from constant */
16200 + {
16201 + REAL_VALUE_TYPE r;
16202 + long bits;
16203 + rtx ops[4];
16204 +
16205 + REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
16206 + bits = real_to_target (NULL, &r, HFmode);
16207 + ops[0] = operands[0];
16208 + ops[1] = GEN_INT (bits);
16209 + ops[2] = GEN_INT (bits & 0xff00);
16210 + ops[3] = GEN_INT (bits & 0x00ff);
16211 +
16212 + if (arm_arch_thumb2)
16213 + output_asm_insn (\"movw%?\\t%0, %1\", ops);
16214 + else
16215 + output_asm_insn (\"mov%?\\t%0, %2\;orr%?\\t%0, %0, %3\", ops);
16216 + return \"\";
16217 + }
16218 + default:
16219 + gcc_unreachable ();
16220 + }
16221 + "
16222 + [(set_attr "conds" "unconditional")
16223 + (set_attr "type" "load1,store1,*,*")
16224 + (set_attr "length" "4,4,4,8")
16225 + (set_attr "predicable" "yes")
16226 + ]
16227 +)
16228 +
16229 +(define_insn "*thumb1_movhf"
16230 + [(set (match_operand:HF 0 "nonimmediate_operand" "=l,l,m,*r,*h")
16231 + (match_operand:HF 1 "general_operand" "l,mF,l,*h,*r"))]
16232 + "TARGET_THUMB1
16233 + && ( s_register_operand (operands[0], HFmode)
16234 + || s_register_operand (operands[1], HFmode))"
16235 + "*
16236 + switch (which_alternative)
16237 + {
16238 + case 1:
16239 + {
16240 + rtx addr;
16241 + gcc_assert (GET_CODE(operands[1]) == MEM);
16242 + addr = XEXP (operands[1], 0);
16243 + if (GET_CODE (addr) == LABEL_REF
16244 + || (GET_CODE (addr) == CONST
16245 + && GET_CODE (XEXP (addr, 0)) == PLUS
16246 + && GET_CODE (XEXP (XEXP (addr, 0), 0)) == LABEL_REF
16247 + && GET_CODE (XEXP (XEXP (addr, 0), 1)) == CONST_INT))
16248 + {
16249 + /* Constant pool entry. */
16250 + return \"ldr\\t%0, %1\";
16251 + }
16252 + return \"ldrh\\t%0, %1\";
16253 + }
16254 + case 2: return \"strh\\t%1, %0\";
16255 + default: return \"mov\\t%0, %1\";
16256 + }
16257 + "
16258 + [(set_attr "length" "2")
16259 + (set_attr "type" "*,load1,store1,*,*")
16260 + (set_attr "pool_range" "*,1020,*,*,*")]
16261 +)
16262 +
16263 (define_expand "movsf"
16264 [(set (match_operand:SF 0 "general_operand" "")
16265 (match_operand:SF 1 "general_operand" ""))]
16266 @@ -5633,6 +6266,7 @@
16267 [(set_attr "length" "4,4,4")
16268 (set_attr "predicable" "yes")
16269 (set_attr "type" "*,load1,store1")
16270 + (set_attr "insn" "mov,*,*")
16271 (set_attr "pool_range" "*,4096,*")
16272 (set_attr "neg_pool_range" "*,4084,*")]
16273 )
16274 @@ -6088,7 +6722,7 @@
16275 (match_operand:BLK 1 "general_operand" "")
16276 (match_operand:SI 2 "const_int_operand" "")
16277 (match_operand:SI 3 "const_int_operand" "")]
16278 - "TARGET_EITHER"
16279 + "TARGET_EITHER && !low_irq_latency"
16280 "
16281 if (TARGET_32BIT)
16282 {
16283 @@ -7298,7 +7932,11 @@
16284 (set_attr "shift" "1")
16285 (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
16286 (const_string "alu_shift")
16287 - (const_string "alu_shift_reg")))]
16288 + (const_string "alu_shift_reg")))
16289 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
16290 + (eq_attr "fix_janus" "yes"))
16291 + (const_int 8)
16292 + (const_int 4)))]
16293 )
16294
16295 (define_insn "*arm_cmpsi_shiftsi_swp"
16296 @@ -7313,7 +7951,11 @@
16297 (set_attr "shift" "1")
16298 (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
16299 (const_string "alu_shift")
16300 - (const_string "alu_shift_reg")))]
16301 + (const_string "alu_shift_reg")))
16302 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
16303 + (eq_attr "fix_janus" "yes"))
16304 + (const_int 8)
16305 + (const_int 4)))]
16306 )
16307
16308 (define_insn "*arm_cmpsi_negshiftsi_si"
16309 @@ -7328,7 +7970,11 @@
16310 [(set_attr "conds" "set")
16311 (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "")
16312 (const_string "alu_shift")
16313 - (const_string "alu_shift_reg")))]
16314 + (const_string "alu_shift_reg")))
16315 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
16316 + (eq_attr "fix_janus" "yes"))
16317 + (const_int 8)
16318 + (const_int 4)))]
16319 )
16320
16321 ;; Cirrus SF compare instruction
16322 @@ -7670,77 +8316,77 @@
16323 (define_expand "seq"
16324 [(set (match_operand:SI 0 "s_register_operand" "")
16325 (eq:SI (match_dup 1) (const_int 0)))]
16326 - "TARGET_32BIT"
16327 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
16328 "operands[1] = arm_gen_compare_reg (EQ, arm_compare_op0, arm_compare_op1);"
16329 )
16330
16331 (define_expand "sne"
16332 [(set (match_operand:SI 0 "s_register_operand" "")
16333 (ne:SI (match_dup 1) (const_int 0)))]
16334 - "TARGET_32BIT"
16335 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
16336 "operands[1] = arm_gen_compare_reg (NE, arm_compare_op0, arm_compare_op1);"
16337 )
16338
16339 (define_expand "sgt"
16340 [(set (match_operand:SI 0 "s_register_operand" "")
16341 (gt:SI (match_dup 1) (const_int 0)))]
16342 - "TARGET_32BIT"
16343 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
16344 "operands[1] = arm_gen_compare_reg (GT, arm_compare_op0, arm_compare_op1);"
16345 )
16346
16347 (define_expand "sle"
16348 [(set (match_operand:SI 0 "s_register_operand" "")
16349 (le:SI (match_dup 1) (const_int 0)))]
16350 - "TARGET_32BIT"
16351 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
16352 "operands[1] = arm_gen_compare_reg (LE, arm_compare_op0, arm_compare_op1);"
16353 )
16354
16355 (define_expand "sge"
16356 [(set (match_operand:SI 0 "s_register_operand" "")
16357 (ge:SI (match_dup 1) (const_int 0)))]
16358 - "TARGET_32BIT"
16359 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
16360 "operands[1] = arm_gen_compare_reg (GE, arm_compare_op0, arm_compare_op1);"
16361 )
16362
16363 (define_expand "slt"
16364 [(set (match_operand:SI 0 "s_register_operand" "")
16365 (lt:SI (match_dup 1) (const_int 0)))]
16366 - "TARGET_32BIT"
16367 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
16368 "operands[1] = arm_gen_compare_reg (LT, arm_compare_op0, arm_compare_op1);"
16369 )
16370
16371 (define_expand "sgtu"
16372 [(set (match_operand:SI 0 "s_register_operand" "")
16373 (gtu:SI (match_dup 1) (const_int 0)))]
16374 - "TARGET_32BIT"
16375 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
16376 "operands[1] = arm_gen_compare_reg (GTU, arm_compare_op0, arm_compare_op1);"
16377 )
16378
16379 (define_expand "sleu"
16380 [(set (match_operand:SI 0 "s_register_operand" "")
16381 (leu:SI (match_dup 1) (const_int 0)))]
16382 - "TARGET_32BIT"
16383 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
16384 "operands[1] = arm_gen_compare_reg (LEU, arm_compare_op0, arm_compare_op1);"
16385 )
16386
16387 (define_expand "sgeu"
16388 [(set (match_operand:SI 0 "s_register_operand" "")
16389 (geu:SI (match_dup 1) (const_int 0)))]
16390 - "TARGET_32BIT"
16391 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
16392 "operands[1] = arm_gen_compare_reg (GEU, arm_compare_op0, arm_compare_op1);"
16393 )
16394
16395 (define_expand "sltu"
16396 [(set (match_operand:SI 0 "s_register_operand" "")
16397 (ltu:SI (match_dup 1) (const_int 0)))]
16398 - "TARGET_32BIT"
16399 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
16400 "operands[1] = arm_gen_compare_reg (LTU, arm_compare_op0, arm_compare_op1);"
16401 )
16402
16403 (define_expand "sunordered"
16404 [(set (match_operand:SI 0 "s_register_operand" "")
16405 (unordered:SI (match_dup 1) (const_int 0)))]
16406 - "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
16407 + "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP) && !TARGET_NO_COND_EXEC"
16408 "operands[1] = arm_gen_compare_reg (UNORDERED, arm_compare_op0,
16409 arm_compare_op1);"
16410 )
16411 @@ -7748,7 +8394,7 @@
16412 (define_expand "sordered"
16413 [(set (match_operand:SI 0 "s_register_operand" "")
16414 (ordered:SI (match_dup 1) (const_int 0)))]
16415 - "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
16416 + "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP) && !TARGET_NO_COND_EXEC"
16417 "operands[1] = arm_gen_compare_reg (ORDERED, arm_compare_op0,
16418 arm_compare_op1);"
16419 )
16420 @@ -7756,7 +8402,7 @@
16421 (define_expand "sungt"
16422 [(set (match_operand:SI 0 "s_register_operand" "")
16423 (ungt:SI (match_dup 1) (const_int 0)))]
16424 - "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
16425 + "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP) && !TARGET_NO_COND_EXEC"
16426 "operands[1] = arm_gen_compare_reg (UNGT, arm_compare_op0,
16427 arm_compare_op1);"
16428 )
16429 @@ -7764,7 +8410,7 @@
16430 (define_expand "sunge"
16431 [(set (match_operand:SI 0 "s_register_operand" "")
16432 (unge:SI (match_dup 1) (const_int 0)))]
16433 - "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
16434 + "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP) && !TARGET_NO_COND_EXEC"
16435 "operands[1] = arm_gen_compare_reg (UNGE, arm_compare_op0,
16436 arm_compare_op1);"
16437 )
16438 @@ -7772,7 +8418,7 @@
16439 (define_expand "sunlt"
16440 [(set (match_operand:SI 0 "s_register_operand" "")
16441 (unlt:SI (match_dup 1) (const_int 0)))]
16442 - "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
16443 + "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP) && !TARGET_NO_COND_EXEC"
16444 "operands[1] = arm_gen_compare_reg (UNLT, arm_compare_op0,
16445 arm_compare_op1);"
16446 )
16447 @@ -7780,7 +8426,7 @@
16448 (define_expand "sunle"
16449 [(set (match_operand:SI 0 "s_register_operand" "")
16450 (unle:SI (match_dup 1) (const_int 0)))]
16451 - "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
16452 + "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP) && !TARGET_NO_COND_EXEC"
16453 "operands[1] = arm_gen_compare_reg (UNLE, arm_compare_op0,
16454 arm_compare_op1);"
16455 )
16456 @@ -7809,6 +8455,7 @@
16457 "TARGET_ARM"
16458 "mov%D1\\t%0, #0\;mov%d1\\t%0, #1"
16459 [(set_attr "conds" "use")
16460 + (set_attr "insn" "mov")
16461 (set_attr "length" "8")]
16462 )
16463
16464 @@ -7819,6 +8466,7 @@
16465 "TARGET_ARM"
16466 "mov%D1\\t%0, #0\;mvn%d1\\t%0, #0"
16467 [(set_attr "conds" "use")
16468 + (set_attr "insn" "mov")
16469 (set_attr "length" "8")]
16470 )
16471
16472 @@ -7829,6 +8477,7 @@
16473 "TARGET_ARM"
16474 "mov%D1\\t%0, #0\;mvn%d1\\t%0, #1"
16475 [(set_attr "conds" "use")
16476 + (set_attr "insn" "mov")
16477 (set_attr "length" "8")]
16478 )
16479
16480 @@ -8032,7 +8681,7 @@
16481 (if_then_else:SI (match_operand 1 "arm_comparison_operator" "")
16482 (match_operand:SI 2 "arm_not_operand" "")
16483 (match_operand:SI 3 "arm_not_operand" "")))]
16484 - "TARGET_32BIT"
16485 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
16486 "
16487 {
16488 enum rtx_code code = GET_CODE (operands[1]);
16489 @@ -8051,7 +8700,7 @@
16490 (if_then_else:SF (match_operand 1 "arm_comparison_operator" "")
16491 (match_operand:SF 2 "s_register_operand" "")
16492 (match_operand:SF 3 "nonmemory_operand" "")))]
16493 - "TARGET_32BIT"
16494 + "TARGET_32BIT && !TARGET_NO_COND_EXEC"
16495 "
16496 {
16497 enum rtx_code code = GET_CODE (operands[1]);
16498 @@ -8076,7 +8725,7 @@
16499 (if_then_else:DF (match_operand 1 "arm_comparison_operator" "")
16500 (match_operand:DF 2 "s_register_operand" "")
16501 (match_operand:DF 3 "arm_float_add_operand" "")))]
16502 - "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
16503 + "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP) && !TARGET_NO_COND_EXEC"
16504 "
16505 {
16506 enum rtx_code code = GET_CODE (operands[1]);
16507 @@ -8108,7 +8757,8 @@
16508 mvn%d3\\t%0, #%B1\;mov%D3\\t%0, %2
16509 mvn%d3\\t%0, #%B1\;mvn%D3\\t%0, #%B2"
16510 [(set_attr "length" "4,4,4,4,8,8,8,8")
16511 - (set_attr "conds" "use")]
16512 + (set_attr "conds" "use")
16513 + (set_attr "insn" "mov,mvn,mov,mvn,mov,mov,mvn,mvn")]
16514 )
16515
16516 (define_insn "*movsfcc_soft_insn"
16517 @@ -8121,7 +8771,8 @@
16518 "@
16519 mov%D3\\t%0, %2
16520 mov%d3\\t%0, %1"
16521 - [(set_attr "conds" "use")]
16522 + [(set_attr "conds" "use")
16523 + (set_attr "insn" "mov")]
16524 )
16525
16526 \f
16527 @@ -8524,7 +9175,7 @@
16528 [(match_operand 1 "cc_register" "") (const_int 0)])
16529 (return)
16530 (pc)))]
16531 - "TARGET_ARM && USE_RETURN_INSN (TRUE)"
16532 + "TARGET_ARM && USE_RETURN_INSN (TRUE) && !TARGET_NO_COND_EXEC"
16533 "*
16534 {
16535 if (arm_ccfsm_state == 2)
16536 @@ -8545,7 +9196,7 @@
16537 [(match_operand 1 "cc_register" "") (const_int 0)])
16538 (pc)
16539 (return)))]
16540 - "TARGET_ARM && USE_RETURN_INSN (TRUE)"
16541 + "TARGET_ARM && USE_RETURN_INSN (TRUE) && !TARGET_NO_COND_EXEC"
16542 "*
16543 {
16544 if (arm_ccfsm_state == 2)
16545 @@ -8864,7 +9515,11 @@
16546 (set_attr "shift" "4")
16547 (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "")
16548 (const_string "alu_shift")
16549 - (const_string "alu_shift_reg")))]
16550 + (const_string "alu_shift_reg")))
16551 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
16552 + (eq_attr "fix_janus" "yes"))
16553 + (const_int 8)
16554 + (const_int 4)))]
16555 )
16556
16557 (define_split
16558 @@ -8902,7 +9557,11 @@
16559 (set_attr "shift" "4")
16560 (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "")
16561 (const_string "alu_shift")
16562 - (const_string "alu_shift_reg")))]
16563 + (const_string "alu_shift_reg")))
16564 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
16565 + (eq_attr "fix_janus" "yes"))
16566 + (const_int 8)
16567 + (const_int 4)))]
16568 )
16569
16570 (define_insn "*arith_shiftsi_compare0_scratch"
16571 @@ -8920,7 +9579,11 @@
16572 (set_attr "shift" "4")
16573 (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "")
16574 (const_string "alu_shift")
16575 - (const_string "alu_shift_reg")))]
16576 + (const_string "alu_shift_reg")))
16577 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
16578 + (eq_attr "fix_janus" "yes"))
16579 + (const_int 8)
16580 + (const_int 4)))]
16581 )
16582
16583 (define_insn "*sub_shiftsi"
16584 @@ -8935,7 +9598,11 @@
16585 (set_attr "shift" "3")
16586 (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "")
16587 (const_string "alu_shift")
16588 - (const_string "alu_shift_reg")))]
16589 + (const_string "alu_shift_reg")))
16590 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
16591 + (eq_attr "fix_janus" "yes"))
16592 + (const_int 8)
16593 + (const_int 4)))]
16594 )
16595
16596 (define_insn "*sub_shiftsi_compare0"
16597 @@ -8955,7 +9622,11 @@
16598 (set_attr "shift" "3")
16599 (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "")
16600 (const_string "alu_shift")
16601 - (const_string "alu_shift_reg")))]
16602 + (const_string "alu_shift_reg")))
16603 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
16604 + (eq_attr "fix_janus" "yes"))
16605 + (const_int 8)
16606 + (const_int 4)))]
16607 )
16608
16609 (define_insn "*sub_shiftsi_compare0_scratch"
16610 @@ -8973,7 +9644,11 @@
16611 (set_attr "shift" "3")
16612 (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "")
16613 (const_string "alu_shift")
16614 - (const_string "alu_shift_reg")))]
16615 + (const_string "alu_shift_reg")))
16616 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
16617 + (eq_attr "fix_janus" "yes"))
16618 + (const_int 8)
16619 + (const_int 4)))]
16620 )
16621
16622 \f
16623 @@ -8986,6 +9661,7 @@
16624 "TARGET_ARM"
16625 "mov%D1\\t%0, #0\;and%d1\\t%0, %2, #1"
16626 [(set_attr "conds" "use")
16627 + (set_attr "insn" "mov")
16628 (set_attr "length" "8")]
16629 )
16630
16631 @@ -8999,6 +9675,7 @@
16632 orr%d2\\t%0, %1, #1
16633 mov%D2\\t%0, %1\;orr%d2\\t%0, %1, #1"
16634 [(set_attr "conds" "use")
16635 + (set_attr "insn" "orr")
16636 (set_attr "length" "4,8")]
16637 )
16638
16639 @@ -9008,7 +9685,7 @@
16640 [(match_operand:SI 2 "s_register_operand" "r,r")
16641 (match_operand:SI 3 "arm_add_operand" "rI,L")]))
16642 (clobber (reg:CC CC_REGNUM))]
16643 - "TARGET_ARM"
16644 + "TARGET_ARM && !TARGET_NO_COND_EXEC"
16645 "*
16646 if (operands[3] == const0_rtx)
16647 {
16648 @@ -9063,6 +9740,7 @@
16649 return \"\";
16650 "
16651 [(set_attr "conds" "use")
16652 + (set_attr "insn" "mov")
16653 (set_attr "length" "4,4,8")]
16654 )
16655
16656 @@ -9074,7 +9752,7 @@
16657 (match_operand:SI 3 "arm_rhs_operand" "rI,rI")])
16658 (match_operand:SI 1 "s_register_operand" "0,?r")]))
16659 (clobber (reg:CC CC_REGNUM))]
16660 - "TARGET_ARM"
16661 + "TARGET_ARM && !TARGET_NO_SINGLE_COND_EXEC"
16662 "*
16663 if (GET_CODE (operands[4]) == LT && operands[3] == const0_rtx)
16664 return \"%i5\\t%0, %1, %2, lsr #31\";
16665 @@ -9470,7 +10148,7 @@
16666 (match_operand:SI 1 "arm_rhs_operand" "0,rI,?rI")
16667 (match_operand:SI 2 "arm_rhs_operand" "rI,0,rI")))
16668 (clobber (reg:CC CC_REGNUM))]
16669 - "TARGET_ARM"
16670 + "TARGET_ARM && !TARGET_NO_COND_EXEC"
16671 "*
16672 if (GET_CODE (operands[5]) == LT
16673 && (operands[4] == const0_rtx))
16674 @@ -9536,7 +10214,7 @@
16675 (match_operand:SI 3 "arm_add_operand" "rIL,rIL"))
16676 (match_operand:SI 1 "arm_rhs_operand" "0,?rI")))
16677 (clobber (reg:CC CC_REGNUM))]
16678 - "TARGET_ARM"
16679 + "TARGET_ARM && !TARGET_NO_SINGLE_COND_EXEC"
16680 "#"
16681 [(set_attr "conds" "clob")
16682 (set_attr "length" "8,12")]
16683 @@ -9572,7 +10250,7 @@
16684 (match_operand:SI 2 "s_register_operand" "r,r")
16685 (match_operand:SI 3 "arm_add_operand" "rIL,rIL"))))
16686 (clobber (reg:CC CC_REGNUM))]
16687 - "TARGET_ARM"
16688 + "TARGET_ARM && !TARGET_NO_SINGLE_COND_EXEC"
16689 "#"
16690 [(set_attr "conds" "clob")
16691 (set_attr "length" "8,12")]
16692 @@ -9610,7 +10288,7 @@
16693 [(match_operand:SI 3 "s_register_operand" "r")
16694 (match_operand:SI 4 "arm_rhs_operand" "rI")])))
16695 (clobber (reg:CC CC_REGNUM))]
16696 - "TARGET_ARM"
16697 + "TARGET_ARM && !TARGET_NO_SINGLE_COND_EXEC"
16698 "#"
16699 [(set_attr "conds" "clob")
16700 (set_attr "length" "12")]
16701 @@ -9760,7 +10438,7 @@
16702 (not:SI
16703 (match_operand:SI 2 "s_register_operand" "r,r"))))
16704 (clobber (reg:CC CC_REGNUM))]
16705 - "TARGET_ARM"
16706 + "TARGET_ARM && !TARGET_NO_SINGLE_COND_EXEC"
16707 "#"
16708 [(set_attr "conds" "clob")
16709 (set_attr "length" "8,12")]
16710 @@ -9779,6 +10457,7 @@
16711 mov%d4\\t%0, %1\;mvn%D4\\t%0, %2
16712 mvn%d4\\t%0, #%B1\;mvn%D4\\t%0, %2"
16713 [(set_attr "conds" "use")
16714 + (set_attr "insn" "mvn")
16715 (set_attr "length" "4,8,8")]
16716 )
16717
16718 @@ -9792,7 +10471,7 @@
16719 (match_operand:SI 2 "s_register_operand" "r,r"))
16720 (match_operand:SI 1 "arm_not_operand" "0,?rIK")))
16721 (clobber (reg:CC CC_REGNUM))]
16722 - "TARGET_ARM"
16723 + "TARGET_ARM && !TARGET_NO_SINGLE_COND_EXEC"
16724 "#"
16725 [(set_attr "conds" "clob")
16726 (set_attr "length" "8,12")]
16727 @@ -9811,6 +10490,7 @@
16728 mov%D4\\t%0, %1\;mvn%d4\\t%0, %2
16729 mvn%D4\\t%0, #%B1\;mvn%d4\\t%0, %2"
16730 [(set_attr "conds" "use")
16731 + (set_attr "insn" "mvn")
16732 (set_attr "length" "4,8,8")]
16733 )
16734
16735 @@ -9825,7 +10505,7 @@
16736 (match_operand:SI 3 "arm_rhs_operand" "rM,rM")])
16737 (match_operand:SI 1 "arm_not_operand" "0,?rIK")))
16738 (clobber (reg:CC CC_REGNUM))]
16739 - "TARGET_ARM"
16740 + "TARGET_ARM && !TARGET_NO_SINGLE_COND_EXEC"
16741 "#"
16742 [(set_attr "conds" "clob")
16743 (set_attr "length" "8,12")]
16744 @@ -9847,10 +10527,23 @@
16745 mvn%D5\\t%0, #%B1\;mov%d5\\t%0, %2%S4"
16746 [(set_attr "conds" "use")
16747 (set_attr "shift" "2")
16748 - (set_attr "length" "4,8,8")
16749 + (set_attr "insn" "mov")
16750 (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "")
16751 (const_string "alu_shift")
16752 - (const_string "alu_shift_reg")))]
16753 + (const_string "alu_shift_reg")))
16754 + (set_attr_alternative "length"
16755 + [(if_then_else (and (eq_attr "type" "alu_shift_reg")
16756 + (eq_attr "fix_janus" "yes"))
16757 + (const_int 8)
16758 + (const_int 4))
16759 + (if_then_else (and (eq_attr "type" "alu_shift_reg")
16760 + (eq_attr "fix_janus" "yes"))
16761 + (const_int 12)
16762 + (const_int 8))
16763 + (if_then_else (and (eq_attr "type" "alu_shift_reg")
16764 + (eq_attr "fix_janus" "yes"))
16765 + (const_int 12)
16766 + (const_int 8))])]
16767 )
16768
16769 (define_insn "*ifcompare_move_shift"
16770 @@ -9864,7 +10557,7 @@
16771 [(match_operand:SI 2 "s_register_operand" "r,r")
16772 (match_operand:SI 3 "arm_rhs_operand" "rM,rM")])))
16773 (clobber (reg:CC CC_REGNUM))]
16774 - "TARGET_ARM"
16775 + "TARGET_ARM && !TARGET_NO_SINGLE_COND_EXEC"
16776 "#"
16777 [(set_attr "conds" "clob")
16778 (set_attr "length" "8,12")]
16779 @@ -9886,10 +10579,24 @@
16780 mvn%d5\\t%0, #%B1\;mov%D5\\t%0, %2%S4"
16781 [(set_attr "conds" "use")
16782 (set_attr "shift" "2")
16783 - (set_attr "length" "4,8,8")
16784 + (set_attr "insn" "mov")
16785 (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "")
16786 (const_string "alu_shift")
16787 - (const_string "alu_shift_reg")))]
16788 + (const_string "alu_shift_reg")))
16789 + (set_attr_alternative "length"
16790 + [(if_then_else (and (eq_attr "type" "alu_shift_reg")
16791 + (eq_attr "fix_janus" "yes"))
16792 + (const_int 8)
16793 + (const_int 4))
16794 + (if_then_else (and (eq_attr "type" "alu_shift_reg")
16795 + (eq_attr "fix_janus" "yes"))
16796 + (const_int 12)
16797 + (const_int 8))
16798 + (if_then_else (and (eq_attr "type" "alu_shift_reg")
16799 + (eq_attr "fix_janus" "yes"))
16800 + (const_int 12)
16801 + (const_int 8))])
16802 + (set_attr "insn" "mov")]
16803 )
16804
16805 (define_insn "*ifcompare_shift_shift"
16806 @@ -9905,7 +10612,7 @@
16807 [(match_operand:SI 3 "s_register_operand" "r")
16808 (match_operand:SI 4 "arm_rhs_operand" "rM")])))
16809 (clobber (reg:CC CC_REGNUM))]
16810 - "TARGET_ARM"
16811 + "TARGET_ARM && !TARGET_NO_SINGLE_COND_EXEC"
16812 "#"
16813 [(set_attr "conds" "clob")
16814 (set_attr "length" "12")]
16815 @@ -9926,12 +10633,16 @@
16816 "mov%d5\\t%0, %1%S6\;mov%D5\\t%0, %3%S7"
16817 [(set_attr "conds" "use")
16818 (set_attr "shift" "1")
16819 - (set_attr "length" "8")
16820 + (set_attr "insn" "mov")
16821 (set (attr "type") (if_then_else
16822 (and (match_operand 2 "const_int_operand" "")
16823 (match_operand 4 "const_int_operand" ""))
16824 (const_string "alu_shift")
16825 - (const_string "alu_shift_reg")))]
16826 + (const_string "alu_shift_reg")))
16827 + (set (attr "length") (if_then_else (and (eq_attr "type" "alu_shift_reg")
16828 + (eq_attr "fix_janus" "yes"))
16829 + (const_int 16)
16830 + (const_int 8)))]
16831 )
16832
16833 (define_insn "*ifcompare_not_arith"
16834 @@ -9945,7 +10656,7 @@
16835 [(match_operand:SI 2 "s_register_operand" "r")
16836 (match_operand:SI 3 "arm_rhs_operand" "rI")])))
16837 (clobber (reg:CC CC_REGNUM))]
16838 - "TARGET_ARM"
16839 + "TARGET_ARM && !TARGET_NO_SINGLE_COND_EXEC"
16840 "#"
16841 [(set_attr "conds" "clob")
16842 (set_attr "length" "12")]
16843 @@ -9963,6 +10674,7 @@
16844 "TARGET_ARM"
16845 "mvn%d5\\t%0, %1\;%I6%D5\\t%0, %2, %3"
16846 [(set_attr "conds" "use")
16847 + (set_attr "insn" "mvn")
16848 (set_attr "length" "8")]
16849 )
16850
16851 @@ -9977,7 +10689,7 @@
16852 (match_operand:SI 3 "arm_rhs_operand" "rI")])
16853 (not:SI (match_operand:SI 1 "s_register_operand" "r"))))
16854 (clobber (reg:CC CC_REGNUM))]
16855 - "TARGET_ARM"
16856 + "TARGET_ARM && !TARGET_NO_SINGLE_COND_EXEC"
16857 "#"
16858 [(set_attr "conds" "clob")
16859 (set_attr "length" "12")]
16860 @@ -9995,6 +10707,7 @@
16861 "TARGET_ARM"
16862 "mvn%D5\\t%0, %1\;%I6%d5\\t%0, %2, %3"
16863 [(set_attr "conds" "use")
16864 + (set_attr "insn" "mvn")
16865 (set_attr "length" "8")]
16866 )
16867
16868 @@ -10007,7 +10720,7 @@
16869 (neg:SI (match_operand:SI 2 "s_register_operand" "r,r"))
16870 (match_operand:SI 1 "arm_not_operand" "0,?rIK")))
16871 (clobber (reg:CC CC_REGNUM))]
16872 - "TARGET_ARM"
16873 + "TARGET_ARM && !TARGET_NO_SINGLE_COND_EXEC"
16874 "#"
16875 [(set_attr "conds" "clob")
16876 (set_attr "length" "8,12")]
16877 @@ -10038,7 +10751,7 @@
16878 (match_operand:SI 1 "arm_not_operand" "0,?rIK")
16879 (neg:SI (match_operand:SI 2 "s_register_operand" "r,r"))))
16880 (clobber (reg:CC CC_REGNUM))]
16881 - "TARGET_ARM"
16882 + "TARGET_ARM && !TARGET_NO_SINGLE_COND_EXEC"
16883 "#"
16884 [(set_attr "conds" "clob")
16885 (set_attr "length" "8,12")]
16886 @@ -10181,13 +10894,13 @@
16887 ; reversed, check that the memory references aren't volatile.
16888
16889 (define_peephole
16890 - [(set (match_operand:SI 0 "s_register_operand" "=r")
16891 + [(set (match_operand:SI 0 "s_register_operand" "=rk")
16892 (match_operand:SI 4 "memory_operand" "m"))
16893 - (set (match_operand:SI 1 "s_register_operand" "=r")
16894 + (set (match_operand:SI 1 "s_register_operand" "=rk")
16895 (match_operand:SI 5 "memory_operand" "m"))
16896 - (set (match_operand:SI 2 "s_register_operand" "=r")
16897 + (set (match_operand:SI 2 "s_register_operand" "=rk")
16898 (match_operand:SI 6 "memory_operand" "m"))
16899 - (set (match_operand:SI 3 "s_register_operand" "=r")
16900 + (set (match_operand:SI 3 "s_register_operand" "=rk")
16901 (match_operand:SI 7 "memory_operand" "m"))]
16902 "TARGET_ARM && load_multiple_sequence (operands, 4, NULL, NULL, NULL)"
16903 "*
16904 @@ -10196,11 +10909,11 @@
16905 )
16906
16907 (define_peephole
16908 - [(set (match_operand:SI 0 "s_register_operand" "=r")
16909 + [(set (match_operand:SI 0 "s_register_operand" "=rk")
16910 (match_operand:SI 3 "memory_operand" "m"))
16911 - (set (match_operand:SI 1 "s_register_operand" "=r")
16912 + (set (match_operand:SI 1 "s_register_operand" "=rk")
16913 (match_operand:SI 4 "memory_operand" "m"))
16914 - (set (match_operand:SI 2 "s_register_operand" "=r")
16915 + (set (match_operand:SI 2 "s_register_operand" "=rk")
16916 (match_operand:SI 5 "memory_operand" "m"))]
16917 "TARGET_ARM && load_multiple_sequence (operands, 3, NULL, NULL, NULL)"
16918 "*
16919 @@ -10209,9 +10922,9 @@
16920 )
16921
16922 (define_peephole
16923 - [(set (match_operand:SI 0 "s_register_operand" "=r")
16924 + [(set (match_operand:SI 0 "s_register_operand" "=rk")
16925 (match_operand:SI 2 "memory_operand" "m"))
16926 - (set (match_operand:SI 1 "s_register_operand" "=r")
16927 + (set (match_operand:SI 1 "s_register_operand" "=rk")
16928 (match_operand:SI 3 "memory_operand" "m"))]
16929 "TARGET_ARM && load_multiple_sequence (operands, 2, NULL, NULL, NULL)"
16930 "*
16931 @@ -10221,13 +10934,13 @@
16932
16933 (define_peephole
16934 [(set (match_operand:SI 4 "memory_operand" "=m")
16935 - (match_operand:SI 0 "s_register_operand" "r"))
16936 + (match_operand:SI 0 "s_register_operand" "rk"))
16937 (set (match_operand:SI 5 "memory_operand" "=m")
16938 - (match_operand:SI 1 "s_register_operand" "r"))
16939 + (match_operand:SI 1 "s_register_operand" "rk"))
16940 (set (match_operand:SI 6 "memory_operand" "=m")
16941 - (match_operand:SI 2 "s_register_operand" "r"))
16942 + (match_operand:SI 2 "s_register_operand" "rk"))
16943 (set (match_operand:SI 7 "memory_operand" "=m")
16944 - (match_operand:SI 3 "s_register_operand" "r"))]
16945 + (match_operand:SI 3 "s_register_operand" "rk"))]
16946 "TARGET_ARM && store_multiple_sequence (operands, 4, NULL, NULL, NULL)"
16947 "*
16948 return emit_stm_seq (operands, 4);
16949 @@ -10236,11 +10949,11 @@
16950
16951 (define_peephole
16952 [(set (match_operand:SI 3 "memory_operand" "=m")
16953 - (match_operand:SI 0 "s_register_operand" "r"))
16954 + (match_operand:SI 0 "s_register_operand" "rk"))
16955 (set (match_operand:SI 4 "memory_operand" "=m")
16956 - (match_operand:SI 1 "s_register_operand" "r"))
16957 + (match_operand:SI 1 "s_register_operand" "rk"))
16958 (set (match_operand:SI 5 "memory_operand" "=m")
16959 - (match_operand:SI 2 "s_register_operand" "r"))]
16960 + (match_operand:SI 2 "s_register_operand" "rk"))]
16961 "TARGET_ARM && store_multiple_sequence (operands, 3, NULL, NULL, NULL)"
16962 "*
16963 return emit_stm_seq (operands, 3);
16964 @@ -10249,9 +10962,9 @@
16965
16966 (define_peephole
16967 [(set (match_operand:SI 2 "memory_operand" "=m")
16968 - (match_operand:SI 0 "s_register_operand" "r"))
16969 + (match_operand:SI 0 "s_register_operand" "rk"))
16970 (set (match_operand:SI 3 "memory_operand" "=m")
16971 - (match_operand:SI 1 "s_register_operand" "r"))]
16972 + (match_operand:SI 1 "s_register_operand" "rk"))]
16973 "TARGET_ARM && store_multiple_sequence (operands, 2, NULL, NULL, NULL)"
16974 "*
16975 return emit_stm_seq (operands, 2);
16976 @@ -10406,7 +11119,7 @@
16977 (match_dup 0)
16978 (match_operand 4 "" "")))
16979 (clobber (reg:CC CC_REGNUM))]
16980 - "TARGET_ARM && reload_completed"
16981 + "TARGET_ARM && reload_completed && !TARGET_NO_SINGLE_COND_EXEC"
16982 [(set (match_dup 5) (match_dup 6))
16983 (cond_exec (match_dup 7)
16984 (set (match_dup 0) (match_dup 4)))]
16985 @@ -10434,7 +11147,7 @@
16986 (match_operand 4 "" "")
16987 (match_dup 0)))
16988 (clobber (reg:CC CC_REGNUM))]
16989 - "TARGET_ARM && reload_completed"
16990 + "TARGET_ARM && reload_completed && !TARGET_NO_SINGLE_COND_EXEC"
16991 [(set (match_dup 5) (match_dup 6))
16992 (cond_exec (match_op_dup 1 [(match_dup 5) (const_int 0)])
16993 (set (match_dup 0) (match_dup 4)))]
16994 @@ -10455,7 +11168,7 @@
16995 (match_operand 4 "" "")
16996 (match_operand 5 "" "")))
16997 (clobber (reg:CC CC_REGNUM))]
16998 - "TARGET_ARM && reload_completed"
16999 + "TARGET_ARM && reload_completed && !TARGET_NO_SINGLE_COND_EXEC"
17000 [(set (match_dup 6) (match_dup 7))
17001 (cond_exec (match_op_dup 1 [(match_dup 6) (const_int 0)])
17002 (set (match_dup 0) (match_dup 4)))
17003 @@ -10487,7 +11200,7 @@
17004 (not:SI
17005 (match_operand:SI 5 "s_register_operand" ""))))
17006 (clobber (reg:CC CC_REGNUM))]
17007 - "TARGET_ARM && reload_completed"
17008 + "TARGET_ARM && reload_completed && !TARGET_NO_SINGLE_COND_EXEC"
17009 [(set (match_dup 6) (match_dup 7))
17010 (cond_exec (match_op_dup 1 [(match_dup 6) (const_int 0)])
17011 (set (match_dup 0) (match_dup 4)))
17012 @@ -10522,6 +11235,7 @@
17013 mvn%D4\\t%0, %2
17014 mov%d4\\t%0, %1\;mvn%D4\\t%0, %2"
17015 [(set_attr "conds" "use")
17016 + (set_attr "insn" "mvn")
17017 (set_attr "length" "4,8")]
17018 )
17019
17020 @@ -10610,8 +11324,8 @@
17021
17022 (define_insn "stack_tie"
17023 [(set (mem:BLK (scratch))
17024 - (unspec:BLK [(match_operand:SI 0 "s_register_operand" "r")
17025 - (match_operand:SI 1 "s_register_operand" "r")]
17026 + (unspec:BLK [(match_operand:SI 0 "s_register_operand" "rk")
17027 + (match_operand:SI 1 "s_register_operand" "rk")]
17028 UNSPEC_PRLG_STK))]
17029 ""
17030 ""
17031 @@ -10656,6 +11370,24 @@
17032 "
17033 )
17034
17035 +(define_insn "align_16"
17036 + [(unspec_volatile [(const_int 0)] VUNSPEC_ALIGN16)]
17037 + "TARGET_EITHER"
17038 + "*
17039 + assemble_align (128);
17040 + return \"\";
17041 + "
17042 +)
17043 +
17044 +(define_insn "align_32"
17045 + [(unspec_volatile [(const_int 0)] VUNSPEC_ALIGN32)]
17046 + "TARGET_EITHER"
17047 + "*
17048 + assemble_align (256);
17049 + return \"\";
17050 + "
17051 +)
17052 +
17053 (define_insn "consttable_end"
17054 [(unspec_volatile [(const_int 0)] VUNSPEC_POOL_END)]
17055 "TARGET_EITHER"
17056 @@ -10682,6 +11414,7 @@
17057 "TARGET_THUMB1"
17058 "*
17059 making_const_table = TRUE;
17060 + gcc_assert (GET_MODE_CLASS (GET_MODE (operands[0])) != MODE_FLOAT);
17061 assemble_integer (operands[0], 2, BITS_PER_WORD, 1);
17062 assemble_zeros (2);
17063 return \"\";
17064 @@ -10694,18 +11427,29 @@
17065 "TARGET_EITHER"
17066 "*
17067 {
17068 + rtx x = operands[0];
17069 making_const_table = TRUE;
17070 - switch (GET_MODE_CLASS (GET_MODE (operands[0])))
17071 + switch (GET_MODE_CLASS (GET_MODE (x)))
17072 {
17073 case MODE_FLOAT:
17074 - {
17075 - REAL_VALUE_TYPE r;
17076 - REAL_VALUE_FROM_CONST_DOUBLE (r, operands[0]);
17077 - assemble_real (r, GET_MODE (operands[0]), BITS_PER_WORD);
17078 - break;
17079 - }
17080 + if (GET_MODE (x) == HFmode)
17081 + arm_emit_fp16_const (x);
17082 + else
17083 + {
17084 + REAL_VALUE_TYPE r;
17085 + REAL_VALUE_FROM_CONST_DOUBLE (r, x);
17086 + assemble_real (r, GET_MODE (x), BITS_PER_WORD);
17087 + }
17088 + break;
17089 default:
17090 - assemble_integer (operands[0], 4, BITS_PER_WORD, 1);
17091 + /* XXX: Sometimes gcc does something really dumb and ends up with
17092 + a HIGH in a constant pool entry, usually because it's trying to
17093 + load into a VFP register. We know this will always be used in
17094 + combination with a LO_SUM which ignores the high bits, so just
17095 + strip off the HIGH. */
17096 + if (GET_CODE (x) == HIGH)
17097 + x = XEXP (x, 0);
17098 + assemble_integer (x, 4, BITS_PER_WORD, 1);
17099 break;
17100 }
17101 return \"\";
17102 @@ -10808,13 +11552,15 @@
17103 "TARGET_32BIT && arm_arch5e"
17104 "pld\\t%a0")
17105
17106 -;; General predication pattern
17107 +;; General predication pattern.
17108 +;; Conditional branches are available as both arm_cond_branch and
17109 +;; predicated arm_jump, so it doesn't matter if we disable the latter.
17110
17111 (define_cond_exec
17112 [(match_operator 0 "arm_comparison_operator"
17113 [(match_operand 1 "cc_register" "")
17114 (const_int 0)])]
17115 - "TARGET_32BIT"
17116 + "TARGET_32BIT && !TARGET_NO_SINGLE_COND_EXEC"
17117 ""
17118 )
17119
17120 --- a/gcc/config/arm/arm.opt
17121 +++ b/gcc/config/arm/arm.opt
17122 @@ -78,6 +78,10 @@ Specify if floating point hardware shoul
17123 mfp=
17124 Target RejectNegative Joined Undocumented Var(target_fpe_name)
17125
17126 +mfp16-format=
17127 +Target RejectNegative Joined Var(target_fp16_format_name)
17128 +Specify the __fp16 floating-point format
17129 +
17130 ;; Now ignored.
17131 mfpe
17132 Target RejectNegative Mask(FPE) Undocumented
17133 @@ -93,6 +97,10 @@ mhard-float
17134 Target RejectNegative
17135 Alias for -mfloat-abi=hard
17136
17137 +mfix-janus-2cc
17138 +Target Report Mask(FIX_JANUS)
17139 +Work around hardware errata for Avalent Janus 2CC cores.
17140 +
17141 mlittle-endian
17142 Target Report RejectNegative InverseMask(BIG_END)
17143 Assume target CPU is configured as little endian
17144 @@ -101,6 +109,10 @@ mlong-calls
17145 Target Report Mask(LONG_CALLS)
17146 Generate call insns as indirect calls, if necessary
17147
17148 +mmarvell-div
17149 +Target Report Mask(MARVELL_DIV)
17150 +Generate hardware integer division instructions supported by some Marvell cores.
17151 +
17152 mpic-register=
17153 Target RejectNegative Joined Var(arm_pic_register_string)
17154 Specify the register to be used for PIC addressing
17155 @@ -156,3 +168,16 @@ Assume big endian bytes, little endian w
17156 mvectorize-with-neon-quad
17157 Target Report Mask(NEON_VECTORIZE_QUAD)
17158 Use Neon quad-word (rather than double-word) registers for vectorization
17159 +
17160 +mlow-irq-latency
17161 +Target Report Var(low_irq_latency)
17162 +Try to reduce interrupt latency of the generated code
17163 +
17164 +mword-relocations
17165 +Target Report Var(target_word_relocations) Init(TARGET_DEFAULT_WORD_RELOCATIONS)
17166 +Only generate absolute relocations on word sized values.
17167 +
17168 +mfix-cortex-m3-ldrd
17169 +Target Report Var(fix_cm3_ldrd) Init(2)
17170 +Avoid overlapping destination and address registers on LDRD instructions
17171 +that may trigger Cortex-M3 errata.
17172 --- a/gcc/config/arm/arm1020e.md
17173 +++ b/gcc/config/arm/arm1020e.md
17174 @@ -281,12 +281,12 @@
17175 ;; first execute state. We model this by using 1020a_e in the first cycle.
17176 (define_insn_reservation "v10_ffarith" 5
17177 (and (eq_attr "vfp10" "yes")
17178 - (eq_attr "type" "ffarith"))
17179 + (eq_attr "type" "fcpys,ffariths,ffarithd,fcmps,fcmpd"))
17180 "1020a_e+v10_fmac")
17181
17182 (define_insn_reservation "v10_farith" 5
17183 (and (eq_attr "vfp10" "yes")
17184 - (eq_attr "type" "farith"))
17185 + (eq_attr "type" "faddd,fadds"))
17186 "1020a_e+v10_fmac")
17187
17188 (define_insn_reservation "v10_cvt" 5
17189 --- a/gcc/config/arm/arm_neon.h
17190 +++ b/gcc/config/arm/arm_neon.h
17191 @@ -39,7 +39,11 @@
17192 extern "C" {
17193 #endif
17194
17195 +#if defined (__vxworks) && defined (_WRS_KERNEL)
17196 +#include <vxWorks.h>
17197 +#else
17198 #include <stdint.h>
17199 +#endif
17200
17201 typedef __builtin_neon_qi int8x8_t __attribute__ ((__vector_size__ (8)));
17202 typedef __builtin_neon_hi int16x4_t __attribute__ ((__vector_size__ (8)));
17203 --- /dev/null
17204 +++ b/gcc/config/arm/bpabi-v6m.S
17205 @@ -0,0 +1,325 @@
17206 +/* Miscellaneous BPABI functions. ARMv6M implementation
17207 +
17208 + Copyright (C) 2006 Free Software Foundation, Inc.
17209 + Contributed by CodeSourcery, LLC.
17210 +
17211 + This file is free software; you can redistribute it and/or modify it
17212 + under the terms of the GNU General Public License as published by the
17213 + Free Software Foundation; either version 2, or (at your option) any
17214 + later version.
17215 +
17216 + In addition to the permissions in the GNU General Public License, the
17217 + Free Software Foundation gives you unlimited permission to link the
17218 + compiled version of this file into combinations with other programs,
17219 + and to distribute those combinations without any restriction coming
17220 + from the use of this file. (The General Public License restrictions
17221 + do apply in other respects; for example, they cover modification of
17222 + the file, and distribution when not linked into a combine
17223 + executable.)
17224 +
17225 + This file is distributed in the hope that it will be useful, but
17226 + WITHOUT ANY WARRANTY; without even the implied warranty of
17227 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17228 + General Public License for more details.
17229 +
17230 + You should have received a copy of the GNU General Public License
17231 + along with this program; see the file COPYING. If not, write to
17232 + the Free Software Foundation, 51 Franklin Street, Fifth Floor,
17233 + Boston, MA 02110-1301, USA. */
17234 +
17235 +#ifdef __ARMEB__
17236 +#define xxh r0
17237 +#define xxl r1
17238 +#define yyh r2
17239 +#define yyl r3
17240 +#else
17241 +#define xxh r1
17242 +#define xxl r0
17243 +#define yyh r3
17244 +#define yyl r2
17245 +#endif
17246 +
17247 +#ifdef L_aeabi_lcmp
17248 +
17249 +FUNC_START aeabi_lcmp
17250 + cmp xxh, yyh
17251 + beq 1f
17252 + bgt 2f
17253 + mov r0, #1
17254 + neg r0, r0
17255 + RET
17256 +2:
17257 + mov r0, #1
17258 + RET
17259 +1:
17260 + sub r0, xxl, yyl
17261 + beq 1f
17262 + bhi 2f
17263 + mov r0, #1
17264 + neg r0, r0
17265 + RET
17266 +2:
17267 + mov r0, #1
17268 +1:
17269 + RET
17270 + FUNC_END aeabi_lcmp
17271 +
17272 +#endif /* L_aeabi_lcmp */
17273 +
17274 +#ifdef L_aeabi_ulcmp
17275 +
17276 +FUNC_START aeabi_ulcmp
17277 + cmp xxh, yyh
17278 + bne 1f
17279 + sub r0, xxl, yyl
17280 + beq 2f
17281 +1:
17282 + bcs 1f
17283 + mov r0, #1
17284 + neg r0, r0
17285 + RET
17286 +1:
17287 + mov r0, #1
17288 +2:
17289 + RET
17290 + FUNC_END aeabi_ulcmp
17291 +
17292 +#endif /* L_aeabi_ulcmp */
17293 +
17294 +.macro test_div_by_zero signed
17295 + cmp yyh, #0
17296 + bne 7f
17297 + cmp yyl, #0
17298 + bne 7f
17299 + cmp xxh, #0
17300 + bne 2f
17301 + cmp xxl, #0
17302 +2:
17303 + .ifc \signed, unsigned
17304 + beq 3f
17305 + mov xxh, #0
17306 + mvn xxh, xxh @ 0xffffffff
17307 + mov xxl, xxh
17308 +3:
17309 + .else
17310 + beq 5f
17311 + blt 6f
17312 + mov xxl, #0
17313 + mvn xxl, xxl @ 0xffffffff
17314 + lsr xxh, xxl, #1 @ 0x7fffffff
17315 + b 5f
17316 +6: mov xxh, #0x80
17317 + lsl xxh, xxh, #24 @ 0x80000000
17318 + mov xxl, #0
17319 +5:
17320 + .endif
17321 + @ tailcalls are tricky on v6-m.
17322 + push {r0, r1, r2}
17323 + ldr r0, 1f
17324 + adr r1, 1f
17325 + add r0, r1
17326 + str r0, [sp, #8]
17327 + @ We know we are not on armv4t, so pop pc is safe.
17328 + pop {r0, r1, pc}
17329 + .align 2
17330 +1:
17331 + .word __aeabi_ldiv0 - 1b
17332 +7:
17333 +.endm
17334 +
17335 +#ifdef L_aeabi_ldivmod
17336 +
17337 +FUNC_START aeabi_ldivmod
17338 + test_div_by_zero signed
17339 +
17340 + push {r0, r1}
17341 + mov r0, sp
17342 + push {r0, lr}
17343 + ldr r0, [sp, #8]
17344 + bl SYM(__gnu_ldivmod_helper)
17345 + ldr r3, [sp, #4]
17346 + mov lr, r3
17347 + add sp, sp, #8
17348 + pop {r2, r3}
17349 + RET
17350 + FUNC_END aeabi_ldivmod
17351 +
17352 +#endif /* L_aeabi_ldivmod */
17353 +
17354 +#ifdef L_aeabi_uldivmod
17355 +
17356 +FUNC_START aeabi_uldivmod
17357 + test_div_by_zero unsigned
17358 +
17359 + push {r0, r1}
17360 + mov r0, sp
17361 + push {r0, lr}
17362 + ldr r0, [sp, #8]
17363 + bl SYM(__gnu_uldivmod_helper)
17364 + ldr r3, [sp, #4]
17365 + mov lr, r3
17366 + add sp, sp, #8
17367 + pop {r2, r3}
17368 + RET
17369 + FUNC_END aeabi_uldivmod
17370 +
17371 +#endif /* L_aeabi_uldivmod */
17372 +
17373 +#ifdef L_arm_addsubsf3
17374 +
17375 +FUNC_START aeabi_frsub
17376 +
17377 + push {r4, lr}
17378 + mov r4, #1
17379 + lsl r4, #31
17380 + eor r0, r0, r4
17381 + bl __aeabi_fadd
17382 + pop {r4, pc}
17383 +
17384 + FUNC_END aeabi_frsub
17385 +
17386 +#endif /* L_arm_addsubsf3 */
17387 +
17388 +#ifdef L_arm_cmpsf2
17389 +
17390 +FUNC_START aeabi_cfrcmple
17391 +
17392 + mov ip, r0
17393 + mov r0, r1
17394 + mov r1, ip
17395 + b 6f
17396 +
17397 +FUNC_START aeabi_cfcmpeq
17398 +FUNC_ALIAS aeabi_cfcmple aeabi_cfcmpeq
17399 +
17400 + @ The status-returning routines are required to preserve all
17401 + @ registers except ip, lr, and cpsr.
17402 +6: push {r0, r1, r2, r3, r4, lr}
17403 + bl __lesf2
17404 + @ Set the Z flag correctly, and the C flag unconditionally.
17405 + cmp r0, #0
17406 + @ Clear the C flag if the return value was -1, indicating
17407 + @ that the first operand was smaller than the second.
17408 + bmi 1f
17409 + mov r1, #0
17410 + cmn r0, r1
17411 +1:
17412 + pop {r0, r1, r2, r3, r4, pc}
17413 +
17414 + FUNC_END aeabi_cfcmple
17415 + FUNC_END aeabi_cfcmpeq
17416 + FUNC_END aeabi_cfrcmple
17417 +
17418 +FUNC_START aeabi_fcmpeq
17419 +
17420 + push {r4, lr}
17421 + bl __eqsf2
17422 + neg r0, r0
17423 + add r0, r0, #1
17424 + pop {r4, pc}
17425 +
17426 + FUNC_END aeabi_fcmpeq
17427 +
17428 +.macro COMPARISON cond, helper, mode=sf2
17429 +FUNC_START aeabi_fcmp\cond
17430 +
17431 + push {r4, lr}
17432 + bl __\helper\mode
17433 + cmp r0, #0
17434 + b\cond 1f
17435 + mov r0, #0
17436 + pop {r4, pc}
17437 +1:
17438 + mov r0, #1
17439 + pop {r4, pc}
17440 +
17441 + FUNC_END aeabi_fcmp\cond
17442 +.endm
17443 +
17444 +COMPARISON lt, le
17445 +COMPARISON le, le
17446 +COMPARISON gt, ge
17447 +COMPARISON ge, ge
17448 +
17449 +#endif /* L_arm_cmpsf2 */
17450 +
17451 +#ifdef L_arm_addsubdf3
17452 +
17453 +FUNC_START aeabi_drsub
17454 +
17455 + push {r4, lr}
17456 + mov r4, #1
17457 + lsl r4, #31
17458 + eor xxh, xxh, r4
17459 + bl __aeabi_dadd
17460 + pop {r4, pc}
17461 +
17462 + FUNC_END aeabi_drsub
17463 +
17464 +#endif /* L_arm_addsubdf3 */
17465 +
17466 +#ifdef L_arm_cmpdf2
17467 +
17468 +FUNC_START aeabi_cdrcmple
17469 +
17470 + mov ip, r0
17471 + mov r0, r2
17472 + mov r2, ip
17473 + mov ip, r1
17474 + mov r1, r3
17475 + mov r3, ip
17476 + b 6f
17477 +
17478 +FUNC_START aeabi_cdcmpeq
17479 +FUNC_ALIAS aeabi_cdcmple aeabi_cdcmpeq
17480 +
17481 + @ The status-returning routines are required to preserve all
17482 + @ registers except ip, lr, and cpsr.
17483 +6: push {r0, r1, r2, r3, r4, lr}
17484 + bl __ledf2
17485 + @ Set the Z flag correctly, and the C flag unconditionally.
17486 + cmp r0, #0
17487 + @ Clear the C flag if the return value was -1, indicating
17488 + @ that the first operand was smaller than the second.
17489 + bmi 1f
17490 + mov r1, #0
17491 + cmn r0, r1
17492 +1:
17493 + pop {r0, r1, r2, r3, r4, pc}
17494 +
17495 + FUNC_END aeabi_cdcmple
17496 + FUNC_END aeabi_cdcmpeq
17497 + FUNC_END aeabi_cdrcmple
17498 +
17499 +FUNC_START aeabi_dcmpeq
17500 +
17501 + push {r4, lr}
17502 + bl __eqdf2
17503 + neg r0, r0
17504 + add r0, r0, #1
17505 + pop {r4, pc}
17506 +
17507 + FUNC_END aeabi_dcmpeq
17508 +
17509 +.macro COMPARISON cond, helper, mode=df2
17510 +FUNC_START aeabi_dcmp\cond
17511 +
17512 + push {r4, lr}
17513 + bl __\helper\mode
17514 + cmp r0, #0
17515 + b\cond 1f
17516 + mov r0, #0
17517 + pop {r4, pc}
17518 +1:
17519 + mov r0, #1
17520 + pop {r4, pc}
17521 +
17522 + FUNC_END aeabi_dcmp\cond
17523 +.endm
17524 +
17525 +COMPARISON lt, le
17526 +COMPARISON le, le
17527 +COMPARISON gt, ge
17528 +COMPARISON ge, ge
17529 +
17530 +#endif /* L_arm_cmpdf2 */
17531 --- a/gcc/config/arm/bpabi.S
17532 +++ b/gcc/config/arm/bpabi.S
17533 @@ -81,20 +81,69 @@ ARM_FUNC_START aeabi_ulcmp
17534
17535 #endif /* L_aeabi_ulcmp */
17536
17537 +.macro test_div_by_zero signed
17538 +/* Tail-call to divide-by-zero handlers which may be overridden by the user,
17539 + so unwinding works properly. */
17540 +#if defined(__thumb2__)
17541 + cbnz yyh, 1f
17542 + cbnz yyl, 1f
17543 + cmp xxh, #0
17544 + do_it eq
17545 + cmpeq xxl, #0
17546 + .ifc \signed, unsigned
17547 + beq 2f
17548 + mov xxh, #0xffffffff
17549 + mov xxl, xxh
17550 +2:
17551 + .else
17552 + do_it lt, t
17553 + movlt xxl, #0
17554 + movlt xxh, #0x80000000
17555 + do_it gt, t
17556 + movgt xxh, #0x7fffffff
17557 + movgt xxl, #0xffffffff
17558 + .endif
17559 + b SYM (__aeabi_ldiv0) __PLT__
17560 +1:
17561 +#else
17562 + /* Note: Thumb-1 code calls via an ARM shim on processors which
17563 + support ARM mode. */
17564 + cmp yyh, #0
17565 + cmpeq yyl, #0
17566 + bne 2f
17567 + cmp xxh, #0
17568 + cmpeq xxl, #0
17569 + .ifc \signed, unsigned
17570 + movne xxh, #0xffffffff
17571 + movne xxl, #0xffffffff
17572 + .else
17573 + movlt xxh, #0x80000000
17574 + movlt xxl, #0
17575 + movgt xxh, #0x7fffffff
17576 + movgt xxl, #0xffffffff
17577 + .endif
17578 + b SYM (__aeabi_ldiv0) __PLT__
17579 +2:
17580 +#endif
17581 +.endm
17582 +
17583 #ifdef L_aeabi_ldivmod
17584
17585 ARM_FUNC_START aeabi_ldivmod
17586 + test_div_by_zero signed
17587 +
17588 sub sp, sp, #8
17589 -#if defined(__thumb2__)
17590 +/* Low latency and Thumb-2 do_push implementations can't push sp directly. */
17591 +#if defined(__thumb2__) || defined(__irq_low_latency__)
17592 mov ip, sp
17593 - push {ip, lr}
17594 + do_push (ip, lr)
17595 #else
17596 - do_push {sp, lr}
17597 + stmfd sp!, {sp, lr}
17598 #endif
17599 bl SYM(__gnu_ldivmod_helper) __PLT__
17600 ldr lr, [sp, #4]
17601 add sp, sp, #8
17602 - do_pop {r2, r3}
17603 + do_pop (r2, r3)
17604 RET
17605
17606 #endif /* L_aeabi_ldivmod */
17607 @@ -102,17 +151,20 @@ ARM_FUNC_START aeabi_ldivmod
17608 #ifdef L_aeabi_uldivmod
17609
17610 ARM_FUNC_START aeabi_uldivmod
17611 + test_div_by_zero unsigned
17612 +
17613 sub sp, sp, #8
17614 -#if defined(__thumb2__)
17615 +/* Low latency and Thumb-2 do_push implementations can't push sp directly. */
17616 +#if defined(__thumb2__) || defined(__irq_low_latency__)
17617 mov ip, sp
17618 - push {ip, lr}
17619 + do_push (ip, lr)
17620 #else
17621 - do_push {sp, lr}
17622 + stmfd sp!, {sp, lr}
17623 #endif
17624 bl SYM(__gnu_uldivmod_helper) __PLT__
17625 ldr lr, [sp, #4]
17626 add sp, sp, #8
17627 - do_pop {r2, r3}
17628 + do_pop (r2, r3)
17629 RET
17630
17631 #endif /* L_aeabi_divmod */
17632 --- a/gcc/config/arm/bpabi.h
17633 +++ b/gcc/config/arm/bpabi.h
17634 @@ -51,15 +51,25 @@
17635 /* The BPABI integer comparison routines return { -1, 0, 1 }. */
17636 #define TARGET_LIB_INT_CMP_BIASED !TARGET_BPABI
17637
17638 +#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4:--fix-v4bx}"
17639 +
17640 +#define BE8_LINK_SPEC " %{mbig-endian:%{march=armv7-a|mcpu=cortex-a8|mcpu=cortex-a9:%{!r:--be8}}}"
17641 +
17642 /* Tell the assembler to build BPABI binaries. */
17643 #undef SUBTARGET_EXTRA_ASM_SPEC
17644 -#define SUBTARGET_EXTRA_ASM_SPEC "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=4}"
17645 +#define SUBTARGET_EXTRA_ASM_SPEC "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5}" TARGET_FIX_V4BX_SPEC
17646 +
17647 +#ifndef SUBTARGET_EXTRA_LINK_SPEC
17648 +#define SUBTARGET_EXTRA_LINK_SPEC ""
17649 +#endif
17650
17651 /* The generic link spec in elf.h does not support shared libraries. */
17652 #undef LINK_SPEC
17653 #define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} " \
17654 "%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \
17655 - "-X"
17656 + "-X" SUBTARGET_EXTRA_LINK_SPEC TARGET_FIX_V4BX_SPEC \
17657 + BE8_LINK_SPEC \
17658 + " %{mfix-janus-2cc:--fix-janus-2cc}"
17659
17660 #if defined (__thumb__)
17661 #define RENAME_LIBRARY_SET ".thumb_set"
17662 @@ -81,16 +91,22 @@
17663 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, lmul)
17664 #endif
17665 #ifdef L_fixdfdi
17666 -#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixdfdi, d2lz)
17667 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixdfdi, d2lz) \
17668 + extern DWtype __fixdfdi (DFtype) __attribute__((pcs("aapcs"))); \
17669 + extern UDWtype __fixunsdfdi (DFtype) __asm__("__aeabi_d2ulz") __attribute__((pcs("aapcs")));
17670 #endif
17671 #ifdef L_fixunsdfdi
17672 -#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfdi, d2ulz)
17673 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfdi, d2ulz) \
17674 + extern UDWtype __fixunsdfdi (DFtype) __attribute__((pcs("aapcs")));
17675 #endif
17676 #ifdef L_fixsfdi
17677 -#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixsfdi, f2lz)
17678 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixsfdi, f2lz) \
17679 + extern DWtype __fixsfdi (SFtype) __attribute__((pcs("aapcs"))); \
17680 + extern UDWtype __fixunssfdi (SFtype) __asm__("__aeabi_f2ulz") __attribute__((pcs("aapcs")));
17681 #endif
17682 #ifdef L_fixunssfdi
17683 -#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfdi, f2ulz)
17684 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfdi, f2ulz) \
17685 + extern UDWtype __fixunssfdi (SFtype) __attribute__((pcs("aapcs")));
17686 #endif
17687 #ifdef L_floatdidf
17688 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdidf, l2d)
17689 @@ -99,6 +115,21 @@
17690 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdisf, l2f)
17691 #endif
17692
17693 +/* These renames are needed on ARMv6M. Other targets get them from
17694 + assembly routines. */
17695 +#ifdef L_fixunsdfsi
17696 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfsi, d2uiz)
17697 +#endif
17698 +#ifdef L_fixunssfsi
17699 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfsi, f2uiz)
17700 +#endif
17701 +#ifdef L_floatundidf
17702 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatundidf, ul2d)
17703 +#endif
17704 +#ifdef L_floatundisf
17705 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatundisf, ul2f)
17706 +#endif
17707 +
17708 /* The BPABI requires that we always use an out-of-line implementation
17709 of RTTI comparison, even if the target supports weak symbols,
17710 because the same object file might be used on a target that does
17711 @@ -123,3 +154,26 @@
17712 #undef FINI_SECTION_ASM_OP
17713 #define INIT_ARRAY_SECTION_ASM_OP ARM_EABI_CTORS_SECTION_OP
17714 #define FINI_ARRAY_SECTION_ASM_OP ARM_EABI_DTORS_SECTION_OP
17715 +
17716 +/* The legacy _mcount implementation assumes r11 points to a
17717 + 4-word APCS frame. This is generally not true for EABI targets,
17718 + particularly not in Thumb mode. We assume the mcount
17719 + implementation does not require a counter variable (No Counter).
17720 + Note that __gnu_mcount_nc will be entered with a misaligned stack.
17721 + This is OK because it uses a special calling convention anyway. */
17722 +
17723 +#undef NO_PROFILE_COUNTERS
17724 +#define NO_PROFILE_COUNTERS 1
17725 +#undef ARM_FUNCTION_PROFILER
17726 +#define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \
17727 +{ \
17728 + fprintf (STREAM, "\tpush\t{lr}\n"); \
17729 + fprintf (STREAM, "\tbl\t__gnu_mcount_nc\n"); \
17730 +}
17731 +
17732 +#undef SUBTARGET_FRAME_POINTER_REQUIRED
17733 +#define SUBTARGET_FRAME_POINTER_REQUIRED 0
17734 +
17735 +/* __gnu_mcount_nc restores the original LR value before returning. Ensure
17736 + that there is no unnecessary hook set up. */
17737 +#undef PROFILE_HOOK
17738 --- a/gcc/config/arm/constraints.md
17739 +++ b/gcc/config/arm/constraints.md
17740 @@ -20,19 +20,19 @@
17741
17742 ;; The following register constraints have been used:
17743 ;; - in ARM/Thumb-2 state: f, t, v, w, x, y, z
17744 -;; - in Thumb state: h, k, b
17745 -;; - in both states: l, c
17746 +;; - in Thumb state: h, b
17747 +;; - in both states: l, c, k
17748 ;; In ARM state, 'l' is an alias for 'r'
17749
17750 ;; The following normal constraints have been used:
17751 -;; in ARM/Thumb-2 state: G, H, I, J, K, L, M
17752 +;; in ARM/Thumb-2 state: G, H, I, j, J, K, L, M
17753 ;; in Thumb-1 state: I, J, K, L, M, N, O
17754
17755 ;; The following multi-letter normal constraints have been used:
17756 ;; in ARM/Thumb-2 state: Da, Db, Dc, Dn, Dl, DL, Dv
17757
17758 ;; The following memory constraints have been used:
17759 -;; in ARM/Thumb-2 state: Q, Ut, Uv, Uy, Un, Us
17760 +;; in ARM/Thumb-2 state: Q, Ut, Uv, Uy, Un, Um, Us
17761 ;; in ARM state: Uq
17762
17763
17764 @@ -46,7 +46,7 @@
17765 "The Cirrus Maverick co-processor registers.")
17766
17767 (define_register_constraint "w"
17768 - "TARGET_32BIT ? (TARGET_VFP3 ? VFP_REGS : VFP_LO_REGS) : NO_REGS"
17769 + "TARGET_32BIT ? (TARGET_VFPD32 ? VFP_REGS : VFP_LO_REGS) : NO_REGS"
17770 "The VFP registers @code{d0}-@code{d15}, or @code{d0}-@code{d31} for VFPv3.")
17771
17772 (define_register_constraint "x" "TARGET_32BIT ? VFP_D0_D7_REGS : NO_REGS"
17773 @@ -65,9 +65,15 @@
17774 (define_register_constraint "h" "TARGET_THUMB ? HI_REGS : NO_REGS"
17775 "In Thumb state the core registers @code{r8}-@code{r15}.")
17776
17777 -(define_register_constraint "k" "TARGET_THUMB ? STACK_REG : NO_REGS"
17778 - "@internal
17779 - Thumb only. The stack register.")
17780 +(define_constraint "j"
17781 + "A constant suitable for a MOVW instruction. (ARM/Thumb-2)"
17782 + (and (match_test "TARGET_32BIT && arm_arch_thumb2")
17783 + (ior (match_code "high")
17784 + (and (match_code "const_int")
17785 + (match_test "(ival & 0xffff0000) == 0")))))
17786 +
17787 +(define_register_constraint "k" "STACK_REG"
17788 + "@internal The stack register.")
17789
17790 (define_register_constraint "b" "TARGET_THUMB ? BASE_REGS : NO_REGS"
17791 "@internal
17792 @@ -117,11 +123,9 @@
17793 : ((ival >= 0 && ival <= 1020) && ((ival & 3) == 0))")))
17794
17795 (define_constraint "N"
17796 - "In ARM/Thumb-2 state a constant suitable for a MOVW instruction.
17797 - In Thumb-1 state a constant in the range 0-31."
17798 + "Thumb-1 state a constant in the range 0-31."
17799 (and (match_code "const_int")
17800 - (match_test "TARGET_32BIT ? arm_arch_thumb2 && ((ival & 0xffff0000) == 0)
17801 - : (ival >= 0 && ival <= 31)")))
17802 + (match_test "!TARGET_32BIT && (ival >= 0 && ival <= 31)")))
17803
17804 (define_constraint "O"
17805 "In Thumb-1 state a constant that is a multiple of 4 in the range
17806 @@ -215,17 +219,24 @@
17807
17808 (define_memory_constraint "Un"
17809 "@internal
17810 + In ARM/Thumb-2 state a valid address for Neon doubleword vector
17811 + load/store instructions."
17812 + (and (match_code "mem")
17813 + (match_test "TARGET_32BIT && neon_vector_mem_operand (op, 0)")))
17814 +
17815 +(define_memory_constraint "Um"
17816 + "@internal
17817 In ARM/Thumb-2 state a valid address for Neon element and structure
17818 load/store instructions."
17819 (and (match_code "mem")
17820 - (match_test "TARGET_32BIT && neon_vector_mem_operand (op, FALSE)")))
17821 + (match_test "TARGET_32BIT && neon_vector_mem_operand (op, 2)")))
17822
17823 (define_memory_constraint "Us"
17824 "@internal
17825 In ARM/Thumb-2 state a valid address for non-offset loads/stores of
17826 quad-word values in four ARM registers."
17827 (and (match_code "mem")
17828 - (match_test "TARGET_32BIT && neon_vector_mem_operand (op, TRUE)")))
17829 + (match_test "TARGET_32BIT && neon_vector_mem_operand (op, 1)")))
17830
17831 (define_memory_constraint "Uq"
17832 "@internal
17833 --- a/gcc/config/arm/cortex-a8-neon.md
17834 +++ b/gcc/config/arm/cortex-a8-neon.md
17835 @@ -134,7 +134,7 @@
17836
17837 (define_insn_reservation "cortex_a8_vfp_add_sub" 10
17838 (and (eq_attr "tune" "cortexa8")
17839 - (eq_attr "type" "farith"))
17840 + (eq_attr "type" "fconsts,fconstd,fadds,faddd"))
17841 "cortex_a8_vfp,cortex_a8_vfplite*9")
17842
17843 (define_insn_reservation "cortex_a8_vfp_muls" 12
17844 @@ -172,7 +172,7 @@
17845 ;; take four cycles, we pick that latency.
17846 (define_insn_reservation "cortex_a8_vfp_farith" 4
17847 (and (eq_attr "tune" "cortexa8")
17848 - (eq_attr "type" "ffarith"))
17849 + (eq_attr "type" "fcpys,ffariths,ffarithd,fconsts,fconstd,fcmps,fcmpd"))
17850 "cortex_a8_vfp,cortex_a8_vfplite*3")
17851
17852 (define_insn_reservation "cortex_a8_vfp_cvt" 7
17853 --- /dev/null
17854 +++ b/gcc/config/arm/cortex-a9.md
17855 @@ -0,0 +1,65 @@
17856 +;; ARM Cortex-A9 VFP pipeline description
17857 +;; Copyright (C) 2008 Free Software Foundation, Inc.
17858 +;; Written by CodeSourcery.
17859 +;;
17860 +;; This file is part of GCC.
17861 +;;
17862 +;; GCC is free software; you can redistribute it and/or modify it
17863 +;; under the terms of the GNU General Public License as published by
17864 +;; the Free Software Foundation; either version 3, or (at your option)
17865 +;; any later version.
17866 +;;
17867 +;; GCC is distributed in the hope that it will be useful, but
17868 +;; WITHOUT ANY WARRANTY; without even the implied warranty of
17869 +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17870 +;; General Public License for more details.
17871 +;;
17872 +;; You should have received a copy of the GNU General Public License
17873 +;; along with GCC; see the file COPYING3. If not see
17874 +;; <http://www.gnu.org/licenses/>.
17875 +
17876 +(define_automaton "cortex_a9")
17877 +
17878 +;; FIXME: We model aingle pipeline for all instructions.
17879 +;; Is dual-issue possible, and do we have other pipelines?
17880 +(define_cpu_unit "cortex_a9_vfp" "cortex_a9")
17881 +
17882 +(define_insn_reservation "cortex_a9_ffarith" 1
17883 + (and (eq_attr "tune" "cortexa9")
17884 + (eq_attr "type" "fcpys,ffariths,ffarithd,fcmps,fcmpd,fconsts,fconstd"))
17885 + "cortex_a9_vfp")
17886 +
17887 +(define_insn_reservation "cortex_a9_fadd" 4
17888 + (and (eq_attr "tune" "cortexa9")
17889 + (eq_attr "type" "fadds,faddd,f_cvt"))
17890 + "cortex_a9_vfp")
17891 +
17892 +(define_insn_reservation "cortex_a9_fmuls" 5
17893 + (and (eq_attr "tune" "cortexa9")
17894 + (eq_attr "type" "fmuls"))
17895 + "cortex_a9_vfp")
17896 +
17897 +(define_insn_reservation "cortex_a9_fmuld" 6
17898 + (and (eq_attr "tune" "cortexa9")
17899 + (eq_attr "type" "fmuld"))
17900 + "cortex_a9_vfp*2")
17901 +
17902 +(define_insn_reservation "cortex_a9_fmacs" 8
17903 + (and (eq_attr "tune" "cortexa9")
17904 + (eq_attr "type" "fmacs"))
17905 + "cortex_a9_vfp")
17906 +
17907 +(define_insn_reservation "cortex_a9_fmacd" 8
17908 + (and (eq_attr "tune" "cortexa9")
17909 + (eq_attr "type" "fmacd"))
17910 + "cortex_a9_vfp*2")
17911 +
17912 +(define_insn_reservation "cortex_a9_fdivs" 15
17913 + (and (eq_attr "tune" "cortexa9")
17914 + (eq_attr "type" "fdivs"))
17915 + "cortex_a9_vfp*10")
17916 +
17917 +(define_insn_reservation "cortex_a9_fdivd" 25
17918 + (and (eq_attr "tune" "cortexa9")
17919 + (eq_attr "type" "fdivd"))
17920 + "cortex_a9_vfp*20")
17921 --- /dev/null
17922 +++ b/gcc/config/arm/cortex-r4.md
17923 @@ -0,0 +1,292 @@
17924 +;; ARM Cortex-R4 scheduling description.
17925 +;; Copyright (C) 2007 Free Software Foundation, Inc.
17926 +;; Contributed by CodeSourcery.
17927 +
17928 +;; This file is part of GCC.
17929 +
17930 +;; GCC is free software; you can redistribute it and/or modify it
17931 +;; under the terms of the GNU General Public License as published
17932 +;; by the Free Software Foundation; either version 3, or (at your
17933 +;; option) any later version.
17934 +
17935 +;; GCC is distributed in the hope that it will be useful, but WITHOUT
17936 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17937 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17938 +;; License for more details.
17939 +
17940 +;; You should have received a copy of the GNU General Public License
17941 +;; along with GCC; see the file COPYING3. If not see
17942 +;; <http://www.gnu.org/licenses/>.
17943 +
17944 +(define_automaton "cortex_r4")
17945 +
17946 +;; We approximate the dual-issue constraints of this core using four
17947 +;; "issue units" and a reservation matrix as follows. The numbers indicate
17948 +;; the instruction groups' preferences in order. Multiple entries for
17949 +;; the same numbered preference indicate units that must be reserved
17950 +;; together.
17951 +;;
17952 +;; Issue unit: A B C ALU
17953 +;;
17954 +;; ALU w/o reg shift 1st 2nd 1st and 2nd
17955 +;; ALU w/ reg shift 1st 2nd 2nd 1st and 2nd
17956 +;; Moves 1st 2nd 2nd
17957 +;; Multiplication 1st 1st
17958 +;; Division 1st 1st
17959 +;; Load/store single 1st 1st
17960 +;; Other load/store 1st 1st
17961 +;; Branches 1st
17962 +
17963 +(define_cpu_unit "cortex_r4_issue_a" "cortex_r4")
17964 +(define_cpu_unit "cortex_r4_issue_b" "cortex_r4")
17965 +(define_cpu_unit "cortex_r4_issue_c" "cortex_r4")
17966 +(define_cpu_unit "cortex_r4_issue_alu" "cortex_r4")
17967 +
17968 +(define_reservation "cortex_r4_alu"
17969 + "(cortex_r4_issue_a+cortex_r4_issue_alu)|\
17970 + (cortex_r4_issue_b+cortex_r4_issue_alu)")
17971 +(define_reservation "cortex_r4_alu_shift_reg"
17972 + "(cortex_r4_issue_a+cortex_r4_issue_alu)|\
17973 + (cortex_r4_issue_b+cortex_r4_issue_c+\
17974 + cortex_r4_issue_alu)")
17975 +(define_reservation "cortex_r4_mov"
17976 + "cortex_r4_issue_a|(cortex_r4_issue_b+\
17977 + cortex_r4_issue_alu)")
17978 +(define_reservation "cortex_r4_mul" "cortex_r4_issue_a+cortex_r4_issue_alu")
17979 +(define_reservation "cortex_r4_mul_2"
17980 + "(cortex_r4_issue_a+cortex_r4_issue_alu)*2")
17981 +;; Division instructions execute out-of-order with respect to the
17982 +;; rest of the pipeline and only require reservations on their first and
17983 +;; final cycles.
17984 +(define_reservation "cortex_r4_div_9"
17985 + "cortex_r4_issue_a+cortex_r4_issue_alu,\
17986 + nothing*7,\
17987 + cortex_r4_issue_a+cortex_r4_issue_alu")
17988 +(define_reservation "cortex_r4_div_10"
17989 + "cortex_r4_issue_a+cortex_r4_issue_alu,\
17990 + nothing*8,\
17991 + cortex_r4_issue_a+cortex_r4_issue_alu")
17992 +(define_reservation "cortex_r4_load_store"
17993 + "cortex_r4_issue_a+cortex_r4_issue_c")
17994 +(define_reservation "cortex_r4_load_store_2"
17995 + "(cortex_r4_issue_a+cortex_r4_issue_b)*2")
17996 +(define_reservation "cortex_r4_branch" "cortex_r4_issue_b")
17997 +
17998 +;; We assume that all instructions are unconditional.
17999 +
18000 +;; Data processing instructions. Moves without shifts are kept separate
18001 +;; for the purposes of the dual-issue constraints above.
18002 +(define_insn_reservation "cortex_r4_alu" 2
18003 + (and (eq_attr "tune_cortexr4" "yes")
18004 + (and (eq_attr "type" "alu")
18005 + (not (eq_attr "insn" "mov"))))
18006 + "cortex_r4_alu")
18007 +
18008 +(define_insn_reservation "cortex_r4_mov" 2
18009 + (and (eq_attr "tune_cortexr4" "yes")
18010 + (and (eq_attr "type" "alu")
18011 + (eq_attr "insn" "mov")))
18012 + "cortex_r4_mov")
18013 +
18014 +(define_insn_reservation "cortex_r4_alu_shift" 2
18015 + (and (eq_attr "tune_cortexr4" "yes")
18016 + (eq_attr "type" "alu_shift"))
18017 + "cortex_r4_alu")
18018 +
18019 +(define_insn_reservation "cortex_r4_alu_shift_reg" 2
18020 + (and (eq_attr "tune_cortexr4" "yes")
18021 + (eq_attr "type" "alu_shift_reg"))
18022 + "cortex_r4_alu_shift_reg")
18023 +
18024 +;; An ALU instruction followed by an ALU instruction with no early dep.
18025 +(define_bypass 1 "cortex_r4_alu,cortex_r4_alu_shift,cortex_r4_alu_shift_reg,\
18026 + cortex_r4_mov"
18027 + "cortex_r4_alu")
18028 +(define_bypass 1 "cortex_r4_alu,cortex_r4_alu_shift,cortex_r4_alu_shift_reg,\
18029 + cortex_r4_mov"
18030 + "cortex_r4_alu_shift"
18031 + "arm_no_early_alu_shift_dep")
18032 +(define_bypass 1 "cortex_r4_alu,cortex_r4_alu_shift,cortex_r4_alu_shift_reg,\
18033 + cortex_r4_mov"
18034 + "cortex_r4_alu_shift_reg"
18035 + "arm_no_early_alu_shift_value_dep")
18036 +
18037 +;; In terms of availabilities, a consumer mov could theoretically be
18038 +;; issued together with a producer ALU instruction, without stalls.
18039 +;; In practice this cannot happen because mov;add (in that order) is not
18040 +;; eligible for dual issue and furthermore dual issue is not permitted
18041 +;; when a dependency is involved. We therefore note it as latency one.
18042 +;; A mov followed by another of the same is also latency one.
18043 +(define_bypass 1 "cortex_r4_alu,cortex_r4_alu_shift,cortex_r4_alu_shift_reg,\
18044 + cortex_r4_mov"
18045 + "cortex_r4_mov")
18046 +
18047 +;; qadd, qdadd, qsub and qdsub are not currently emitted, and neither are
18048 +;; media data processing instructions nor sad instructions.
18049 +
18050 +;; Multiplication instructions.
18051 +
18052 +(define_insn_reservation "cortex_r4_mul_4" 4
18053 + (and (eq_attr "tune_cortexr4" "yes")
18054 + (eq_attr "insn" "mul,smmul"))
18055 + "cortex_r4_mul_2")
18056 +
18057 +(define_insn_reservation "cortex_r4_mul_3" 3
18058 + (and (eq_attr "tune_cortexr4" "yes")
18059 + (eq_attr "insn" "smulxy,smulwy,smuad,smusd"))
18060 + "cortex_r4_mul")
18061 +
18062 +(define_insn_reservation "cortex_r4_mla_4" 4
18063 + (and (eq_attr "tune_cortexr4" "yes")
18064 + (eq_attr "insn" "mla,smmla,smmls"))
18065 + "cortex_r4_mul_2")
18066 +
18067 +(define_insn_reservation "cortex_r4_mla_3" 3
18068 + (and (eq_attr "tune_cortexr4" "yes")
18069 + (eq_attr "insn" "smlaxy,smlawy,smlad,smlsd"))
18070 + "cortex_r4_mul")
18071 +
18072 +(define_insn_reservation "cortex_r4_smlald" 3
18073 + (and (eq_attr "tune_cortexr4" "yes")
18074 + (eq_attr "insn" "smlald,smlsld"))
18075 + "cortex_r4_mul")
18076 +
18077 +(define_insn_reservation "cortex_r4_mull" 4
18078 + (and (eq_attr "tune_cortexr4" "yes")
18079 + (eq_attr "insn" "smull,umull,umlal,umaal"))
18080 + "cortex_r4_mul_2")
18081 +
18082 +;; A multiply or an MLA with a single-register result, followed by an
18083 +;; MLA with an accumulator dependency, has its result forwarded.
18084 +(define_bypass 2 "cortex_r4_mul_3,cortex_r4_mla_3"
18085 + "cortex_r4_mla_3,cortex_r4_mla_4"
18086 + "arm_mac_accumulator_is_mul_result")
18087 +
18088 +(define_bypass 3 "cortex_r4_mul_4,cortex_r4_mla_4"
18089 + "cortex_r4_mla_3,cortex_r4_mla_4"
18090 + "arm_mac_accumulator_is_mul_result")
18091 +
18092 +;; A multiply followed by an ALU instruction needing the multiply
18093 +;; result only at ALU has lower latency than one needing it at Shift.
18094 +(define_bypass 2 "cortex_r4_mul_3,cortex_r4_mla_3,cortex_r4_smlald"
18095 + "cortex_r4_alu")
18096 +(define_bypass 2 "cortex_r4_mul_3,cortex_r4_mla_3,cortex_r4_smlald"
18097 + "cortex_r4_alu_shift"
18098 + "arm_no_early_alu_shift_dep")
18099 +(define_bypass 2 "cortex_r4_mul_3,cortex_r4_mla_3,cortex_r4_smlald"
18100 + "cortex_r4_alu_shift_reg"
18101 + "arm_no_early_alu_shift_value_dep")
18102 +(define_bypass 3 "cortex_r4_mul_4,cortex_r4_mla_4,cortex_r4_mull"
18103 + "cortex_r4_alu")
18104 +(define_bypass 3 "cortex_r4_mul_4,cortex_r4_mla_4,cortex_r4_mull"
18105 + "cortex_r4_alu_shift"
18106 + "arm_no_early_alu_shift_dep")
18107 +(define_bypass 3 "cortex_r4_mul_4,cortex_r4_mla_4,cortex_r4_mull"
18108 + "cortex_r4_alu_shift_reg"
18109 + "arm_no_early_alu_shift_value_dep")
18110 +
18111 +;; A multiply followed by a mov has one cycle lower latency again.
18112 +(define_bypass 1 "cortex_r4_mul_3,cortex_r4_mla_3,cortex_r4_smlald"
18113 + "cortex_r4_mov")
18114 +(define_bypass 2 "cortex_r4_mul_4,cortex_r4_mla_4,cortex_r4_mull"
18115 + "cortex_r4_mov")
18116 +
18117 +;; We guess that division of A/B using sdiv or udiv, on average,
18118 +;; is performed with B having ten more leading zeros than A.
18119 +;; This gives a latency of nine for udiv and ten for sdiv.
18120 +(define_insn_reservation "cortex_r4_udiv" 9
18121 + (and (eq_attr "tune_cortexr4" "yes")
18122 + (eq_attr "insn" "udiv"))
18123 + "cortex_r4_div_9")
18124 +
18125 +(define_insn_reservation "cortex_r4_sdiv" 10
18126 + (and (eq_attr "tune_cortexr4" "yes")
18127 + (eq_attr "insn" "sdiv"))
18128 + "cortex_r4_div_10")
18129 +
18130 +;; Branches. We assume correct prediction.
18131 +
18132 +(define_insn_reservation "cortex_r4_branch" 0
18133 + (and (eq_attr "tune_cortexr4" "yes")
18134 + (eq_attr "type" "branch"))
18135 + "cortex_r4_branch")
18136 +
18137 +;; Call latencies are not predictable. A semi-arbitrary very large
18138 +;; number is used as "positive infinity" so that everything should be
18139 +;; finished by the time of return.
18140 +(define_insn_reservation "cortex_r4_call" 32
18141 + (and (eq_attr "tune_cortexr4" "yes")
18142 + (eq_attr "type" "call"))
18143 + "nothing")
18144 +
18145 +;; Status register access instructions are not currently emitted.
18146 +
18147 +;; Load instructions.
18148 +;; We do not model the "addr_md_3cycle" cases and assume that
18149 +;; accesses following are correctly aligned.
18150 +
18151 +(define_insn_reservation "cortex_r4_load_1_2" 3
18152 + (and (eq_attr "tune_cortexr4" "yes")
18153 + (eq_attr "type" "load1,load2"))
18154 + "cortex_r4_load_store")
18155 +
18156 +(define_insn_reservation "cortex_r4_load_3_4" 4
18157 + (and (eq_attr "tune_cortexr4" "yes")
18158 + (eq_attr "type" "load3,load4"))
18159 + "cortex_r4_load_store_2")
18160 +
18161 +;; If a producing load is followed by an instruction consuming only
18162 +;; as a Normal Reg, there is one fewer cycle of latency.
18163 +
18164 +(define_bypass 2 "cortex_r4_load_1_2"
18165 + "cortex_r4_alu")
18166 +(define_bypass 2 "cortex_r4_load_1_2"
18167 + "cortex_r4_alu_shift"
18168 + "arm_no_early_alu_shift_dep")
18169 +(define_bypass 2 "cortex_r4_load_1_2"
18170 + "cortex_r4_alu_shift_reg"
18171 + "arm_no_early_alu_shift_value_dep")
18172 +
18173 +(define_bypass 3 "cortex_r4_load_3_4"
18174 + "cortex_r4_alu")
18175 +(define_bypass 3 "cortex_r4_load_3_4"
18176 + "cortex_r4_alu_shift"
18177 + "arm_no_early_alu_shift_dep")
18178 +(define_bypass 3 "cortex_r4_load_3_4"
18179 + "cortex_r4_alu_shift_reg"
18180 + "arm_no_early_alu_shift_value_dep")
18181 +
18182 +;; If a producing load is followed by an instruction consuming only
18183 +;; as a Late Reg, there are two fewer cycles of latency. Such consumer
18184 +;; instructions are moves and stores.
18185 +
18186 +(define_bypass 1 "cortex_r4_load_1_2"
18187 + "cortex_r4_mov,cortex_r4_store_1_2,cortex_r4_store_3_4")
18188 +(define_bypass 2 "cortex_r4_load_3_4"
18189 + "cortex_r4_mov,cortex_r4_store_1_2,cortex_r4_store_3_4")
18190 +
18191 +;; If a producer's result is required as the base or offset of a load,
18192 +;; there is an extra cycle latency.
18193 +
18194 +(define_bypass 3 "cortex_r4_alu,cortex_r4_mov,cortex_r4_alu_shift,\
18195 + cortex_r4_alu_shift_reg"
18196 + "cortex_r4_load_1_2,cortex_r4_load_3_4")
18197 +
18198 +(define_bypass 4 "cortex_r4_mul_3,cortex_r4_mla_3,cortex_r4_smlald"
18199 + "cortex_r4_load_1_2,cortex_r4_load_3_4")
18200 +
18201 +(define_bypass 5 "cortex_r4_mul_4,cortex_r4_mla_4,cortex_r4_mull"
18202 + "cortex_r4_load_1_2,cortex_r4_load_3_4")
18203 +
18204 +;; Store instructions.
18205 +
18206 +(define_insn_reservation "cortex_r4_store_1_2" 0
18207 + (and (eq_attr "tune_cortexr4" "yes")
18208 + (eq_attr "type" "store1,store2"))
18209 + "cortex_r4_load_store")
18210 +
18211 +(define_insn_reservation "cortex_r4_store_3_4" 0
18212 + (and (eq_attr "tune_cortexr4" "yes")
18213 + (eq_attr "type" "store3,store4"))
18214 + "cortex_r4_load_store_2")
18215 +
18216 --- /dev/null
18217 +++ b/gcc/config/arm/cortex-r4f.md
18218 @@ -0,0 +1,161 @@
18219 +;; ARM Crotex-R4F VFP pipeline description
18220 +;; Copyright (C) 2007 Free Software Foundation, Inc.
18221 +;; Written by CodeSourcery.
18222 +;;
18223 +;; This file is part of GCC.
18224 +;;
18225 +;; GCC is free software; you can redistribute it and/or modify it
18226 +;; under the terms of the GNU General Public License as published by
18227 +;; the Free Software Foundation; either version 3, or (at your option)
18228 +;; any later version.
18229 +;;
18230 +;; GCC is distributed in the hope that it will be useful, but
18231 +;; WITHOUT ANY WARRANTY; without even the implied warranty of
18232 +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18233 +;; General Public License for more details.
18234 +;;
18235 +;; You should have received a copy of the GNU General Public License
18236 +;; along with GCC; see the file COPYING3. If not see
18237 +;; <http://www.gnu.org/licenses/>.
18238 +
18239 +;; With the exception of simple VMOV <freg>, <freg> instructions and
18240 +;; the accululate operand of a multiply-accumulate instruction, all
18241 +;; registers are early registers. Thus base latencies are 1 more than
18242 +;; those listed in the TRM.
18243 +
18244 +;; We use the A, B abd C units from the integer core, plus two additional
18245 +;; units to enforce VFP dual issue constraints.
18246 +
18247 +;; A B C V1 VMLA
18248 +;; fcpy 1 2
18249 +;; farith 1 2 1
18250 +;; fmrc 1 2
18251 +;; fconst 1 2 * *
18252 +;; ffarith 1 2 * *
18253 +;; fmac 1 2 1 2
18254 +;; fdiv 1 2 *
18255 +;; f_loads * * *
18256 +;; f_stores * * *
18257 +
18258 +(define_cpu_unit "cortex_r4_v1" "cortex_r4")
18259 +
18260 +(define_cpu_unit "cortex_r4_vmla" "cortex_r4")
18261 +
18262 +(define_reservation "cortex_r4_issue_ab"
18263 + "(cortex_r4_issue_a|cortex_r4_issue_b)")
18264 +(define_reservation "cortex_r4_single_issue"
18265 + "cortex_r4_issue_a+cortex_r4_issue_b")
18266 +
18267 +(define_insn_reservation "cortex_r4_fcpys" 2
18268 + (and (eq_attr "tune_cortexr4" "yes")
18269 + (eq_attr "type" "fcpys"))
18270 + "cortex_r4_issue_ab")
18271 +
18272 +(define_insn_reservation "cortex_r4_ffariths" 2
18273 + (and (eq_attr "tune_cortexr4" "yes")
18274 + (eq_attr "type" "ffariths,fconsts,fcmps"))
18275 + "cortex_r4_issue_ab+cortex_r4_issue_c+cortex_r4_v1")
18276 +
18277 +(define_insn_reservation "cortex_r4_fariths" 3
18278 + (and (eq_attr "tune_cortexr4" "yes")
18279 + (eq_attr "type" "fadds,fmuls"))
18280 + "(cortex_r4_issue_a+cortex_r4_v1)|cortex_r4_issue_b")
18281 +
18282 +(define_insn_reservation "cortex_r4_fmacs" 6
18283 + (and (eq_attr "tune_cortexr4" "yes")
18284 + (eq_attr "type" "fmacs"))
18285 + "(cortex_r4_issue_a+cortex_r4_v1)|(cortex_r4_issue_b+cortex_r4_vmla)")
18286 +
18287 +(define_insn_reservation "cortex_r4_fdivs" 17
18288 + (and (eq_attr "tune_cortexr4" "yes")
18289 + (eq_attr "type" "fdivs"))
18290 + "cortex_r4_issue_ab+cortex_r4_v1,cortex_r4_issue_a+cortex_r4_v1")
18291 +
18292 +(define_insn_reservation "cortex_r4_floads" 2
18293 + (and (eq_attr "tune_cortexr4" "yes")
18294 + (eq_attr "type" "f_loads"))
18295 + "cortex_r4_issue_a+cortex_r4_issue_c+cortex_r4_v1")
18296 +
18297 +(define_insn_reservation "cortex_r4_fstores" 1
18298 + (and (eq_attr "tune_cortexr4" "yes")
18299 + (eq_attr "type" "f_stores"))
18300 + "cortex_r4_issue_a+cortex_r4_issue_c+cortex_r4_vmla")
18301 +
18302 +(define_insn_reservation "cortex_r4_mcr" 2
18303 + (and (eq_attr "tune_cortexr4" "yes")
18304 + (eq_attr "type" "r_2_f"))
18305 + "cortex_r4_issue_ab")
18306 +
18307 +(define_insn_reservation "cortex_r4_mrc" 3
18308 + (and (eq_attr "tune_cortexr4" "yes")
18309 + (eq_attr "type" "f_2_r"))
18310 + "cortex_r4_issue_ab")
18311 +
18312 +;; Bypasses for normal (not early) regs.
18313 +(define_bypass 1 "cortex_r4_ffariths,cortex_r4_fcpys,cortex_r4_mcr"
18314 + "cortex_r4_fcpys")
18315 +(define_bypass 2 "cortex_r4_fariths"
18316 + "cortex_r4_fcpys")
18317 +(define_bypass 5 "cortex_r4_fmacs"
18318 + "cortex_r4_fcpys")
18319 +(define_bypass 16 "cortex_r4_fdivs"
18320 + "cortex_r4_fcpys")
18321 +
18322 +(define_bypass 1 "cortex_r4_ffariths,cortex_r4_fcpys,cortex_r4_mcr"
18323 + "cortex_r4_fmacs"
18324 + "arm_no_early_mul_dep")
18325 +(define_bypass 2 "cortex_r4_fariths"
18326 + "cortex_r4_fmacs"
18327 + "arm_no_early_mul_dep")
18328 +;; mac->mac has an extra forwarding path.
18329 +(define_bypass 3 "cortex_r4_fmacs"
18330 + "cortex_r4_fmacs"
18331 + "arm_no_early_mul_dep")
18332 +(define_bypass 16 "cortex_r4_fdivs"
18333 + "cortex_r4_fmacs"
18334 + "arm_no_early_mul_dep")
18335 +
18336 +;; Double precision operations. These can not dual issue.
18337 +
18338 +(define_insn_reservation "cortex_r4_fmacd" 20
18339 + (and (eq_attr "tune_cortexr4" "yes")
18340 + (eq_attr "type" "fmacd"))
18341 + "cortex_r4_single_issue*13")
18342 +
18343 +(define_insn_reservation "cortex_r4_farith" 10
18344 + (and (eq_attr "tune_cortexr4" "yes")
18345 + (eq_attr "type" "faddd,fmuld"))
18346 + "cortex_r4_single_issue*3")
18347 +
18348 +;; FIXME: The short cycle count suggests these instructions complete
18349 +;; out of order. Chances are this is not a pipelined operation.
18350 +(define_insn_reservation "cortex_r4_fdivd" 97
18351 + (and (eq_attr "tune_cortexr4" "yes")
18352 + (eq_attr "type" "fdivd"))
18353 + "cortex_r4_single_issue*3")
18354 +
18355 +(define_insn_reservation "cortex_r4_ffarithd" 2
18356 + (and (eq_attr "tune_cortexr4" "yes")
18357 + (eq_attr "type" "ffarithd,fconstd"))
18358 + "cortex_r4_single_issue")
18359 +
18360 +(define_insn_reservation "cortex_r4_fcmpd" 2
18361 + (and (eq_attr "tune_cortexr4" "yes")
18362 + (eq_attr "type" "fcmpd"))
18363 + "cortex_r4_single_issue*2")
18364 +
18365 +(define_insn_reservation "cortex_r4_f_cvt" 8
18366 + (and (eq_attr "tune_cortexr4" "yes")
18367 + (eq_attr "type" "f_cvt"))
18368 + "cortex_r4_single_issue*3")
18369 +
18370 +(define_insn_reservation "cortex_r4_f_memd" 8
18371 + (and (eq_attr "tune_cortexr4" "yes")
18372 + (eq_attr "type" "f_loadd,f_stored"))
18373 + "cortex_r4_single_issue")
18374 +
18375 +(define_insn_reservation "cortex_r4_f_flag" 1
18376 + (and (eq_attr "tune_cortexr4" "yes")
18377 + (eq_attr "type" "f_stores"))
18378 + "cortex_r4_single_issue")
18379 +
18380 --- a/gcc/config/arm/crti.asm
18381 +++ b/gcc/config/arm/crti.asm
18382 @@ -64,8 +64,6 @@
18383 #endif
18384 .endm
18385
18386 - .file "crti.asm"
18387 -
18388 .section ".init"
18389 .align 2
18390 .global _init
18391 --- a/gcc/config/arm/crtn.asm
18392 +++ b/gcc/config/arm/crtn.asm
18393 @@ -72,8 +72,6 @@
18394 .endm
18395
18396
18397 - .file "crtn.asm"
18398 -
18399 .section ".init"
18400 ;;
18401 FUNC_END
18402 --- a/gcc/config/arm/elf.h
18403 +++ b/gcc/config/arm/elf.h
18404 @@ -145,3 +145,17 @@
18405 } \
18406 while (0)
18407
18408 +/* Horrible hack: We want to prevent some libgcc routines being included
18409 + for some multilibs. */
18410 +#ifndef __ARM_ARCH_6M__
18411 +#undef L_fixdfsi
18412 +#undef L_fixunsdfsi
18413 +#undef L_truncdfsf2
18414 +#undef L_fixsfsi
18415 +#undef L_fixunssfsi
18416 +#undef L_floatdidf
18417 +#undef L_floatdisf
18418 +#undef L_floatundidf
18419 +#undef L_floatundisf
18420 +#endif
18421 +
18422 --- /dev/null
18423 +++ b/gcc/config/arm/fp16.c
18424 @@ -0,0 +1,150 @@
18425 +/* Half-float conversion routines.
18426 +
18427 + Copyright (C) 2008 Free Software Foundation, Inc.
18428 + Contributed by CodeSourcery.
18429 +
18430 + This file is free software; you can redistribute it and/or modify it
18431 + under the terms of the GNU General Public License as published by the
18432 + Free Software Foundation; either version 2, or (at your option) any
18433 + later version.
18434 +
18435 + In addition to the permissions in the GNU General Public License, the
18436 + Free Software Foundation gives you unlimited permission to link the
18437 + compiled version of this file into combinations with other programs,
18438 + and to distribute those combinations without any restriction coming
18439 + from the use of this file. (The General Public License restrictions
18440 + do apply in other respects; for example, they cover modification of
18441 + the file, and distribution when not linked into a combine
18442 + executable.)
18443 +
18444 + This file is distributed in the hope that it will be useful, but
18445 + WITHOUT ANY WARRANTY; without even the implied warranty of
18446 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18447 + General Public License for more details.
18448 +
18449 + You should have received a copy of the GNU General Public License
18450 + along with this program; see the file COPYING. If not, write to
18451 + the Free Software Foundation, 51 Franklin Street, Fifth Floor,
18452 + Boston, MA 02110-1301, USA. */
18453 +
18454 +static inline unsigned short
18455 +__gnu_f2h_internal(unsigned int a, int ieee)
18456 +{
18457 + unsigned short sign = (a >> 16) & 0x8000;
18458 + int aexp = (a >> 23) & 0xff;
18459 + unsigned int mantissa = a & 0x007fffff;
18460 + unsigned int mask;
18461 + unsigned int increment;
18462 +
18463 + if (aexp == 0xff)
18464 + {
18465 + if (!ieee)
18466 + return sign;
18467 + return sign | 0x7e00 | (mantissa >> 13);
18468 + }
18469 +
18470 + if (aexp == 0 && mantissa == 0)
18471 + return sign;
18472 +
18473 + aexp -= 127;
18474 +
18475 + /* Decimal point between bits 22 and 23. */
18476 + mantissa |= 0x00800000;
18477 + if (aexp < -14)
18478 + {
18479 + mask = 0x007fffff;
18480 + if (aexp < -25)
18481 + aexp = -26;
18482 + else if (aexp != -25)
18483 + mask >>= 24 + aexp;
18484 + }
18485 + else
18486 + mask = 0x00001fff;
18487 +
18488 + /* Round. */
18489 + if (mantissa & mask)
18490 + {
18491 + increment = (mask + 1) >> 1;
18492 + if ((mantissa & mask) == increment)
18493 + increment = mantissa & (increment << 1);
18494 + mantissa += increment;
18495 + if (mantissa >= 0x01000000)
18496 + {
18497 + mantissa >>= 1;
18498 + aexp++;
18499 + }
18500 + }
18501 +
18502 + if (ieee)
18503 + {
18504 + if (aexp > 15)
18505 + return sign | 0x7c00;
18506 + }
18507 + else
18508 + {
18509 + if (aexp > 16)
18510 + return sign | 0x7fff;
18511 + }
18512 +
18513 + if (aexp < -24)
18514 + return sign;
18515 +
18516 + if (aexp < -14)
18517 + {
18518 + mantissa >>= -14 - aexp;
18519 + aexp = -14;
18520 + }
18521 +
18522 + /* We leave the leading 1 in the mantissa, and subtract one
18523 + from the exponent bias to compensate. */
18524 + return sign | (((aexp + 14) << 10) + (mantissa >> 13));
18525 +}
18526 +
18527 +unsigned int
18528 +__gnu_h2f_internal(unsigned short a, int ieee)
18529 +{
18530 + unsigned int sign = (unsigned int)(a & 0x8000) << 16;
18531 + int aexp = (a >> 10) & 0x1f;
18532 + unsigned int mantissa = a & 0x3ff;
18533 +
18534 + if (aexp == 0x1f && ieee)
18535 + return sign | 0x7f800000 | (mantissa << 13);
18536 +
18537 + if (aexp == 0)
18538 + {
18539 + int shift;
18540 +
18541 + if (mantissa == 0)
18542 + return sign;
18543 +
18544 + shift = __builtin_clz(mantissa) - 21;
18545 + mantissa <<= shift;
18546 + aexp = -shift;
18547 + }
18548 +
18549 + return sign | (((aexp + 0x70) << 23) + (mantissa << 13));
18550 +}
18551 +
18552 +unsigned short
18553 +__gnu_f2h_ieee(unsigned int a)
18554 +{
18555 + return __gnu_f2h_internal(a, 1);
18556 +}
18557 +
18558 +unsigned int
18559 +__gnu_h2f_ieee(unsigned short a)
18560 +{
18561 + return __gnu_h2f_internal(a, 1);
18562 +}
18563 +
18564 +unsigned short
18565 +__gnu_f2h_alternative(unsigned int x)
18566 +{
18567 + return __gnu_f2h_internal(x, 0);
18568 +}
18569 +
18570 +unsigned int
18571 +__gnu_h2f_alternative(unsigned short a)
18572 +{
18573 + return __gnu_h2f_internal(a, 0);
18574 +}
18575 --- /dev/null
18576 +++ b/gcc/config/arm/hwdiv.md
18577 @@ -0,0 +1,40 @@
18578 +;; ARM instruction patterns for hardware division
18579 +;; Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
18580 +;; Written by CodeSourcery, LLC.
18581 +;;
18582 +;; This file is part of GCC.
18583 +
18584 +;; GCC is free software; you can redistribute it and/or modify it
18585 +;; under the terms of the GNU General Public License as published
18586 +;; by the Free Software Foundation; either version 3, or (at your
18587 +;; option) any later version.
18588 +
18589 +;; GCC is distributed in the hope that it will be useful, but WITHOUT
18590 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18591 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18592 +;; License for more details.
18593 +
18594 +;; You should have received a copy of the GNU General Public License
18595 +;; along with GCC; see the file COPYING3. If not see
18596 +;; <http://www.gnu.org/licenses/>.
18597 +
18598 +(define_insn "divsi3"
18599 + [(set (match_operand:SI 0 "s_register_operand" "=r")
18600 + (div:SI (match_operand:SI 1 "s_register_operand" "r")
18601 + (match_operand:SI 2 "s_register_operand" "r")))]
18602 + "arm_arch_hwdiv"
18603 + "sdiv%?\t%0, %1, %2"
18604 + [(set_attr "predicable" "yes")
18605 + (set_attr "insn" "sdiv")]
18606 +)
18607 +
18608 +(define_insn "udivsi3"
18609 + [(set (match_operand:SI 0 "s_register_operand" "=r")
18610 + (udiv:SI (match_operand:SI 1 "s_register_operand" "r")
18611 + (match_operand:SI 2 "s_register_operand" "r")))]
18612 + "arm_arch_hwdiv"
18613 + "udiv%?\t%0, %1, %2"
18614 + [(set_attr "predicable" "yes")
18615 + (set_attr "insn" "udiv")]
18616 +)
18617 +
18618 --- a/gcc/config/arm/ieee754-df.S
18619 +++ b/gcc/config/arm/ieee754-df.S
18620 @@ -56,7 +56,7 @@
18621 #endif
18622
18623
18624 -#ifdef L_negdf2
18625 +#ifdef L_arm_negdf2
18626
18627 ARM_FUNC_START negdf2
18628 ARM_FUNC_ALIAS aeabi_dneg negdf2
18629 @@ -70,7 +70,7 @@ ARM_FUNC_ALIAS aeabi_dneg negdf2
18630
18631 #endif
18632
18633 -#ifdef L_addsubdf3
18634 +#ifdef L_arm_addsubdf3
18635
18636 ARM_FUNC_START aeabi_drsub
18637
18638 @@ -88,7 +88,7 @@ ARM_FUNC_ALIAS aeabi_dsub subdf3
18639 ARM_FUNC_START adddf3
18640 ARM_FUNC_ALIAS aeabi_dadd adddf3
18641
18642 -1: do_push {r4, r5, lr}
18643 +1: do_push (r4, r5, lr)
18644
18645 @ Look for zeroes, equal values, INF, or NAN.
18646 shift1 lsl, r4, xh, #1
18647 @@ -432,7 +432,7 @@ ARM_FUNC_ALIAS aeabi_ui2d floatunsidf
18648 do_it eq, t
18649 moveq r1, #0
18650 RETc(eq)
18651 - do_push {r4, r5, lr}
18652 + do_push (r4, r5, lr)
18653 mov r4, #0x400 @ initial exponent
18654 add r4, r4, #(52-1 - 1)
18655 mov r5, #0 @ sign bit is 0
18656 @@ -452,7 +452,7 @@ ARM_FUNC_ALIAS aeabi_i2d floatsidf
18657 do_it eq, t
18658 moveq r1, #0
18659 RETc(eq)
18660 - do_push {r4, r5, lr}
18661 + do_push (r4, r5, lr)
18662 mov r4, #0x400 @ initial exponent
18663 add r4, r4, #(52-1 - 1)
18664 ands r5, r0, #0x80000000 @ sign bit in r5
18665 @@ -486,7 +486,7 @@ ARM_FUNC_ALIAS aeabi_f2d extendsfdf2
18666 RETc(eq) @ we are done already.
18667
18668 @ value was denormalized. We can normalize it now.
18669 - do_push {r4, r5, lr}
18670 + do_push (r4, r5, lr)
18671 mov r4, #0x380 @ setup corresponding exponent
18672 and r5, xh, #0x80000000 @ move sign bit in r5
18673 bic xh, xh, #0x80000000
18674 @@ -513,9 +513,9 @@ ARM_FUNC_ALIAS aeabi_ul2d floatundidf
18675 @ compatibility.
18676 adr ip, LSYM(f0_ret)
18677 @ Push pc as well so that RETLDM works correctly.
18678 - do_push {r4, r5, ip, lr, pc}
18679 + do_push (r4, r5, ip, lr, pc)
18680 #else
18681 - do_push {r4, r5, lr}
18682 + do_push (r4, r5, lr)
18683 #endif
18684
18685 mov r5, #0
18686 @@ -539,9 +539,9 @@ ARM_FUNC_ALIAS aeabi_l2d floatdidf
18687 @ compatibility.
18688 adr ip, LSYM(f0_ret)
18689 @ Push pc as well so that RETLDM works correctly.
18690 - do_push {r4, r5, ip, lr, pc}
18691 + do_push (r4, r5, ip, lr, pc)
18692 #else
18693 - do_push {r4, r5, lr}
18694 + do_push (r4, r5, lr)
18695 #endif
18696
18697 ands r5, ah, #0x80000000 @ sign bit in r5
18698 @@ -590,7 +590,7 @@ ARM_FUNC_ALIAS aeabi_l2d floatdidf
18699 @ Legacy code expects the result to be returned in f0. Copy it
18700 @ there as well.
18701 LSYM(f0_ret):
18702 - do_push {r0, r1}
18703 + do_push (r0, r1)
18704 ldfd f0, [sp], #8
18705 RETLDM
18706
18707 @@ -603,11 +603,11 @@ LSYM(f0_ret):
18708
18709 #endif /* L_addsubdf3 */
18710
18711 -#ifdef L_muldivdf3
18712 +#ifdef L_arm_muldivdf3
18713
18714 ARM_FUNC_START muldf3
18715 ARM_FUNC_ALIAS aeabi_dmul muldf3
18716 - do_push {r4, r5, r6, lr}
18717 + do_push (r4, r5, r6, lr)
18718
18719 @ Mask out exponents, trap any zero/denormal/INF/NAN.
18720 mov ip, #0xff
18721 @@ -840,7 +840,7 @@ LSYM(Lml_d):
18722 orr xh, xh, r6
18723 teq r5, #0
18724 do_it ne
18725 - movne pc, lr
18726 + RETc(ne)
18727 2: and r6, yh, #0x80000000
18728 3: movs yl, yl, lsl #1
18729 adc yh, yh, yh
18730 @@ -849,7 +849,7 @@ LSYM(Lml_d):
18731 subeq r5, r5, #1
18732 beq 3b
18733 orr yh, yh, r6
18734 - mov pc, lr
18735 + RET
18736
18737 LSYM(Lml_s):
18738 @ Isolate the INF and NAN cases away
18739 @@ -915,7 +915,7 @@ LSYM(Lml_n):
18740 ARM_FUNC_START divdf3
18741 ARM_FUNC_ALIAS aeabi_ddiv divdf3
18742
18743 - do_push {r4, r5, r6, lr}
18744 + do_push (r4, r5, r6, lr)
18745
18746 @ Mask out exponents, trap any zero/denormal/INF/NAN.
18747 mov ip, #0xff
18748 @@ -1103,7 +1103,7 @@ LSYM(Ldv_s):
18749
18750 #endif /* L_muldivdf3 */
18751
18752 -#ifdef L_cmpdf2
18753 +#ifdef L_arm_cmpdf2
18754
18755 @ Note: only r0 (return value) and ip are clobbered here.
18756
18757 @@ -1122,7 +1122,7 @@ ARM_FUNC_ALIAS nedf2 cmpdf2
18758 ARM_FUNC_ALIAS eqdf2 cmpdf2
18759 mov ip, #1 @ how should we specify unordered here?
18760
18761 -1: str ip, [sp, #-4]
18762 +1: str ip, [sp, #-4]!
18763
18764 @ Trap any INF/NAN first.
18765 mov ip, xh, lsl #1
18766 @@ -1134,7 +1134,8 @@ ARM_FUNC_ALIAS eqdf2 cmpdf2
18767
18768 @ Test for equality.
18769 @ Note that 0.0 is equal to -0.0.
18770 -2: orrs ip, xl, xh, lsl #1 @ if x == 0.0 or -0.0
18771 +2: add sp, sp, #4
18772 + orrs ip, xl, xh, lsl #1 @ if x == 0.0 or -0.0
18773 do_it eq, e
18774 COND(orr,s,eq) ip, yl, yh, lsl #1 @ and y == 0.0 or -0.0
18775 teqne xh, yh @ or xh == yh
18776 @@ -1173,7 +1174,7 @@ ARM_FUNC_ALIAS eqdf2 cmpdf2
18777 bne 2b
18778 orrs ip, yl, yh, lsl #12
18779 beq 2b @ y is not NAN
18780 -5: ldr r0, [sp, #-4] @ unordered return code
18781 +5: ldr r0, [sp], #4 @ unordered return code
18782 RET
18783
18784 FUNC_END gedf2
18785 @@ -1199,7 +1200,7 @@ ARM_FUNC_ALIAS aeabi_cdcmple aeabi_cdcmp
18786
18787 @ The status-returning routines are required to preserve all
18788 @ registers except ip, lr, and cpsr.
18789 -6: do_push {r0, lr}
18790 +6: do_push (r0, lr)
18791 ARM_CALL cmpdf2
18792 @ Set the Z flag correctly, and the C flag unconditionally.
18793 cmp r0, #0
18794 @@ -1271,7 +1272,7 @@ ARM_FUNC_START aeabi_dcmpgt
18795
18796 #endif /* L_cmpdf2 */
18797
18798 -#ifdef L_unorddf2
18799 +#ifdef L_arm_unorddf2
18800
18801 ARM_FUNC_START unorddf2
18802 ARM_FUNC_ALIAS aeabi_dcmpun unorddf2
18803 @@ -1297,7 +1298,7 @@ ARM_FUNC_ALIAS aeabi_dcmpun unorddf2
18804
18805 #endif /* L_unorddf2 */
18806
18807 -#ifdef L_fixdfsi
18808 +#ifdef L_arm_fixdfsi
18809
18810 ARM_FUNC_START fixdfsi
18811 ARM_FUNC_ALIAS aeabi_d2iz fixdfsi
18812 @@ -1339,7 +1340,7 @@ ARM_FUNC_ALIAS aeabi_d2iz fixdfsi
18813
18814 #endif /* L_fixdfsi */
18815
18816 -#ifdef L_fixunsdfsi
18817 +#ifdef L_arm_fixunsdfsi
18818
18819 ARM_FUNC_START fixunsdfsi
18820 ARM_FUNC_ALIAS aeabi_d2uiz fixunsdfsi
18821 @@ -1377,7 +1378,7 @@ ARM_FUNC_ALIAS aeabi_d2uiz fixunsdfsi
18822
18823 #endif /* L_fixunsdfsi */
18824
18825 -#ifdef L_truncdfsf2
18826 +#ifdef L_arm_truncdfsf2
18827
18828 ARM_FUNC_START truncdfsf2
18829 ARM_FUNC_ALIAS aeabi_d2f truncdfsf2
18830 --- a/gcc/config/arm/ieee754-sf.S
18831 +++ b/gcc/config/arm/ieee754-sf.S
18832 @@ -38,7 +38,7 @@
18833 * if necessary without impacting performances.
18834 */
18835
18836 -#ifdef L_negsf2
18837 +#ifdef L_arm_negsf2
18838
18839 ARM_FUNC_START negsf2
18840 ARM_FUNC_ALIAS aeabi_fneg negsf2
18841 @@ -51,7 +51,7 @@ ARM_FUNC_ALIAS aeabi_fneg negsf2
18842
18843 #endif
18844
18845 -#ifdef L_addsubsf3
18846 +#ifdef L_arm_addsubsf3
18847
18848 ARM_FUNC_START aeabi_frsub
18849
18850 @@ -448,7 +448,7 @@ LSYM(f0_ret):
18851
18852 #endif /* L_addsubsf3 */
18853
18854 -#ifdef L_muldivsf3
18855 +#ifdef L_arm_muldivsf3
18856
18857 ARM_FUNC_START mulsf3
18858 ARM_FUNC_ALIAS aeabi_fmul mulsf3
18859 @@ -486,7 +486,7 @@ LSYM(Lml_x):
18860 and r3, ip, #0x80000000
18861
18862 @ Well, no way to make it shorter without the umull instruction.
18863 - do_push {r3, r4, r5}
18864 + do_push (r3, r4, r5)
18865 mov r4, r0, lsr #16
18866 mov r5, r1, lsr #16
18867 bic r0, r0, r4, lsl #16
18868 @@ -497,7 +497,7 @@ LSYM(Lml_x):
18869 mla r0, r4, r1, r0
18870 adds r3, r3, r0, lsl #16
18871 adc r1, ip, r0, lsr #16
18872 - do_pop {r0, r4, r5}
18873 + do_pop (r0, r4, r5)
18874
18875 #else
18876
18877 @@ -795,7 +795,7 @@ LSYM(Ldv_s):
18878
18879 #endif /* L_muldivsf3 */
18880
18881 -#ifdef L_cmpsf2
18882 +#ifdef L_arm_cmpsf2
18883
18884 @ The return value in r0 is
18885 @
18886 @@ -827,7 +827,7 @@ ARM_FUNC_ALIAS nesf2 cmpsf2
18887 ARM_FUNC_ALIAS eqsf2 cmpsf2
18888 mov ip, #1 @ how should we specify unordered here?
18889
18890 -1: str ip, [sp, #-4]
18891 +1: str ip, [sp, #-4]!
18892
18893 @ Trap any INF/NAN first.
18894 mov r2, r0, lsl #1
18895 @@ -839,7 +839,8 @@ ARM_FUNC_ALIAS eqsf2 cmpsf2
18896
18897 @ Compare values.
18898 @ Note that 0.0 is equal to -0.0.
18899 -2: orrs ip, r2, r3, lsr #1 @ test if both are 0, clear C flag
18900 +2: add sp, sp, #4
18901 + orrs ip, r2, r3, lsr #1 @ test if both are 0, clear C flag
18902 do_it ne
18903 teqne r0, r1 @ if not 0 compare sign
18904 do_it pl
18905 @@ -863,7 +864,7 @@ ARM_FUNC_ALIAS eqsf2 cmpsf2
18906 bne 2b
18907 movs ip, r1, lsl #9
18908 beq 2b @ r1 is not NAN
18909 -5: ldr r0, [sp, #-4] @ return unordered code.
18910 +5: ldr r0, [sp], #4 @ return unordered code.
18911 RET
18912
18913 FUNC_END gesf2
18914 @@ -886,7 +887,7 @@ ARM_FUNC_ALIAS aeabi_cfcmple aeabi_cfcmp
18915
18916 @ The status-returning routines are required to preserve all
18917 @ registers except ip, lr, and cpsr.
18918 -6: do_push {r0, r1, r2, r3, lr}
18919 +6: do_push (r0, r1, r2, r3, lr)
18920 ARM_CALL cmpsf2
18921 @ Set the Z flag correctly, and the C flag unconditionally.
18922 cmp r0, #0
18923 @@ -958,7 +959,7 @@ ARM_FUNC_START aeabi_fcmpgt
18924
18925 #endif /* L_cmpsf2 */
18926
18927 -#ifdef L_unordsf2
18928 +#ifdef L_arm_unordsf2
18929
18930 ARM_FUNC_START unordsf2
18931 ARM_FUNC_ALIAS aeabi_fcmpun unordsf2
18932 @@ -983,7 +984,7 @@ ARM_FUNC_ALIAS aeabi_fcmpun unordsf2
18933
18934 #endif /* L_unordsf2 */
18935
18936 -#ifdef L_fixsfsi
18937 +#ifdef L_arm_fixsfsi
18938
18939 ARM_FUNC_START fixsfsi
18940 ARM_FUNC_ALIAS aeabi_f2iz fixsfsi
18941 @@ -1025,7 +1026,7 @@ ARM_FUNC_ALIAS aeabi_f2iz fixsfsi
18942
18943 #endif /* L_fixsfsi */
18944
18945 -#ifdef L_fixunssfsi
18946 +#ifdef L_arm_fixunssfsi
18947
18948 ARM_FUNC_START fixunssfsi
18949 ARM_FUNC_ALIAS aeabi_f2uiz fixunssfsi
18950 --- a/gcc/config/arm/iwmmxt.md
18951 +++ b/gcc/config/arm/iwmmxt.md
18952 @@ -105,8 +105,8 @@
18953 )
18954
18955 (define_insn "*iwmmxt_movsi_insn"
18956 - [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r, m,z,r,?z,Uy,z")
18957 - (match_operand:SI 1 "general_operand" "rI,K,mi,r,r,z,Uy,z,z"))]
18958 + [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,rk, m,z,r,?z,Uy,z")
18959 + (match_operand:SI 1 "general_operand" "rk, I,K,mi,rk,r,z,Uy,z, z"))]
18960 "TARGET_REALLY_IWMMXT
18961 && ( register_operand (operands[0], SImode)
18962 || register_operand (operands[1], SImode))"
18963 @@ -114,19 +114,20 @@
18964 switch (which_alternative)
18965 {
18966 case 0: return \"mov\\t%0, %1\";
18967 - case 1: return \"mvn\\t%0, #%B1\";
18968 - case 2: return \"ldr\\t%0, %1\";
18969 - case 3: return \"str\\t%1, %0\";
18970 - case 4: return \"tmcr\\t%0, %1\";
18971 - case 5: return \"tmrc\\t%0, %1\";
18972 - case 6: return arm_output_load_gr (operands);
18973 - case 7: return \"wstrw\\t%1, %0\";
18974 + case 1: return \"mov\\t%0, %1\";
18975 + case 2: return \"mvn\\t%0, #%B1\";
18976 + case 3: return \"ldr\\t%0, %1\";
18977 + case 4: return \"str\\t%1, %0\";
18978 + case 5: return \"tmcr\\t%0, %1\";
18979 + case 6: return \"tmrc\\t%0, %1\";
18980 + case 7: return arm_output_load_gr (operands);
18981 + case 8: return \"wstrw\\t%1, %0\";
18982 default:return \"wstrw\\t%1, [sp, #-4]!\;wldrw\\t%0, [sp], #4\\t@move CG reg\";
18983 }"
18984 - [(set_attr "type" "*,*,load1,store1,*,*,load1,store1,*")
18985 - (set_attr "length" "*,*,*, *,*,*, 16, *,8")
18986 - (set_attr "pool_range" "*,*,4096, *,*,*,1024, *,*")
18987 - (set_attr "neg_pool_range" "*,*,4084, *,*,*, *, 1012,*")
18988 + [(set_attr "type" "*,*,*,load1,store1,*,*,load1,store1,*")
18989 + (set_attr "length" "*,*,*,*, *,*,*, 16, *,8")
18990 + (set_attr "pool_range" "*,*,*,4096, *,*,*,1024, *,*")
18991 + (set_attr "neg_pool_range" "*,*,*,4084, *,*,*, *, 1012,*")
18992 ;; Note - the "predicable" attribute is not allowed to have alternatives.
18993 ;; Since the wSTRw wCx instruction is not predicable, we cannot support
18994 ;; predicating any of the alternatives in this template. Instead,
18995 @@ -166,9 +167,9 @@
18996 (set_attr "neg_pool_range" "*,*,4084, *,*,*")]
18997 )
18998
18999 -(define_insn "movv8qi_internal"
19000 - [(set (match_operand:V8QI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r,?m")
19001 - (match_operand:V8QI 1 "general_operand" "y,y,mi,y,r,r,mi,r"))]
19002 +(define_insn "mov<mode>_internal"
19003 + [(set (match_operand:VMMX 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r,?m")
19004 + (match_operand:VMMX 1 "general_operand" "y,y,mi,y,r,r,mi,r"))]
19005 "TARGET_REALLY_IWMMXT"
19006 "*
19007 switch (which_alternative)
19008 @@ -187,64 +188,6 @@
19009 (set_attr "pool_range" "*, *, 256,*,*,*, 256,*")
19010 (set_attr "neg_pool_range" "*, *, 244,*,*,*, 244,*")])
19011
19012 -(define_insn "movv4hi_internal"
19013 - [(set (match_operand:V4HI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r,?m")
19014 - (match_operand:V4HI 1 "general_operand" "y,y,mi,y,r,r,mi,r"))]
19015 - "TARGET_REALLY_IWMMXT"
19016 - "*
19017 - switch (which_alternative)
19018 - {
19019 - case 0: return \"wmov%?\\t%0, %1\";
19020 - case 1: return \"wstrd%?\\t%1, %0\";
19021 - case 2: return \"wldrd%?\\t%0, %1\";
19022 - case 3: return \"tmrrc%?\\t%Q0, %R0, %1\";
19023 - case 4: return \"tmcrr%?\\t%0, %Q1, %R1\";
19024 - case 5: return \"#\";
19025 - default: return output_move_double (operands);
19026 - }"
19027 - [(set_attr "predicable" "yes")
19028 - (set_attr "length" "4, 4, 4,4,4,8, 8,8")
19029 - (set_attr "type" "*,store1,load1,*,*,*,load1,store1")
19030 - (set_attr "pool_range" "*, *, 256,*,*,*, 256,*")
19031 - (set_attr "neg_pool_range" "*, *, 244,*,*,*, 244,*")])
19032 -
19033 -(define_insn "movv2si_internal"
19034 - [(set (match_operand:V2SI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r,?m")
19035 - (match_operand:V2SI 1 "general_operand" "y,y,mi,y,r,r,mi,r"))]
19036 - "TARGET_REALLY_IWMMXT"
19037 - "*
19038 - switch (which_alternative)
19039 - {
19040 - case 0: return \"wmov%?\\t%0, %1\";
19041 - case 1: return \"wstrd%?\\t%1, %0\";
19042 - case 2: return \"wldrd%?\\t%0, %1\";
19043 - case 3: return \"tmrrc%?\\t%Q0, %R0, %1\";
19044 - case 4: return \"tmcrr%?\\t%0, %Q1, %R1\";
19045 - case 5: return \"#\";
19046 - default: return output_move_double (operands);
19047 - }"
19048 - [(set_attr "predicable" "yes")
19049 - (set_attr "length" "4, 4, 4,4,4,8, 24,8")
19050 - (set_attr "type" "*,store1,load1,*,*,*,load1,store1")
19051 - (set_attr "pool_range" "*, *, 256,*,*,*, 256,*")
19052 - (set_attr "neg_pool_range" "*, *, 244,*,*,*, 244,*")])
19053 -
19054 -;; This pattern should not be needed. It is to match a
19055 -;; wierd case generated by GCC when no optimizations are
19056 -;; enabled. (Try compiling gcc/testsuite/gcc.c-torture/
19057 -;; compile/simd-5.c at -O0). The mode for operands[1] is
19058 -;; deliberately omitted.
19059 -(define_insn "movv2si_internal_2"
19060 - [(set (match_operand:V2SI 0 "nonimmediate_operand" "=?r")
19061 - (match_operand 1 "immediate_operand" "mi"))]
19062 - "TARGET_REALLY_IWMMXT"
19063 - "* return output_move_double (operands);"
19064 - [(set_attr "predicable" "yes")
19065 - (set_attr "length" "8")
19066 - (set_attr "type" "load1")
19067 - (set_attr "pool_range" "256")
19068 - (set_attr "neg_pool_range" "244")])
19069 -
19070 ;; Vector add/subtract
19071
19072 (define_insn "*add<mode>3_iwmmxt"
19073 --- a/gcc/config/arm/lib1funcs.asm
19074 +++ b/gcc/config/arm/lib1funcs.asm
19075 @@ -94,7 +94,8 @@ Boston, MA 02110-1301, USA. */
19076
19077 #if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
19078 || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
19079 - || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__)
19080 + || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) \
19081 + || defined(__ARM_ARCH_6M__)
19082 # define __ARM_ARCH__ 6
19083 #endif
19084
19085 @@ -237,8 +238,8 @@ LSYM(Lend_fde):
19086 .macro shift1 op, arg0, arg1, arg2
19087 \op \arg0, \arg1, \arg2
19088 .endm
19089 -#define do_push push
19090 -#define do_pop pop
19091 +#define do_push(...) push {__VA_ARGS__}
19092 +#define do_pop(...) pop {__VA_ARGS__}
19093 #define COND(op1, op2, cond) op1 ## op2 ## cond
19094 /* Perform an arithmetic operation with a variable shift operand. This
19095 requires two instructions and a scratch register on Thumb-2. */
19096 @@ -252,24 +253,133 @@ LSYM(Lend_fde):
19097 .macro shift1 op, arg0, arg1, arg2
19098 mov \arg0, \arg1, \op \arg2
19099 .endm
19100 -#define do_push stmfd sp!,
19101 -#define do_pop ldmfd sp!,
19102 +#if defined(__low_irq_latency__)
19103 +#define do_push(...) \
19104 + _buildN1(do_push, _buildC1(__VA_ARGS__))( __VA_ARGS__)
19105 +#define _buildN1(BASE, X) _buildN2(BASE, X)
19106 +#define _buildN2(BASE, X) BASE##X
19107 +#define _buildC1(...) _buildC2(__VA_ARGS__,9,8,7,6,5,4,3,2,1)
19108 +#define _buildC2(a1,a2,a3,a4,a5,a6,a7,a8,a9,c,...) c
19109 +
19110 +#define do_push1(r1) str r1, [sp, #-4]!
19111 +#define do_push2(r1, r2) str r2, [sp, #-4]! ; str r1, [sp, #-4]!
19112 +#define do_push3(r1, r2, r3) str r3, [sp, #-4]! ; str r2, [sp, #-4]!; str r1, [sp, #-4]!
19113 +#define do_push4(r1, r2, r3, r4) \
19114 + do_push3 (r2, r3, r4);\
19115 + do_push1 (r1)
19116 +#define do_push5(r1, r2, r3, r4, r5) \
19117 + do_push4 (r2, r3, r4, r5);\
19118 + do_push1 (r1)
19119 +
19120 +#define do_pop(...) \
19121 +_buildN1(do_pop, _buildC1(__VA_ARGS__))( __VA_ARGS__)
19122 +
19123 +#define do_pop1(r1) ldr r1, [sp], #4
19124 +#define do_pop2(r1, r2) ldr r1, [sp], #4 ; ldr r2, [sp], #4
19125 +#define do_pop3(r1, r2, r3) ldr r1, [sp], #4 ; str r2, [sp], #4; str r3, [sp], #4
19126 +#define do_pop4(r1, r2, r3, r4) \
19127 + do_pop1 (r1);\
19128 + do_pup3 (r2, r3, r4)
19129 +#define do_pop5(r1, r2, r3, r4, r5) \
19130 + do_pop1 (r1);\
19131 + do_pop4 (r2, r3, r4, r5)
19132 +#else
19133 +#define do_push(...) stmfd sp!, { __VA_ARGS__}
19134 +#define do_pop(...) ldmfd sp!, {__VA_ARGS__}
19135 +#endif
19136 +
19137 +
19138 #define COND(op1, op2, cond) op1 ## cond ## op2
19139 .macro shiftop name, dest, src1, src2, shiftop, shiftreg, tmp
19140 \name \dest, \src1, \src2, \shiftop \shiftreg
19141 .endm
19142 #endif
19143
19144 -.macro ARM_LDIV0 name
19145 +#ifdef __ARM_EABI__
19146 +.macro ARM_LDIV0 name signed
19147 + cmp r0, #0
19148 + .ifc \signed, unsigned
19149 + movne r0, #0xffffffff
19150 + .else
19151 + movgt r0, #0x7fffffff
19152 + movlt r0, #0x80000000
19153 + .endif
19154 + b SYM (__aeabi_idiv0) __PLT__
19155 +.endm
19156 +#else
19157 +.macro ARM_LDIV0 name signed
19158 str lr, [sp, #-8]!
19159 98: cfi_push 98b - __\name, 0xe, -0x8, 0x8
19160 bl SYM (__div0) __PLT__
19161 mov r0, #0 @ About as wrong as it could be.
19162 RETLDM unwind=98b
19163 .endm
19164 +#endif
19165
19166
19167 -.macro THUMB_LDIV0 name
19168 +#ifdef __ARM_EABI__
19169 +.macro THUMB_LDIV0 name signed
19170 +#if defined(__ARM_ARCH_6M__)
19171 + .ifc \signed, unsigned
19172 + cmp r0, #0
19173 + beq 1f
19174 + mov r0, #0
19175 + mvn r0, r0 @ 0xffffffff
19176 +1:
19177 + .else
19178 + cmp r0, #0
19179 + beq 2f
19180 + blt 3f
19181 + mov r0, #0
19182 + mvn r0, r0
19183 + lsr r0, r0, #1 @ 0x7fffffff
19184 + b 2f
19185 +3: mov r0, #0x80
19186 + lsl r0, r0, #24 @ 0x80000000
19187 +2:
19188 + .endif
19189 + push {r0, r1, r2}
19190 + ldr r0, 4f
19191 + adr r1, 4f
19192 + add r0, r1
19193 + str r0, [sp, #8]
19194 + @ We know we are not on armv4t, so pop pc is safe.
19195 + pop {r0, r1, pc}
19196 + .align 2
19197 +4:
19198 + .word __aeabi_idiv0 - 4b
19199 +#elif defined(__thumb2__)
19200 + .syntax unified
19201 + .ifc \signed, unsigned
19202 + cbz r0, 1f
19203 + mov r0, #0xffffffff
19204 +1:
19205 + .else
19206 + cmp r0, #0
19207 + do_it gt
19208 + movgt r0, #0x7fffffff
19209 + do_it lt
19210 + movlt r0, #0x80000000
19211 + .endif
19212 + b.w SYM(__aeabi_idiv0) __PLT__
19213 +#else
19214 + .align 2
19215 + bx pc
19216 + nop
19217 + .arm
19218 + cmp r0, #0
19219 + .ifc \signed, unsigned
19220 + movne r0, #0xffffffff
19221 + .else
19222 + movgt r0, #0x7fffffff
19223 + movlt r0, #0x80000000
19224 + .endif
19225 + b SYM(__aeabi_idiv0) __PLT__
19226 + .thumb
19227 +#endif
19228 +.endm
19229 +#else
19230 +.macro THUMB_LDIV0 name signed
19231 push { r1, lr }
19232 98: cfi_push 98b - __\name, 0xe, -0x4, 0x8
19233 bl SYM (__div0)
19234 @@ -281,18 +391,19 @@ LSYM(Lend_fde):
19235 pop { r1, pc }
19236 #endif
19237 .endm
19238 +#endif
19239
19240 .macro FUNC_END name
19241 SIZE (__\name)
19242 .endm
19243
19244 -.macro DIV_FUNC_END name
19245 +.macro DIV_FUNC_END name signed
19246 cfi_start __\name, LSYM(Lend_div0)
19247 LSYM(Ldiv0):
19248 #ifdef __thumb__
19249 - THUMB_LDIV0 \name
19250 + THUMB_LDIV0 \name \signed
19251 #else
19252 - ARM_LDIV0 \name
19253 + ARM_LDIV0 \name \signed
19254 #endif
19255 cfi_end LSYM(Lend_div0)
19256 FUNC_END \name
19257 @@ -367,6 +478,9 @@ _L__\name:
19258
19259 #else /* !(__INTERWORKING_STUBS__ || __thumb2__) */
19260
19261 +#ifdef __ARM_ARCH_6M__
19262 +#define EQUIV .thumb_set
19263 +#else
19264 .macro ARM_FUNC_START name
19265 .text
19266 .globl SYM (__\name)
19267 @@ -379,6 +493,7 @@ SYM (__\name):
19268 .macro ARM_CALL name
19269 bl __\name
19270 .endm
19271 +#endif
19272
19273 #endif
19274
19275 @@ -391,6 +506,7 @@ SYM (__\name):
19276 #endif
19277 .endm
19278
19279 +#ifndef __ARM_ARCH_6M__
19280 .macro ARM_FUNC_ALIAS new old
19281 .globl SYM (__\new)
19282 EQUIV SYM (__\new), SYM (__\old)
19283 @@ -398,6 +514,13 @@ SYM (__\name):
19284 .set SYM (_L__\new), SYM (_L__\old)
19285 #endif
19286 .endm
19287 +#endif
19288 +
19289 +#ifdef __ARM_EABI__
19290 +.macro WEAK name
19291 + .weak SYM (__\name)
19292 +.endm
19293 +#endif
19294
19295 #ifdef __thumb__
19296 /* Register aliases. */
19297 @@ -423,6 +546,23 @@ pc .req r15
19298
19299 #if __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__)
19300
19301 +#if defined(__ARM_TUNE_MARVELL_F__)
19302 + clz \curbit, \dividend
19303 + clz \result, \divisor
19304 + sub \curbit, \result, \curbit
19305 + mov \divisor, \divisor, lsl \curbit
19306 + rsb \curbit, \curbit, #31
19307 + mov \curbit, \curbit, lsl #2
19308 + mov \result, #0
19309 + add pc, pc, \curbit, lsl #2
19310 + nop
19311 + .rept 32
19312 + cmp \dividend, \divisor
19313 + subcs \dividend, \dividend, \divisor
19314 + mov \divisor, \divisor, lsr #1
19315 + adc \result, \result, \result
19316 + .endr
19317 +#else /* ! defined(__ARM_TUNE_MARVELL_F__) */
19318 clz \curbit, \dividend
19319 clz \result, \divisor
19320 sub \curbit, \result, \curbit
19321 @@ -438,6 +578,7 @@ pc .req r15
19322 adc \result, \result, \result
19323 subcs \dividend, \dividend, \divisor, lsl #shift
19324 .endr
19325 +#endif /* defined(__ARM_TUNE_MARVELL_F__) */
19326
19327 #else /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */
19328 #if __ARM_ARCH__ >= 5
19329 @@ -792,6 +933,7 @@ LSYM(Lgot_result):
19330
19331 cmp divisor, #0
19332 beq LSYM(Ldiv0)
19333 +LSYM(udivsi3_nodiv0):
19334 mov curbit, #1
19335 mov result, #0
19336
19337 @@ -807,6 +949,9 @@ LSYM(Lgot_result):
19338
19339 #else /* ARM version. */
19340
19341 + /* Note: if called via udivsi3_nodiv0, this will unnecessarily check
19342 + for division-by-zero a second time. */
19343 +LSYM(udivsi3_nodiv0):
19344 subs r2, r1, #1
19345 RETc(eq)
19346 bcc LSYM(Ldiv0)
19347 @@ -831,19 +976,23 @@ LSYM(Lgot_result):
19348
19349 #endif /* ARM version */
19350
19351 - DIV_FUNC_END udivsi3
19352 + DIV_FUNC_END udivsi3 unsigned
19353
19354 FUNC_START aeabi_uidivmod
19355 #ifdef __thumb__
19356 + cmp r1, #0
19357 + beq LSYM(Ldiv0)
19358 push {r0, r1, lr}
19359 - bl SYM(__udivsi3)
19360 + bl LSYM(udivsi3_nodiv0)
19361 POP {r1, r2, r3}
19362 mul r2, r0
19363 sub r1, r1, r2
19364 bx r3
19365 #else
19366 + cmp r1, #0
19367 + beq LSYM(Ldiv0)
19368 stmfd sp!, { r0, r1, lr }
19369 - bl SYM(__udivsi3)
19370 + bl LSYM(udivsi3_nodiv0)
19371 ldmfd sp!, { r1, r2, lr }
19372 mul r3, r2, r0
19373 sub r1, r1, r3
19374 @@ -890,7 +1039,7 @@ LSYM(Lover10):
19375
19376 #endif /* ARM version. */
19377
19378 - DIV_FUNC_END umodsi3
19379 + DIV_FUNC_END umodsi3 unsigned
19380
19381 #endif /* L_umodsi3 */
19382 /* ------------------------------------------------------------------------ */
19383 @@ -902,7 +1051,7 @@ LSYM(Lover10):
19384 #ifdef __thumb__
19385 cmp divisor, #0
19386 beq LSYM(Ldiv0)
19387 -
19388 +LSYM(divsi3_nodiv0):
19389 push { work }
19390 mov work, dividend
19391 eor work, divisor @ Save the sign of the result.
19392 @@ -934,8 +1083,9 @@ LSYM(Lover12):
19393 #else /* ARM version. */
19394
19395 cmp r1, #0
19396 - eor ip, r0, r1 @ save the sign of the result.
19397 beq LSYM(Ldiv0)
19398 +LSYM(divsi3_nodiv0):
19399 + eor ip, r0, r1 @ save the sign of the result.
19400 rsbmi r1, r1, #0 @ loops below use unsigned.
19401 subs r2, r1, #1 @ division by 1 or -1 ?
19402 beq 10f
19403 @@ -970,19 +1120,23 @@ LSYM(Lover12):
19404
19405 #endif /* ARM version */
19406
19407 - DIV_FUNC_END divsi3
19408 + DIV_FUNC_END divsi3 signed
19409
19410 FUNC_START aeabi_idivmod
19411 #ifdef __thumb__
19412 + cmp r1, #0
19413 + beq LSYM(Ldiv0)
19414 push {r0, r1, lr}
19415 - bl SYM(__divsi3)
19416 + bl LSYM(divsi3_nodiv0)
19417 POP {r1, r2, r3}
19418 mul r2, r0
19419 sub r1, r1, r2
19420 bx r3
19421 #else
19422 + cmp r1, #0
19423 + beq LSYM(Ldiv0)
19424 stmfd sp!, { r0, r1, lr }
19425 - bl SYM(__divsi3)
19426 + bl LSYM(divsi3_nodiv0)
19427 ldmfd sp!, { r1, r2, lr }
19428 mul r3, r2, r0
19429 sub r1, r1, r3
19430 @@ -1048,21 +1202,25 @@ LSYM(Lover12):
19431
19432 #endif /* ARM version */
19433
19434 - DIV_FUNC_END modsi3
19435 + DIV_FUNC_END modsi3 signed
19436
19437 #endif /* L_modsi3 */
19438 /* ------------------------------------------------------------------------ */
19439 #ifdef L_dvmd_tls
19440
19441 - FUNC_START div0
19442 - FUNC_ALIAS aeabi_idiv0 div0
19443 - FUNC_ALIAS aeabi_ldiv0 div0
19444 -
19445 +#ifdef __ARM_EABI__
19446 + WEAK aeabi_idiv0
19447 + WEAK aeabi_ldiv0
19448 + FUNC_START aeabi_idiv0
19449 + FUNC_START aeabi_ldiv0
19450 RET
19451 -
19452 FUNC_END aeabi_ldiv0
19453 FUNC_END aeabi_idiv0
19454 +#else
19455 + FUNC_START div0
19456 + RET
19457 FUNC_END div0
19458 +#endif
19459
19460 #endif /* L_divmodsi_tools */
19461 /* ------------------------------------------------------------------------ */
19462 @@ -1072,14 +1230,26 @@ LSYM(Lover12):
19463 /* Constant taken from <asm/signal.h>. */
19464 #define SIGFPE 8
19465
19466 +#ifdef __ARM_EABI__
19467 + WEAK aeabi_idiv0
19468 + WEAK aeabi_ldiv0
19469 + ARM_FUNC_START aeabi_idiv0
19470 + ARM_FUNC_START aeabi_ldiv0
19471 +#else
19472 ARM_FUNC_START div0
19473 +#endif
19474
19475 - do_push {r1, lr}
19476 + do_push (r1, lr)
19477 mov r0, #SIGFPE
19478 bl SYM(raise) __PLT__
19479 RETLDM r1
19480
19481 +#ifdef __ARM_EABI__
19482 + FUNC_END aeabi_ldiv0
19483 + FUNC_END aeabi_idiv0
19484 +#else
19485 FUNC_END div0
19486 +#endif
19487
19488 #endif /* L_dvmd_lnx */
19489 /* ------------------------------------------------------------------------ */
19490 @@ -1256,8 +1426,8 @@ LSYM(Lover12):
19491 #endif /* L_call_via_rX */
19492
19493 /* Don't bother with the old interworking routines for Thumb-2. */
19494 -/* ??? Maybe only omit these on v7m. */
19495 -#ifndef __thumb2__
19496 +/* ??? Maybe only omit these on "m" variants. */
19497 +#if !defined(__thumb2__) && !defined(__ARM_ARCH_6M__)
19498
19499 #if defined L_interwork_call_via_rX
19500
19501 @@ -1387,7 +1557,11 @@ LSYM(Lchange_\register):
19502 #endif /* Arch supports thumb. */
19503
19504 #ifndef __symbian__
19505 +#ifndef __ARM_ARCH_6M__
19506 #include "ieee754-df.S"
19507 #include "ieee754-sf.S"
19508 #include "bpabi.S"
19509 -#endif /* __symbian__ */
19510 +#else /* __ARM_ARCH_6M__ */
19511 +#include "bpabi-v6m.S"
19512 +#endif /* __ARM_ARCH_6M__ */
19513 +#endif /* !__symbian__ */
19514 --- a/gcc/config/arm/libunwind.S
19515 +++ b/gcc/config/arm/libunwind.S
19516 @@ -53,6 +53,119 @@
19517 #endif
19518 #endif
19519
19520 +#ifdef __ARM_ARCH_6M__
19521 +
19522 +/* r0 points to a 16-word block. Upload these values to the actual core
19523 + state. */
19524 +FUNC_START restore_core_regs
19525 + mov r1, r0
19526 + add r1, r1, #52
19527 + ldmia r1!, {r3, r4, r5}
19528 + sub r3, r3, #4
19529 + mov ip, r3
19530 + str r5, [r3]
19531 + mov lr, r4
19532 + /* Restore r8-r11. */
19533 + mov r1, r0
19534 + add r1, r1, #32
19535 + ldmia r1!, {r2, r3, r4, r5}
19536 + mov r8, r2
19537 + mov r9, r3
19538 + mov sl, r4
19539 + mov fp, r5
19540 + mov r1, r0
19541 + add r1, r1, #8
19542 + ldmia r1!, {r2, r3, r4, r5, r6, r7}
19543 + ldr r1, [r0, #4]
19544 + ldr r0, [r0]
19545 + mov sp, ip
19546 + pop {pc}
19547 + FUNC_END restore_core_regs
19548 + UNPREFIX restore_core_regs
19549 +
19550 +/* ARMV6M does not have coprocessors, so these should never be used. */
19551 +FUNC_START gnu_Unwind_Restore_VFP
19552 + RET
19553 +
19554 +/* Store VFR regsters d0-d15 to the address in r0. */
19555 +FUNC_START gnu_Unwind_Save_VFP
19556 + RET
19557 +
19558 +/* Load VFP registers d0-d15 from the address in r0.
19559 + Use this to load from FSTMD format. */
19560 +FUNC_START gnu_Unwind_Restore_VFP_D
19561 + RET
19562 +
19563 +/* Store VFP registers d0-d15 to the address in r0.
19564 + Use this to store in FLDMD format. */
19565 +FUNC_START gnu_Unwind_Save_VFP_D
19566 + RET
19567 +
19568 +/* Load VFP registers d16-d31 from the address in r0.
19569 + Use this to load from FSTMD (=VSTM) format. Needs VFPv3. */
19570 +FUNC_START gnu_Unwind_Restore_VFP_D_16_to_31
19571 + RET
19572 +
19573 +/* Store VFP registers d16-d31 to the address in r0.
19574 + Use this to store in FLDMD (=VLDM) format. Needs VFPv3. */
19575 +FUNC_START gnu_Unwind_Save_VFP_D_16_to_31
19576 + RET
19577 +
19578 +FUNC_START gnu_Unwind_Restore_WMMXD
19579 + RET
19580 +
19581 +FUNC_START gnu_Unwind_Save_WMMXD
19582 + RET
19583 +
19584 +FUNC_START gnu_Unwind_Restore_WMMXC
19585 + RET
19586 +
19587 +FUNC_START gnu_Unwind_Save_WMMXC
19588 + RET
19589 +
19590 +.macro UNWIND_WRAPPER name nargs
19591 + FUNC_START \name
19592 + /* Create a phase2_vrs structure. */
19593 + /* Save r0 in the PC slot so we can use it as a scratch register. */
19594 + push {r0}
19595 + add r0, sp, #4
19596 + push {r0, lr} /* Push original SP and LR. */
19597 + /* Make space for r8-r12. */
19598 + sub sp, sp, #20
19599 + /* Save low registers. */
19600 + push {r0, r1, r2, r3, r4, r5, r6, r7}
19601 + /* Save high registers. */
19602 + add r0, sp, #32
19603 + mov r1, r8
19604 + mov r2, r9
19605 + mov r3, sl
19606 + mov r4, fp
19607 + mov r5, ip
19608 + stmia r0!, {r1, r2, r3, r4, r5}
19609 + /* Restore original low register values. */
19610 + add r0, sp, #4
19611 + ldmia r0!, {r1, r2, r3, r4, r5}
19612 + /* Restore orginial r0. */
19613 + ldr r0, [sp, #60]
19614 + str r0, [sp]
19615 + /* Demand-save flags, plus an extra word for alignment. */
19616 + mov r3, #0
19617 + push {r2, r3}
19618 + /* Point r1 at the block. Pass r[0..nargs) unchanged. */
19619 + add r\nargs, sp, #4
19620 +
19621 + bl SYM (__gnu\name)
19622 +
19623 + ldr r3, [sp, #64]
19624 + add sp, sp, #72
19625 + bx r3
19626 +
19627 + FUNC_END \name
19628 + UNPREFIX \name
19629 +.endm
19630 +
19631 +#else /* !__ARM_ARCH_6M__ */
19632 +
19633 /* r0 points to a 16-word block. Upload these values to the actual core
19634 state. */
19635 ARM_FUNC_START restore_core_regs
19636 @@ -233,6 +346,8 @@ ARM_FUNC_START gnu_Unwind_Save_WMMXC
19637 UNPREFIX \name
19638 .endm
19639
19640 +#endif /* !__ARM_ARCH_6M__ */
19641 +
19642 UNWIND_WRAPPER _Unwind_RaiseException 1
19643 UNWIND_WRAPPER _Unwind_Resume 1
19644 UNWIND_WRAPPER _Unwind_Resume_or_Rethrow 1
19645 --- /dev/null
19646 +++ b/gcc/config/arm/linux-atomic.c
19647 @@ -0,0 +1,280 @@
19648 +/* Linux-specific atomic operations for ARM EABI.
19649 + Copyright (C) 2008 Free Software Foundation, Inc.
19650 + Contributed by CodeSourcery.
19651 +
19652 +This file is part of GCC.
19653 +
19654 +GCC is free software; you can redistribute it and/or modify it under
19655 +the terms of the GNU General Public License as published by the Free
19656 +Software Foundation; either version 2, or (at your option) any later
19657 +version.
19658 +
19659 +In addition to the permissions in the GNU General Public License, the
19660 +Free Software Foundation gives you unlimited permission to link the
19661 +compiled version of this file into combinations with other programs,
19662 +and to distribute those combinations without any restriction coming
19663 +from the use of this file. (The General Public License restrictions
19664 +do apply in other respects; for example, they cover modification of
19665 +the file, and distribution when not linked into a combine
19666 +executable.)
19667 +
19668 +GCC is distributed in the hope that it will be useful, but WITHOUT ANY
19669 +WARRANTY; without even the implied warranty of MERCHANTABILITY or
19670 +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19671 +for more details.
19672 +
19673 +You should have received a copy of the GNU General Public License
19674 +along with GCC; see the file COPYING. If not, write to the Free
19675 +Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
19676 +02110-1301, USA. */
19677 +
19678 +/* Kernel helper for compare-and-exchange. */
19679 +typedef int (__kernel_cmpxchg_t) (int oldval, int newval, int *ptr);
19680 +#define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) 0xffff0fc0)
19681 +
19682 +/* Kernel helper for memory barrier. */
19683 +typedef void (__kernel_dmb_t) (void);
19684 +#define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0)
19685 +
19686 +/* Note: we implement byte, short and int versions of atomic operations using
19687 + the above kernel helpers, but there is no support for "long long" (64-bit)
19688 + operations as yet. */
19689 +
19690 +#define HIDDEN __attribute__ ((visibility ("hidden")))
19691 +
19692 +#ifdef __ARMEL__
19693 +#define INVERT_MASK_1 0
19694 +#define INVERT_MASK_2 0
19695 +#else
19696 +#define INVERT_MASK_1 24
19697 +#define INVERT_MASK_2 16
19698 +#endif
19699 +
19700 +#define MASK_1 0xffu
19701 +#define MASK_2 0xffffu
19702 +
19703 +#define FETCH_AND_OP_WORD(OP, PFX_OP, INF_OP) \
19704 + int HIDDEN \
19705 + __sync_fetch_and_##OP##_4 (int *ptr, int val) \
19706 + { \
19707 + int failure, tmp; \
19708 + \
19709 + do { \
19710 + tmp = *ptr; \
19711 + failure = __kernel_cmpxchg (tmp, PFX_OP tmp INF_OP val, ptr); \
19712 + } while (failure != 0); \
19713 + \
19714 + return tmp; \
19715 + }
19716 +
19717 +FETCH_AND_OP_WORD (add, , +)
19718 +FETCH_AND_OP_WORD (sub, , -)
19719 +FETCH_AND_OP_WORD (or, , |)
19720 +FETCH_AND_OP_WORD (and, , &)
19721 +FETCH_AND_OP_WORD (xor, , ^)
19722 +FETCH_AND_OP_WORD (nand, ~, &)
19723 +
19724 +#define NAME_oldval(OP, WIDTH) __sync_fetch_and_##OP##_##WIDTH
19725 +#define NAME_newval(OP, WIDTH) __sync_##OP##_and_fetch_##WIDTH
19726 +
19727 +/* Implement both __sync_<op>_and_fetch and __sync_fetch_and_<op> for
19728 + subword-sized quantities. */
19729 +
19730 +#define SUBWORD_SYNC_OP(OP, PFX_OP, INF_OP, TYPE, WIDTH, RETURN) \
19731 + TYPE HIDDEN \
19732 + NAME##_##RETURN (OP, WIDTH) (TYPE *ptr, TYPE val) \
19733 + { \
19734 + int *wordptr = (int *) ((unsigned int) ptr & ~3); \
19735 + unsigned int mask, shift, oldval, newval; \
19736 + int failure; \
19737 + \
19738 + shift = (((unsigned int) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \
19739 + mask = MASK_##WIDTH << shift; \
19740 + \
19741 + do { \
19742 + oldval = *wordptr; \
19743 + newval = ((PFX_OP ((oldval & mask) >> shift) \
19744 + INF_OP (unsigned int) val) << shift) & mask; \
19745 + newval |= oldval & ~mask; \
19746 + failure = __kernel_cmpxchg (oldval, newval, wordptr); \
19747 + } while (failure != 0); \
19748 + \
19749 + return (RETURN & mask) >> shift; \
19750 + }
19751 +
19752 +SUBWORD_SYNC_OP (add, , +, short, 2, oldval)
19753 +SUBWORD_SYNC_OP (sub, , -, short, 2, oldval)
19754 +SUBWORD_SYNC_OP (or, , |, short, 2, oldval)
19755 +SUBWORD_SYNC_OP (and, , &, short, 2, oldval)
19756 +SUBWORD_SYNC_OP (xor, , ^, short, 2, oldval)
19757 +SUBWORD_SYNC_OP (nand, ~, &, short, 2, oldval)
19758 +
19759 +SUBWORD_SYNC_OP (add, , +, char, 1, oldval)
19760 +SUBWORD_SYNC_OP (sub, , -, char, 1, oldval)
19761 +SUBWORD_SYNC_OP (or, , |, char, 1, oldval)
19762 +SUBWORD_SYNC_OP (and, , &, char, 1, oldval)
19763 +SUBWORD_SYNC_OP (xor, , ^, char, 1, oldval)
19764 +SUBWORD_SYNC_OP (nand, ~, &, char, 1, oldval)
19765 +
19766 +#define OP_AND_FETCH_WORD(OP, PFX_OP, INF_OP) \
19767 + int HIDDEN \
19768 + __sync_##OP##_and_fetch_4 (int *ptr, int val) \
19769 + { \
19770 + int tmp, failure; \
19771 + \
19772 + do { \
19773 + tmp = *ptr; \
19774 + failure = __kernel_cmpxchg (tmp, PFX_OP tmp INF_OP val, ptr); \
19775 + } while (failure != 0); \
19776 + \
19777 + return PFX_OP tmp INF_OP val; \
19778 + }
19779 +
19780 +OP_AND_FETCH_WORD (add, , +)
19781 +OP_AND_FETCH_WORD (sub, , -)
19782 +OP_AND_FETCH_WORD (or, , |)
19783 +OP_AND_FETCH_WORD (and, , &)
19784 +OP_AND_FETCH_WORD (xor, , ^)
19785 +OP_AND_FETCH_WORD (nand, ~, &)
19786 +
19787 +SUBWORD_SYNC_OP (add, , +, short, 2, newval)
19788 +SUBWORD_SYNC_OP (sub, , -, short, 2, newval)
19789 +SUBWORD_SYNC_OP (or, , |, short, 2, newval)
19790 +SUBWORD_SYNC_OP (and, , &, short, 2, newval)
19791 +SUBWORD_SYNC_OP (xor, , ^, short, 2, newval)
19792 +SUBWORD_SYNC_OP (nand, ~, &, short, 2, newval)
19793 +
19794 +SUBWORD_SYNC_OP (add, , +, char, 1, newval)
19795 +SUBWORD_SYNC_OP (sub, , -, char, 1, newval)
19796 +SUBWORD_SYNC_OP (or, , |, char, 1, newval)
19797 +SUBWORD_SYNC_OP (and, , &, char, 1, newval)
19798 +SUBWORD_SYNC_OP (xor, , ^, char, 1, newval)
19799 +SUBWORD_SYNC_OP (nand, ~, &, char, 1, newval)
19800 +
19801 +int HIDDEN
19802 +__sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval)
19803 +{
19804 + int actual_oldval, fail;
19805 +
19806 + while (1)
19807 + {
19808 + actual_oldval = *ptr;
19809 +
19810 + if (oldval != actual_oldval)
19811 + return actual_oldval;
19812 +
19813 + fail = __kernel_cmpxchg (actual_oldval, newval, ptr);
19814 +
19815 + if (!fail)
19816 + return oldval;
19817 + }
19818 +}
19819 +
19820 +#define SUBWORD_VAL_CAS(TYPE, WIDTH) \
19821 + TYPE HIDDEN \
19822 + __sync_val_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \
19823 + TYPE newval) \
19824 + { \
19825 + int *wordptr = (int *)((unsigned int) ptr & ~3), fail; \
19826 + unsigned int mask, shift, actual_oldval, actual_newval; \
19827 + \
19828 + shift = (((unsigned int) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \
19829 + mask = MASK_##WIDTH << shift; \
19830 + \
19831 + while (1) \
19832 + { \
19833 + actual_oldval = *wordptr; \
19834 + \
19835 + if (((actual_oldval & mask) >> shift) != (unsigned int) oldval) \
19836 + return (actual_oldval & mask) >> shift; \
19837 + \
19838 + actual_newval = (actual_oldval & ~mask) \
19839 + | (((unsigned int) newval << shift) & mask); \
19840 + \
19841 + fail = __kernel_cmpxchg (actual_oldval, actual_newval, \
19842 + wordptr); \
19843 + \
19844 + if (!fail) \
19845 + return oldval; \
19846 + } \
19847 + }
19848 +
19849 +SUBWORD_VAL_CAS (short, 2)
19850 +SUBWORD_VAL_CAS (char, 1)
19851 +
19852 +typedef unsigned char bool;
19853 +
19854 +bool HIDDEN
19855 +__sync_bool_compare_and_swap_4 (int *ptr, int oldval, int newval)
19856 +{
19857 + int failure = __kernel_cmpxchg (oldval, newval, ptr);
19858 + return (failure == 0);
19859 +}
19860 +
19861 +#define SUBWORD_BOOL_CAS(TYPE, WIDTH) \
19862 + bool HIDDEN \
19863 + __sync_bool_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \
19864 + TYPE newval) \
19865 + { \
19866 + TYPE actual_oldval \
19867 + = __sync_val_compare_and_swap_##WIDTH (ptr, oldval, newval); \
19868 + return (oldval == actual_oldval); \
19869 + }
19870 +
19871 +SUBWORD_BOOL_CAS (short, 2)
19872 +SUBWORD_BOOL_CAS (char, 1)
19873 +
19874 +void HIDDEN
19875 +__sync_synchronize (void)
19876 +{
19877 + __kernel_dmb ();
19878 +}
19879 +
19880 +int HIDDEN
19881 +__sync_lock_test_and_set_4 (int *ptr, int val)
19882 +{
19883 + int failure, oldval;
19884 +
19885 + do {
19886 + oldval = *ptr;
19887 + failure = __kernel_cmpxchg (oldval, val, ptr);
19888 + } while (failure != 0);
19889 +
19890 + return oldval;
19891 +}
19892 +
19893 +#define SUBWORD_TEST_AND_SET(TYPE, WIDTH) \
19894 + TYPE HIDDEN \
19895 + __sync_lock_test_and_set_##WIDTH (TYPE *ptr, TYPE val) \
19896 + { \
19897 + int failure; \
19898 + unsigned int oldval, newval, shift, mask; \
19899 + int *wordptr = (int *) ((unsigned int) ptr & ~3); \
19900 + \
19901 + shift = (((unsigned int) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \
19902 + mask = MASK_##WIDTH << shift; \
19903 + \
19904 + do { \
19905 + oldval = *wordptr; \
19906 + newval = (oldval & ~mask) \
19907 + | (((unsigned int) val << shift) & mask); \
19908 + failure = __kernel_cmpxchg (oldval, newval, wordptr); \
19909 + } while (failure != 0); \
19910 + \
19911 + return (oldval & mask) >> shift; \
19912 + }
19913 +
19914 +SUBWORD_TEST_AND_SET (short, 2)
19915 +SUBWORD_TEST_AND_SET (char, 1)
19916 +
19917 +#define SYNC_LOCK_RELEASE(TYPE, WIDTH) \
19918 + void HIDDEN \
19919 + __sync_lock_release_##WIDTH (TYPE *ptr) \
19920 + { \
19921 + *ptr = 0; \
19922 + __kernel_dmb (); \
19923 + }
19924 +
19925 +SYNC_LOCK_RELEASE (int, 4)
19926 +SYNC_LOCK_RELEASE (short, 2)
19927 +SYNC_LOCK_RELEASE (char, 1)
19928 --- a/gcc/config/arm/linux-eabi.h
19929 +++ b/gcc/config/arm/linux-eabi.h
19930 @@ -66,7 +66,7 @@
19931 /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
19932 use the GNU/Linux version, not the generic BPABI version. */
19933 #undef LINK_SPEC
19934 -#define LINK_SPEC LINUX_TARGET_LINK_SPEC
19935 +#define LINK_SPEC LINUX_TARGET_LINK_SPEC BE8_LINK_SPEC
19936
19937 /* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
19938 do not use -lfloat. */
19939 --- /dev/null
19940 +++ b/gcc/config/arm/marvell-f-vfp.md
19941 @@ -0,0 +1,157 @@
19942 +;; Marvell 2850 VFP pipeline description
19943 +;; Copyright (C) 2007 Free Software Foundation, Inc.
19944 +;; Written by CodeSourcery, Inc.
19945 +
19946 +;; This file is part of GCC.
19947 +
19948 +;; GCC is free software; you can redistribute it and/or modify it
19949 +;; under the terms of the GNU General Public License as published
19950 +;; by the Free Software Foundation; either version 3, or (at your
19951 +;; option) any later version.
19952 +
19953 +;; GCC is distributed in the hope that it will be useful, but WITHOUT
19954 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19955 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19956 +;; License for more details.
19957 +
19958 +;; You should have received a copy of the GNU General Public License
19959 +;; along with GCC; see the file COPYING3. If not see
19960 +;; <http://www.gnu.org/licenses/>.
19961 +
19962 +;; This automaton provides a pipeline description for the Marvell
19963 +;; 2850 core.
19964 +;;
19965 +;; The model given here assumes that the condition for all conditional
19966 +;; instructions is "true", i.e., that all of the instructions are
19967 +;; actually executed.
19968 +
19969 +(define_automaton "marvell_f_vfp")
19970 +
19971 +;; This is a single-issue VFPv2 implementation with the following execution
19972 +;; units:
19973 +;;
19974 +;; 1. Addition/subtraction unit; takes three cycles, pipelined.
19975 +;; 2. Multiplication unit; takes four cycles, pipelined.
19976 +;; 3. Add buffer, used for multiply-accumulate (see below).
19977 +;; 4. Divide/square root unit, not pipelined.
19978 +;; For single-precision: takes sixteen cycles, can accept another insn
19979 +;; after fifteen cycles.
19980 +;; For double-precision: takes thirty-one cycles, can accept another insn
19981 +;; after thirty cycles.
19982 +;; 5. Single-cycle unit, pipelined.
19983 +;; This does absolute value/copy/negate/compare in one cycle and
19984 +;; conversion in two cycles.
19985 +;;
19986 +;; When all three operands of a multiply-accumulate instruction are ready,
19987 +;; one is issued to the add buffer (which can hold six operands in a FIFO)
19988 +;; and the two to be multiplied are issued to the multiply unit. After
19989 +;; four cycles in the multiply unit, one cycle is taken to issue the
19990 +;; operand from the add buffer plus the multiplication result to the
19991 +;; addition/subtraction unit. That issue takes priority over any add/sub
19992 +;; instruction waiting at the normal issue stage, but may be performed in
19993 +;; parallel with the issue of a non-add/sub instruction. The total time
19994 +;; for a multiply-accumulate instruction to pass through the execution
19995 +;; units is hence eight cycles.
19996 +;;
19997 +;; We do not need to explicitly model the add buffer because it can
19998 +;; always issue the instruction at the head of its FIFO (due to the above
19999 +;; priority rule) and there are more spaces in the add buffer (six) than
20000 +;; there are stages (four) in the multiplication unit.
20001 +;;
20002 +;; Two instructions may be retired at once from the head of an 8-entry
20003 +;; reorder buffer. Data from these first two instructions only may be
20004 +;; forwarded to the inputs of the issue unit. We assume that the
20005 +;; pressure on the reorder buffer will be sufficiently low that every
20006 +;; instruction entering it will be eligible for data forwarding. Since
20007 +;; data is forwarded to the issue unit and not the execution units (so
20008 +;; for example single-cycle instructions cannot be issued back-to-back),
20009 +;; the latencies given below are the cycle counts above plus one.
20010 +
20011 +(define_cpu_unit "mf_vfp_issue" "marvell_f_vfp")
20012 +(define_cpu_unit "mf_vfp_add" "marvell_f_vfp")
20013 +(define_cpu_unit "mf_vfp_mul" "marvell_f_vfp")
20014 +(define_cpu_unit "mf_vfp_div" "marvell_f_vfp")
20015 +(define_cpu_unit "mf_vfp_single_cycle" "marvell_f_vfp")
20016 +
20017 +;; An attribute to indicate whether our reservations are applicable.
20018 +
20019 +(define_attr "marvell_f_vfp" "yes,no"
20020 + (const (if_then_else (and (eq_attr "tune" "marvell_f")
20021 + (eq_attr "fpu" "vfp"))
20022 + (const_string "yes") (const_string "no"))))
20023 +
20024 +;; Reservations of functional units. The nothing*2 reservations at the
20025 +;; start of many of the reservation strings correspond to the decode
20026 +;; stages. We need to have these reservations so that we can correctly
20027 +;; reserve parts of the core's A1 pipeline for loads and stores. For
20028 +;; that case (since loads skip E1) the pipelines line up thus:
20029 +;; A1 pipe: Issue E2 OF WR WB ...
20030 +;; VFP pipe: Fetch Decode1 Decode2 Issue Execute1 ...
20031 +;; For a load, we need to make a reservation of E2, and thus we must
20032 +;; use Decode1 as the starting point for all VFP reservations here.
20033 +;;
20034 +;; For reservations of pipelined VFP execution units we only reserve
20035 +;; the execution unit for the first execution cycle, omitting any trailing
20036 +;; "nothing" reservations.
20037 +
20038 +(define_insn_reservation "marvell_f_vfp_add" 4
20039 + (and (eq_attr "marvell_f_vfp" "yes")
20040 + (eq_attr "type" "fadds,faddd"))
20041 + "nothing*2,mf_vfp_issue,mf_vfp_add")
20042 +
20043 +(define_insn_reservation "marvell_f_vfp_mul" 5
20044 + (and (eq_attr "marvell_f_vfp" "yes")
20045 + (eq_attr "type" "fmuls,fmuld"))
20046 + "nothing*2,mf_vfp_issue,mf_vfp_mul")
20047 +
20048 +(define_insn_reservation "marvell_f_vfp_divs" 17
20049 + (and (eq_attr "marvell_f_vfp" "yes")
20050 + (eq_attr "type" "fdivs"))
20051 + "nothing*2,mf_vfp_issue,mf_vfp_div*15")
20052 +
20053 +(define_insn_reservation "marvell_f_vfp_divd" 32
20054 + (and (eq_attr "marvell_f_vfp" "yes")
20055 + (eq_attr "type" "fdivd"))
20056 + "nothing*2,mf_vfp_issue,mf_vfp_div*30")
20057 +
20058 +;; The DFA lookahead is small enough that the "add" reservation here
20059 +;; will always take priority over any addition/subtraction instruction
20060 +;; issued five cycles after the multiply-accumulate instruction, as
20061 +;; required.
20062 +(define_insn_reservation "marvell_f_vfp_mac" 9
20063 + (and (eq_attr "marvell_f_vfp" "yes")
20064 + (eq_attr "type" "fmacs,fmacd"))
20065 + "nothing*2,mf_vfp_issue,mf_vfp_mul,nothing*4,mf_vfp_add")
20066 +
20067 +(define_insn_reservation "marvell_f_vfp_single" 2
20068 + (and (eq_attr "marvell_f_vfp" "yes")
20069 + (eq_attr "type" "fcpys,ffariths,ffarithd,fcmps,fcmpd"))
20070 + "nothing*2,mf_vfp_issue,mf_vfp_single_cycle")
20071 +
20072 +(define_insn_reservation "marvell_f_vfp_convert" 3
20073 + (and (eq_attr "marvell_f_vfp" "yes")
20074 + (eq_attr "type" "f_cvt"))
20075 + "nothing*2,mf_vfp_issue,mf_vfp_single_cycle")
20076 +
20077 +(define_insn_reservation "marvell_f_vfp_load" 2
20078 + (and (eq_attr "marvell_f_vfp" "yes")
20079 + (eq_attr "type" "f_loads,f_loadd"))
20080 + "a1_e2+sram,a1_of,a1_wr+mf_vfp_issue,a1_wb+mf_vfp_single_cycle")
20081 +
20082 +(define_insn_reservation "marvell_f_vfp_from_core" 2
20083 + (and (eq_attr "marvell_f_vfp" "yes")
20084 + (eq_attr "type" "r_2_f"))
20085 + "a1_e2,a1_of,a1_wr+mf_vfp_issue,a1_wb+mf_vfp_single_cycle")
20086 +
20087 +;; The interaction between the core and VFP pipelines during VFP
20088 +;; store operations and core <-> VFP moves is not clear, so we guess.
20089 +(define_insn_reservation "marvell_f_vfp_store" 3
20090 + (and (eq_attr "marvell_f_vfp" "yes")
20091 + (eq_attr "type" "f_stores,f_stored"))
20092 + "a1_e2,a1_of,mf_vfp_issue,a1_wr+sram+mf_vfp_single_cycle")
20093 +
20094 +(define_insn_reservation "marvell_f_vfp_to_core" 4
20095 + (and (eq_attr "marvell_f_vfp" "yes")
20096 + (eq_attr "type" "f_2_r"))
20097 + "a1_e2,a1_of,a1_wr+mf_vfp_issue,a1_wb+mf_vfp_single_cycle")
20098 +
20099 --- /dev/null
20100 +++ b/gcc/config/arm/marvell-f.md
20101 @@ -0,0 +1,364 @@
20102 +;; Marvell 2850 pipeline description
20103 +;; Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
20104 +;; Written by Marvell and CodeSourcery, Inc.
20105 +
20106 +;; This file is part of GCC.
20107 +
20108 +;; GCC is free software; you can redistribute it and/or modify it
20109 +;; under the terms of the GNU General Public License as published
20110 +;; by the Free Software Foundation; either version 3, or (at your
20111 +;; option) any later version.
20112 +
20113 +;; GCC is distributed in the hope that it will be useful, but WITHOUT
20114 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20115 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
20116 +;; License for more details.
20117 +
20118 +;; You should have received a copy of the GNU General Public License
20119 +;; along with GCC; see the file COPYING3. If not see
20120 +;; <http://www.gnu.org/licenses/>.
20121 +
20122 +;; This automaton provides a pipeline description for the Marvell
20123 +;; 2850 core.
20124 +;;
20125 +;; The model given here assumes that the condition for all conditional
20126 +;; instructions is "true", i.e., that all of the instructions are
20127 +;; actually executed.
20128 +
20129 +(define_automaton "marvell_f")
20130 +
20131 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20132 +;; Pipelines
20133 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20134 +
20135 +;; This is a dual-issue processor with three pipelines:
20136 +;;
20137 +;; 1. Arithmetic and load/store pipeline A1.
20138 +;; Issue | E1 | E2 | OF | WR | WB for load-store instructions
20139 +;; Issue | E1 | E2 | WB for arithmetic instructions
20140 +;;
20141 +;; 2. Arithmetic pipeline A2.
20142 +;; Issue | E1 | E2 | WB
20143 +;;
20144 +;; 3. Multiply and multiply-accumulate pipeline.
20145 +;; Issue | MAC1 | MAC2 | MAC3 | WB
20146 +;;
20147 +;; There are various bypasses modelled to a greater or lesser extent.
20148 +;;
20149 +;; Latencies in this file correspond to the number of cycles after
20150 +;; the issue stage that it takes for the result of the instruction to
20151 +;; be computed, or for its side-effects to occur.
20152 +
20153 +(define_cpu_unit "a1_e1,a1_e2,a1_of,a1_wr,a1_wb" "marvell_f") ; ALU 1
20154 +(define_cpu_unit "a2_e1,a2_e2,a2_wb" "marvell_f") ; ALU 2
20155 +(define_cpu_unit "m_1,m_2,m_3,m_wb" "marvell_f") ; MAC
20156 +
20157 +;; We define an SRAM cpu unit to enable us to describe conflicts
20158 +;; between loads at the E2 stage and stores at the WR stage.
20159 +
20160 +(define_cpu_unit "sram" "marvell_f")
20161 +
20162 +;; Handling of dual-issue constraints.
20163 +;;
20164 +;; Certain pairs of instructions can be issued in parallel, and certain
20165 +;; pairs cannot. We divide a subset of the instructions into groups as
20166 +;; follows.
20167 +;;
20168 +;; - data processing 1 (mov, mvn);
20169 +;; - data processing 2 (adc, add, and, bic, cmn, cmp, eor, orr, rsb,
20170 +;; rsc, sbc, sub, teq, tst);
20171 +;; - load single (ldr, ldrb, ldrbt, ldrt, ldrh, ldrsb, ldrsh);
20172 +;; - store single (str, strb, strbt, strt, strh);
20173 +;; - swap (swp, swpb);
20174 +;; - pld;
20175 +;; - count leading zeros and DSP add/sub (clz, qadd, qdadd, qsub, qdsub);
20176 +;; - multiply 2 (mul, muls, smull, umull, smulxy, smulls, umulls);
20177 +;; - multiply 3 (mla, mlas, smlal, umlal, smlaxy, smlalxy, smlawx,
20178 +;; smlawy, smlals, umlals);
20179 +;; - branches (b, bl, blx, bx).
20180 +;;
20181 +;; Ignoring conditional execution, it is a good approximation to the core
20182 +;; to model that two instructions may only be issued in parallel if the
20183 +;; following conditions are met.
20184 +;; I. The instructions both fall into one of the above groups and their
20185 +;; corresponding groups have a entry in the matrix below that is not X.
20186 +;; II. The second instruction does not read any register updated by the
20187 +;; first instruction (already enforced by the GCC scheduler).
20188 +;; III. The second instruction does not need the carry flag updated by the
20189 +;; first instruction. Currently we do not model this.
20190 +;;
20191 +;; First Second instruction group
20192 +;; insn
20193 +;; DP1 DP2 L S SWP PLD CLZ M2 M3 B
20194 +;;
20195 +;; DP1 ok ok ok ok ok ok ok ok ok ok
20196 +;; DP2(1) ok ok ok ok ok ok ok ok ok ok
20197 +;; DP2(2) ok (2) ok (4) ok ok ok ok X ok
20198 +;; L }
20199 +;; SWP } ok ok X X X X ok ok ok ok
20200 +;; PLD }
20201 +;; S(3) ok ok X X X X ok ok ok ok
20202 +;; S(4) ok (2) X X X X ok ok X ok
20203 +;; CLZ ok ok ok ok ok ok ok ok ok ok
20204 +;; M2 ok ok ok ok ok ok ok X X ok
20205 +;; M3 ok (2) ok (4) ok ok ok X X ok
20206 +;; B ok ok ok ok ok ok ok ok ok ok
20207 +;;
20208 +;; (1) without register shift
20209 +;; (2) with register shift
20210 +;; (3) with immediate offset
20211 +;; (4) with register offset
20212 +;;
20213 +;; We define a fake cpu unit "reg_shift_lock" to enforce constraints
20214 +;; between instructions in groups DP2(2) and M3. All other
20215 +;; constraints are enforced automatically by virtue of the limited
20216 +;; number of pipelines available for the various operations, with
20217 +;; the exception of constraints involving S(4) that we do not model.
20218 +
20219 +(define_cpu_unit "reg_shift_lock" "marvell_f")
20220 +
20221 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20222 +;; ALU instructions
20223 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20224 +
20225 +;; 1. Certain logic operations can be retired after the E1 stage if
20226 +;; the pipeline is not already retiring another instruction. In this
20227 +;; model we assume this behaviour always holds for mov, mvn, and, orr, eor
20228 +;; instructions. If a register shift is involved and the instruction is
20229 +;; not mov or mvn, then a dual-issue constraint must be enforced.
20230 +
20231 +;; The first two cases are separate so they can be identified for
20232 +;; bypasses below.
20233 +
20234 +(define_insn_reservation "marvell_f_alu_early_retire" 1
20235 + (and (eq_attr "tune" "marvell_f")
20236 + (and (eq_attr "type" "alu")
20237 + (eq_attr "insn" "mov,mvn,and,orr,eor")))
20238 + "(a1_e1,a1_wb)|(a2_e1,a2_wb)")
20239 +
20240 +(define_insn_reservation "marvell_f_alu_early_retire_shift" 1
20241 + (and (eq_attr "tune" "marvell_f")
20242 + (and (eq_attr "type" "alu_shift_reg")
20243 + (eq_attr "insn" "mov,mvn,and,orr,eor")))
20244 + "(a1_e1,a1_wb)|(a2_e1,a2_wb)")
20245 +
20246 +(define_insn_reservation "marvell_f_alu_early_retire_reg_shift1" 1
20247 + (and (eq_attr "tune" "marvell_f")
20248 + (and (eq_attr "type" "alu_shift_reg")
20249 + (eq_attr "insn" "mov,mvn")))
20250 + "(a1_e1,a1_wb)|(a2_e1,a2_wb)")
20251 +
20252 +(define_insn_reservation "marvell_f_alu_early_retire_reg_shift2" 1
20253 + (and (eq_attr "tune" "marvell_f")
20254 + (and (eq_attr "type" "alu_shift_reg")
20255 + (eq_attr "insn" "and,orr,eor")))
20256 + "(reg_shift_lock+a1_e1,a1_wb)|(reg_shift_lock+a2_e1,a2_wb)")
20257 +
20258 +;; 2. ALU operations with no shifted operand. These bypass the E1 stage if
20259 +;; the E2 stage of the corresponding pipeline is clear; here, we always
20260 +;; model this scenario [*]. We give the operation a latency of 1 yet reserve
20261 +;; both E1 and E2 for it (thus preventing the GCC scheduler, in the case
20262 +;; where both E1 and E2 of one pipeline are clear, from issuing one
20263 +;; instruction to each).
20264 +;;
20265 +;; [*] The non-bypass case is a latency of two, reserving E1 on the first
20266 +;; cycle and E2 on the next. Due to the way the scheduler works we
20267 +;; have to choose between taking this as the default and taking the
20268 +;; above case (with latency one) as the default; we choose the latter.
20269 +
20270 +(define_insn_reservation "marvell_f_alu_op_bypass_e1" 1
20271 + (and (eq_attr "tune" "marvell_f")
20272 + (and (eq_attr "type" "alu")
20273 + (not (eq_attr "insn" "mov,mvn,and,orr,eor"))))
20274 + "(a1_e1+a1_e2,a1_wb)|(a2_e1+a2_e2,a2_wb)")
20275 +
20276 +;; 3. ALU operations with a shift-by-constant operand.
20277 +
20278 +(define_insn_reservation "marvell_f_alu_shift_op" 2
20279 + (and (eq_attr "tune" "marvell_f")
20280 + (and (eq_attr "type" "alu_shift")
20281 + (not (eq_attr "insn" "mov,mvn,and,orr,eor"))))
20282 + "(a1_e1,a1_e2,a1_wb)|(a2_e1,a2_e2,a2_wb)")
20283 +
20284 +;; 4. ALU operations with a shift-by-register operand. Since the
20285 +;; instruction is never mov or mvn, a dual-issue constraint must
20286 +;; be enforced.
20287 +
20288 +(define_insn_reservation "marvell_f_alu_shift_reg_op" 2
20289 + (and (eq_attr "tune" "marvell_f")
20290 + (and (eq_attr "type" "alu_shift_reg")
20291 + (not (eq_attr "insn" "mov,mvn,and,orr,eor"))))
20292 + "(reg_shift_lock+a1_e1,a1_e2,a1_wb)|(reg_shift_lock+a2_e1,a2_e2,a2_wb)")
20293 +
20294 +;; Given an ALU operation with shift (I1) followed by another ALU
20295 +;; operation (I2), with I2 depending on the destination register Rd of I1
20296 +;; and with I2 not using that value as the amount or the starting value for
20297 +;; a shift, then I1 and I2 may be issued to the same pipeline on
20298 +;; consecutive cycles. In terms of this model that corresponds to I1
20299 +;; having a latency of one cycle. There are three cases for various
20300 +;; I1 and I2 as follows.
20301 +
20302 +;; (a) I1 has a constant or register shift and I2 doesn't have a shift at all.
20303 +(define_bypass 1 "marvell_f_alu_shift_op,\
20304 + marvell_f_alu_shift_reg_op"
20305 + "marvell_f_alu_op_bypass_e1,marvell_f_alu_early_retire")
20306 +
20307 +;; (b) I1 has a constant or register shift and I2 has a constant shift.
20308 +;; Rd must not provide the starting value for the shift.
20309 +(define_bypass 1 "marvell_f_alu_shift_op,\
20310 + marvell_f_alu_shift_reg_op"
20311 + "marvell_f_alu_shift_op,marvell_f_alu_early_retire_shift"
20312 + "arm_no_early_alu_shift_value_dep")
20313 +
20314 +;; (c) I1 has a constant or register shift and I2 has a register shift.
20315 +;; Rd must not provide the amount by which to shift.
20316 +(define_bypass 1 "marvell_f_alu_shift_op,\
20317 + marvell_f_alu_shift_reg_op"
20318 + "marvell_f_alu_shift_reg_op,\
20319 + marvell_f_alu_early_retire_reg_shift1,\
20320 + marvell_f_alu_early_retire_reg_shift2"
20321 + "arm_no_early_alu_shift_dep")
20322 +
20323 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20324 +;; Multiplication instructions
20325 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20326 +
20327 +;; Multiplication instructions in group "Multiply 2".
20328 +
20329 +(define_insn_reservation "marvell_f_multiply_2" 3
20330 + (and (eq_attr "tune" "marvell_f")
20331 + (eq_attr "insn" "mul,muls,smull,umull,smulxy,smulls,umulls"))
20332 + "m_1,m_2,m_3,m_wb")
20333 +
20334 +;; Multiplication instructions in group "Multiply 3". There is a
20335 +;; dual-issue constraint with non-multiplication ALU instructions
20336 +;; to be respected here.
20337 +
20338 +(define_insn_reservation "marvell_f_multiply_3" 3
20339 + (and (eq_attr "tune" "marvell_f")
20340 + (eq_attr "insn" "mla,mlas,smlal,umlal,smlaxy,smlalxy,smlawx,\
20341 + smlawy,smlals,umlals"))
20342 + "reg_shift_lock+m_1,m_2,m_3,m_wb")
20343 +
20344 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20345 +;; Branch instructions
20346 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20347 +
20348 +;; Conditional backward b instructions can have a zero-cycle penalty, and
20349 +;; other conditional b and bl instructions have a one-cycle penalty if
20350 +;; predicted correctly. Currently we model the zero-cycle case for all
20351 +;; branches.
20352 +
20353 +(define_insn_reservation "marvell_f_branches" 0
20354 + (and (eq_attr "tune" "marvell_f")
20355 + (eq_attr "type" "branch"))
20356 + "nothing")
20357 +
20358 +;; Call latencies are not predictable; a semi-arbitrary very large
20359 +;; number is used as "positive infinity" for such latencies.
20360 +
20361 +(define_insn_reservation "marvell_f_call" 32
20362 + (and (eq_attr "tune" "marvell_f")
20363 + (eq_attr "type" "call"))
20364 + "nothing")
20365 +
20366 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20367 +;; Load/store instructions
20368 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20369 +
20370 +;; The models for load/store instructions do not accurately describe
20371 +;; the difference between operations with a base register writeback.
20372 +;; These models assume that all memory references hit in dcache.
20373 +
20374 +;; 1. Load/store for single registers.
20375 +
20376 +;; The worst case for a load is when the load result is needed in E1
20377 +;; (for example for a register shift), giving a latency of four. Loads
20378 +;; skip E1 and access memory at the E2 stage.
20379 +
20380 +(define_insn_reservation "marvell_f_load1" 4
20381 + (and (eq_attr "tune" "marvell_f")
20382 + (eq_attr "type" "load1,load_byte"))
20383 + "a1_e2+sram,a1_of,a1_wr,a1_wb")
20384 +
20385 +;; The result for a load may be bypassed (to be available at the same
20386 +;; time as the load arrives in the WR stage, so effectively at the OF
20387 +;; stage) to the Rn operand at E2 with a latency of two. The result may
20388 +;; be bypassed to a non-Rn operand at E2 with a latency of three. For
20389 +;; instructions without shifts, detection of an Rn bypass situation is
20390 +;; difficult (because some of the instruction patterns switch their
20391 +;; operands), and so we do not model that here. For instructions with
20392 +;; shifts, the operand used at E2 will always be Rn, and so we can
20393 +;; model the latency-two bypass for these.
20394 +
20395 +(define_bypass 2 "marvell_f_load1"
20396 + "marvell_f_alu_shift_op"
20397 + "arm_no_early_alu_shift_value_dep")
20398 +
20399 +(define_bypass 2 "marvell_f_load1"
20400 + "marvell_f_alu_shift_reg_op"
20401 + "arm_no_early_alu_shift_dep")
20402 +
20403 +;; Stores write at the WR stage and loads read at the E2 stage, giving
20404 +;; a store latency of three.
20405 +
20406 +(define_insn_reservation "marvell_f_store1" 3
20407 + (and (eq_attr "tune" "marvell_f")
20408 + (eq_attr "type" "store1"))
20409 + "a1_e2,a1_of,a1_wr+sram,a1_wb")
20410 +
20411 +;; 2. Load/store for two consecutive registers. These may be dealt
20412 +;; with in the same number of cycles as single loads and stores.
20413 +
20414 +(define_insn_reservation "marvell_f_load2" 4
20415 + (and (eq_attr "tune" "marvell_f")
20416 + (eq_attr "type" "load2"))
20417 + "a1_e2+sram,a1_of,a1_wr,a1_wb")
20418 +
20419 +(define_insn_reservation "marvell_f_store2" 3
20420 + (and (eq_attr "tune" "marvell_f")
20421 + (eq_attr "type" "store2"))
20422 + "a1_e2,a1_of,a1_wr+sram,a1_wb")
20423 +
20424 +;; The first word of a doubleword load is eligible for the latency-two
20425 +;; bypass described above for single loads, but this is not modelled here.
20426 +;; We do however assume that either word may also be bypassed with
20427 +;; latency three for ALU operations with shifts (where the shift value and
20428 +;; amount do not depend on the loaded value) and latency four for ALU
20429 +;; operations without shifts. The latency four case is of course the default.
20430 +
20431 +(define_bypass 3 "marvell_f_load2"
20432 + "marvell_f_alu_shift_op"
20433 + "arm_no_early_alu_shift_value_dep")
20434 +
20435 +(define_bypass 3 "marvell_f_load2"
20436 + "marvell_f_alu_shift_reg_op"
20437 + "arm_no_early_alu_shift_dep")
20438 +
20439 +;; 3. Load/store for more than two registers.
20440 +
20441 +;; These instructions stall for an extra cycle in the decode stage;
20442 +;; individual load/store instructions for each register are then issued.
20443 +;; The load/store multiple instruction itself is removed from the decode
20444 +;; stage at the same time as the final load/store instruction is issued.
20445 +;; To complicate matters, pairs of loads/stores referencing two
20446 +;; consecutive registers will be issued together as doubleword operations.
20447 +;; We model a 3-word load as an LDR plus an LDRD, and a 4-word load
20448 +;; as two LDRDs; thus, these are allocated the same latencies (the
20449 +;; latency for two consecutive loads plus one for the setup stall).
20450 +;; The extra stall is modelled by reserving E1.
20451 +
20452 +(define_insn_reservation "marvell_f_load3_4" 6
20453 + (and (eq_attr "tune" "marvell_f")
20454 + (eq_attr "type" "load3,load4"))
20455 + "a1_e1,a1_e1+a1_e2+sram,a1_e2+sram+a1_of,a1_of+a1_wr,a1_wr+a1_wb,a1_wb")
20456 +
20457 +;; Bypasses are possible for ldm as for single loads, but we do not
20458 +;; model them here since the order of the constituent loads is
20459 +;; difficult to predict.
20460 +
20461 +(define_insn_reservation "marvell_f_store3_4" 5
20462 + (and (eq_attr "tune" "marvell_f")
20463 + (eq_attr "type" "store3,store4"))
20464 + "a1_e1,a1_e1+a1_e2,a1_e2+a1_of,a1_of+a1_wr+sram,a1_wr+sram+a1_wb,a1_wb")
20465 +
20466 --- /dev/null
20467 +++ b/gcc/config/arm/montavista-linux.h
20468 @@ -0,0 +1,33 @@
20469 +/* MontaVista GNU/Linux Configuration.
20470 + Copyright (C) 2009
20471 + Free Software Foundation, Inc.
20472 +
20473 +This file is part of GCC.
20474 +
20475 +GCC is free software; you can redistribute it and/or modify
20476 +it under the terms of the GNU General Public License as published by
20477 +the Free Software Foundation; either version 3, or (at your option)
20478 +any later version.
20479 +
20480 +GCC is distributed in the hope that it will be useful,
20481 +but WITHOUT ANY WARRANTY; without even the implied warranty of
20482 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20483 +GNU General Public License for more details.
20484 +
20485 +You should have received a copy of the GNU General Public License
20486 +along with GCC; see the file COPYING3. If not see
20487 +<http://www.gnu.org/licenses/>. */
20488 +
20489 +/* Add -tarmv6 and -tthumb2 options for convenience in generating multilibs.
20490 +*/
20491 +#undef CC1_SPEC
20492 +#define CC1_SPEC " \
20493 + %{tarmv6: -march=armv6 -mfloat-abi=softfp ; \
20494 + tthumb2: -mthumb -march=armv7-a -mfloat-abi=softfp ; \
20495 + : -march=armv5t}"
20496 +
20497 +/* The various C libraries each have their own subdirectory. */
20498 +#undef SYSROOT_SUFFIX_SPEC
20499 +#define SYSROOT_SUFFIX_SPEC \
20500 + "%{tarmv6:/armv6 ; \
20501 + tthumb2:/thumb2}"
20502 --- a/gcc/config/arm/neon-gen.ml
20503 +++ b/gcc/config/arm/neon-gen.ml
20504 @@ -402,7 +402,11 @@ let _ =
20505 "extern \"C\" {";
20506 "#endif";
20507 "";
20508 +"#if defined (__vxworks) && defined (_WRS_KERNEL)";
20509 +"#include <vxWorks.h>";
20510 +"#else";
20511 "#include <stdint.h>";
20512 +"#endif";
20513 ""];
20514 deftypes ();
20515 arrtypes ();
20516 --- a/gcc/config/arm/neon-testgen.ml
20517 +++ b/gcc/config/arm/neon-testgen.ml
20518 @@ -51,8 +51,8 @@ let emit_prologue chan test_name =
20519 Printf.fprintf chan "/* This file was autogenerated by neon-testgen. */\n\n";
20520 Printf.fprintf chan "/* { dg-do assemble } */\n";
20521 Printf.fprintf chan "/* { dg-require-effective-target arm_neon_ok } */\n";
20522 - Printf.fprintf chan
20523 - "/* { dg-options \"-save-temps -O0 -mfpu=neon -mfloat-abi=softfp\" } */\n";
20524 + Printf.fprintf chan "/* { dg-options \"-save-temps -O0\" } */\n";
20525 + Printf.fprintf chan "/* { dg-add-options arm_neon } */\n";
20526 Printf.fprintf chan "\n#include \"arm_neon.h\"\n\n";
20527 Printf.fprintf chan "void test_%s (void)\n{\n" test_name
20528
20529 --- a/gcc/config/arm/neon.md
20530 +++ b/gcc/config/arm/neon.md
20531 @@ -159,7 +159,8 @@
20532 (UNSPEC_VUZP1 201)
20533 (UNSPEC_VUZP2 202)
20534 (UNSPEC_VZIP1 203)
20535 - (UNSPEC_VZIP2 204)])
20536 + (UNSPEC_VZIP2 204)
20537 + (UNSPEC_MISALIGNED_ACCESS 205)])
20538
20539 ;; Double-width vector modes.
20540 (define_mode_iterator VD [V8QI V4HI V2SI V2SF])
20541 @@ -427,76 +428,7 @@
20542 ;; neon_type attribute definitions.
20543 (define_attr "vqh_mnem" "vadd,vmin,vmax" (const_string "vadd"))
20544
20545 -;; Classification of NEON instructions for scheduling purposes.
20546 -;; Do not set this attribute and the "type" attribute together in
20547 -;; any one instruction pattern.
20548 -(define_attr "neon_type"
20549 - "neon_int_1,\
20550 - neon_int_2,\
20551 - neon_int_3,\
20552 - neon_int_4,\
20553 - neon_int_5,\
20554 - neon_vqneg_vqabs,\
20555 - neon_vmov,\
20556 - neon_vaba,\
20557 - neon_vsma,\
20558 - neon_vaba_qqq,\
20559 - neon_mul_ddd_8_16_qdd_16_8_long_32_16_long,\
20560 - neon_mul_qqq_8_16_32_ddd_32,\
20561 - neon_mul_qdd_64_32_long_qqd_16_ddd_32_scalar_64_32_long_scalar,\
20562 - neon_mla_ddd_8_16_qdd_16_8_long_32_16_long,\
20563 - neon_mla_qqq_8_16,\
20564 - neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long,\
20565 - neon_mla_qqq_32_qqd_32_scalar,\
20566 - neon_mul_ddd_16_scalar_32_16_long_scalar,\
20567 - neon_mul_qqd_32_scalar,\
20568 - neon_mla_ddd_16_scalar_qdd_32_16_long_scalar,\
20569 - neon_shift_1,\
20570 - neon_shift_2,\
20571 - neon_shift_3,\
20572 - neon_vshl_ddd,\
20573 - neon_vqshl_vrshl_vqrshl_qqq,\
20574 - neon_vsra_vrsra,\
20575 - neon_fp_vadd_ddd_vabs_dd,\
20576 - neon_fp_vadd_qqq_vabs_qq,\
20577 - neon_fp_vsum,\
20578 - neon_fp_vmul_ddd,\
20579 - neon_fp_vmul_qqd,\
20580 - neon_fp_vmla_ddd,\
20581 - neon_fp_vmla_qqq,\
20582 - neon_fp_vmla_ddd_scalar,\
20583 - neon_fp_vmla_qqq_scalar,\
20584 - neon_fp_vrecps_vrsqrts_ddd,\
20585 - neon_fp_vrecps_vrsqrts_qqq,\
20586 - neon_bp_simple,\
20587 - neon_bp_2cycle,\
20588 - neon_bp_3cycle,\
20589 - neon_ldr,\
20590 - neon_str,\
20591 - neon_vld1_1_2_regs,\
20592 - neon_vld1_3_4_regs,\
20593 - neon_vld2_2_regs_vld1_vld2_all_lanes,\
20594 - neon_vld2_4_regs,\
20595 - neon_vld3_vld4,\
20596 - neon_vst1_1_2_regs_vst2_2_regs,\
20597 - neon_vst1_3_4_regs,\
20598 - neon_vst2_4_regs_vst3_vst4,\
20599 - neon_vst3_vst4,\
20600 - neon_vld1_vld2_lane,\
20601 - neon_vld3_vld4_lane,\
20602 - neon_vst1_vst2_lane,\
20603 - neon_vst3_vst4_lane,\
20604 - neon_vld3_vld4_all_lanes,\
20605 - neon_mcr,\
20606 - neon_mcr_2_mcrr,\
20607 - neon_mrc,\
20608 - neon_mrrc,\
20609 - neon_ldm_2,\
20610 - neon_stm_2,\
20611 - none"
20612 - (const_string "none"))
20613 -
20614 -;; Predicates used for setting the above attribute.
20615 +;; Predicates used for setting neon_type
20616
20617 (define_mode_attr Is_float_mode [(V8QI "false") (V16QI "false")
20618 (V4HI "false") (V8HI "false")
20619 @@ -550,7 +482,7 @@
20620
20621 /* FIXME: If the memory layout is changed in big-endian mode, output_move_vfp
20622 below must be changed to output_move_neon (which will use the
20623 - element/structure loads/stores), and the constraint changed to 'Un' instead
20624 + element/structure loads/stores), and the constraint changed to 'Um' instead
20625 of 'Uv'. */
20626
20627 switch (which_alternative)
20628 @@ -639,7 +571,8 @@
20629 default: gcc_unreachable ();
20630 }
20631 }
20632 - [(set_attr "length" "<V_slen>,<V_slen>,<V_slen>")])
20633 + [(set_attr "neon_type" "neon_int_1,neon_stm_2,neon_ldm_2")
20634 + (set_attr "length" "<V_slen>,<V_slen>,<V_slen>")])
20635
20636 (define_split
20637 [(set (match_operand:EI 0 "s_register_operand" "")
20638 @@ -726,6 +659,41 @@
20639 neon_disambiguate_copy (operands, dest, src, 4);
20640 })
20641
20642 +(define_expand "movmisalign<mode>"
20643 + [(set (match_operand:VDQX 0 "nonimmediate_operand" "")
20644 + (unspec:VDQX [(match_operand:VDQX 1 "general_operand" "")]
20645 + UNSPEC_MISALIGNED_ACCESS))]
20646 + "TARGET_NEON && !BYTES_BIG_ENDIAN"
20647 +{
20648 + if (!s_register_operand (operands[0], <MODE>mode)
20649 + && !s_register_operand (operands[1], <MODE>mode))
20650 + FAIL;
20651 +})
20652 +
20653 +(define_insn "*movmisalign<mode>_neon"
20654 + [(set (match_operand:VDX 0 "nonimmediate_operand" "=Um,w")
20655 + (unspec:VDX [(match_operand:VDX 1 "general_operand" " w, Um")]
20656 + UNSPEC_MISALIGNED_ACCESS))]
20657 + "TARGET_NEON && !BYTES_BIG_ENDIAN
20658 + && ( s_register_operand (operands[0], <MODE>mode)
20659 + || s_register_operand (operands[1], <MODE>mode))"
20660 + "@
20661 + vst1.<V_sz_elem>\t{%P1}, %A0
20662 + vld1.<V_sz_elem>\t{%P0}, %A1"
20663 + [(set_attr "neon_type" "neon_vst1_1_2_regs_vst2_2_regs,neon_vld1_1_2_regs")])
20664 +
20665 +(define_insn "*movmisalign<mode>_neon"
20666 + [(set (match_operand:VQX 0 "nonimmediate_operand" "=Um,w")
20667 + (unspec:VQX [(match_operand:VQX 1 "general_operand" " w, Um")]
20668 + UNSPEC_MISALIGNED_ACCESS))]
20669 + "TARGET_NEON && !BYTES_BIG_ENDIAN
20670 + && ( s_register_operand (operands[0], <MODE>mode)
20671 + || s_register_operand (operands[1], <MODE>mode))"
20672 + "@
20673 + vst1.<V_sz_elem>\t{%q1}, %A0
20674 + vld1.<V_sz_elem>\t{%q0}, %A1"
20675 + [(set_attr "neon_type" "neon_vst1_1_2_regs_vst2_2_regs,neon_vld1_1_2_regs")])
20676 +
20677 (define_insn "vec_set<mode>_internal"
20678 [(set (match_operand:VD 0 "s_register_operand" "=w")
20679 (vec_merge:VD
20680 @@ -735,7 +703,10 @@
20681 (match_operand:SI 2 "immediate_operand" "i")))]
20682 "TARGET_NEON"
20683 {
20684 - operands[2] = GEN_INT (ffs ((int) INTVAL (operands[2]) - 1));
20685 + int elt = ffs ((int) INTVAL (operands[2]) - 1);
20686 + if (BYTES_BIG_ENDIAN)
20687 + elt = GET_MODE_NUNITS (<MODE>mode) - 1 - elt;
20688 + operands[2] = GEN_INT (elt);
20689
20690 return "vmov%?.<V_uf_sclr>\t%P0[%c2], %1";
20691 }
20692 @@ -757,6 +728,9 @@
20693 int hi = (elem / half_elts) * 2;
20694 int regno = REGNO (operands[0]);
20695
20696 + if (BYTES_BIG_ENDIAN)
20697 + elt = half_elts - 1 - elt;
20698 +
20699 operands[0] = gen_rtx_REG (<V_HALF>mode, regno + hi);
20700 operands[2] = GEN_INT (elt);
20701
20702 @@ -804,7 +778,15 @@
20703 (match_operand:VD 1 "s_register_operand" "w")
20704 (parallel [(match_operand:SI 2 "immediate_operand" "i")])))]
20705 "TARGET_NEON"
20706 - "vmov%?.<V_uf_sclr>\t%0, %P1[%c2]"
20707 +{
20708 + if (BYTES_BIG_ENDIAN)
20709 + {
20710 + int elt = INTVAL (operands[2]);
20711 + elt = GET_MODE_NUNITS (<MODE>mode) - 1 - elt;
20712 + operands[2] = GEN_INT (elt);
20713 + }
20714 + return "vmov%?.<V_uf_sclr>\t%0, %P1[%c2]";
20715 +}
20716 [(set_attr "predicable" "yes")
20717 (set_attr "neon_type" "neon_bp_simple")]
20718 )
20719 @@ -821,6 +803,9 @@
20720 int hi = (INTVAL (operands[2]) / half_elts) * 2;
20721 int regno = REGNO (operands[1]);
20722
20723 + if (BYTES_BIG_ENDIAN)
20724 + elt = half_elts - 1 - elt;
20725 +
20726 operands[1] = gen_rtx_REG (<V_HALF>mode, regno + hi);
20727 operands[2] = GEN_INT (elt);
20728
20729 @@ -913,6 +898,50 @@
20730 (const_string "neon_mul_qqq_8_16_32_ddd_32")))))]
20731 )
20732
20733 +(define_insn "*mul<mode>3add<mode>_neon"
20734 + [(set (match_operand:VDQ 0 "s_register_operand" "=w")
20735 + (plus:VDQ (mult:VDQ (match_operand:VDQ 2 "s_register_operand" "w")
20736 + (match_operand:VDQ 3 "s_register_operand" "w"))
20737 + (match_operand:VDQ 1 "s_register_operand" "0")))]
20738 + "TARGET_NEON"
20739 + "vmla.<V_if_elem>\t%<V_reg>0, %<V_reg>2, %<V_reg>3"
20740 + [(set (attr "neon_type")
20741 + (if_then_else (ne (symbol_ref "<Is_float_mode>") (const_int 0))
20742 + (if_then_else (ne (symbol_ref "<Is_d_reg>") (const_int 0))
20743 + (const_string "neon_fp_vmla_ddd")
20744 + (const_string "neon_fp_vmla_qqq"))
20745 + (if_then_else (ne (symbol_ref "<Is_d_reg>") (const_int 0))
20746 + (if_then_else
20747 + (ne (symbol_ref "<Scalar_mul_8_16>") (const_int 0))
20748 + (const_string "neon_mla_ddd_8_16_qdd_16_8_long_32_16_long")
20749 + (const_string "neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long"))
20750 + (if_then_else (ne (symbol_ref "<Scalar_mul_8_16>") (const_int 0))
20751 + (const_string "neon_mla_qqq_8_16")
20752 + (const_string "neon_mla_qqq_32_qqd_32_scalar")))))]
20753 +)
20754 +
20755 +(define_insn "*mul<mode>3neg<mode>add<mode>_neon"
20756 + [(set (match_operand:VDQ 0 "s_register_operand" "=w")
20757 + (minus:VDQ (match_operand:VDQ 1 "s_register_operand" "0")
20758 + (mult:VDQ (match_operand:VDQ 2 "s_register_operand" "w")
20759 + (match_operand:VDQ 3 "s_register_operand" "w"))))]
20760 + "TARGET_NEON"
20761 + "vmls.<V_if_elem>\t%<V_reg>0, %<V_reg>2, %<V_reg>3"
20762 + [(set (attr "neon_type")
20763 + (if_then_else (ne (symbol_ref "<Is_float_mode>") (const_int 0))
20764 + (if_then_else (ne (symbol_ref "<Is_d_reg>") (const_int 0))
20765 + (const_string "neon_fp_vmla_ddd")
20766 + (const_string "neon_fp_vmla_qqq"))
20767 + (if_then_else (ne (symbol_ref "<Is_d_reg>") (const_int 0))
20768 + (if_then_else
20769 + (ne (symbol_ref "<Scalar_mul_8_16>") (const_int 0))
20770 + (const_string "neon_mla_ddd_8_16_qdd_16_8_long_32_16_long")
20771 + (const_string "neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long"))
20772 + (if_then_else (ne (symbol_ref "<Scalar_mul_8_16>") (const_int 0))
20773 + (const_string "neon_mla_qqq_8_16")
20774 + (const_string "neon_mla_qqq_32_qqd_32_scalar")))))]
20775 +)
20776 +
20777 (define_insn "ior<mode>3"
20778 [(set (match_operand:VDQ 0 "s_register_operand" "=w,w")
20779 (ior:VDQ (match_operand:VDQ 1 "s_register_operand" "w,0")
20780 @@ -2413,7 +2442,15 @@
20781 (match_operand:VD 1 "s_register_operand" "w")
20782 (parallel [(match_operand:SI 2 "immediate_operand" "i")]))))]
20783 "TARGET_NEON"
20784 - "vmov%?.s<V_sz_elem>\t%0, %P1[%c2]"
20785 +{
20786 + if (BYTES_BIG_ENDIAN)
20787 + {
20788 + int elt = INTVAL (operands[2]);
20789 + elt = GET_MODE_NUNITS (<MODE>mode) - 1 - elt;
20790 + operands[2] = GEN_INT (elt);
20791 + }
20792 + return "vmov%?.s<V_sz_elem>\t%0, %P1[%c2]";
20793 +}
20794 [(set_attr "predicable" "yes")
20795 (set_attr "neon_type" "neon_bp_simple")]
20796 )
20797 @@ -2425,7 +2462,15 @@
20798 (match_operand:VD 1 "s_register_operand" "w")
20799 (parallel [(match_operand:SI 2 "immediate_operand" "i")]))))]
20800 "TARGET_NEON"
20801 - "vmov%?.u<V_sz_elem>\t%0, %P1[%c2]"
20802 +{
20803 + if (BYTES_BIG_ENDIAN)
20804 + {
20805 + int elt = INTVAL (operands[2]);
20806 + elt = GET_MODE_NUNITS (<MODE>mode) - 1 - elt;
20807 + operands[2] = GEN_INT (elt);
20808 + }
20809 + return "vmov%?.u<V_sz_elem>\t%0, %P1[%c2]";
20810 +}
20811 [(set_attr "predicable" "yes")
20812 (set_attr "neon_type" "neon_bp_simple")]
20813 )
20814 @@ -2442,10 +2487,14 @@
20815 int regno = REGNO (operands[1]);
20816 unsigned int halfelts = GET_MODE_NUNITS (<MODE>mode) / 2;
20817 unsigned int elt = INTVAL (operands[2]);
20818 + unsigned int elt_adj = elt % halfelts;
20819 +
20820 + if (BYTES_BIG_ENDIAN)
20821 + elt_adj = halfelts - 1 - elt_adj;
20822
20823 ops[0] = operands[0];
20824 ops[1] = gen_rtx_REG (<V_HALF>mode, regno + 2 * (elt / halfelts));
20825 - ops[2] = GEN_INT (elt % halfelts);
20826 + ops[2] = GEN_INT (elt_adj);
20827 output_asm_insn ("vmov%?.s<V_sz_elem>\t%0, %P1[%c2]", ops);
20828
20829 return "";
20830 @@ -2466,10 +2515,14 @@
20831 int regno = REGNO (operands[1]);
20832 unsigned int halfelts = GET_MODE_NUNITS (<MODE>mode) / 2;
20833 unsigned int elt = INTVAL (operands[2]);
20834 + unsigned int elt_adj = elt % halfelts;
20835 +
20836 + if (BYTES_BIG_ENDIAN)
20837 + elt_adj = halfelts - 1 - elt_adj;
20838
20839 ops[0] = operands[0];
20840 ops[1] = gen_rtx_REG (<V_HALF>mode, regno + 2 * (elt / halfelts));
20841 - ops[2] = GEN_INT (elt % halfelts);
20842 + ops[2] = GEN_INT (elt_adj);
20843 output_asm_insn ("vmov%?.u<V_sz_elem>\t%0, %P1[%c2]", ops);
20844
20845 return "";
20846 @@ -2490,6 +2543,20 @@
20847
20848 neon_lane_bounds (operands[2], 0, GET_MODE_NUNITS (<MODE>mode));
20849
20850 + if (BYTES_BIG_ENDIAN)
20851 + {
20852 + /* The intrinsics are defined in terms of a model where the
20853 + element ordering in memory is vldm order, whereas the generic
20854 + RTL is defined in terms of a model where the element ordering
20855 + in memory is array order. Convert the lane number to conform
20856 + to this model. */
20857 + unsigned int elt = INTVAL (operands[2]);
20858 + unsigned int reg_nelts
20859 + = 64 / GET_MODE_BITSIZE (GET_MODE_INNER (<MODE>mode));
20860 + elt ^= reg_nelts - 1;
20861 + operands[2] = GEN_INT (elt);
20862 + }
20863 +
20864 if ((magic & 3) == 3 || GET_MODE_BITSIZE (GET_MODE_INNER (<MODE>mode)) == 32)
20865 insn = gen_vec_extract<mode> (operands[0], operands[1], operands[2]);
20866 else
20867 --- a/gcc/config/arm/netbsd.h
20868 +++ b/gcc/config/arm/netbsd.h
20869 @@ -101,7 +101,7 @@
20870 /* Although not normally relevant (since by default, all aggregates
20871 are returned in memory) compiling some parts of libc requires
20872 non-APCS style struct returns. */
20873 -#undef RETURN_IN_MEMORY
20874 +#undef TARGET_RETURN_IN_MEMORY
20875
20876 /* VERY BIG NOTE : Change of structure alignment for RiscBSD.
20877 There are consequences you should be aware of...
20878 --- /dev/null
20879 +++ b/gcc/config/arm/nocrt0.h
20880 @@ -0,0 +1,24 @@
20881 +/* Definitions for generic libgloss based cofigs where crt0 is supplied by
20882 + the linker script.
20883 + Copyright (C) 2006 Free Software Foundation, Inc.
20884 +
20885 + This file is part of GCC.
20886 +
20887 + GCC is free software; you can redistribute it and/or modify it
20888 + under the terms of the GNU General Public License as published
20889 + by the Free Software Foundation; either version 3, or (at your
20890 + option) any later version.
20891 +
20892 + GCC is distributed in the hope that it will be useful, but WITHOUT
20893 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20894 + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
20895 + License for more details.
20896 +
20897 + You should have received a copy of the GNU General Public License
20898 + along with GCC; see the file COPYING3. If not see
20899 + <http://www.gnu.org/licenses/>. */
20900 +
20901 +#undef STARTFILE_SPEC
20902 +#define STARTFILE_SPEC " crti%O%s crtbegin%O%s"
20903 +
20904 +#define LIB_SPEC "-lc"
20905 --- a/gcc/config/arm/predicates.md
20906 +++ b/gcc/config/arm/predicates.md
20907 @@ -168,6 +168,11 @@
20908 (and (match_code "plus,minus,ior,xor,and")
20909 (match_test "mode == GET_MODE (op)")))
20910
20911 +;; True for plus/minus operators
20912 +(define_special_predicate "plusminus_operator"
20913 + (and (match_code "plus,minus")
20914 + (match_test "mode == GET_MODE (op)")))
20915 +
20916 ;; True for logical binary operators.
20917 (define_special_predicate "logical_binary_operator"
20918 (and (match_code "ior,xor,and")
20919 @@ -291,6 +296,9 @@
20920 HOST_WIDE_INT i = 1, base = 0;
20921 rtx elt;
20922
20923 + if (low_irq_latency)
20924 + return false;
20925 +
20926 if (count <= 1
20927 || GET_CODE (XVECEXP (op, 0, 0)) != SET)
20928 return false;
20929 @@ -348,6 +356,9 @@
20930 HOST_WIDE_INT i = 1, base = 0;
20931 rtx elt;
20932
20933 + if (low_irq_latency)
20934 + return false;
20935 +
20936 if (count <= 1
20937 || GET_CODE (XVECEXP (op, 0, 0)) != SET)
20938 return false;
20939 --- /dev/null
20940 +++ b/gcc/config/arm/sfp-machine.h
20941 @@ -0,0 +1,100 @@
20942 +#define _FP_W_TYPE_SIZE 32
20943 +#define _FP_W_TYPE unsigned long
20944 +#define _FP_WS_TYPE signed long
20945 +#define _FP_I_TYPE long
20946 +
20947 +#define _FP_MUL_MEAT_S(R,X,Y) \
20948 + _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
20949 +#define _FP_MUL_MEAT_D(R,X,Y) \
20950 + _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
20951 +#define _FP_MUL_MEAT_Q(R,X,Y) \
20952 + _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
20953 +
20954 +#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_loop(S,R,X,Y)
20955 +#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
20956 +#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
20957 +
20958 +#define _FP_NANFRAC_H ((_FP_QNANBIT_H << 1) - 1)
20959 +#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
20960 +#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1
20961 +#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
20962 +#define _FP_NANSIGN_H 0
20963 +#define _FP_NANSIGN_S 0
20964 +#define _FP_NANSIGN_D 0
20965 +#define _FP_NANSIGN_Q 0
20966 +
20967 +#define _FP_KEEPNANFRACP 1
20968 +
20969 +/* Someone please check this. */
20970 +#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
20971 + do { \
20972 + if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \
20973 + && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \
20974 + { \
20975 + R##_s = Y##_s; \
20976 + _FP_FRAC_COPY_##wc(R,Y); \
20977 + } \
20978 + else \
20979 + { \
20980 + R##_s = X##_s; \
20981 + _FP_FRAC_COPY_##wc(R,X); \
20982 + } \
20983 + R##_c = FP_CLS_NAN; \
20984 + } while (0)
20985 +
20986 +#define __LITTLE_ENDIAN 1234
20987 +#define __BIG_ENDIAN 4321
20988 +
20989 +#if defined __ARMEB__
20990 +# define __BYTE_ORDER __BIG_ENDIAN
20991 +#else
20992 +# define __BYTE_ORDER __LITTLE_ENDIAN
20993 +#endif
20994 +
20995 +
20996 +/* Define ALIASNAME as a strong alias for NAME. */
20997 +# define strong_alias(name, aliasname) _strong_alias(name, aliasname)
20998 +# define _strong_alias(name, aliasname) \
20999 + extern __typeof (name) aliasname __attribute__ ((alias (#name)));
21000 +
21001 +#ifdef __ARM_EABI__
21002 +/* Rename functions to their EABI names. */
21003 +/* The comparison functions need wrappers for EABI semantics, so
21004 + leave them unmolested. */
21005 +#define __negsf2 __aeabi_fneg
21006 +#define __subsf3 __aeabi_fsub
21007 +#define __addsf3 __aeabi_fadd
21008 +#define __floatunsisf __aeabi_ui2f
21009 +#define __floatsisf __aeabi_i2f
21010 +#define __floatundisf __aeabi_ul2f
21011 +#define __floatdisf __aeabi_l2f
21012 +#define __mulsf3 __aeabi_fmul
21013 +#define __divsf3 __aeabi_fdiv
21014 +#define __unordsf2 __aeabi_fcmpun
21015 +#define __fixsfsi __aeabi_f2iz
21016 +#define __fixunssfsi __aeabi_f2uiz
21017 +#define __fixsfdi __aeabi_f2lz
21018 +#define __fixunssfdi __aeabi_f2ulz
21019 +#define __floatdisf __aeabi_l2f
21020 +
21021 +#define __negdf2 __aeabi_dneg
21022 +#define __subdf3 __aeabi_dsub
21023 +#define __adddf3 __aeabi_dadd
21024 +#define __floatunsidf __aeabi_ui2d
21025 +#define __floatsidf __aeabi_i2d
21026 +#define __extendsfdf2 __aeabi_f2d
21027 +#define __truncdfsf2 __aeabi_d2f
21028 +#define __floatundidf __aeabi_ul2d
21029 +#define __floatdidf __aeabi_l2d
21030 +#define __muldf3 __aeabi_dmul
21031 +#define __divdf3 __aeabi_ddiv
21032 +#define __unorddf2 __aeabi_dcmpun
21033 +#define __fixdfsi __aeabi_d2iz
21034 +#define __fixunsdfsi __aeabi_d2uiz
21035 +#define __fixdfdi __aeabi_d2lz
21036 +#define __fixunsdfdi __aeabi_d2ulz
21037 +#define __floatdidf __aeabi_l2d
21038 +#define __extendhfsf2 __gnu_h2f_ieee
21039 +#define __truncsfhf2 __gnu_f2h_ieee
21040 +
21041 +#endif /* __ARM_EABI__ */
21042 --- a/gcc/config/arm/symbian.h
21043 +++ b/gcc/config/arm/symbian.h
21044 @@ -101,3 +101,5 @@
21045
21046 /* SymbianOS cannot merge entities with vague linkage at runtime. */
21047 #define TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P false
21048 +
21049 +#define TARGET_DEFAULT_WORD_RELOCATIONS 1
21050 --- a/gcc/config/arm/t-arm
21051 +++ b/gcc/config/arm/t-arm
21052 @@ -13,7 +13,9 @@ MD_INCLUDES= $(srcdir)/config/arm/arm-t
21053 $(srcdir)/config/arm/iwmmxt.md \
21054 $(srcdir)/config/arm/vfp.md \
21055 $(srcdir)/config/arm/neon.md \
21056 - $(srcdir)/config/arm/thumb2.md
21057 + $(srcdir)/config/arm/thumb2.md \
21058 + $(srcdir)/config/arm/marvell-f.md \
21059 + $(srcdir)/config/arm/hwdiv.md
21060
21061 s-config s-conditions s-flags s-codes s-constants s-emit s-recog s-preds \
21062 s-opinit s-extract s-peep s-attr s-attrtab s-output: $(MD_INCLUDES)
21063 --- a/gcc/config/arm/t-arm-elf
21064 +++ b/gcc/config/arm/t-arm-elf
21065 @@ -1,25 +1,68 @@
21066 LIB1ASMSRC = arm/lib1funcs.asm
21067 +# For most CPUs we have an assembly soft-float implementations.
21068 +# However this is not true for ARMv6M. Here we want to use the soft-fp C
21069 +# implementation. The soft-fp code is only build for ARMv6M. This pulls
21070 +# in the asm implementation for other CPUs.
21071 LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
21072 _call_via_rX _interwork_call_via_rX \
21073 _lshrdi3 _ashrdi3 _ashldi3 \
21074 - _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
21075 - _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
21076 - _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf
21077 + _arm_negdf2 _arm_addsubdf3 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
21078 + _arm_fixdfsi _arm_fixunsdfsi \
21079 + _arm_truncdfsf2 _arm_negsf2 _arm_addsubsf3 _arm_muldivsf3 \
21080 + _arm_cmpsf2 _arm_unordsf2 _arm_fixsfsi _arm_fixunssfsi \
21081 + _arm_floatdidf _arm_floatdisf _arm_floatundidf _arm_floatundisf
21082 +
21083 +# We build 4 multilibs:
21084 +# ./ (default)
21085 +# thumb/ -mthumb
21086 +# thumb2/ -mthumb -march=armv7
21087 +# armv6-m/ -mthumb -march=armv6-m
21088
21089 -MULTILIB_OPTIONS = marm/mthumb
21090 -MULTILIB_DIRNAMES = arm thumb
21091 +MULTILIB_OPTIONS = mthumb
21092 +MULTILIB_DIRNAMES = thumb
21093 MULTILIB_EXCEPTIONS =
21094 MULTILIB_MATCHES =
21095
21096 -#MULTILIB_OPTIONS += march=armv7
21097 -#MULTILIB_DIRNAMES += thumb2
21098 -#MULTILIB_EXCEPTIONS += march=armv7* marm/*march=armv7*
21099 -#MULTILIB_MATCHES += march?armv7=march?armv7-a
21100 -#MULTILIB_MATCHES += march?armv7=march?armv7-r
21101 -#MULTILIB_MATCHES += march?armv7=march?armv7-m
21102 -#MULTILIB_MATCHES += march?armv7=mcpu?cortex-a8
21103 -#MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4
21104 -#MULTILIB_MATCHES += march?armv7=mcpu?cortex-m3
21105 +MULTILIB_OPTIONS += march=armv7/march=armv6-m
21106 +MULTILIB_DIRNAMES += v7 v6-m
21107 +MULTILIB_EXCEPTIONS += march=armv7*
21108 +MULTILIB_MATCHES += march?armv7=march?armv7-a
21109 +MULTILIB_MATCHES += march?armv7=march?armv7-r
21110 +MULTILIB_MATCHES += march?armv7=march?armv7-m
21111 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a9
21112 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a8
21113 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4
21114 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4f
21115 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-m3
21116 +
21117 +MULTILIB_EXCEPTIONS += march=armv6-m
21118 +MULTILIB_MATCHES += march?armv6-m=mcpu?cortex-m1
21119 +MULTILIB_MATCHES += march?armv6-m=mcpu?cortex-m0
21120 +
21121 +# FIXME: We need a sane way of doing this.
21122 +# This isn't really a multilib, it's a hack to add an extra option
21123 +# to the v7-m multilib.
21124 +MULTILIB_OPTIONS += mfix-cortex-m3-ldrd
21125 +MULTILIB_DIRNAMES += broken_ldrd
21126 +
21127 +MULTILIB_EXCEPTIONS += mfix-cortex-m3-ldrd
21128 +MULTILIB_EXCEPTIONS += mthumb/mfix-cortex-m3-ldrd
21129 +MULTILIB_EXCEPTIONS += *march=armv6-m*mfix-cortex-m3-ldrd
21130 +
21131 +MULTILIB_ALIASES += mthumb/march?armv7/mfix-cortex-m3-ldrd=mthumb/march?armv7
21132 +
21133 +# As of at least 4.2, gcc passes the wrong -L options if some multilibs are
21134 +# omitted from MULTILIB_OSDIRNAMES
21135 +MULTILIB_OSDIRNAMES = mthumb=!thumb
21136 +MULTILIB_OSDIRNAMES += mthumb/march.armv7/mfix-cortex-m3-ldrd=!thumb2
21137 +MULTILIB_OSDIRNAMES += mthumb/march.armv6-m=!armv6-m
21138 +
21139 +# Not quite true. We can support hard-vfp calling in Thumb2, but how do we
21140 +# express that here? Also, we really need architecture v5e or later
21141 +# (mcrr etc).
21142 +# MULTILIB_OPTIONS += mfloat-abi=hard
21143 +# MULTILIB_DIRNAMES += fpu
21144 +# MULTILIB_EXCEPTIONS += *mthumb/*mfloat-abi=hard*
21145
21146 # MULTILIB_OPTIONS += mcpu=ep9312
21147 # MULTILIB_DIRNAMES += ep9312
21148 --- /dev/null
21149 +++ b/gcc/config/arm/t-arm-softfp
21150 @@ -0,0 +1,11 @@
21151 +softfp_float_modes := sf df
21152 +softfp_int_modes := si di
21153 +softfp_extensions := sfdf
21154 +softfp_truncations := dfsf
21155 +softfp_machine_header := arm/sfp-machine.h
21156 +softfp_exclude_libgcc2 := y
21157 +softfp_wrap_start := '\#ifdef __ARM_ARCH_6M__'
21158 +softfp_wrap_end := '\#endif'
21159 +
21160 +# softfp seems to be missing a whole bunch of prototypes.
21161 +TARGET_LIBGCC2_CFLAGS += -Wno-missing-prototypes
21162 --- /dev/null
21163 +++ b/gcc/config/arm/t-asa
21164 @@ -0,0 +1,45 @@
21165 +# Overrides for ASA
21166 +
21167 +# Here is the expected output from xgcc -print-multi-lib.
21168 +#
21169 +# .;@fno-omit-frame-pointer@mapcs-frame
21170 +# armv4t;@march=armv4t@fno-omit-frame-pointer@mapcs-frame
21171 +# armv6;@march=armv6@fno-omit-frame-pointer@mapcs-frame
21172 +# armv7a;@march=armv7-a@fno-omit-frame-pointer@mapcs-frame
21173 +# armv6f;@march=armv6@mfloat-abi=softfp@fno-omit-frame-pointer@mapcs-frame
21174 +# armv7af;@march=armv7-a@mfpu=neon@mfloat-abi=softfp@fno-omit-frame-pointer@mapcs-frame
21175 +# thumb2;@mthumb@march=armv7-a@fno-omit-frame-pointer@mapcs-frame
21176 +# thumb2f;@mthumb@march=armv7-a@mfpu=neon@mfloat-abi=softfp@fno-omit-frame-pointer@mapcs-frame
21177 +
21178 +MULTILIB_OPTIONS = mthumb march=armv4t/march=armv6/march=armv7-a mfpu=neon mfloat-abi=softfp
21179 +MULTILIB_DIRNAMES = thumb v4t v6 v7a neon softfp
21180 +MULTILIB_MATCHES =
21181 +
21182 +MULTILIB_EXTRA_OPTS = fno-omit-frame-pointer mapcs-frame
21183 +
21184 +MULTILIB_EXCEPTIONS = mthumb
21185 +MULTILIB_EXCEPTIONS += mfpu=neon*
21186 +MULTILIB_EXCEPTIONS += mfloat-abi=softfp
21187 +MULTILIB_EXCEPTIONS += *march=armv4t*/*mfpu=neon*
21188 +MULTILIB_EXCEPTIONS += *march=armv4t*/*mfloat-abi=softfp*
21189 +MULTILIB_EXCEPTIONS += march=armv6/*mfpu=neon*
21190 +MULTILIB_EXCEPTIONS += mthumb/mfpu=neon
21191 +MULTILIB_EXCEPTIONS += mthumb/mfloat-abi=softfp
21192 +MULTILIB_EXCEPTIONS += mthumb/mfpu=neon*
21193 +MULTILIB_EXCEPTIONS += mthumb/march=armv6/mfpu=neon*
21194 +
21195 +MULTILIB_OSDIRNAMES = march.armv4t=!armv4t
21196 +MULTILIB_OSDIRNAMES += march.armv6=!armv6
21197 +MULTILIB_OSDIRNAMES += march.armv6/mfloat-abi.softfp=!armv6f
21198 +MULTILIB_OSDIRNAMES += march.armv7-a=!armv7a
21199 +MULTILIB_OSDIRNAMES += march.armv7-a/mfpu.neon/mfloat-abi.softfp=!armv7af
21200 +MULTILIB_OSDIRNAMES += mthumb/march.armv7-a=!thumb2
21201 +MULTILIB_OSDIRNAMES += mthumb/march.armv7-a/mfpu.neon/mfloat-abi.softfp=!thumb2f
21202 +
21203 +MULTILIB_ALIASES = march?armv4t=mthumb/march?armv4t
21204 +MULTILIB_ALIASES += march?armv6=mthumb/march?armv6
21205 +MULTILIB_ALIASES += march?armv6/mfloat-abi?softfp=mthumb/march?armv6/mfloat-abi?softfp
21206 +MULTILIB_ALIASES += march?armv7-a/mfpu?neon/mfloat-abi?softfp=march?armv7-a/mfpu?neon
21207 +MULTILIB_ALIASES += march?armv7-a/mfpu?neon/mfloat-abi?softfp=march?armv7-a/mfloat-abi?softfp
21208 +MULTILIB_ALIASES += mthumb/march?armv7-a/mfpu?neon/mfloat-abi?softfp=mthumb/march?armv7-a/mfpu?neon
21209 +MULTILIB_ALIASES += mthumb/march?armv7-a/mfpu?neon/mfloat-abi?softfp=mthumb/march?armv7-a/mfloat-abi?softfp
21210 --- a/gcc/config/arm/t-bpabi
21211 +++ b/gcc/config/arm/t-bpabi
21212 @@ -1,10 +1,13 @@
21213 # Add the bpabi.S functions.
21214 -LIB1ASMFUNCS += _aeabi_lcmp _aeabi_ulcmp _aeabi_ldivmod _aeabi_uldivmod
21215 +LIB1ASMFUNCS += _aeabi_lcmp _aeabi_ulcmp _aeabi_ldivmod _aeabi_uldivmod \
21216 + _aeabi_idiv0 _aeabi_ldiv0
21217
21218 # Add the BPABI C functions.
21219 LIB2FUNCS_EXTRA = $(srcdir)/config/arm/bpabi.c \
21220 $(srcdir)/config/arm/unaligned-funcs.c
21221
21222 +LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c
21223 +
21224 UNWIND_H = $(srcdir)/config/arm/unwind-arm.h
21225 LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \
21226 $(srcdir)/config/arm/libunwind.S \
21227 --- /dev/null
21228 +++ b/gcc/config/arm/t-cs-eabi
21229 @@ -0,0 +1,193 @@
21230 +# Multilibs for SourceryG++ arm-none-eabi
21231 +
21232 +MULTILIB_OPTIONS = mthumb
21233 +MULTILIB_DIRNAMES = t
21234 +MULTILIB_EXCEPTIONS =
21235 +MULTILIB_MATCHES =
21236 +MULTILIB_ALIASES =
21237 +
21238 +MULTILIB_OPTIONS += march=armv7/march=armv7-a/march=armv5t/march=armv6-m
21239 +MULTILIB_DIRNAMES += v7 v7a v5t v6m
21240 +MULTILIB_MATCHES += march?armv7-a=march?armv7a
21241 +MULTILIB_MATCHES += march?armv7=march?armv7r
21242 +MULTILIB_MATCHES += march?armv7=march?armv7m
21243 +MULTILIB_MATCHES += march?armv7=march?armv7-r
21244 +MULTILIB_MATCHES += march?armv7=march?armv7-m
21245 +MULTILIB_MATCHES += march?armv7-a=mcpu?cortex-a9
21246 +MULTILIB_MATCHES += march?armv7-a=mcpu?cortex-a8
21247 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4
21248 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4f
21249 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-m3
21250 +MULTILIB_MATCHES += march?armv6-m=mcpu?cortex-m1
21251 +MULTILIB_MATCHES += march?armv6-m=mcpu?cortex-m0
21252 +MULTILIB_MATCHES += march?armv5t=march?armv5te
21253 +MULTILIB_MATCHES += march?armv5t=march?armv6
21254 +MULTILIB_MATCHES += march?armv5t=march?armv6j
21255 +MULTILIB_MATCHES += march?armv5t=march?armv6k
21256 +MULTILIB_MATCHES += march?armv5t=march?armv6z
21257 +MULTILIB_MATCHES += march?armv5t=march?armv6zk
21258 +MULTILIB_MATCHES += march?armv5t=march?armv6t2
21259 +MULTILIB_MATCHES += march?armv5t=march?iwmmxt
21260 +MULTILIB_MATCHES += march?armv5t=march?iwmmxt2
21261 +MULTILIB_MATCHES += march?armv5t=mcpu?arm10tdmi
21262 +MULTILIB_MATCHES += march?armv5t=mcpu?arm1020t
21263 +MULTILIB_MATCHES += march?armv5t=mcpu?arm9e
21264 +MULTILIB_MATCHES += march?armv5t=mcpu?arm946e-s
21265 +MULTILIB_MATCHES += march?armv5t=mcpu?arm966e-s
21266 +MULTILIB_MATCHES += march?armv5t=mcpu?arm968e-s
21267 +MULTILIB_MATCHES += march?armv5t=mcpu?arm10e
21268 +MULTILIB_MATCHES += march?armv5t=mcpu?arm1020e
21269 +MULTILIB_MATCHES += march?armv5t=mcpu?arm1022e
21270 +MULTILIB_MATCHES += march?armv5t=mcpu?xscale
21271 +MULTILIB_MATCHES += march?armv5t=mcpu?iwmmxt
21272 +MULTILIB_MATCHES += march?armv5t=mcpu?iwmmxt2
21273 +MULTILIB_MATCHES += march?armv5t=mcpu?marvell-f
21274 +MULTILIB_MATCHES += march?armv5t=mcpu?arm926ej-s
21275 +MULTILIB_MATCHES += march?armv5t=mcpu?arm1026ej-s
21276 +MULTILIB_MATCHES += march?armv5t=mcpu?arm1136j-s
21277 +MULTILIB_MATCHES += march?armv5t=mcpu?arm1136jf-s
21278 +MULTILIB_MATCHES += march?armv5t=mcpu?arm1176jz-s
21279 +MULTILIB_MATCHES += march?armv5t=mcpu?arm1176jzf-s
21280 +MULTILIB_MATCHES += march?armv5t=mcpu?mpcorenovfp
21281 +MULTILIB_MATCHES += march?armv5t=mcpu?mpcore
21282 +MULTILIB_MATCHES += march?armv5t=mcpu?arm1156t2-s
21283 +
21284 +MULTILIB_OPTIONS += mfloat-abi=softfp/mfloat-abi=hard
21285 +MULTILIB_DIRNAMES += softfp hard
21286 +MULTILIB_MATCHES += mfloat-abi?hard=mhard-float
21287 +
21288 +MULTILIB_OPTIONS += mfpu=neon
21289 +MULTILIB_DIRNAMES += neon
21290 +MULTILIB_EXCEPTIONS += mfpu=neon
21291 +MULTILIB_MATCHES += mfpu?neon=mfpu?neon-fp16
21292 +
21293 +MULTILIB_ALIASES += mthumb=mthumb/mfpu?neon
21294 +MULTILIB_ALIASES += mthumb=mthumb/march?armv5t/mfpu?neon
21295 +MULTILIB_ALIASES += mbig-endian=mthumb/mfpu?neon/mbig-endian
21296 +MULTILIB_ALIASES += mfloat-abi?softfp=mthumb/mfloat-abi?softfp/mfpu?neon
21297 +MULTILIB_ALIASES += mfloat-abi?softfp=mfloat-abi?softfp/mfpu?neon
21298 +MULTILIB_ALIASES += mfloat-abi?softfp/mbig-endian=mfloat-abi?softfp/mfpu?neon/mbig-endian
21299 +MULTILIB_ALIASES += mfloat-abi?softfp/mbig-endian=mthumb/mfloat-abi?softfp/mfpu?neon/mbig-endian
21300 +MULTILIB_ALIASES += mthumb/march?armv7/mfix-cortex-m3-ldrd=mthumb/march?armv7-a/mfpu?neon
21301 +MULTILIB_ALIASES += mthumb/march?armv7/mbig-endian=mthumb/march?armv7-a/mfpu?neon/mbig-endian
21302 +MULTILIB_ALIASES += march?armv7-a/mfloat-abi?softfp/mfpu?neon=mthumb/march?armv7-a/mfloat-abi?softfp/mfpu?neon
21303 +MULTILIB_ALIASES += march?armv7-a/mfloat-abi?hard/mfpu?neon=mthumb/march?armv7-a/mfloat-abi?hard/mfpu?neon
21304 +
21305 +MULTILIB_OPTIONS += mbig-endian
21306 +MULTILIB_DIRNAMES += be
21307 +MULTILIB_ALIASES += mbig-endian=mfpu?neon/mbig-endian
21308 +
21309 +# ARMv6-M does not have ARM mode.
21310 +MULTILIB_EXCEPTIONS += march=armv6-m
21311 +
21312 +# Some ARMv7 variants have ARM mode. Use the ARM libraries.
21313 +MULTILIB_EXCEPTIONS += march=armv7 march=armv7/*
21314 +MULTILIB_ALIASES += mbig-endian=march?armv7/mbig-endian
21315 +MULTILIB_ALIASES += mfloat-abi?softfp=march?armv7/mfloat-abi?softfp
21316 +MULTILIB_ALIASES += mfloat-abi?softfp=march?armv7/mfloat-abi?softfp/mfpu?neon
21317 +MULTILIB_ALIASES += mfloat-abi?softfp/mbig-endian=march?armv7/mfloat-abi?softfp/mbig-endian
21318 +MULTILIB_ALIASES += mfloat-abi?softfp/mbig-endian=march?armv7/mfloat-abi?softfp/mfpu?neon/mbig-endian
21319 +MULTILIB_ALIASES += mbig-endian=march?armv7/mfpu?neon/mbig-endian
21320 +MULTILIB_ALIASES += mthumb/march?armv7/mfix-cortex-m3-ldrd=mthumb/march?armv7/mfloat-abi?softfp/mfpu?neon
21321 +MULTILIB_ALIASES += mthumb/march?armv7/mfix-cortex-m3-ldrd=mthumb/march?armv7/mfpu?neon
21322 +MULTILIB_ALIASES += mthumb/march?armv7/mbig-endian=mthumb/march?armv7/mfpu?neon/mbig-endian
21323 +MULTILIB_ALIASES += mthumb/march?armv7/mbig-endian=mthumb/march?armv7/mfloat-abi?softfp/mfpu?neon/mbig-endian
21324 +
21325 +# ARMv7-A is specially useful used with VFPv3 (enabled by NEON). Rest of the cases behaves as ARMv7.
21326 +MULTILIB_ALIASES += mthumb/march?armv7/mfix-cortex-m3-ldrd=mthumb/march?armv7-a
21327 +MULTILIB_ALIASES += mbig-endian=march?armv7-a/mbig-endian
21328 +MULTILIB_ALIASES += mfloat-abi?softfp/mbig-endian=march?armv7-a/mfloat-abi?softfp/mbig-endian
21329 +MULTILIB_ALIASES += mfloat-abi?softfp/mbig-endian=march?armv7-a/mfloat-abi?softfp/mfpu?neon/mbig-endian
21330 +MULTILIB_ALIASES += mthumb/march?armv7/mfix-cortex-m3-ldrd=mthumb/march?armv7-a/mfloat-abi?softfp
21331 +MULTILIB_ALIASES += mthumb/march?armv7/mbig-endian=mthumb/march?armv7-a/mbig-endian
21332 +MULTILIB_ALIASES += mthumb/march?armv7/mbig-endian=mthumb/march?armv7-a/mfloat-abi?softfp/mbig-endian
21333 +MULTILIB_ALIASES += mthumb/march?armv7/mfix-cortex-m3-ldrd=mthumb/march?armv7/mfloat-abi?softfp
21334 +MULTILIB_ALIASES += march?armv5t=march?armv7-a
21335 +MULTILIB_ALIASES += march?armv5t=march?armv7-a/mfloat-abi?softfp
21336 +MULTILIB_ALIASES += march?armv5t=march?armv7-a/mfpu?neon
21337 +MULTILIB_ALIASES += mbig-endian=march?armv7-a/mfpu?neon/mbig-endian
21338 +MULTILIB_ALIASES += mthumb/march?armv7/mbig-endian=mthumb/march?armv7-a/mfloat-abi?softfp/mfpu?neon/mbig-endian
21339 +
21340 +# ARMv5T thumb uses the ARMv5T ARM libraries (with or without VFP).
21341 +MULTILIB_ALIASES += mthumb=mthumb/march?armv5t
21342 +MULTILIB_ALIASES += march?armv5t/mfloat-abi?softfp=mthumb/march?armv5t/mfloat-abi?softfp
21343 +MULTILIB_ALIASES += march?armv5t/mfloat-abi?softfp=march?armv5t/mfloat-abi?softfp/mfpu?neon
21344 +MULTILIB_ALIASES += march?armv5t/mfloat-abi?softfp=mthumb/march?armv5t/mfloat-abi?softfp/mfpu?neon
21345 +MULTILIB_ALIASES += march?armv5t=march?armv5t/mfpu?neon
21346 +MULTILIB_ALIASES += mbig-endian=march?armv5t/mfpu?neon/mbig-endian
21347 +MULTILIB_ALIASES += mbig-endian=march?armv5t/mfloat-abi?softfp/mfpu?neon/mbig-endian
21348 +MULTILIB_ALIASES += mbig-endian=mthumb/march?armv5t/mfpu?neon/mbig-endian
21349 +MULTILIB_ALIASES += mbig-endian=mthumb/march?armv5t/mfloat-abi?softfp/mfpu?neon/mbig-endian
21350 +
21351 +# ARMv6-M and VFP are incompatible.
21352 +# FIXME: The compiler should probably error.
21353 +MULTILIB_EXCEPTIONS += *march=armv6-m/mfloat-abi=softfp
21354 +MULTILIB_ALIASES += mthumb/march?armv6-m=mthumb/march?armv6-m/mfpu?neon
21355 +MULTILIB_EXCEPTIONS += march=armv6-m*mfpu=neon
21356 +MULTILIB_EXCEPTIONS += mthumb/march=armv6-m/mfloat-abi=softfp/mfpu=neon
21357 +
21358 +# Thumb-1 VFP isn't really a meaningful combination. Use the ARM VFP.
21359 +MULTILIB_ALIASES += mfloat-abi?softfp=mthumb/mfloat-abi?softfp
21360 +MULTILIB_ALIASES += mfloat-abi?softfp/mbig-endian=mthumb/mfloat-abi?softfp/mbig-endian
21361 +
21362 +# We don't have a big-endian ARMv6-M compatible multilibs.
21363 +MULTILIB_EXCEPTIONS += *march=armv6-m*mbig-endian
21364 +
21365 +# Use the generic libraries for big-endian ARMv5T
21366 +MULTILIB_ALIASES += mbig-endian=march?armv5t/mbig-endian
21367 +MULTILIB_ALIASES += mbig-endian=march?armv5t/mfloat-abi?softfp/mbig-endian
21368 +MULTILIB_ALIASES += mbig-endian=mthumb/march?armv5t/mbig-endian
21369 +MULTILIB_ALIASES += mbig-endian=mthumb/march?armv5t/mfloat-abi?softfp/mbig-endian
21370 +
21371 +# Use ARM libraries for big-endian Thumb.
21372 +MULTILIB_ALIASES += mbig-endian=mthumb/mbig-endian
21373 +
21374 +# Don't bother with big-endian Thumb-2 VFP. Use the soft-float libraries
21375 +# for now.
21376 +MULTILIB_ALIASES += mthumb/march?armv7/mbig-endian=mthumb/march?armv7/mfloat-abi?softfp/mbig-endian
21377 +
21378 +# The only -mfloat-abi=hard libraries provided are for little-endian
21379 +# v7-A NEON.
21380 +MULTILIB_EXCEPTIONS += mfloat-abi=hard*
21381 +MULTILIB_EXCEPTIONS += *march=armv5t*mfloat-abi=hard*
21382 +MULTILIB_EXCEPTIONS += *march=armv7/*mfloat-abi=hard*
21383 +MULTILIB_EXCEPTIONS += *march=armv6-m*mfloat-abi=hard*
21384 +MULTILIB_EXCEPTIONS += mthumb/mfloat-abi=hard*
21385 +MULTILIB_EXCEPTIONS += *mfloat-abi=hard*mbig-endian
21386 +MULTILIB_EXCEPTIONS += *mfloat-abi=hard
21387 +
21388 +# FIXME: We need a sane way of doing this.
21389 +# This isn't really a multilib, it's a hack to add an extra option
21390 +# to the v7-m multilib.
21391 +MULTILIB_OPTIONS += mfix-cortex-m3-ldrd
21392 +MULTILIB_DIRNAMES += broken_ldrd
21393 +
21394 +MULTILIB_EXCEPTIONS += mfix-cortex-m3-ldrd
21395 +MULTILIB_EXCEPTIONS += mthumb/mfix-cortex-m3-ldrd
21396 +MULTILIB_EXCEPTIONS += *march=armv6-m*mfix-cortex-m3-ldrd
21397 +MULTILIB_EXCEPTIONS += *march=armv7-a*mfix-cortex-m3-ldrd
21398 +MULTILIB_EXCEPTIONS += *mcpu=*mfix-cortex-m3-ldrd
21399 +MULTILIB_EXCEPTIONS += *mbig-endian*mfix-cortex-m3-ldrd
21400 +MULTILIB_EXCEPTIONS += *mfloat-abi=softfp*mfix-cortex-m3-ldrd
21401 +MULTILIB_EXCEPTIONS += mfloat-abi=softfp*mfpu=neon*
21402 +MULTILIB_EXCEPTIONS += *march=armv5t*mfix-cortex-m3-ldrd
21403 +MULTILIB_EXCEPTIONS += *mfpu=neon*mfix-cortex-m3-ldrd
21404 +
21405 +MULTILIB_ALIASES += mthumb/march?armv7/mfix-cortex-m3-ldrd=mthumb/march?armv7
21406 +MULTILIB_ALIASES += mthumb/march?armv7/mfix-cortex-m3-ldrd=mthumb/march?armv7-a/mfix-cortex-m3-ldrd
21407 +MULTILIB_ALIASES += mthumb/march?armv7/mfix-cortex-m3-ldrd=mthumb/march?armv7/mfpu?neon/mfix-cortex-m3-ldrd
21408 +MULTILIB_ALIASES += mthumb/march?armv7/mfix-cortex-m3-ldrd=mthumb/march?armv7-a/mfpu?neon/mfix-cortex-m3-ldrd
21409 +
21410 +# As of at least 4.2, gcc passes the wrong -L options if some multilibs are
21411 +# omitted from MULTILIB_OSDIRNAMES
21412 +MULTILIB_OSDIRNAMES = mthumb=!thumb
21413 +MULTILIB_OSDIRNAMES += mbig-endian=!be
21414 +MULTILIB_OSDIRNAMES += mfloat-abi.softfp=!vfp
21415 +MULTILIB_OSDIRNAMES += mfloat-abi.softfp/mbig-endian=!vfp-be
21416 +MULTILIB_OSDIRNAMES += march.armv5t=!armv5t
21417 +MULTILIB_OSDIRNAMES += march.armv5t/mfloat-abi.softfp=!armv5t-vfp
21418 +MULTILIB_OSDIRNAMES += mthumb/march.armv7/mfix-cortex-m3-ldrd=!thumb2
21419 +MULTILIB_OSDIRNAMES += march.armv7-a/mfloat-abi.softfp/mfpu.neon=!armv7-a-neon
21420 +MULTILIB_OSDIRNAMES += march.armv7-a/mfloat-abi.hard/mfpu.neon=!armv7-a-hard
21421 +MULTILIB_OSDIRNAMES += mthumb/march.armv7/mbig-endian=!thumb2-be
21422 +MULTILIB_OSDIRNAMES += mthumb/march.armv6-m=!armv6-m
21423 --- /dev/null
21424 +++ b/gcc/config/arm/t-cs-linux
21425 @@ -0,0 +1,106 @@
21426 +# Multilibs for SourceryG++ arm-none-linux-gnueabi
21427 +
21428 +MULTILIB_OPTIONS = mthumb
21429 +MULTILIB_DIRNAMES = t
21430 +MULTILIB_EXCEPTIONS =
21431 +MULTILIB_MATCHES =
21432 +MULTILIB_ALIASES =
21433 +
21434 +MULTILIB_OPTIONS += march=armv4t/march=armv7-a
21435 +MULTILIB_DIRNAMES += v4t v7a
21436 +
21437 +MULTILIB_MATCHES += march?armv7-a=march?armv7a
21438 +MULTILIB_MATCHES += march?armv7-a=mcpu?cortex-a9
21439 +MULTILIB_MATCHES += march?armv7-a=mcpu?cortex-a8
21440 +MULTILIB_MATCHES += march?armv4t=march?ep9312
21441 +MULTILIB_MATCHES += march?armv4t=mcpu?arm7tdmi
21442 +MULTILIB_MATCHES += march?armv4t=mcpu?arm7tdmi-s
21443 +MULTILIB_MATCHES += march?armv4t=mcpu?arm710t
21444 +MULTILIB_MATCHES += march?armv4t=mcpu?arm720t
21445 +MULTILIB_MATCHES += march?armv4t=mcpu?arm740t
21446 +MULTILIB_MATCHES += march?armv4t=mcpu?arm9
21447 +MULTILIB_MATCHES += march?armv4t=mcpu?arm9tdmi
21448 +MULTILIB_MATCHES += march?armv4t=mcpu?arm920
21449 +MULTILIB_MATCHES += march?armv4t=mcpu?arm920t
21450 +MULTILIB_MATCHES += march?armv4t=mcpu?arm922t
21451 +MULTILIB_MATCHES += march?armv4t=mcpu?arm940t
21452 +MULTILIB_MATCHES += march?armv4t=mcpu?ep9312
21453 +
21454 +MULTILIB_OPTIONS += mfloat-abi=softfp/mfloat-abi=hard
21455 +MULTILIB_DIRNAMES += softfp hard
21456 +MULTILIB_MATCHES += mfloat-abi?hard=mhard-float
21457 +
21458 +MULTILIB_OPTIONS += mfpu=neon
21459 +MULTILIB_DIRNAMES += neon
21460 +MULTILIB_EXCEPTIONS += mfpu=neon
21461 +MULTILIB_MATCHES += mfpu?neon=mfpu?neon-fp16
21462 +MULTILIB_ALIASES += mfloat-abi?softfp=mfloat-abi?softfp/mfpu?neon
21463 +MULTILIB_ALIASES += mfloat-abi?softfp=mthumb/mfloat-abi?softfp/mfpu?neon
21464 +MULTILIB_ALIASES += march?armv7-a/mfloat-abi?hard/mfpu?neon=mthumb/march?armv7-a/mfloat-abi?hard/mfpu?neon
21465 +
21466 +MULTILIB_OPTIONS += mbig-endian
21467 +MULTILIB_DIRNAMES += be
21468 +MULTILIB_ALIASES += mbig-endian=mfpu?neon/mbig-endian
21469 +MULTILIB_ALIASES += mfloat-abi?softfp/mbig-endian=mfloat-abi?softfp/mfpu?neon/mbig-endian
21470 +MULTILIB_ALIASES += mbig-endian=mthumb/mfpu?neon/mbig-endian
21471 +MULTILIB_ALIASES += mfloat-abi?softfp/mbig-endian=mthumb/mfloat-abi?softfp/mfpu?neon/mbig-endian
21472 +
21473 +# Do not build Thumb libraries.
21474 +MULTILIB_EXCEPTIONS += mthumb
21475 +MULTILIB_EXCEPTIONS += mthumb/mfpu=neon
21476 +
21477 +# Use ARM libraries for ARMv4t Thumb and VFP.
21478 +MULTILIB_ALIASES += march?armv4t=mthumb/march?armv4t
21479 +MULTILIB_ALIASES += march?armv4t=march?armv4t/mfloat-abi?softfp
21480 +MULTILIB_ALIASES += march?armv4t=mthumb/march?armv4t/mfloat-abi?softfp
21481 +MULTILIB_ALIASES += march?armv4t=march?armv4t/mfpu?neon
21482 +MULTILIB_ALIASES += march?armv4t=march?armv4t/mfloat-abi?softfp/mfpu?neon
21483 +MULTILIB_ALIASES += march?armv4t=mthumb/march?armv4t/mfpu?neon
21484 +MULTILIB_ALIASES += march?armv4t=mthumb/march?armv4t/mfloat-abi?softfp/mfpu?neon
21485 +
21486 +# We do not support ARMv4t big-endian.
21487 +MULTILIB_EXCEPTIONS += *march=armv4t*mbig-endian
21488 +
21489 +# Behave ARMv7-A as ARMv7 for some cases.
21490 +MULTILIB_EXCEPTIONS += march=armv7-a
21491 +MULTILIB_EXCEPTIONS += march=armv7-a/mfpu=neon
21492 +MULTILIB_ALIASES += mfloat-abi?softfp=march?armv7-a/mfloat-abi?softfp
21493 +MULTILIB_ALIASES += mbig-endian=march?armv7-a/mbig-endian
21494 +MULTILIB_ALIASES += mbig-endian=march?armv7-a/mfpu?neon/mbig-endian
21495 +MULTILIB_ALIASES += mfloat-abi?softfp/mbig-endian=march?armv7-a/mfloat-abi?softfp/mbig-endian
21496 +MULTILIB_ALIASES += mfloat-abi?softfp/mbig-endian=march?armv7-a/mfloat-abi?softfp/mfpu?neon/mbig-endian
21497 +MULTILIB_ALIASES += mthumb/march?armv7-a=mthumb/march?armv7-a/mfpu?neon
21498 +MULTILIB_ALIASES += mthumb/march?armv7-a/mbig-endian=mthumb/march?armv7-a/mfpu?neon/mbig-endian
21499 +MULTILIB_ALIASES += mthumb/march?armv7-a/mbig-endian=mthumb/march?armv7-a/mfloat-abi?softfp/mfpu?neon/mbig-endian
21500 +MULTILIB_ALIASES += march?armv7-a/mfloat-abi?softfp/mfpu?neon=mthumb/march?armv7-a/mfloat-abi?softfp/mfpu?neon
21501 +MULTILIB_ALIASES += mthumb/march?armv7-a=mthumb/march?armv7-a/mfloat-abi?softfp
21502 +
21503 +# Thumb-1 VFP isn't really a meaningful combination. Use the ARM VFP.
21504 +MULTILIB_ALIASES += mfloat-abi?softfp=mthumb/mfloat-abi?softfp
21505 +MULTILIB_ALIASES += mfloat-abi?softfp/mbig-endian=mthumb/mfloat-abi?softfp/mbig-endian
21506 +
21507 +# Use ARM libraries for big-endian Thumb.
21508 +MULTILIB_ALIASES += mbig-endian=mthumb/mbig-endian
21509 +
21510 +# Don't bother with big-endian Thumb-2 VFP. Use the soft-float libraries
21511 +# for now.
21512 +MULTILIB_ALIASES += mthumb/march?armv7-a/mbig-endian=mthumb/march?armv7-a/mfloat-abi?softfp/mbig-endian
21513 +
21514 +# The only -mfloat-abi=hard libraries provided are for little-endian
21515 +# v7-A NEON.
21516 +MULTILIB_EXCEPTIONS += mfloat-abi=hard*
21517 +MULTILIB_EXCEPTIONS += *march=armv4t*mfloat-abi=hard*
21518 +MULTILIB_EXCEPTIONS += mthumb/mfloat-abi=hard*
21519 +MULTILIB_EXCEPTIONS += *mfloat-abi=hard*mbig-endian
21520 +MULTILIB_EXCEPTIONS += *mfloat-abi=hard
21521 +
21522 +# As of at least 4.2, gcc passes the wrong -L options if some multilibs are
21523 +# omitted from MULTILIB_OSDIRNAMES
21524 +MULTILIB_OSDIRNAMES = march.armv4t=!armv4t
21525 +MULTILIB_OSDIRNAMES += mbig-endian=!be
21526 +MULTILIB_OSDIRNAMES += mfloat-abi.softfp=!vfp
21527 +MULTILIB_OSDIRNAMES += mfloat-abi.softfp/mbig-endian=!vfp-be
21528 +MULTILIB_OSDIRNAMES += mthumb/march.armv7-a=!thumb2
21529 +MULTILIB_OSDIRNAMES += march.armv7-a/mfloat-abi.softfp/mfpu.neon=!armv7-a-neon
21530 +MULTILIB_OSDIRNAMES += march.armv7-a/mfloat-abi.hard/mfpu.neon=!armv7-a-hard
21531 +MULTILIB_OSDIRNAMES += mthumb/march.armv7-a/mbig-endian=!thumb2-be
21532 --- a/gcc/config/arm/t-linux-eabi
21533 +++ b/gcc/config/arm/t-linux-eabi
21534 @@ -1,10 +1,48 @@
21535 # These functions are included in shared libraries.
21536 TARGET_LIBGCC2_CFLAGS = -fPIC
21537
21538 -# We do not build a Thumb multilib for Linux because the definition of
21539 -# CLEAR_INSN_CACHE in linux-gas.h does not work in Thumb mode.
21540 -MULTILIB_OPTIONS =
21541 -MULTILIB_DIRNAMES =
21542 +# We build 3 multilibs:
21543 +# ./ (default)
21544 +# armv4t/ -march=armv4t [-mthumb]
21545 +# thumb2/ -mthumb -march=armv7
21546 +MULTILIB_OPTIONS = mthumb
21547 +MULTILIB_DIRNAMES = thumb
21548 +MULTILIB_OPTIONS += march=armv4t/march=armv7
21549 +MULTILIB_DIRNAMES += v4t v7
21550 +MULTILIB_EXCEPTIONS += march=armv7
21551 +MULTILIB_EXCEPTIONS += mthumb
21552 +
21553 +MULTILIB_ALIASES = march?armv4t=mthumb/march?armv4t
21554 +
21555 +# As of at least 4.2, gcc passes the wrong -L options if some multilibs are
21556 +# omitted from MULTILIB_OSDIRNAMES
21557 +MULTILIB_OSDIRNAMES = march.armv4t=!armv4t
21558 +MULTILIB_OSDIRNAMES += mthumb/march.armv7=!thumb2
21559 +
21560 +MULTILIB_MATCHES += march?armv7=march?armv7a
21561 +MULTILIB_MATCHES += march?armv7=march?armv7r
21562 +MULTILIB_MATCHES += march?armv7=march?armv7m
21563 +MULTILIB_MATCHES += march?armv7=march?armv7-a
21564 +MULTILIB_MATCHES += march?armv7=march?armv7-r
21565 +MULTILIB_MATCHES += march?armv7=march?armv7-m
21566 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a9
21567 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a8
21568 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4
21569 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4f
21570 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-m3
21571 +MULTILIB_MATCHES += march?armv4t=march?ep9312
21572 +MULTILIB_MATCHES += march?armv4t=mcpu?arm7tdmi
21573 +MULTILIB_MATCHES += march?armv4t=mcpu?arm7tdmi-s
21574 +MULTILIB_MATCHES += march?armv4t=mcpu?arm710t
21575 +MULTILIB_MATCHES += march?armv4t=mcpu?arm720t
21576 +MULTILIB_MATCHES += march?armv4t=mcpu?arm740t
21577 +MULTILIB_MATCHES += march?armv4t=mcpu?arm9
21578 +MULTILIB_MATCHES += march?armv4t=mcpu?arm9tdmi
21579 +MULTILIB_MATCHES += march?armv4t=mcpu?arm920
21580 +MULTILIB_MATCHES += march?armv4t=mcpu?arm920t
21581 +MULTILIB_MATCHES += march?armv4t=mcpu?arm922t
21582 +MULTILIB_MATCHES += march?armv4t=mcpu?arm940t
21583 +MULTILIB_MATCHES += march?armv4t=mcpu?ep9312
21584
21585 # Use a version of div0 which raises SIGFPE.
21586 LIB1ASMFUNCS := $(filter-out _dvmd_tls,$(LIB1ASMFUNCS)) _dvmd_lnx
21587 @@ -12,3 +50,5 @@ LIB1ASMFUNCS := $(filter-out _dvmd_tls,$
21588 # Multilib the standard Linux files. Don't include crti.o or crtn.o,
21589 # which are provided by glibc.
21590 EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
21591 +
21592 +LIB2FUNCS_STATIC_EXTRA += $(srcdir)/config/arm/linux-atomic.c
21593 --- /dev/null
21594 +++ b/gcc/config/arm/t-montavista-linux
21595 @@ -0,0 +1,33 @@
21596 +# MontaVista GNU/Linux Configuration.
21597 +# Copyright (C) 2009
21598 +# Free Software Foundation, Inc.
21599 +#
21600 +# This file is part of GCC.
21601 +#
21602 +# GCC is free software; you can redistribute it and/or modify
21603 +# it under the terms of the GNU General Public License as published by
21604 +# the Free Software Foundation; either version 3, or (at your option)
21605 +# any later version.
21606 +#
21607 +# GCC is distributed in the hope that it will be useful,
21608 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
21609 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21610 +# GNU General Public License for more details.
21611 +#
21612 +# You should have received a copy of the GNU General Public License
21613 +# along with GCC; see the file COPYING3. If not see
21614 +# <http://www.gnu.org/licenses/>.
21615 +
21616 +MULTILIB_OPTIONS = tarmv6/tthumb2
21617 +MULTILIB_DIRNAMES = armv6 thumb2
21618 +
21619 +MULTILIB_EXCEPTIONS =
21620 +
21621 +MULTILIB_OSDIRNAMES =
21622 +
21623 +MULTILIB_ALIASES =
21624 +
21625 +MULTILIB_MATCHES =
21626 +
21627 +# These files must be built for each multilib.
21628 +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
21629 --- a/gcc/config/arm/t-symbian
21630 +++ b/gcc/config/arm/t-symbian
21631 @@ -17,12 +17,18 @@ UNWIND_H = $(srcdir)/config/arm/unwind-a
21632 LIB2ADDEH = $(srcdir)/unwind-c.c $(srcdir)/config/arm/pr-support.c
21633 LIB2ADDEHDEP = $(UNWIND_H)
21634
21635 +# Include half-float helpers.
21636 +LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c
21637 +
21638 # Create a multilib for processors with VFP floating-point, and a
21639 # multilib for those without -- using the soft-float ABI in both
21640 # cases. Symbian OS object should be compiled with interworking
21641 # enabled, so there are no separate thumb-mode libraries.
21642 MULTILIB_OPTIONS = mfloat-abi=softfp
21643 MULTILIB_DIRNAMES = softfp
21644 +MULTILIB_EXCEPTIONS =
21645 +MULTILIB_MATCHES =
21646 +MULTILIB_ALIASES =
21647
21648 # There is no C library to link against on Symbian OS -- at least when
21649 # building GCC.
21650 --- /dev/null
21651 +++ b/gcc/config/arm/t-timesys
21652 @@ -0,0 +1,10 @@
21653 +# Overrides for timesys
21654 +
21655 +MULTILIB_OPTIONS = march=armv5t/march=armv6/mcpu=xscale mbig-endian
21656 +MULTILIB_DIRNAMES = armv5t armv6 xscale be
21657 +MULTILIB_MATCHES = mbig-endian=mbe
21658 +MULTILIB_EXCEPTIONS = mbig-endian march=*/mbig-endian mcpu=xscale
21659 +MULTILIB_OSDIRNAMES = march.armv5t=!armv5t
21660 +MULTILIB_OSDIRNAMES += march.armv6=!armv6
21661 +MULTILIB_OSDIRNAMES += mcpu.xscale/mbig-endian=!xscale/be
21662 +MULTILIB_ALIASES =
21663 --- /dev/null
21664 +++ b/gcc/config/arm/t-uclinux-eabi
21665 @@ -0,0 +1,53 @@
21666 +# EABI uClinux multilib selection. Other setting are inherited from t-arm-elf
21667 +
21668 +# We build 3 multilibs:
21669 +# . (default)
21670 +# thumb2/ -mthumb -march=armv7 -mfix-cortex-m3-ldrd
21671 +# armv6-m/ -mthumb -march=armv6-m
21672 +
21673 +MULTILIB_OPTIONS = mthumb
21674 +MULTILIB_DIRNAMES = thumb
21675 +MULTILIB_EXCEPTIONS =
21676 +MULTILIB_MATCHES =
21677 +
21678 +MULTILIB_OPTIONS += march=armv7/march=armv6-m
21679 +MULTILIB_DIRNAMES += armv7 armv6-m
21680 +
21681 +MULTILIB_EXCEPTIONS += mthumb
21682 +
21683 +MULTILIB_EXCEPTIONS += march=armv7
21684 +MULTILIB_MATCHES += march?armv7=march?armv7a
21685 +MULTILIB_MATCHES += march?armv7=march?armv7r
21686 +MULTILIB_MATCHES += march?armv7=march?armv7m
21687 +MULTILIB_MATCHES += march?armv7=march?armv7-a
21688 +MULTILIB_MATCHES += march?armv7=march?armv7-r
21689 +MULTILIB_MATCHES += march?armv7=march?armv7-m
21690 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a9
21691 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-a8
21692 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4
21693 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4f
21694 +MULTILIB_MATCHES += march?armv7=mcpu?cortex-m3
21695 +
21696 +MULTILIB_EXCEPTIONS += march=armv6-m
21697 +MULTILIB_MATCHES += march?armv6-m=mcpu?cortex-m1
21698 +MULTILIB_MATCHES += march?armv6-m=mcpu?cortex-m0
21699 +
21700 +MULTILIB_ALIASES =
21701 +
21702 +# FIXME: We need a sane way of doing this.
21703 +# This isn't really a multilib, it's a hack to add an extra option
21704 +# to the v7-m multilib.
21705 +MULTILIB_OPTIONS += mfix-cortex-m3-ldrd
21706 +MULTILIB_DIRNAMES += broken_ldrd
21707 +
21708 +MULTILIB_EXCEPTIONS += mfix-cortex-m3-ldrd
21709 +MULTILIB_EXCEPTIONS += mthumb/mfix-cortex-m3-ldrd
21710 +MULTILIB_EXCEPTIONS += march=armv7/mfix-cortex-m3-ldrd
21711 +MULTILIB_EXCEPTIONS += *march=armv6-m*mfix-cortex-m3-ldrd
21712 +
21713 +MULTILIB_ALIASES += mthumb/march?armv7/mfix-cortex-m3-ldrd=mthumb/march?armv7
21714 +
21715 +
21716 +MULTILIB_OSDIRNAMES = mthumb/march.armv7/mfix-cortex-m3-ldrd=!thumb2
21717 +MULTILIB_OSDIRNAMES += mthumb/march.armv6-m=!armv6-m
21718 +
21719 --- /dev/null
21720 +++ b/gcc/config/arm/t-wrs-linux
21721 @@ -0,0 +1,43 @@
21722 +# Wind River GNU/Linux Configuration.
21723 +# Copyright (C) 2006, 2007, 2008
21724 +# Free Software Foundation, Inc.
21725 +#
21726 +# This file is part of GCC.
21727 +#
21728 +# GCC is free software; you can redistribute it and/or modify
21729 +# it under the terms of the GNU General Public License as published by
21730 +# the Free Software Foundation; either version 3, or (at your option)
21731 +# any later version.
21732 +#
21733 +# GCC is distributed in the hope that it will be useful,
21734 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
21735 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21736 +# GNU General Public License for more details.
21737 +#
21738 +# You should have received a copy of the GNU General Public License
21739 +# along with GCC; see the file COPYING3. If not see
21740 +# <http://www.gnu.org/licenses/>.
21741 +
21742 +MULTILIB_OPTIONS = muclibc
21743 +MULTILIB_OPTIONS += tarm926ej-s/tiwmmxt/txscale/tarm920t/tthumb2/tcortex-a8-be8
21744 +MULTILIB_OPTIONS += mfloat-abi=softfp
21745 +MULTILIB_DIRNAMES = uclibc
21746 +MULTILIB_DIRNAMES += tarm926ej-s tiwmmxt txscale tarm920t thumb2 cortex-a8-be8
21747 +MULTILIB_DIRNAMES += softfp
21748 +
21749 +MULTILIB_EXCEPTIONS = *muclibc*/*tarm920t*
21750 +MULTILIB_EXCEPTIONS += *muclibc*/*cortex-a8-be8*
21751 +
21752 +MULTILIB_EXCEPTIONS += *tiwmmxt*/*mfloat-abi=softfp*
21753 +MULTILIB_EXCEPTIONS += *txscale*/*mfloat-abi=softfp*
21754 +MULTILIB_EXCEPTIONS += *tarm920t*/*mfloat-abi=softfp*
21755 +MULTILIB_EXCEPTIONS += *thumb2*/*mfloat-abi=softfp*
21756 +
21757 +MULTILIB_MATCHES = tiwmmxt=tiwmmxt2
21758 +
21759 +MULTILIB_ALIASES = tcortex-a8-be8=tcortex-a8-be8/mfloat-abi?softfp
21760 +MULTILIB_OSDIRNAMES =
21761 +
21762 +# These files must be built for each multilib.
21763 +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
21764 +
21765 --- a/gcc/config/arm/thumb2.md
21766 +++ b/gcc/config/arm/thumb2.md
21767 @@ -1,5 +1,5 @@
21768 ;; ARM Thumb-2 Machine Description
21769 -;; Copyright (C) 2007 Free Software Foundation, Inc.
21770 +;; Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
21771 ;; Written by CodeSourcery, LLC.
21772 ;;
21773 ;; This file is part of GCC.
21774 @@ -24,6 +24,8 @@
21775 ;; changes made in armv5t as "thumb2". These are considered part
21776 ;; the 16-bit Thumb-1 instruction set.
21777
21778 +(include "hwdiv.md")
21779 +
21780 (define_insn "*thumb2_incscc"
21781 [(set (match_operand:SI 0 "s_register_operand" "=r,r")
21782 (plus:SI (match_operator:SI 2 "arm_comparison_operator"
21783 @@ -172,34 +174,6 @@
21784 (set_attr "length" "8")]
21785 )
21786
21787 -(define_insn "*thumb2_abssi2"
21788 - [(set (match_operand:SI 0 "s_register_operand" "=r,&r")
21789 - (abs:SI (match_operand:SI 1 "s_register_operand" "0,r")))
21790 - (clobber (reg:CC CC_REGNUM))]
21791 - "TARGET_THUMB2"
21792 - "@
21793 - cmp\\t%0, #0\;it\tlt\;rsblt\\t%0, %0, #0
21794 - eor%?\\t%0, %1, %1, asr #31\;sub%?\\t%0, %0, %1, asr #31"
21795 - [(set_attr "conds" "clob,*")
21796 - (set_attr "shift" "1")
21797 - ;; predicable can't be set based on the variant, so left as no
21798 - (set_attr "length" "10,8")]
21799 -)
21800 -
21801 -(define_insn "*thumb2_neg_abssi2"
21802 - [(set (match_operand:SI 0 "s_register_operand" "=r,&r")
21803 - (neg:SI (abs:SI (match_operand:SI 1 "s_register_operand" "0,r"))))
21804 - (clobber (reg:CC CC_REGNUM))]
21805 - "TARGET_THUMB2"
21806 - "@
21807 - cmp\\t%0, #0\;it\\tgt\;rsbgt\\t%0, %0, #0
21808 - eor%?\\t%0, %1, %1, asr #31\;rsb%?\\t%0, %0, %1, asr #31"
21809 - [(set_attr "conds" "clob,*")
21810 - (set_attr "shift" "1")
21811 - ;; predicable can't be set based on the variant, so left as no
21812 - (set_attr "length" "10,8")]
21813 -)
21814 -
21815 (define_insn "*thumb2_movdi"
21816 [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, r, r, m")
21817 (match_operand:DI 1 "di_operand" "rDa,Db,Dc,mi,r"))]
21818 @@ -223,23 +197,31 @@
21819 (set_attr "neg_pool_range" "*,*,*,0,*")]
21820 )
21821
21822 +;; We have two alternatives here for memory loads (and similarly for stores)
21823 +;; to reflect the fact that the permissible constant pool ranges differ
21824 +;; between ldr instructions taking low regs and ldr instructions taking high
21825 +;; regs. The high register alternatives are not taken into account when
21826 +;; choosing register preferences in order to reflect their expense.
21827 (define_insn "*thumb2_movsi_insn"
21828 - [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,r, m")
21829 - (match_operand:SI 1 "general_operand" "rI,K,N,mi,r"))]
21830 + [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r,l,*hk,m,*m")
21831 + (match_operand:SI 1 "general_operand" "rk ,I,K,j,mi,*mi,l,*hk"))]
21832 "TARGET_THUMB2 && ! TARGET_IWMMXT
21833 && !(TARGET_HARD_FLOAT && TARGET_VFP)
21834 && ( register_operand (operands[0], SImode)
21835 || register_operand (operands[1], SImode))"
21836 "@
21837 mov%?\\t%0, %1
21838 + mov%?\\t%0, %1
21839 mvn%?\\t%0, #%B1
21840 movw%?\\t%0, %1
21841 ldr%?\\t%0, %1
21842 + ldr%?\\t%0, %1
21843 + str%?\\t%1, %0
21844 str%?\\t%1, %0"
21845 - [(set_attr "type" "*,*,*,load1,store1")
21846 + [(set_attr "type" "*,*,*,*,load1,load1,store1,store1")
21847 (set_attr "predicable" "yes")
21848 - (set_attr "pool_range" "*,*,*,4096,*")
21849 - (set_attr "neg_pool_range" "*,*,*,0,*")]
21850 + (set_attr "pool_range" "*,*,*,*,1020,4096,*,*")
21851 + (set_attr "neg_pool_range" "*,*,*,*,0,0,*,*")]
21852 )
21853
21854 ;; ??? We can probably do better with thumb2
21855 @@ -754,15 +736,12 @@
21856 (clobber (reg:CC CC_REGNUM))]
21857 "TARGET_THUMB2"
21858 "*
21859 - if (GET_CODE (operands[3]) == LT && operands[3] == const0_rtx)
21860 + if (GET_CODE (operands[3]) == LT && operands[2] == const0_rtx)
21861 return \"asr\\t%0, %1, #31\";
21862
21863 if (GET_CODE (operands[3]) == NE)
21864 return \"subs\\t%0, %1, %2\;it\\tne\;mvnne\\t%0, #0\";
21865
21866 - if (GET_CODE (operands[3]) == GT)
21867 - return \"subs\\t%0, %1, %2\;it\\tne\;mvnne\\t%0, %0, asr #31\";
21868 -
21869 output_asm_insn (\"cmp\\t%1, %2\", operands);
21870 output_asm_insn (\"ite\\t%D3\", operands);
21871 output_asm_insn (\"mov%D3\\t%0, #0\", operands);
21872 @@ -951,7 +930,7 @@
21873 (label_ref (match_operand 2 "" ""))))
21874 (label_ref (match_operand 3 "" ""))))
21875 (clobber (reg:CC CC_REGNUM))
21876 - (clobber (match_scratch:SI 4 "=r"))
21877 + (clobber (match_scratch:SI 4 "=&r"))
21878 (use (label_ref (match_dup 2)))])]
21879 "TARGET_THUMB2 && !flag_pic"
21880 "* return thumb2_output_casesi(operands);"
21881 @@ -968,7 +947,7 @@
21882 (label_ref (match_operand 2 "" ""))))
21883 (label_ref (match_operand 3 "" ""))))
21884 (clobber (reg:CC CC_REGNUM))
21885 - (clobber (match_scratch:SI 4 "=r"))
21886 + (clobber (match_scratch:SI 4 "=&r"))
21887 (clobber (match_scratch:SI 5 "=r"))
21888 (use (label_ref (match_dup 2)))])]
21889 "TARGET_THUMB2 && flag_pic"
21890 @@ -1001,7 +980,10 @@
21891 (match_operator:SI 3 "thumb_16bit_operator"
21892 [(match_operand:SI 1 "low_register_operand" "")
21893 (match_operand:SI 2 "low_register_operand" "")]))]
21894 - "TARGET_THUMB2 && rtx_equal_p(operands[0], operands[1])
21895 + "TARGET_THUMB2
21896 + && (rtx_equal_p(operands[0], operands[1])
21897 + || GET_CODE(operands[3]) == PLUS
21898 + || GET_CODE(operands[3]) == MINUS)
21899 && peep2_regno_dead_p(0, CC_REGNUM)"
21900 [(parallel
21901 [(set (match_dup 0)
21902 @@ -1018,7 +1000,9 @@
21903 [(match_operand:SI 1 "s_register_operand" "0")
21904 (match_operand:SI 2 "s_register_operand" "l")]))
21905 (clobber (reg:CC CC_REGNUM))]
21906 - "TARGET_THUMB2 && reload_completed"
21907 + "TARGET_THUMB2 && reload_completed
21908 + && GET_CODE(operands[3]) != PLUS
21909 + && GET_CODE(operands[3]) != MINUS"
21910 "%I3%!\\t%0, %1, %2"
21911 [(set_attr "predicable" "yes")
21912 (set_attr "length" "2")]
21913 @@ -1104,16 +1088,20 @@
21914 ""
21915 )
21916
21917 -(define_insn "*thumb2_addsi_shortim"
21918 +(define_insn "*thumb2_addsi_short"
21919 [(set (match_operand:SI 0 "low_register_operand" "=l")
21920 (plus:SI (match_operand:SI 1 "low_register_operand" "l")
21921 - (match_operand:SI 2 "const_int_operand" "IL")))
21922 + (match_operand:SI 2 "low_reg_or_int_operand" "lIL")))
21923 (clobber (reg:CC CC_REGNUM))]
21924 "TARGET_THUMB2 && reload_completed"
21925 "*
21926 HOST_WIDE_INT val;
21927
21928 - val = INTVAL(operands[2]);
21929 + if (GET_CODE (operands[2]) == CONST_INT)
21930 + val = INTVAL(operands[2]);
21931 + else
21932 + val = 0;
21933 +
21934 /* We prefer eg. subs rn, rn, #1 over adds rn, rn, #0xffffffff. */
21935 if (val < 0 && const_ok_for_arm(ARM_SIGN_EXTEND (-val)))
21936 return \"sub%!\\t%0, %1, #%n2\";
21937 @@ -1124,24 +1112,82 @@
21938 (set_attr "length" "2")]
21939 )
21940
21941 -(define_insn "divsi3"
21942 - [(set (match_operand:SI 0 "s_register_operand" "=r")
21943 - (div:SI (match_operand:SI 1 "s_register_operand" "r")
21944 - (match_operand:SI 2 "s_register_operand" "r")))]
21945 - "TARGET_THUMB2 && arm_arch_hwdiv"
21946 - "sdiv%?\t%0, %1, %2"
21947 - [(set_attr "predicable" "yes")]
21948 -)
21949 -
21950 -(define_insn "udivsi3"
21951 - [(set (match_operand:SI 0 "s_register_operand" "=r")
21952 - (udiv:SI (match_operand:SI 1 "s_register_operand" "r")
21953 - (match_operand:SI 2 "s_register_operand" "r")))]
21954 - "TARGET_THUMB2 && arm_arch_hwdiv"
21955 - "udiv%?\t%0, %1, %2"
21956 - [(set_attr "predicable" "yes")]
21957 +(define_insn "*thumb2_subsi_short"
21958 + [(set (match_operand:SI 0 "low_register_operand" "=l")
21959 + (minus:SI (match_operand:SI 1 "low_register_operand" "l")
21960 + (match_operand:SI 2 "low_register_operand" "l")))
21961 + (clobber (reg:CC CC_REGNUM))]
21962 + "TARGET_THUMB2 && reload_completed"
21963 + "sub%!\\t%0, %1, %2"
21964 + [(set_attr "predicable" "yes")
21965 + (set_attr "length" "2")]
21966 +)
21967 +
21968 +;; 16-bit encodings of "muls" and "mul<c>". We only use these when
21969 +;; optimizing for size since "muls" is slow on all known
21970 +;; implementations and since "mul<c>" will be generated by
21971 +;; "*arm_mulsi3_v6" anyhow. The assembler will use a 16-bit encoding
21972 +;; for "mul<c>" whenever possible anyhow.
21973 +(define_peephole2
21974 + [(set (match_operand:SI 0 "low_register_operand" "")
21975 + (mult:SI (match_operand:SI 1 "low_register_operand" "")
21976 + (match_dup 0)))]
21977 + "TARGET_THUMB2 && optimize_size && peep2_regno_dead_p (0, CC_REGNUM)"
21978 + [(parallel
21979 + [(set (match_dup 0)
21980 + (mult:SI (match_dup 0) (match_dup 1)))
21981 + (clobber (reg:CC CC_REGNUM))])]
21982 + ""
21983 )
21984
21985 +(define_peephole2
21986 + [(set (match_operand:SI 0 "low_register_operand" "")
21987 + (mult:SI (match_dup 0)
21988 + (match_operand:SI 1 "low_register_operand" "")))]
21989 + "TARGET_THUMB2 && optimize_size && peep2_regno_dead_p (0, CC_REGNUM)"
21990 + [(parallel
21991 + [(set (match_dup 0)
21992 + (mult:SI (match_dup 0) (match_dup 1)))
21993 + (clobber (reg:CC CC_REGNUM))])]
21994 + ""
21995 +)
21996 +
21997 +(define_insn "*thumb2_mulsi_short"
21998 + [(set (match_operand:SI 0 "low_register_operand" "=l")
21999 + (mult:SI (match_operand:SI 1 "low_register_operand" "%0")
22000 + (match_operand:SI 2 "low_register_operand" "l")))
22001 + (clobber (reg:CC CC_REGNUM))]
22002 + "TARGET_THUMB2 && optimize_size && reload_completed"
22003 + "mul%!\\t%0, %2, %0"
22004 + [(set_attr "predicable" "yes")
22005 + (set_attr "length" "2")
22006 + (set_attr "insn" "muls")])
22007 +
22008 +(define_insn "*thumb2_mulsi_short_compare0"
22009 + [(set (reg:CC_NOOV CC_REGNUM)
22010 + (compare:CC_NOOV
22011 + (mult:SI (match_operand:SI 1 "register_operand" "%0")
22012 + (match_operand:SI 2 "register_operand" "l"))
22013 + (const_int 0)))
22014 + (set (match_operand:SI 0 "register_operand" "=l")
22015 + (mult:SI (match_dup 1) (match_dup 2)))]
22016 + "TARGET_THUMB2 && optimize_size"
22017 + "muls\\t%0, %2, %0"
22018 + [(set_attr "length" "2")
22019 + (set_attr "insn" "muls")])
22020 +
22021 +(define_insn "*thumb2_mulsi_short_compare0_scratch"
22022 + [(set (reg:CC_NOOV CC_REGNUM)
22023 + (compare:CC_NOOV
22024 + (mult:SI (match_operand:SI 1 "register_operand" "%0")
22025 + (match_operand:SI 2 "register_operand" "l"))
22026 + (const_int 0)))
22027 + (clobber (match_scratch:SI 0 "=r"))]
22028 + "TARGET_THUMB2 && optimize_size"
22029 + "muls\\t%0, %2, %0"
22030 + [(set_attr "length" "2")
22031 + (set_attr "insn" "muls")])
22032 +
22033 (define_insn "*thumb2_cbz"
22034 [(set (pc) (if_then_else
22035 (eq (match_operand:SI 0 "s_register_operand" "l,?r")
22036 @@ -1185,3 +1231,50 @@
22037 (const_int 2)
22038 (const_int 8)))]
22039 )
22040 +
22041 +;; 16-bit complement
22042 +(define_peephole2
22043 + [(set (match_operand:SI 0 "low_register_operand" "")
22044 + (not:SI (match_operand:SI 1 "low_register_operand" "")))]
22045 + "TARGET_THUMB2
22046 + && peep2_regno_dead_p(0, CC_REGNUM)"
22047 + [(parallel
22048 + [(set (match_dup 0)
22049 + (not:SI (match_dup 1)))
22050 + (clobber (reg:CC CC_REGNUM))])]
22051 + ""
22052 +)
22053 +
22054 +(define_insn "*thumb2_one_cmplsi2_short"
22055 + [(set (match_operand:SI 0 "low_register_operand" "=l")
22056 + (not:SI (match_operand:SI 1 "low_register_operand" "l")))
22057 + (clobber (reg:CC CC_REGNUM))]
22058 + "TARGET_THUMB2 && reload_completed"
22059 + "mvn%!\t%0, %1"
22060 + [(set_attr "predicable" "yes")
22061 + (set_attr "length" "2")]
22062 +)
22063 +
22064 +;; 16-bit negate
22065 +(define_peephole2
22066 + [(set (match_operand:SI 0 "low_register_operand" "")
22067 + (neg:SI (match_operand:SI 1 "low_register_operand" "")))]
22068 + "TARGET_THUMB2
22069 + && peep2_regno_dead_p(0, CC_REGNUM)"
22070 + [(parallel
22071 + [(set (match_dup 0)
22072 + (neg:SI (match_dup 1)))
22073 + (clobber (reg:CC CC_REGNUM))])]
22074 + ""
22075 +)
22076 +
22077 +(define_insn "*thumb2_negsi2_short"
22078 + [(set (match_operand:SI 0 "low_register_operand" "=l")
22079 + (neg:SI (match_operand:SI 1 "low_register_operand" "l")))
22080 + (clobber (reg:CC CC_REGNUM))]
22081 + "TARGET_THUMB2 && reload_completed"
22082 + "neg%!\t%0, %1"
22083 + [(set_attr "predicable" "yes")
22084 + (set_attr "length" "2")]
22085 +)
22086 +
22087 --- a/gcc/config/arm/uclinux-eabi.h
22088 +++ b/gcc/config/arm/uclinux-eabi.h
22089 @@ -42,7 +42,8 @@
22090 while (false)
22091
22092 #undef SUBTARGET_EXTRA_LINK_SPEC
22093 -#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
22094 +#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi -elf2flt" \
22095 + " --pic-veneer --target2=abs"
22096
22097 /* We default to the "aapcs-linux" ABI so that enums are int-sized by
22098 default. */
22099 @@ -62,4 +63,3 @@
22100 : "=r" (_beg) \
22101 : "0" (_beg), "r" (_end), "r" (_flg), "r" (_scno)); \
22102 }
22103 -
22104 --- a/gcc/config/arm/uclinux-elf.h
22105 +++ b/gcc/config/arm/uclinux-elf.h
22106 @@ -83,3 +83,5 @@
22107 "%{pthread:-lpthread} \
22108 %{shared:-lc} \
22109 %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
22110 +
22111 +#define TARGET_DEFAULT_WORD_RELOCATIONS 1
22112 --- a/gcc/config/arm/unwind-arm.c
22113 +++ b/gcc/config/arm/unwind-arm.c
22114 @@ -1201,8 +1201,6 @@ __gnu_unwind_pr_common (_Unwind_State st
22115 ucbp->barrier_cache.bitpattern[4] = (_uw) &data[1];
22116
22117 if (data[0] & uint32_highbit)
22118 - phase2_call_unexpected_after_unwind = 1;
22119 - else
22120 {
22121 data += rtti_count + 1;
22122 /* Setup for entry to the handler. */
22123 @@ -1212,6 +1210,8 @@ __gnu_unwind_pr_common (_Unwind_State st
22124 _Unwind_SetGR (context, 0, (_uw) ucbp);
22125 return _URC_INSTALL_CONTEXT;
22126 }
22127 + else
22128 + phase2_call_unexpected_after_unwind = 1;
22129 }
22130 if (data[0] & uint32_highbit)
22131 data++;
22132 --- a/gcc/config/arm/unwind-arm.h
22133 +++ b/gcc/config/arm/unwind-arm.h
22134 @@ -232,11 +232,11 @@ extern "C" {
22135 if (!tmp)
22136 return 0;
22137
22138 -#if defined(linux) || defined(__NetBSD__)
22139 +#if (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__)
22140 /* Pc-relative indirect. */
22141 tmp += ptr;
22142 tmp = *(_Unwind_Word *) tmp;
22143 -#elif defined(__symbian__)
22144 +#elif defined(__symbian__) || defined(__uClinux__)
22145 /* Absolute pointer. Nothing more to do. */
22146 #else
22147 /* Pc-relative pointer. */
22148 --- a/gcc/config/arm/vfp.md
22149 +++ b/gcc/config/arm/vfp.md
22150 @@ -1,6 +1,6 @@
22151 -;; ARM VFP coprocessor Machine Description
22152 -;; Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
22153 -;; Written by CodeSourcery, LLC.
22154 +;; ARM VFP instruction patterns
22155 +;; Copyright (C) 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
22156 +;; Written by CodeSourcery.
22157 ;;
22158 ;; This file is part of GCC.
22159 ;;
22160 @@ -23,45 +23,20 @@
22161 [(VFPCC_REGNUM 127)]
22162 )
22163
22164 -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22165 -;; Pipeline description
22166 -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22167 -
22168 -(define_automaton "vfp11")
22169 -
22170 -;; There are 3 pipelines in the VFP11 unit.
22171 -;;
22172 -;; - A 8-stage FMAC pipeline (7 execute + writeback) with forward from
22173 -;; fourth stage for simple operations.
22174 -;;
22175 -;; - A 5-stage DS pipeline (4 execute + writeback) for divide/sqrt insns.
22176 -;; These insns also uses first execute stage of FMAC pipeline.
22177 -;;
22178 -;; - A 4-stage LS pipeline (execute + 2 memory + writeback) with forward from
22179 -;; second memory stage for loads.
22180 -
22181 -;; We do not model Write-After-Read hazards.
22182 -;; We do not do write scheduling with the arm core, so it is only necessary
22183 -;; to model the first stage of each pipeline
22184 -;; ??? Need to model LS pipeline properly for load/store multiple?
22185 -;; We do not model fmstat properly. This could be done by modeling pipelines
22186 -;; properly and defining an absence set between a dummy fmstat unit and all
22187 -;; other vfp units.
22188 -
22189 -(define_cpu_unit "fmac" "vfp11")
22190 -
22191 -(define_cpu_unit "ds" "vfp11")
22192 -
22193 -(define_cpu_unit "vfp_ls" "vfp11")
22194 -
22195 -(define_cpu_unit "fmstat" "vfp11")
22196 -
22197 -(exclusion_set "fmac,ds" "fmstat")
22198 -
22199 ;; The VFP "type" attributes differ from those used in the FPA model.
22200 -;; ffarith Fast floating point insns, e.g. abs, neg, cpy, cmp.
22201 -;; farith Most arithmetic insns.
22202 -;; fmul Double precision multiply.
22203 +;; fcpys Single precision cpy.
22204 +;; ffariths Single precision abs, neg.
22205 +;; ffarithd Double precision abs, neg, cpy.
22206 +;; fadds Single precision add/sub.
22207 +;; faddd Double precision add/sub.
22208 +;; fconsts Single precision load immediate.
22209 +;; fconstd Double precision load immediate.
22210 +;; fcmps Single precision comparison.
22211 +;; fcmpd Double precision comparison.
22212 +;; fmuls Single precision multiply.
22213 +;; fmuld Double precision multiply.
22214 +;; fmacs Single precision multiply-accumulate.
22215 +;; fmacd Double precision multiply-accumulate.
22216 ;; fdivs Single precision sqrt or division.
22217 ;; fdivd Double precision sqrt or division.
22218 ;; f_flag fmstat operation
22219 @@ -71,126 +46,89 @@
22220 ;; r_2_f Transfer arm to vfp reg.
22221 ;; f_cvt Convert floating<->integral
22222
22223 -(define_insn_reservation "vfp_ffarith" 4
22224 - (and (eq_attr "generic_vfp" "yes")
22225 - (eq_attr "type" "ffarith"))
22226 - "fmac")
22227 -
22228 -(define_insn_reservation "vfp_farith" 8
22229 - (and (eq_attr "generic_vfp" "yes")
22230 - (eq_attr "type" "farith,f_cvt"))
22231 - "fmac")
22232 -
22233 -(define_insn_reservation "vfp_fmul" 9
22234 - (and (eq_attr "generic_vfp" "yes")
22235 - (eq_attr "type" "fmul"))
22236 - "fmac*2")
22237 -
22238 -(define_insn_reservation "vfp_fdivs" 19
22239 - (and (eq_attr "generic_vfp" "yes")
22240 - (eq_attr "type" "fdivs"))
22241 - "ds*15")
22242 -
22243 -(define_insn_reservation "vfp_fdivd" 33
22244 - (and (eq_attr "generic_vfp" "yes")
22245 - (eq_attr "type" "fdivd"))
22246 - "fmac+ds*29")
22247 -
22248 -;; Moves to/from arm regs also use the load/store pipeline.
22249 -(define_insn_reservation "vfp_fload" 4
22250 - (and (eq_attr "generic_vfp" "yes")
22251 - (eq_attr "type" "f_loads,f_loadd,r_2_f"))
22252 - "vfp_ls")
22253 -
22254 -(define_insn_reservation "vfp_fstore" 4
22255 - (and (eq_attr "generic_vfp" "yes")
22256 - (eq_attr "type" "f_stores,f_stored,f_2_r"))
22257 - "vfp_ls")
22258 -
22259 -(define_insn_reservation "vfp_to_cpsr" 4
22260 - (and (eq_attr "generic_vfp" "yes")
22261 - (eq_attr "type" "f_flag"))
22262 - "fmstat,vfp_ls*3")
22263 -
22264 -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22265 -;; Insn pattern
22266 -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22267 -
22268 ;; SImode moves
22269 ;; ??? For now do not allow loading constants into vfp regs. This causes
22270 ;; problems because small constants get converted into adds.
22271 (define_insn "*arm_movsi_vfp"
22272 - [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,r ,m,*t,r,*t,*t, *Uv")
22273 - (match_operand:SI 1 "general_operand" "rI,K,N,mi,r,r,*t,*t,*Uvi,*t"))]
22274 + [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r,rk,m ,*t,r,*t,*t, *Uv")
22275 + (match_operand:SI 1 "general_operand" "rk, I,K,j,mi,rk,r,*t,*t,*Uvi,*t"))]
22276 "TARGET_ARM && TARGET_VFP && TARGET_HARD_FLOAT
22277 && ( s_register_operand (operands[0], SImode)
22278 || s_register_operand (operands[1], SImode))"
22279 "*
22280 switch (which_alternative)
22281 {
22282 - case 0:
22283 + case 0: case 1:
22284 return \"mov%?\\t%0, %1\";
22285 - case 1:
22286 - return \"mvn%?\\t%0, #%B1\";
22287 case 2:
22288 - return \"movw%?\\t%0, %1\";
22289 + return \"mvn%?\\t%0, #%B1\";
22290 case 3:
22291 - return \"ldr%?\\t%0, %1\";
22292 + return \"movw%?\\t%0, %1\";
22293 case 4:
22294 - return \"str%?\\t%1, %0\";
22295 + return \"ldr%?\\t%0, %1\";
22296 case 5:
22297 - return \"fmsr%?\\t%0, %1\\t%@ int\";
22298 + return \"str%?\\t%1, %0\";
22299 case 6:
22300 - return \"fmrs%?\\t%0, %1\\t%@ int\";
22301 + return \"fmsr%?\\t%0, %1\\t%@ int\";
22302 case 7:
22303 + return \"fmrs%?\\t%0, %1\\t%@ int\";
22304 + case 8:
22305 return \"fcpys%?\\t%0, %1\\t%@ int\";
22306 - case 8: case 9:
22307 + case 9: case 10:
22308 return output_move_vfp (operands);
22309 default:
22310 gcc_unreachable ();
22311 }
22312 "
22313 [(set_attr "predicable" "yes")
22314 - (set_attr "type" "*,*,*,load1,store1,r_2_f,f_2_r,ffarith,f_loads,f_stores")
22315 - (set_attr "pool_range" "*,*,*,4096,*,*,*,*,1020,*")
22316 - (set_attr "neg_pool_range" "*,*,*,4084,*,*,*,*,1008,*")]
22317 + (set_attr "type" "*,*,*,*,load1,store1,r_2_f,f_2_r,fcpys,f_loads,f_stores")
22318 + (set_attr "neon_type" "*,*,*,*,*,*,neon_mcr,neon_mrc,neon_vmov,*,*")
22319 + (set_attr "insn" "mov,mov,mvn,mov,*,*,*,*,*,*,*")
22320 + (set_attr "pool_range" "*,*,*,*,4096,*,*,*,*,1020,*")
22321 + (set_attr "neg_pool_range" "*,*,*,*,4084,*,*,*,*,1008,*")]
22322 )
22323
22324 +;; See thumb2.md:thumb2_movsi_insn for an explanation of the split
22325 +;; high/low register alternatives for loads and stores here.
22326 (define_insn "*thumb2_movsi_vfp"
22327 - [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,r,m,*t,r,*t,*t, *Uv")
22328 - (match_operand:SI 1 "general_operand" "rI,K,N,mi,r,r,*t,*t,*Uvi,*t"))]
22329 + [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r,l,*hk,m,*m,*t,r, *t,*t, *Uv")
22330 + (match_operand:SI 1 "general_operand" "rk, I,K,j,mi,*mi,l,*hk,r,*t,*t,*Uvi,*t"))]
22331 "TARGET_THUMB2 && TARGET_VFP && TARGET_HARD_FLOAT
22332 && ( s_register_operand (operands[0], SImode)
22333 || s_register_operand (operands[1], SImode))"
22334 "*
22335 switch (which_alternative)
22336 {
22337 - case 0:
22338 + case 0: case 1:
22339 return \"mov%?\\t%0, %1\";
22340 - case 1:
22341 - return \"mvn%?\\t%0, #%B1\";
22342 case 2:
22343 - return \"movw%?\\t%0, %1\";
22344 + return \"mvn%?\\t%0, #%B1\";
22345 case 3:
22346 - return \"ldr%?\\t%0, %1\";
22347 + return \"movw%?\\t%0, %1\";
22348 case 4:
22349 - return \"str%?\\t%1, %0\";
22350 case 5:
22351 - return \"fmsr%?\\t%0, %1\\t%@ int\";
22352 + return \"ldr%?\\t%0, %1\";
22353 case 6:
22354 - return \"fmrs%?\\t%0, %1\\t%@ int\";
22355 case 7:
22356 + return \"str%?\\t%1, %0\";
22357 + case 8:
22358 + return \"fmsr%?\\t%0, %1\\t%@ int\";
22359 + case 9:
22360 + return \"fmrs%?\\t%0, %1\\t%@ int\";
22361 + case 10:
22362 return \"fcpys%?\\t%0, %1\\t%@ int\";
22363 - case 8: case 9:
22364 + case 11: case 12:
22365 return output_move_vfp (operands);
22366 default:
22367 gcc_unreachable ();
22368 }
22369 "
22370 [(set_attr "predicable" "yes")
22371 - (set_attr "type" "*,*,*,load1,store1,r_2_f,f_2_r,ffarith,f_load,f_store")
22372 - (set_attr "pool_range" "*,*,*,4096,*,*,*,*,1020,*")
22373 - (set_attr "neg_pool_range" "*,*,*, 0,*,*,*,*,1008,*")]
22374 + (set_attr "type" "*,*,*,*,load1,load1,store1,store1,r_2_f,f_2_r,fcpys,f_load,f_store")
22375 + (set_attr "neon_type" "*,*,*,*,*,*,*,*,neon_mcr,neon_mrc,neon_vmov,*,*")
22376 + (set_attr "insn" "mov,mov,mvn,mov,*,*,*,*,*,*,*,*,*")
22377 + (set_attr "pool_range" "*,*,*,*,1020,4096,*,*,*,*,*,1020,*")
22378 + (set_attr "neg_pool_range" "*,*,*,*, 0, 0,*,*,*,*,*,1008,*")]
22379 )
22380
22381
22382 @@ -222,7 +160,8 @@
22383 gcc_unreachable ();
22384 }
22385 "
22386 - [(set_attr "type" "*,load2,store2,r_2_f,f_2_r,ffarith,f_loadd,f_stored")
22387 + [(set_attr "type" "*,load2,store2,r_2_f,f_2_r,ffarithd,f_loadd,f_stored")
22388 + (set_attr "neon_type" "*,*,*,neon_mcr_2_mcrr,neon_mrrc,neon_vmov,*,*")
22389 (set_attr "length" "8,8,8,4,4,4,4,4")
22390 (set_attr "pool_range" "*,1020,*,*,*,*,1020,*")
22391 (set_attr "neg_pool_range" "*,1008,*,*,*,*,1008,*")]
22392 @@ -249,12 +188,68 @@
22393 abort ();
22394 }
22395 "
22396 - [(set_attr "type" "*,load2,store2,r_2_f,f_2_r,ffarith,f_load,f_store")
22397 + [(set_attr "type" "*,load2,store2,r_2_f,f_2_r,ffarithd,f_load,f_store")
22398 + (set_attr "neon_type" "*,*,*,neon_mcr_2_mcrr,neon_mrrc,neon_vmov,*,*")
22399 (set_attr "length" "8,8,8,4,4,4,4,4")
22400 (set_attr "pool_range" "*,4096,*,*,*,*,1020,*")
22401 (set_attr "neg_pool_range" "*, 0,*,*,*,*,1008,*")]
22402 )
22403
22404 +;; HFmode moves
22405 +(define_insn "*movhf_vfp"
22406 + [(set (match_operand:HF 0 "nonimmediate_operand" "= t,Um,r,m,t,r,t,r,r")
22407 + (match_operand:HF 1 "general_operand" " Um, t,m,r,t,r,r,t,F"))]
22408 + "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_NEON_FP16
22409 + && ( s_register_operand (operands[0], HFmode)
22410 + || s_register_operand (operands[1], HFmode))"
22411 + "*
22412 + switch (which_alternative)
22413 + {
22414 + case 0: /* S register from memory */
22415 + return \"vld1.16\\t{%z0}, %A1\";
22416 + case 1: /* memory from S register */
22417 + return \"vst1.16\\t{%z1}, %A0\";
22418 + case 2: /* ARM register from memory */
22419 + return \"ldrh\\t%0, %1\\t%@ __fp16\";
22420 + case 3: /* memory from ARM register */
22421 + return \"strh\\t%1, %0\\t%@ __fp16\";
22422 + case 4: /* S register from S register */
22423 + return \"fcpys\\t%0, %1\";
22424 + case 5: /* ARM register from ARM register */
22425 + return \"mov\\t%0, %1\\t%@ __fp16\";
22426 + case 6: /* S register from ARM register */
22427 + return \"fmsr\\t%0, %1\";
22428 + case 7: /* ARM register from S register */
22429 + return \"fmrs\\t%0, %1\";
22430 + case 8: /* ARM register from constant */
22431 + {
22432 + REAL_VALUE_TYPE r;
22433 + long bits;
22434 + rtx ops[4];
22435 +
22436 + REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
22437 + bits = real_to_target (NULL, &r, HFmode);
22438 + ops[0] = operands[0];
22439 + ops[1] = GEN_INT (bits);
22440 + ops[2] = GEN_INT (bits & 0xff00);
22441 + ops[3] = GEN_INT (bits & 0x00ff);
22442 +
22443 + if (arm_arch_thumb2)
22444 + output_asm_insn (\"movw\\t%0, %1\", ops);
22445 + else
22446 + output_asm_insn (\"mov\\t%0, %2\;orr\\t%0, %0, %3\", ops);
22447 + return \"\";
22448 + }
22449 + default:
22450 + gcc_unreachable ();
22451 + }
22452 + "
22453 + [(set_attr "conds" "unconditional")
22454 + (set_attr "type" "*,*,load1,store1,fcpys,*,r_2_f,f_2_r,*")
22455 + (set_attr "neon_type" "neon_vld1_1_2_regs,neon_vst1_1_2_regs_vst2_2_regs,*,*,*,*,*,*,*")
22456 + (set_attr "length" "4,4,4,4,4,4,4,4,8")]
22457 +)
22458 +
22459
22460 ;; SFmode moves
22461 ;; Disparage the w<->r cases because reloading an invalid address is
22462 @@ -291,7 +286,8 @@
22463 "
22464 [(set_attr "predicable" "yes")
22465 (set_attr "type"
22466 - "r_2_f,f_2_r,farith,f_loads,f_stores,load1,store1,ffarith,*")
22467 + "r_2_f,f_2_r,fconsts,f_loads,f_stores,load1,store1,fcpys,*")
22468 + (set_attr "neon_type" "neon_mcr,neon_mrc,*,*,*,*,*,neon_vmov,*")
22469 (set_attr "pool_range" "*,*,*,1020,*,4096,*,*,*")
22470 (set_attr "neg_pool_range" "*,*,*,1008,*,4080,*,*,*")]
22471 )
22472 @@ -327,7 +323,8 @@
22473 "
22474 [(set_attr "predicable" "yes")
22475 (set_attr "type"
22476 - "r_2_f,f_2_r,farith,f_load,f_store,load1,store1,ffarith,*")
22477 + "r_2_f,f_2_r,fconsts,f_load,f_store,load1,store1,fcpys,*")
22478 + (set_attr "neon_type" "neon_mcr,neon_mrc,*,*,*,*,*,neon_vmov,*")
22479 (set_attr "pool_range" "*,*,*,1020,*,4092,*,*,*")
22480 (set_attr "neg_pool_range" "*,*,*,1008,*,0,*,*,*")]
22481 )
22482 @@ -365,7 +362,8 @@
22483 }
22484 "
22485 [(set_attr "type"
22486 - "r_2_f,f_2_r,farith,f_loadd,f_stored,load2,store2,ffarith,*")
22487 + "r_2_f,f_2_r,fconstd,f_loadd,f_stored,load2,store2,ffarithd,*")
22488 + (set_attr "neon_type" "neon_mcr_2_mcrr,neon_mrrc,*,*,*,*,*,neon_vmov,*")
22489 (set_attr "length" "4,4,4,8,8,4,4,4,8")
22490 (set_attr "pool_range" "*,*,*,1020,*,1020,*,*,*")
22491 (set_attr "neg_pool_range" "*,*,*,1008,*,1008,*,*,*")]
22492 @@ -397,7 +395,8 @@
22493 }
22494 "
22495 [(set_attr "type"
22496 - "r_2_f,f_2_r,farith,load2,store2,f_load,f_store,ffarith,*")
22497 + "r_2_f,f_2_r,fconstd,load2,store2,f_load,f_store,ffarithd,*")
22498 + (set_attr "neon_type" "neon_mcr_2_mcrr,neon_mrrc,*,*,*,*,*,neon_vmov,*")
22499 (set_attr "length" "4,4,4,8,8,4,4,4,8")
22500 (set_attr "pool_range" "*,*,*,4096,*,1020,*,*,*")
22501 (set_attr "neg_pool_range" "*,*,*,0,*,1008,*,*,*")]
22502 @@ -426,7 +425,8 @@
22503 fmrs%D3\\t%0, %2\;fmrs%d3\\t%0, %1"
22504 [(set_attr "conds" "use")
22505 (set_attr "length" "4,4,8,4,4,8,4,4,8")
22506 - (set_attr "type" "ffarith,ffarith,ffarith,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")]
22507 + (set_attr "type" "fcpys,fcpys,fcpys,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")
22508 + (set_attr "neon_type" "neon_vmov,neon_vmov,neon_vmov,neon_mcr,neon_mcr,neon_mcr,neon_mrc,neon_mrc,neon_mrc")]
22509 )
22510
22511 (define_insn "*thumb2_movsfcc_vfp"
22512 @@ -449,7 +449,8 @@
22513 ite\\t%D3\;fmrs%D3\\t%0, %2\;fmrs%d3\\t%0, %1"
22514 [(set_attr "conds" "use")
22515 (set_attr "length" "6,6,10,6,6,10,6,6,10")
22516 - (set_attr "type" "ffarith,ffarith,ffarith,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")]
22517 + (set_attr "type" "fcpys,fcpys,fcpys,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")
22518 + (set_attr "neon_type" "neon_vmov,neon_vmov,neon_vmov,neon_mcr,neon_mcr,neon_mcr,neon_mrc,neon_mrc,neon_mrc")]
22519 )
22520
22521 (define_insn "*movdfcc_vfp"
22522 @@ -472,7 +473,8 @@
22523 fmrrd%D3\\t%Q0, %R0, %P2\;fmrrd%d3\\t%Q0, %R0, %P1"
22524 [(set_attr "conds" "use")
22525 (set_attr "length" "4,4,8,4,4,8,4,4,8")
22526 - (set_attr "type" "ffarith,ffarith,ffarith,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")]
22527 + (set_attr "type" "ffarithd,ffarithd,ffarithd,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")
22528 + (set_attr "neon_type" "neon_vmov,neon_vmov,neon_vmov,neon_mcr_2_mcrr,neon_mcr_2_mcrr,neon_mcr_2_mcrr,neon_mrrc,neon_mrrc,neon_mrrc")]
22529 )
22530
22531 (define_insn "*thumb2_movdfcc_vfp"
22532 @@ -495,7 +497,8 @@
22533 ite\\t%D3\;fmrrd%D3\\t%Q0, %R0, %P2\;fmrrd%d3\\t%Q0, %R0, %P1"
22534 [(set_attr "conds" "use")
22535 (set_attr "length" "6,6,10,6,6,10,6,6,10")
22536 - (set_attr "type" "ffarith,ffarith,ffarith,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")]
22537 + (set_attr "type" "ffarithd,ffarithd,ffarithd,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")
22538 + (set_attr "neon_type" "neon_vmov,neon_vmov,neon_vmov,neon_mcr_2_mcrr,neon_mcr_2_mcrr,neon_mcr_2_mcrr,neon_mrrc,neon_mrrc,neon_mrrc")]
22539 )
22540
22541
22542 @@ -507,7 +510,7 @@
22543 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22544 "fabss%?\\t%0, %1"
22545 [(set_attr "predicable" "yes")
22546 - (set_attr "type" "ffarith")]
22547 + (set_attr "type" "ffariths")]
22548 )
22549
22550 (define_insn "*absdf2_vfp"
22551 @@ -516,7 +519,7 @@
22552 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22553 "fabsd%?\\t%P0, %P1"
22554 [(set_attr "predicable" "yes")
22555 - (set_attr "type" "ffarith")]
22556 + (set_attr "type" "ffarithd")]
22557 )
22558
22559 (define_insn "*negsf2_vfp"
22560 @@ -527,7 +530,7 @@
22561 fnegs%?\\t%0, %1
22562 eor%?\\t%0, %1, #-2147483648"
22563 [(set_attr "predicable" "yes")
22564 - (set_attr "type" "ffarith")]
22565 + (set_attr "type" "ffariths")]
22566 )
22567
22568 (define_insn_and_split "*negdf2_vfp"
22569 @@ -573,7 +576,7 @@
22570 "
22571 [(set_attr "predicable" "yes")
22572 (set_attr "length" "4,4,8")
22573 - (set_attr "type" "ffarith")]
22574 + (set_attr "type" "ffarithd")]
22575 )
22576
22577
22578 @@ -586,7 +589,7 @@
22579 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22580 "fadds%?\\t%0, %1, %2"
22581 [(set_attr "predicable" "yes")
22582 - (set_attr "type" "farith")]
22583 + (set_attr "type" "fadds")]
22584 )
22585
22586 (define_insn "*adddf3_vfp"
22587 @@ -596,7 +599,7 @@
22588 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22589 "faddd%?\\t%P0, %P1, %P2"
22590 [(set_attr "predicable" "yes")
22591 - (set_attr "type" "farith")]
22592 + (set_attr "type" "faddd")]
22593 )
22594
22595
22596 @@ -607,7 +610,7 @@
22597 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22598 "fsubs%?\\t%0, %1, %2"
22599 [(set_attr "predicable" "yes")
22600 - (set_attr "type" "farith")]
22601 + (set_attr "type" "fadds")]
22602 )
22603
22604 (define_insn "*subdf3_vfp"
22605 @@ -617,7 +620,7 @@
22606 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22607 "fsubd%?\\t%P0, %P1, %P2"
22608 [(set_attr "predicable" "yes")
22609 - (set_attr "type" "farith")]
22610 + (set_attr "type" "faddd")]
22611 )
22612
22613
22614 @@ -653,7 +656,7 @@
22615 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22616 "fmuls%?\\t%0, %1, %2"
22617 [(set_attr "predicable" "yes")
22618 - (set_attr "type" "farith")]
22619 + (set_attr "type" "fmuls")]
22620 )
22621
22622 (define_insn "*muldf3_vfp"
22623 @@ -663,7 +666,7 @@
22624 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22625 "fmuld%?\\t%P0, %P1, %P2"
22626 [(set_attr "predicable" "yes")
22627 - (set_attr "type" "fmul")]
22628 + (set_attr "type" "fmuld")]
22629 )
22630
22631
22632 @@ -674,7 +677,7 @@
22633 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22634 "fnmuls%?\\t%0, %1, %2"
22635 [(set_attr "predicable" "yes")
22636 - (set_attr "type" "farith")]
22637 + (set_attr "type" "fmuls")]
22638 )
22639
22640 (define_insn "*muldf3negdf_vfp"
22641 @@ -684,7 +687,7 @@
22642 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22643 "fnmuld%?\\t%P0, %P1, %P2"
22644 [(set_attr "predicable" "yes")
22645 - (set_attr "type" "fmul")]
22646 + (set_attr "type" "fmuld")]
22647 )
22648
22649
22650 @@ -696,10 +699,11 @@
22651 (plus:SF (mult:SF (match_operand:SF 2 "s_register_operand" "t")
22652 (match_operand:SF 3 "s_register_operand" "t"))
22653 (match_operand:SF 1 "s_register_operand" "0")))]
22654 - "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22655 + "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP
22656 + && (!arm_tune_marvell_f || optimize_size)"
22657 "fmacs%?\\t%0, %2, %3"
22658 [(set_attr "predicable" "yes")
22659 - (set_attr "type" "farith")]
22660 + (set_attr "type" "fmacs")]
22661 )
22662
22663 (define_insn "*muldf3adddf_vfp"
22664 @@ -707,10 +711,11 @@
22665 (plus:DF (mult:DF (match_operand:DF 2 "s_register_operand" "w")
22666 (match_operand:DF 3 "s_register_operand" "w"))
22667 (match_operand:DF 1 "s_register_operand" "0")))]
22668 - "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22669 + "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP
22670 + && (!arm_tune_marvell_f || optimize_size)"
22671 "fmacd%?\\t%P0, %P2, %P3"
22672 [(set_attr "predicable" "yes")
22673 - (set_attr "type" "fmul")]
22674 + (set_attr "type" "fmacd")]
22675 )
22676
22677 ;; 0 = 1 * 2 - 0
22678 @@ -719,10 +724,11 @@
22679 (minus:SF (mult:SF (match_operand:SF 2 "s_register_operand" "t")
22680 (match_operand:SF 3 "s_register_operand" "t"))
22681 (match_operand:SF 1 "s_register_operand" "0")))]
22682 - "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22683 + "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP
22684 + && (!arm_tune_marvell_f || optimize_size)"
22685 "fmscs%?\\t%0, %2, %3"
22686 [(set_attr "predicable" "yes")
22687 - (set_attr "type" "farith")]
22688 + (set_attr "type" "fmacs")]
22689 )
22690
22691 (define_insn "*muldf3subdf_vfp"
22692 @@ -730,10 +736,11 @@
22693 (minus:DF (mult:DF (match_operand:DF 2 "s_register_operand" "w")
22694 (match_operand:DF 3 "s_register_operand" "w"))
22695 (match_operand:DF 1 "s_register_operand" "0")))]
22696 - "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22697 + "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP
22698 + && (!arm_tune_marvell_f || optimize_size)"
22699 "fmscd%?\\t%P0, %P2, %P3"
22700 [(set_attr "predicable" "yes")
22701 - (set_attr "type" "fmul")]
22702 + (set_attr "type" "fmacd")]
22703 )
22704
22705 ;; 0 = -(1 * 2) + 0
22706 @@ -742,10 +749,11 @@
22707 (minus:SF (match_operand:SF 1 "s_register_operand" "0")
22708 (mult:SF (match_operand:SF 2 "s_register_operand" "t")
22709 (match_operand:SF 3 "s_register_operand" "t"))))]
22710 - "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22711 + "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP
22712 + && (!arm_tune_marvell_f || optimize_size)"
22713 "fnmacs%?\\t%0, %2, %3"
22714 [(set_attr "predicable" "yes")
22715 - (set_attr "type" "farith")]
22716 + (set_attr "type" "fmacs")]
22717 )
22718
22719 (define_insn "*fmuldf3negdfadddf_vfp"
22720 @@ -753,10 +761,11 @@
22721 (minus:DF (match_operand:DF 1 "s_register_operand" "0")
22722 (mult:DF (match_operand:DF 2 "s_register_operand" "w")
22723 (match_operand:DF 3 "s_register_operand" "w"))))]
22724 - "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22725 + "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP
22726 + && (!arm_tune_marvell_f || optimize_size)"
22727 "fnmacd%?\\t%P0, %P2, %P3"
22728 [(set_attr "predicable" "yes")
22729 - (set_attr "type" "fmul")]
22730 + (set_attr "type" "fmacd")]
22731 )
22732
22733
22734 @@ -767,10 +776,11 @@
22735 (neg:SF (match_operand:SF 2 "s_register_operand" "t"))
22736 (match_operand:SF 3 "s_register_operand" "t"))
22737 (match_operand:SF 1 "s_register_operand" "0")))]
22738 - "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22739 + "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP
22740 + && (!arm_tune_marvell_f || optimize_size)"
22741 "fnmscs%?\\t%0, %2, %3"
22742 [(set_attr "predicable" "yes")
22743 - (set_attr "type" "farith")]
22744 + (set_attr "type" "fmacs")]
22745 )
22746
22747 (define_insn "*muldf3negdfsubdf_vfp"
22748 @@ -779,10 +789,11 @@
22749 (neg:DF (match_operand:DF 2 "s_register_operand" "w"))
22750 (match_operand:DF 3 "s_register_operand" "w"))
22751 (match_operand:DF 1 "s_register_operand" "0")))]
22752 - "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
22753 + "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP
22754 + && (!arm_tune_marvell_f || optimize_size)"
22755 "fnmscd%?\\t%P0, %P2, %P3"
22756 [(set_attr "predicable" "yes")
22757 - (set_attr "type" "fmul")]
22758 + (set_attr "type" "fmacd")]
22759 )
22760
22761
22762 @@ -806,6 +817,24 @@
22763 (set_attr "type" "f_cvt")]
22764 )
22765
22766 +(define_insn "extendhfsf2"
22767 + [(set (match_operand:SF 0 "s_register_operand" "=t")
22768 + (float_extend:SF (match_operand:HF 1 "s_register_operand" "t")))]
22769 + "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_NEON_FP16"
22770 + "vcvtb%?.f32.f16\\t%0, %1"
22771 + [(set_attr "predicable" "yes")
22772 + (set_attr "type" "f_cvt")]
22773 +)
22774 +
22775 +(define_insn "truncsfhf2"
22776 + [(set (match_operand:HF 0 "s_register_operand" "=t")
22777 + (float_truncate:HF (match_operand:SF 1 "s_register_operand" "t")))]
22778 + "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_NEON_FP16"
22779 + "vcvtb%?.f16.f32\\t%0, %1"
22780 + [(set_attr "predicable" "yes")
22781 + (set_attr "type" "f_cvt")]
22782 +)
22783 +
22784 (define_insn "*truncsisf2_vfp"
22785 [(set (match_operand:SI 0 "s_register_operand" "=t")
22786 (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" "t"))))]
22787 @@ -986,7 +1015,7 @@
22788 fcmps%?\\t%0, %1
22789 fcmpzs%?\\t%0"
22790 [(set_attr "predicable" "yes")
22791 - (set_attr "type" "ffarith")]
22792 + (set_attr "type" "fcmps")]
22793 )
22794
22795 (define_insn "*cmpsf_trap_vfp"
22796 @@ -998,7 +1027,7 @@
22797 fcmpes%?\\t%0, %1
22798 fcmpezs%?\\t%0"
22799 [(set_attr "predicable" "yes")
22800 - (set_attr "type" "ffarith")]
22801 + (set_attr "type" "fcmpd")]
22802 )
22803
22804 (define_insn "*cmpdf_vfp"
22805 @@ -1010,7 +1039,7 @@
22806 fcmpd%?\\t%P0, %P1
22807 fcmpzd%?\\t%P0"
22808 [(set_attr "predicable" "yes")
22809 - (set_attr "type" "ffarith")]
22810 + (set_attr "type" "fcmpd")]
22811 )
22812
22813 (define_insn "*cmpdf_trap_vfp"
22814 @@ -1022,7 +1051,7 @@
22815 fcmped%?\\t%P0, %P1
22816 fcmpezd%?\\t%P0"
22817 [(set_attr "predicable" "yes")
22818 - (set_attr "type" "ffarith")]
22819 + (set_attr "type" "fcmpd")]
22820 )
22821
22822
22823 --- /dev/null
22824 +++ b/gcc/config/arm/vfp11.md
22825 @@ -0,0 +1,92 @@
22826 +;; ARM VFP11 pipeline description
22827 +;; Copyright (C) 2003, 2005, 2007, 2008 Free Software Foundation, Inc.
22828 +;; Written by CodeSourcery.
22829 +;;
22830 +;; This file is part of GCC.
22831 +
22832 +;; GCC is free software; you can redistribute it and/or modify it
22833 +;; under the terms of the GNU General Public License as published
22834 +;; by the Free Software Foundation; either version 3, or (at your
22835 +;; option) any later version.
22836 +
22837 +;; GCC is distributed in the hope that it will be useful, but WITHOUT
22838 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22839 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
22840 +;; License for more details.
22841 +
22842 +;; You should have received a copy of the GNU General Public License
22843 +;; along with GCC; see the file COPYING3. If not see
22844 +;; <http://www.gnu.org/licenses/>.
22845 +
22846 +(define_automaton "vfp11")
22847 +
22848 +;; There are 3 pipelines in the VFP11 unit.
22849 +;;
22850 +;; - A 8-stage FMAC pipeline (7 execute + writeback) with forward from
22851 +;; fourth stage for simple operations.
22852 +;;
22853 +;; - A 5-stage DS pipeline (4 execute + writeback) for divide/sqrt insns.
22854 +;; These insns also uses first execute stage of FMAC pipeline.
22855 +;;
22856 +;; - A 4-stage LS pipeline (execute + 2 memory + writeback) with forward from
22857 +;; second memory stage for loads.
22858 +
22859 +;; We do not model Write-After-Read hazards.
22860 +;; We do not do write scheduling with the arm core, so it is only necessary
22861 +;; to model the first stage of each pipeline
22862 +;; ??? Need to model LS pipeline properly for load/store multiple?
22863 +;; We do not model fmstat properly. This could be done by modeling pipelines
22864 +;; properly and defining an absence set between a dummy fmstat unit and all
22865 +;; other vfp units.
22866 +
22867 +(define_cpu_unit "fmac" "vfp11")
22868 +
22869 +(define_cpu_unit "ds" "vfp11")
22870 +
22871 +(define_cpu_unit "vfp_ls" "vfp11")
22872 +
22873 +(define_cpu_unit "fmstat" "vfp11")
22874 +
22875 +(exclusion_set "fmac,ds" "fmstat")
22876 +
22877 +(define_insn_reservation "vfp_ffarith" 4
22878 + (and (eq_attr "generic_vfp" "yes")
22879 + (eq_attr "type" "fcpys,ffariths,ffarithd,fcmps,fcmpd"))
22880 + "fmac")
22881 +
22882 +(define_insn_reservation "vfp_farith" 8
22883 + (and (eq_attr "generic_vfp" "yes")
22884 + (eq_attr "type" "fadds,faddd,fconsts,fconstd,f_cvt,fmuls,fmacs"))
22885 + "fmac")
22886 +
22887 +(define_insn_reservation "vfp_fmul" 9
22888 + (and (eq_attr "generic_vfp" "yes")
22889 + (eq_attr "type" "fmuld,fmacd"))
22890 + "fmac*2")
22891 +
22892 +(define_insn_reservation "vfp_fdivs" 19
22893 + (and (eq_attr "generic_vfp" "yes")
22894 + (eq_attr "type" "fdivs"))
22895 + "ds*15")
22896 +
22897 +(define_insn_reservation "vfp_fdivd" 33
22898 + (and (eq_attr "generic_vfp" "yes")
22899 + (eq_attr "type" "fdivd"))
22900 + "fmac+ds*29")
22901 +
22902 +;; Moves to/from arm regs also use the load/store pipeline.
22903 +(define_insn_reservation "vfp_fload" 4
22904 + (and (eq_attr "generic_vfp" "yes")
22905 + (eq_attr "type" "f_loads,f_loadd,r_2_f"))
22906 + "vfp_ls")
22907 +
22908 +(define_insn_reservation "vfp_fstore" 4
22909 + (and (eq_attr "generic_vfp" "yes")
22910 + (eq_attr "type" "f_stores,f_stored,f_2_r"))
22911 + "vfp_ls")
22912 +
22913 +(define_insn_reservation "vfp_to_cpsr" 4
22914 + (and (eq_attr "generic_vfp" "yes")
22915 + (eq_attr "type" "f_flag"))
22916 + "fmstat,vfp_ls*3")
22917 +
22918 --- a/gcc/config/arm/vxworks.h
22919 +++ b/gcc/config/arm/vxworks.h
22920 @@ -113,3 +113,6 @@ along with GCC; see the file COPYING3.
22921 cannot allow arbitrary offsets for shared libraries either. */
22922 #undef ARM_OFFSETS_MUST_BE_WITHIN_SECTIONS_P
22923 #define ARM_OFFSETS_MUST_BE_WITHIN_SECTIONS_P 1
22924 +
22925 +#undef TARGET_DEFAULT_WORD_RELOCATIONS
22926 +#define TARGET_DEFAULT_WORD_RELOCATIONS 1
22927 --- /dev/null
22928 +++ b/gcc/config/arm/wrs-linux.h
22929 @@ -0,0 +1,76 @@
22930 +/* Wind River GNU/Linux Configuration.
22931 + Copyright (C) 2006, 2007, 2008
22932 + Free Software Foundation, Inc.
22933 +
22934 +This file is part of GCC.
22935 +
22936 +GCC is free software; you can redistribute it and/or modify
22937 +it under the terms of the GNU General Public License as published by
22938 +the Free Software Foundation; either version 3, or (at your option)
22939 +any later version.
22940 +
22941 +GCC is distributed in the hope that it will be useful,
22942 +but WITHOUT ANY WARRANTY; without even the implied warranty of
22943 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22944 +GNU General Public License for more details.
22945 +
22946 +You should have received a copy of the GNU General Public License
22947 +along with GCC; see the file COPYING3. If not see
22948 +<http://www.gnu.org/licenses/>. */
22949 +
22950 +/* Use the ARM926EJ-S by default. */
22951 +#undef SUBTARGET_CPU_DEFAULT
22952 +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm926ejs
22953 +
22954 +/* Add a -tiwmmxt option for convenience in generating multilibs.
22955 + This option generates big-endian IWMMXT code. */
22956 +#undef CC1_SPEC
22957 +#define CC1_SPEC " \
22958 + %{tarm926ej-s: -mcpu=arm926ej-s ; \
22959 + tiwmmxt: -mcpu=iwmmxt ; \
22960 + tiwmmxt2: -mcpu=iwmmxt ; \
22961 + txscale: -mcpu=xscale -mbig-endian ; \
22962 + tarm920t: -mcpu=arm920t ; \
22963 + tthumb2: %{!mcpu=*:%{!march=*:-march=armv6t2}} -mthumb ; \
22964 + tcortex-a8-be8: -mcpu=cortex-a8 -mbig-endian -mfloat-abi=softfp \
22965 + -mfpu=neon } \
22966 + %{txscale:%{mfloat-abi=softfp:%eXScale VFP multilib not provided}} \
22967 + %{tarm920t:%{mfloat-abi=softfp:%eARM920T VFP multilib not provided}} \
22968 + %{profile:-p}"
22969 +
22970 +/* Since the ARM926EJ-S is the default processor, we do not need to
22971 + provide an explicit multilib for that processor. */
22972 +#undef MULTILIB_DEFAULTS
22973 +#define MULTILIB_DEFAULTS \
22974 + { "tarm926ej-s" }
22975 +
22976 +/* The GLIBC headers are in /usr/include, relative to the sysroot; the
22977 + uClibc headers are in /uclibc/usr/include. */
22978 +#undef SYSROOT_HEADERS_SUFFIX_SPEC
22979 +#define SYSROOT_HEADERS_SUFFIX_SPEC \
22980 + "%{muclibc:/uclibc}"
22981 +
22982 +/* Translate -tiwmmxt appropriately for the assembler. The -meabi=5
22983 + option is the relevant part of SUBTARGET_EXTRA_ASM_SPEC in bpabi.h. */
22984 +#undef SUBTARGET_EXTRA_ASM_SPEC
22985 +#define SUBTARGET_EXTRA_ASM_SPEC \
22986 + "%{tiwmmxt2:-mcpu=iwmmxt2} %{tiwmmxt:-mcpu=iwmmxt} %{txscale:-mcpu=xscale -EB} %{tcortex-a8-be8:-mcpu=cortex-a8 -EB} -meabi=5"
22987 +
22988 +/* Translate -tiwmmxt for the linker. */
22989 +#undef SUBTARGET_EXTRA_LINK_SPEC
22990 +#define SUBTARGET_EXTRA_LINK_SPEC \
22991 + " %{tiwmmxt:-m armelf_linux_eabi ; \
22992 + txscale:-m armelfb_linux_eabi ; \
22993 + tcortex-a8-be8:-m armelfb_linux_eabi %{!r:--be8} ; \
22994 + : -m armelf_linux_eabi}"
22995 +
22996 +/* The various C libraries each have their own subdirectory. */
22997 +#undef SYSROOT_SUFFIX_SPEC
22998 +#define SYSROOT_SUFFIX_SPEC \
22999 + "%{muclibc:/uclibc}%{tiwmmxt:/tiwmmxt ; \
23000 + tiwmmxt2:/tiwmmxt ; \
23001 + txscale:/txscale ; \
23002 + tarm920t:/tarm920t ; \
23003 + tthumb2:/thumb2 ; \
23004 + tcortex-a8-be8:/cortex-a8-be8}%{!tthumb2:%{!tcortex-a8-be8:%{mfloat-abi=softfp:/softfp}}}"
23005 +
23006 --- /dev/null
23007 +++ b/gcc/config/i386/cs-linux.h
23008 @@ -0,0 +1,41 @@
23009 +/* Sourcery G++ IA32 GNU/Linux Configuration.
23010 + Copyright (C) 2007
23011 + Free Software Foundation, Inc.
23012 +
23013 +This file is part of GCC.
23014 +
23015 +GCC is free software; you can redistribute it and/or modify
23016 +it under the terms of the GNU General Public License as published by
23017 +the Free Software Foundation; either version 3, or (at your option)
23018 +any later version.
23019 +
23020 +GCC is distributed in the hope that it will be useful,
23021 +but WITHOUT ANY WARRANTY; without even the implied warranty of
23022 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23023 +GNU General Public License for more details.
23024 +
23025 +You should have received a copy of the GNU General Public License
23026 +along with GCC; see the file COPYING3. If not see
23027 +<http://www.gnu.org/licenses/>. */
23028 +
23029 +/* This configuration may be used either with the system glibc (in
23030 + system32 and system64 subdirectories) or with the included glibc
23031 + (in the sgxx-glibc subdirectory). */
23032 +
23033 +#undef SYSROOT_SUFFIX_SPEC
23034 +#define SYSROOT_SUFFIX_SPEC \
23035 + "%{msgxx-glibc:/sgxx-glibc ; \
23036 + m64:/system64 ; \
23037 + mrhel3:/system64 ; \
23038 + mrh73:/system32-old ; \
23039 + :/system32}"
23040 +
23041 +#undef SYSROOT_HEADERS_SUFFIX_SPEC
23042 +#define SYSROOT_HEADERS_SUFFIX_SPEC SYSROOT_SUFFIX_SPEC
23043 +
23044 +/* See mips/wrs-linux.h for details on this use of
23045 + STARTFILE_PREFIX_SPEC. */
23046 +#undef STARTFILE_PREFIX_SPEC
23047 +#define STARTFILE_PREFIX_SPEC \
23048 + "%{m64: /usr/local/lib64/ /lib64/ /usr/lib64/} \
23049 + %{!m64: /usr/local/lib/ /lib/ /usr/lib/}"
23050 --- /dev/null
23051 +++ b/gcc/config/i386/cs-linux.opt
23052 @@ -0,0 +1,11 @@
23053 +; Additional options for Sourcery G++.
23054 +
23055 +mrh73
23056 +Target Undocumented
23057 +
23058 +mrhel3
23059 +Target Undocumented
23060 +
23061 +msgxx-glibc
23062 +Target
23063 +Use included version of GLIBC
23064 --- a/gcc/config/i386/i386.c
23065 +++ b/gcc/config/i386/i386.c
23066 @@ -2700,6 +2700,18 @@ override_options (void)
23067 target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
23068 }
23069
23070 + /* If stack probes are required, the space used for large function
23071 + arguments on the stack must also be probed, so enable
23072 + -maccumulate-outgoing-args so this happens in the prologue. */
23073 + if (TARGET_STACK_PROBE
23074 + && !(target_flags & MASK_ACCUMULATE_OUTGOING_ARGS))
23075 + {
23076 + if (target_flags_explicit & MASK_ACCUMULATE_OUTGOING_ARGS)
23077 + warning (0, "stack probing requires -maccumulate-outgoing-args "
23078 + "for correctness");
23079 + target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
23080 + }
23081 +
23082 /* For sane SSE instruction set generation we need fcomi instruction.
23083 It is safe to enable all CMOVE instructions. */
23084 if (TARGET_SSE)
23085 --- a/gcc/config/i386/i386.h
23086 +++ b/gcc/config/i386/i386.h
23087 @@ -476,13 +476,23 @@ extern const char *host_detect_local_cpu
23088 #define HAVE_LOCAL_CPU_DETECT
23089 #endif
23090
23091 +#if TARGET_64BIT_DEFAULT
23092 +#define OPT_ARCH64 "!m32"
23093 +#define OPT_ARCH32 "m32"
23094 +#else
23095 +#define OPT_ARCH64 "m64"
23096 +#define OPT_ARCH32 "!m64"
23097 +#endif
23098 +
23099 /* Support for configure-time defaults of some command line options.
23100 The order here is important so that -march doesn't squash the
23101 tune or cpu values. */
23102 #define OPTION_DEFAULT_SPECS \
23103 {"tune", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \
23104 {"cpu", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \
23105 - {"arch", "%{!march=*:-march=%(VALUE)}"}
23106 + {"arch", "%{!march=*:-march=%(VALUE)}"}, \
23107 + {"arch32", "%{" OPT_ARCH32 ":%{!march=*:-march=%(VALUE)}}"}, \
23108 + {"arch64", "%{" OPT_ARCH64 ":%{!march=*:-march=%(VALUE)}}"},
23109
23110 /* Specs for the compiler proper */
23111
23112 --- a/gcc/config/i386/mingw32.h
23113 +++ b/gcc/config/i386/mingw32.h
23114 @@ -79,7 +79,7 @@ along with GCC; see the file COPYING3.
23115 /* Include in the mingw32 libraries with libgcc */
23116 #undef LIBGCC_SPEC
23117 #define LIBGCC_SPEC \
23118 - "%{mthreads:-lmingwthrd} -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt"
23119 + "-lgcc %{mthreads:-lmingwthrd} -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt"
23120
23121 #undef STARTFILE_SPEC
23122 #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \
23123 --- /dev/null
23124 +++ b/gcc/config/i386/t-cs-linux
23125 @@ -0,0 +1,25 @@
23126 +# Sourcery G++ IA32 GNU/Linux Configuration.
23127 +# Copyright (C) 2007
23128 +# Free Software Foundation, Inc.
23129 +#
23130 +# This file is part of GCC.
23131 +#
23132 +# GCC is free software; you can redistribute it and/or modify
23133 +# it under the terms of the GNU General Public License as published by
23134 +# the Free Software Foundation; either version 3, or (at your option)
23135 +# any later version.
23136 +#
23137 +# GCC is distributed in the hope that it will be useful,
23138 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
23139 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23140 +# GNU General Public License for more details.
23141 +#
23142 +# You should have received a copy of the GNU General Public License
23143 +# along with GCC; see the file COPYING3. If not see
23144 +# <http://www.gnu.org/licenses/>.
23145 +
23146 +MULTILIB_OPTIONS = m64/m32 msgxx-glibc/mrh73/mrhel3
23147 +MULTILIB_DIRNAMES = 64 32 sgxx-glibc rh73 rhel3
23148 +MULTILIB_OSDIRNAMES = ../lib64 ../lib sgxx-glibc rh73 rhel3
23149 +MULTILIB_EXCEPTIONS = m64/mrh73 m64/mrhel3
23150 +
23151 --- a/gcc/config/i386/x-mingw32
23152 +++ b/gcc/config/i386/x-mingw32
23153 @@ -8,6 +8,6 @@ local_includedir=$(libsubdir)/$(unlibsub
23154 WERROR_FLAGS += -Wno-format
23155
23156 host-mingw32.o : $(srcdir)/config/i386/host-mingw32.c $(CONFIG_H) $(SYSTEM_H) \
23157 - coretypes.h hosthooks.h hosthooks-def.h toplev.h diagnostic.h $(HOOKS_H)
23158 + coretypes.h hosthooks.h hosthooks-def.h toplev.h $(DIAGNOSTIC_H) $(HOOKS_H)
23159 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
23160 $(srcdir)/config/i386/host-mingw32.c
23161 --- a/gcc/config/m68k/cf.md
23162 +++ b/gcc/config/m68k/cf.md
23163 @@ -1,6 +1,6 @@
23164 -;; ColdFire V2 DFA description.
23165 +;; ColdFire V1, V2, V3 and V4/V4e DFA description.
23166 ;; Copyright (C) 2007 Free Software Foundation, Inc.
23167 -;; Contributed by CodeSourcery Inc.
23168 +;; Contributed by CodeSourcery Inc., www.codesourcery.com
23169 ;;
23170 ;; This file is part of GCC.
23171 ;;
23172 @@ -19,661 +19,2236 @@
23173 ;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,
23174 ;; Boston, MA 02110-1301, USA.
23175
23176 -;; ??? To let genattrtab live, implement this attribute in C.
23177 -(define_attr "type2"
23178 - "alu, alu_l, bcc, bra, call, jmp, lea, move, move_l, mul, pea, rts, unlk,
23179 - unknown"
23180 - (symbol_ref "m68k_sched_attr_type2 (insn)"))
23181 -
23182 ;; Instruction Buffer
23183 -(define_automaton "cf_v2_ib")
23184 +(define_automaton "cfv123_ib")
23185
23186 -;; If one of these cpu units is occupied, that means that corresponding
23187 -;; word in the buffer is empty.
23188 -(define_cpu_unit "cf_v2_ib_w0, cf_v2_ib_w1, cf_v2_ib_w2, cf_v2_ib_w3, cf_v2_ib_w4, cf_v2_ib_w5" "cf_v2_ib")
23189 -
23190 -(final_presence_set "cf_v2_ib_w1, cf_v2_ib_w2, cf_v2_ib_w3, cf_v2_ib_w4, cf_v2_ib_w5" "cf_v2_ib_w0")
23191 -(final_presence_set "cf_v2_ib_w2, cf_v2_ib_w3, cf_v2_ib_w4, cf_v2_ib_w5" "cf_v2_ib_w1")
23192 -(final_presence_set "cf_v2_ib_w3, cf_v2_ib_w4, cf_v2_ib_w5" "cf_v2_ib_w2")
23193 -(final_presence_set "cf_v2_ib_w4, cf_v2_ib_w5" "cf_v2_ib_w3")
23194 -(final_presence_set "cf_v2_ib_w5" "cf_v2_ib_w4")
23195 -
23196 -;; Occupy 1 word.
23197 -(define_reservation "cf_v2_ib1" "cf_v2_ib_w0|cf_v2_ib_w1|cf_v2_ib_w2|cf_v2_ib_w3|cf_v2_ib_w4|cf_v2_ib_w5")
23198 -
23199 -;; Occupy 2 words.
23200 -(define_reservation "cf_v2_ib2" "(cf_v2_ib_w0+cf_v2_ib_w1)|(cf_v2_ib_w1+cf_v2_ib_w2)|(cf_v2_ib_w2+cf_v2_ib_w3)|(cf_v2_ib_w3+cf_v2_ib_w4)|(cf_v2_ib_w4+cf_v2_ib_w5)")
23201 -
23202 -;; Occupy 3 words.
23203 -(define_reservation "cf_v2_ib3" "(cf_v2_ib_w0+cf_v2_ib_w1+cf_v2_ib_w2)|(cf_v2_ib_w1+cf_v2_ib_w2+cf_v2_ib_w3)|(cf_v2_ib_w2+cf_v2_ib_w3+cf_v2_ib_w4)|(cf_v2_ib_w3+cf_v2_ib_w4+cf_v2_ib_w5)")
23204 -
23205 -;; Reservation to subscribe 1 word in the instruction buffer. If a given
23206 -;; word in the instruction buffer is subscribed, that means it is empty.
23207 -;; This reservation is used at the start of each cycle to setup the number
23208 -;; of prefetched instruction words in the instruction buffer.
23209 -;; At each cycle, given that memory bus is available (i.e. there is no
23210 -;; pending memory operation), IFP prefetches two instruction words into IB.
23211 -(define_insn_reservation "cf_v2_ib" 0
23212 - (and (eq_attr "cpu" "cf_v2")
23213 +;; These pseudo units are used to model instruction buffer of ColdFire cores.
23214 +;; Instruction of size N can be issued only when cf_ib_wN is available.
23215 +(define_cpu_unit "cf_ib_w1, cf_ib_w2, cf_ib_w3" "cfv123_ib")
23216 +
23217 +;; Instruction occupies 1 word in the instruction buffer.
23218 +(define_reservation "cf_ib1" "cf_ib_w1")
23219 +;; Instruction occupies 2 words in the instruction buffer.
23220 +(define_reservation "cf_ib2" "cf_ib_w1+cf_ib_w2")
23221 +;; Instruction occupies 3 words in the instruction buffer.
23222 +(define_reservation "cf_ib3" "cf_ib_w1+cf_ib_w2+cf_ib_w3")
23223 +
23224 +;; This reservation is used at the start of each cycle to setup the maximal
23225 +;; length of instruction that can be issued on current cycle.
23226 +;; E.g., when this reservation is applied for the first time, cf_ib_w3
23227 +;; resource is marked busy, thus filtering out all 3-word insns.
23228 +;;
23229 +;; This reservation requires deterministic automaton.
23230 +;;
23231 +;; At each cycle, given that memory bus is available (i.e., there is no
23232 +;; pending memory operation), instruction fetch pipeline (IFP) prefetches
23233 +;; two instruction words into instruction buffer (IB).
23234 +(define_insn_reservation "cf_ib1" 0
23235 + (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
23236 (eq_attr "type" "ib"))
23237 - "cf_v2_ib1")
23238 + "cf_ib_w3|cf_ib_w2|cf_ib_w1")
23239
23240 ;; Operand Execution Pipeline
23241 -(define_automaton "cf_v2_oep")
23242 +(define_automaton "cfv123_oep")
23243
23244 -(define_cpu_unit "cf_v2_dsoc, cf_v2_agex" "cf_v2_oep")
23245 +(define_cpu_unit "cf_dsoc,cf_agex" "cfv123_oep")
23246
23247 ;; A memory unit that is reffered to as 'certain hardware resources' in
23248 ;; ColdFire reference manuals. This unit remains occupied for two cycles
23249 ;; after last dsoc cycle of a store - hence there is a 2 cycle delay between
23250 ;; two consecutive stores.
23251 -(define_automaton "cf_v2_chr")
23252 +(define_automaton "cfv123_chr")
23253
23254 -(define_cpu_unit "cf_v2_chr" "cf_v2_chr")
23255 +(define_cpu_unit "cf_chr" "cfv123_chr")
23256
23257 ;; Memory bus
23258 -(define_automaton "cf_v2_mem")
23259 +(define_automaton "cfv123_mem")
23260
23261 ;; When memory bus is subscribed, that implies that instruction buffer won't
23262 -;; get its portion this cycle. To model that we query if cf_v2_mem unit is
23263 +;; get its portion this cycle. To model that we query if cf_mem unit is
23264 ;; subscribed and adjust number of prefetched instruction words accordingly.
23265 ;;
23266 -(define_query_cpu_unit "cf_v2_mem" "cf_v2_mem")
23267 +(define_query_cpu_unit "cf_mem1, cf_mem2" "cfv123_mem")
23268 +
23269 +(define_reservation "cf_mem" "cf_mem1+cf_mem2")
23270 +
23271 +(define_automaton "cf_mac")
23272 +
23273 +(define_cpu_unit "cf_mac1,cf_mac2,cf_mac3,cf_mac4"
23274 + "cf_mac")
23275 +
23276 +(define_automaton "cfv123_guess")
23277 +
23278 +(define_query_cpu_unit "cfv123_guess" "cfv123_guess")
23279
23280 ;; Register to register move.
23281 ;; Takes 1 cycle.
23282 -(define_reservation "cf_v2_move_00"
23283 - "cf_v2_dsoc+cf_v2_agex")
23284 +(define_reservation "cfv123_alu_00"
23285 + "cf_dsoc,cf_agex")
23286
23287 ;; Load from a memory location.
23288 ;; Takes 3 cycles.
23289 -(define_reservation "cf_v2_move_10"
23290 - "cf_v2_dsoc,cf_v2_agex,cf_v2_dsoc+cf_v2_mem,cf_v2_agex")
23291 -
23292 -;; Long load from a memory location.
23293 +(define_reservation "cfv12_alu_10"
23294 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem,cf_agex")
23295 ;; Takes 2 cycles.
23296 -(define_reservation "cf_v2_move_l_10"
23297 - "cf_v2_dsoc+cf_v2_agex,cf_v2_dsoc+cf_v2_mem,cf_v2_agex")
23298 +(define_reservation "cfv12_omove_10"
23299 + "cf_dsoc+cf_agex,cf_dsoc+cf_mem,cf_agex")
23300 +;; Takes 4 cycles.
23301 +(define_reservation "cfv3_alu_10"
23302 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex")
23303 +;; Takes 3 cycles.
23304 +(define_reservation "cfv3_omove_10"
23305 + "cf_dsoc+cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex")
23306
23307 ;; Load from an indexed location.
23308 ;; Takes 4 cycles.
23309 -(define_reservation "cf_v2_move_i0"
23310 - "cf_v2_dsoc,cf_v2_agex,cf_v2_agex,cf_v2_dsoc+cf_v2_mem,cf_v2_agex")
23311 -
23312 -;; Long load from an indexed location.
23313 +(define_reservation "cfv12_alu_i0"
23314 + "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem,cf_agex")
23315 ;; Takes 3 cycles.
23316 -(define_reservation "cf_v2_move_l_i0"
23317 - "cf_v2_dsoc+cf_v2_agex,cf_v2_agex,cf_v2_dsoc+cf_v2_mem,cf_v2_agex")
23318 +(define_reservation "cfv12_omove_i0"
23319 + "cf_dsoc+cf_agex,cf_agex,cf_dsoc+cf_mem,cf_agex")
23320 +;; Takes 5 cycles.
23321 +(define_reservation "cfv3_alu_i0"
23322 + "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex")
23323 +;; Takes 4 cycles.
23324 +(define_reservation "cfv3_omove_i0"
23325 + "cf_dsoc+cf_agex,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex")
23326
23327 ;; Store to a memory location.
23328 ;; Takes 1 cycle.
23329 -(define_reservation "cf_v2_move_01"
23330 - "cf_v2_dsoc+cf_v2_agex+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
23331 +(define_reservation "cfv12_alu_01"
23332 + "cf_dsoc+cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
23333 +;; Takes 1 cycle.
23334 +(define_reservation "cfv3_alu_01"
23335 + "cf_dsoc+cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
23336
23337 ;; Store to an indexed location.
23338 -;; Takes 2 cycle.
23339 -(define_reservation "cf_v2_move_0i"
23340 - "cf_v2_dsoc+cf_v2_agex,cf_v2_agex+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
23341 +;; Takes 2 cycles.
23342 +(define_reservation "cfv12_alu_0i"
23343 + "cf_dsoc+cf_agex,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
23344 +;; Takes 2 cycles.
23345 +(define_reservation "cfv3_alu_0i"
23346 + "cf_dsoc+cf_agex,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
23347
23348 ;; Load from a memory location and store to a memory location.
23349 ;; Takes 3 cycles
23350 -(define_reservation "cf_v2_move_11"
23351 - "cf_v2_dsoc,cf_v2_agex,cf_v2_dsoc+cf_v2_agex+cf_v2_mem+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
23352 -
23353 -;; Long load from a memory location and store to a memory location.
23354 +(define_reservation "cfv12_alu_11"
23355 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
23356 ;; Takes 2 cycles.
23357 -(define_reservation "cf_v2_move_l_11"
23358 - "cf_v2_dsoc+cf_v2_agex,cf_v2_dsoc+cf_v2_agex+cf_v2_mem+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
23359 +(define_reservation "cfv12_omove_11"
23360 + "cf_dsoc+cf_agex,cf_dsoc+cf_mem,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
23361 +;; Takes 4 cycles
23362 +(define_reservation "cfv3_alu_11"
23363 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
23364 +;; Takes 3 cycles.
23365 +(define_reservation "cfv3_omove_11"
23366 + "cf_dsoc+cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
23367
23368 ;; Load from an indexed location and store to a memory location.
23369 ;; Takes 4 cycles.
23370 -(define_reservation "cf_v2_move_i1"
23371 - "cf_v2_dsoc,cf_v2_agex,cf_v2_agex,cf_v2_dsoc+cf_v2_agex+cf_v2_mem+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
23372 -
23373 -;; Long load from an indexed location and store to a memory location.
23374 +(define_reservation "cfv12_alu_i1"
23375 + "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
23376 ;; Takes 3 cycles.
23377 -(define_reservation "cf_v2_move_l_i1"
23378 - "cf_v2_dsoc+cf_v2_agex,cf_v2_agex,cf_v2_dsoc+cf_v2_agex+cf_v2_mem+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
23379 +(define_reservation "cfv12_omove_i1"
23380 + "cf_dsoc+cf_agex,cf_agex,cf_dsoc+cf_mem,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
23381 +;; Takes 5 cycles.
23382 +(define_reservation "cfv3_alu_i1"
23383 + "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
23384 +;; Takes 4 cycles.
23385 +(define_reservation "cfv3_omove_i1"
23386 + "cf_dsoc+cf_agex,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
23387
23388 ;; Load from a memory location and store to an indexed location.
23389 ;; Takes 4 cycles.
23390 -(define_reservation "cf_v2_move_1i"
23391 - "cf_v2_dsoc,cf_v2_agex,cf_v2_dsoc+cf_v2_agex+cf_v2_mem,cf_v2_agex,cf_v2_mem")
23392 -
23393 -;; Long load from a memory location and store to an indexed location.
23394 +(define_reservation "cfv12_alu_1i"
23395 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem,cf_agex,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
23396 ;; Takes 3 cycles.
23397 -(define_reservation "cf_v2_move_l_1i"
23398 - "cf_v2_dsoc+cf_v2_agex,cf_v2_dsoc+cf_v2_agex+cf_v2_mem,cf_v2_agex,cf_v2_mem")
23399 +(define_reservation "cfv12_omove_1i"
23400 + "cf_dsoc+cf_agex,cf_dsoc+cf_mem,cf_agex,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
23401 +;; Takes 5 cycles.
23402 +(define_reservation "cfv3_alu_1i"
23403 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
23404 +;; Takes 4 cycles.
23405 +(define_reservation "cfv3_omove_1i"
23406 + "cf_dsoc+cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
23407
23408 ;; Lea operation for a memory location.
23409 ;; Takes 1 cycle.
23410 -(define_reservation "cf_v2_lea_10"
23411 - "cf_v2_dsoc+cf_v2_agex")
23412 +(define_reservation "cfv123_lea_10"
23413 + "cf_dsoc,cf_agex")
23414
23415 ;; Lea operation for an indexed location.
23416 ;; Takes 2 cycles.
23417 -(define_reservation "cf_v2_lea_i0"
23418 - "cf_v2_dsoc+cf_v2_agex,cf_v2_agex")
23419 +(define_reservation "cfv123_lea_i0"
23420 + "cf_dsoc,cf_agex,cf_agex")
23421
23422 ;; Pea operation for a memory location.
23423 -;; Takes 2 cycle.
23424 -(define_reservation "cf_v2_pea_11"
23425 - "cf_v2_dsoc+cf_v2_agex,cf_v2_agex+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
23426 +;; Takes 2 cycles.
23427 +(define_reservation "cfv12_pea_11"
23428 + "cf_dsoc,cf_agex,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
23429 +;; Takes 2 cycles.
23430 +(define_reservation "cfv3_pea_11"
23431 + "cf_dsoc,cf_agex,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
23432
23433 ;; Pea operation for an indexed location.
23434 ;; Takes 3 cycles.
23435 -(define_reservation "cf_v2_pea_i1"
23436 - "cf_v2_dsoc+cf_v2_agex,cf_v2_agex,cf_v2_agex+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
23437 -
23438 -(define_automaton "cf_v2_emac")
23439 +(define_reservation "cfv12_pea_i1"
23440 + "cf_dsoc,cf_agex,cf_agex,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
23441 +;; Takes 3 cycles.
23442 +(define_reservation "cfv3_pea_i1"
23443 + "cf_dsoc,cf_agex,cf_agex,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
23444
23445 -(define_cpu_unit "cf_v2_emac1,cf_v2_emac2,cf_v2_emac3,cf_v2_emac4"
23446 - "cf_v2_emac")
23447 +;; Long multiplication with no mac.
23448 +;; Takes 9-18 cycles.
23449 +(define_reservation "cfv123_mul_l_00"
23450 + "cf_dsoc,(cf_agex+cf_dsoc)*17,cf_agex")
23451 +
23452 +;; Word multiplication with no mac.
23453 +;; Takes 9 cycles.
23454 +(define_reservation "cfv123_mul_w_00"
23455 + "cf_dsoc,(cf_agex+cf_dsoc)*8,cf_agex")
23456 +
23457 +;; Long multiplication with no mac.
23458 +;; Takes 11-20 cycles.
23459 +(define_reservation "cfv12_mul_l_10"
23460 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem,(cf_agex+cf_dsoc)*17,cf_agex")
23461 +;; Takes 12-21 cycles.
23462 +(define_reservation "cfv3_mul_l_10"
23463 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,(cf_agex+cf_dsoc)*17,cf_agex")
23464 +
23465 +;; Word multiplication with no mac.
23466 +;; Takes 11 cycles.
23467 +(define_reservation "cfv12_mul_w_10"
23468 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem,(cf_agex+cf_dsoc)*8,cf_agex")
23469 +;; Takes 12 cycles.
23470 +(define_reservation "cfv3_mul_w_10"
23471 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,(cf_agex+cf_dsoc)*8,cf_agex")
23472 +
23473 +;; Word multiplication with no mac.
23474 +;; Takes 12 cycles.
23475 +(define_reservation "cfv12_mul_w_i0"
23476 + "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem,(cf_agex+cf_dsoc)*8,cf_agex")
23477 +;; Takes 13 cycles.
23478 +(define_reservation "cfv3_mul_w_i0"
23479 + "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,(cf_agex+cf_dsoc)*8,cf_agex")
23480 +
23481 +;; Long multiplication with mac.
23482 +;; Takes 5 cycles.
23483 +(define_reservation "cfv123_mac_l_00"
23484 + "cf_dsoc,cf_agex,cf_mac1,cf_mac2,cf_mac3,cf_mac4")
23485
23486 -;; Mul operation with register operands.
23487 -;; Takes 4 cycles.
23488 -(define_reservation "cf_v2_mul_00"
23489 - "cf_v2_dsoc,cf_v2_agex+cf_v2_emac1,cf_v2_emac2,cf_v2_emac3,cf_v2_emac4")
23490 +;; Word multiplication with mac.
23491 +;; Takes 3 cycles.
23492 +(define_reservation "cfv123_mac_w_00"
23493 + "cf_dsoc,cf_agex,cf_mac1,cf_mac2")
23494
23495 -;; Mul operation with implicit load from a memory location.
23496 +;; Long multiplication with mac.
23497 +;; Takes 7 cycles.
23498 +(define_reservation "cfv12_mac_l_10"
23499 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem,cf_agex,cf_mac1,cf_mac2,cf_mac3,cf_mac4")
23500 +;; Takes 8 cycles.
23501 +(define_reservation "cfv3_mac_l_10"
23502 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex,cf_mac1,cf_mac2,cf_mac3,cf_mac4")
23503 +
23504 +;; Word multiplication with mac.
23505 +;; Takes 5 cycles.
23506 +(define_reservation "cfv12_mac_w_10"
23507 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem,cf_agex,cf_mac1,cf_mac2")
23508 ;; Takes 6 cycles.
23509 -(define_reservation "cf_v2_mul_10"
23510 - "cf_v2_dsoc,cf_v2_agex,cf_v2_dsoc+cf_v2_mem,cf_v2_agex+cf_v2_emac1,cf_v2_emac2,cf_v2_emac3,cf_v2_emac4")
23511 +(define_reservation "cfv3_mac_w_10"
23512 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex,cf_mac1,cf_mac2")
23513
23514 -;; Mul operation with implicit load from an indexed location.
23515 +;; Word multiplication with mac.
23516 +;; Takes 6 cycles.
23517 +(define_reservation "cfv12_mac_w_i0"
23518 + "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem,cf_agex,cf_mac1,cf_mac2")
23519 ;; Takes 7 cycles.
23520 -(define_reservation "cf_v2_mul_i0"
23521 - "cf_v2_dsoc,cf_v2_agex,cf_v2_agex,cf_v2_dsoc+cf_v2_mem,cf_v2_agex+cf_v2_emac1,cf_v2_emac2,cf_v2_emac3,cf_v2_emac4")
23522 -
23523 -;; Instruction reservations.
23524 -
23525 -;; Below reservations are simple derivation from the above reservations.
23526 -;; Each reservation from the above expands into 3 reservations below - one
23527 -;; for each instruction size.
23528 -;; A number in the end of reservation's name is the size of the instruction.
23529 -
23530 -(define_insn_reservation "cf_v2_move_00_1" 1
23531 - (and (and (and (eq_attr "cpu" "cf_v2")
23532 - (eq_attr "type2" "alu,alu_l,move,move_l"))
23533 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
23534 - (eq_attr "op_mem" "00"))
23535 - "cf_v2_ib1+cf_v2_move_00")
23536 -
23537 -(define_insn_reservation "cf_v2_move_00_2" 1
23538 - (and (and (and (eq_attr "cpu" "cf_v2")
23539 - (eq_attr "type2" "alu,alu_l,move,move_l"))
23540 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23541 - (eq_attr "op_mem" "00"))
23542 - "cf_v2_ib2+cf_v2_move_00")
23543 -
23544 -(define_insn_reservation "cf_v2_move_00_3" 1
23545 - (and (and (and (eq_attr "cpu" "cf_v2")
23546 - (eq_attr "type2" "alu,alu_l,move,move_l"))
23547 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23548 - (eq_attr "op_mem" "00"))
23549 - "cf_v2_ib3+cf_v2_move_00")
23550 -
23551 -(define_insn_reservation "cf_v2_move_10_1" 4
23552 - (and (and (and (eq_attr "cpu" "cf_v2")
23553 - (eq_attr "type2" "alu_l,move"))
23554 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
23555 - (eq_attr "op_mem" "10"))
23556 - "cf_v2_ib1+cf_v2_move_10")
23557 -
23558 -(define_insn_reservation "cf_v2_move_10_2" 4
23559 - (and (and (and (eq_attr "cpu" "cf_v2")
23560 - (eq_attr "type2" "alu_l,move"))
23561 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23562 - (eq_attr "op_mem" "10"))
23563 - "cf_v2_ib2+cf_v2_move_10")
23564 -
23565 -(define_insn_reservation "cf_v2_move_10_3" 4
23566 - (and (and (and (eq_attr "cpu" "cf_v2")
23567 - (eq_attr "type2" "alu_l,move"))
23568 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23569 - (eq_attr "op_mem" "10"))
23570 - "cf_v2_ib3+cf_v2_move_10")
23571 -
23572 -(define_insn_reservation "cf_v2_move_l_10_1" 3
23573 - (and (and (and (eq_attr "cpu" "cf_v2")
23574 - (eq_attr "type2" "move_l"))
23575 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
23576 - (eq_attr "op_mem" "10"))
23577 - "cf_v2_ib1+cf_v2_move_l_10")
23578 -
23579 -(define_insn_reservation "cf_v2_move_l_10_2" 3
23580 - (and (and (and (eq_attr "cpu" "cf_v2")
23581 - (eq_attr "type2" "move_l"))
23582 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23583 - (eq_attr "op_mem" "10"))
23584 - "cf_v2_ib2+cf_v2_move_l_10")
23585 -
23586 -(define_insn_reservation "cf_v2_move_l_10_3" 3
23587 - (and (and (and (eq_attr "cpu" "cf_v2")
23588 - (eq_attr "type2" "move_l"))
23589 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23590 - (eq_attr "op_mem" "10"))
23591 - "cf_v2_ib3+cf_v2_move_l_10")
23592 -
23593 -(define_insn_reservation "cf_v2_move_i0_2" 5
23594 - (and (and (and (eq_attr "cpu" "cf_v2")
23595 - (eq_attr "type2" "alu_l,move"))
23596 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23597 - (eq_attr "op_mem" "i0"))
23598 - "cf_v2_ib2+cf_v2_move_i0")
23599 -
23600 -(define_insn_reservation "cf_v2_move_i0_3" 5
23601 - (and (and (and (eq_attr "cpu" "cf_v2")
23602 - (eq_attr "type2" "alu_l,move"))
23603 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23604 - (eq_attr "op_mem" "i0"))
23605 - "cf_v2_ib3+cf_v2_move_i0")
23606 -
23607 -(define_insn_reservation "cf_v2_move_l_i0_2" 4
23608 - (and (and (and (eq_attr "cpu" "cf_v2")
23609 - (eq_attr "type2" "move_l"))
23610 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23611 - (eq_attr "op_mem" "i0"))
23612 - "cf_v2_ib2+cf_v2_move_l_i0")
23613 -
23614 -(define_insn_reservation "cf_v2_move_l_i0_3" 4
23615 - (and (and (and (eq_attr "cpu" "cf_v2")
23616 - (eq_attr "type2" "move_l"))
23617 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23618 - (eq_attr "op_mem" "i0"))
23619 - "cf_v2_ib3+cf_v2_move_l_i0")
23620 -
23621 -(define_insn_reservation "cf_v2_move_01_1" 0
23622 - (and (and (and (eq_attr "cpu" "cf_v2")
23623 - (eq_attr "type2" "alu_l,move,move_l"))
23624 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
23625 - (eq_attr "op_mem" "01"))
23626 - "cf_v2_ib1+cf_v2_move_01")
23627 -
23628 -(define_insn_reservation "cf_v2_move_01_2" 0
23629 - (and (and (and (eq_attr "cpu" "cf_v2")
23630 - (eq_attr "type2" "alu_l,move,move_l"))
23631 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23632 - (eq_attr "op_mem" "01"))
23633 - "cf_v2_ib2+cf_v2_move_01")
23634 -
23635 -(define_insn_reservation "cf_v2_move_01_3" 0
23636 - (and (and (and (eq_attr "cpu" "cf_v2")
23637 - (eq_attr "type2" "alu_l,move,move_l"))
23638 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23639 - (eq_attr "op_mem" "01"))
23640 - "cf_v2_ib3+cf_v2_move_01")
23641 +(define_reservation "cfv3_mac_w_i0"
23642 + "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex,cf_mac1,cf_mac2")
23643
23644 -(define_insn_reservation "cf_v2_move_0i_2" 0
23645 - (and (and (and (eq_attr "cpu" "cf_v2")
23646 - (eq_attr "type2" "alu_l,move,move_l"))
23647 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23648 - (eq_attr "op_mem" "0i"))
23649 - "cf_v2_ib2+cf_v2_move_0i")
23650 -
23651 -(define_insn_reservation "cf_v2_move_0i_3" 0
23652 - (and (and (and (eq_attr "cpu" "cf_v2")
23653 - (eq_attr "type2" "alu_l,move,move_l"))
23654 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23655 - (eq_attr "op_mem" "0i"))
23656 - "cf_v2_ib3+cf_v2_move_0i")
23657 -
23658 -(define_insn_reservation "cf_v2_move_11_1" 0
23659 - (and (and (and (eq_attr "cpu" "cf_v2")
23660 - (eq_attr "type2" "alu_l,move"))
23661 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
23662 - (eq_attr "op_mem" "11"))
23663 - "cf_v2_ib1+cf_v2_move_11")
23664 -
23665 -(define_insn_reservation "cf_v2_move_11_2" 0
23666 - (and (and (and (eq_attr "cpu" "cf_v2")
23667 - (eq_attr "type2" "alu_l,move"))
23668 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23669 - (eq_attr "op_mem" "11"))
23670 - "cf_v2_ib2+cf_v2_move_11")
23671 -
23672 -(define_insn_reservation "cf_v2_move_11_3" 0
23673 - (and (and (and (eq_attr "cpu" "cf_v2")
23674 - (eq_attr "type2" "alu_l,move"))
23675 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23676 - (eq_attr "op_mem" "11"))
23677 - "cf_v2_ib3+cf_v2_move_11")
23678 -
23679 -(define_insn_reservation "cf_v2_move_l_11_1" 0
23680 - (and (and (and (eq_attr "cpu" "cf_v2")
23681 - (eq_attr "type2" "move_l"))
23682 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
23683 - (eq_attr "op_mem" "11"))
23684 - "cf_v2_ib1+cf_v2_move_l_11")
23685 -
23686 -(define_insn_reservation "cf_v2_move_l_11_2" 0
23687 - (and (and (and (eq_attr "cpu" "cf_v2")
23688 - (eq_attr "type2" "move_l"))
23689 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23690 - (eq_attr "op_mem" "11"))
23691 - "cf_v2_ib2+cf_v2_move_l_11")
23692 -
23693 -(define_insn_reservation "cf_v2_move_l_11_3" 0
23694 - (and (and (and (eq_attr "cpu" "cf_v2")
23695 - (eq_attr "type2" "move_l"))
23696 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23697 - (eq_attr "op_mem" "11"))
23698 - "cf_v2_ib3+cf_v2_move_l_11")
23699 -
23700 -(define_insn_reservation "cf_v2_move_i1_2" 0
23701 - (and (and (and (eq_attr "cpu" "cf_v2")
23702 - (eq_attr "type2" "alu_l,move"))
23703 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23704 - (eq_attr "op_mem" "i1"))
23705 - "cf_v2_ib2+cf_v2_move_i1")
23706 -
23707 -(define_insn_reservation "cf_v2_move_i1_3" 0
23708 - (and (and (and (eq_attr "cpu" "cf_v2")
23709 - (eq_attr "type2" "alu_l,move"))
23710 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23711 - (eq_attr "op_mem" "i1"))
23712 - "cf_v2_ib3+cf_v2_move_i1")
23713 -
23714 -(define_insn_reservation "cf_v2_move_l_i1_2" 0
23715 - (and (and (and (eq_attr "cpu" "cf_v2")
23716 - (eq_attr "type2" "move_l"))
23717 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23718 - (eq_attr "op_mem" "i1"))
23719 - "cf_v2_ib2+cf_v2_move_l_i1")
23720 -
23721 -(define_insn_reservation "cf_v2_move_l_i1_3" 0
23722 - (and (and (and (eq_attr "cpu" "cf_v2")
23723 - (eq_attr "type2" "move_l"))
23724 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23725 - (eq_attr "op_mem" "i1"))
23726 - "cf_v2_ib3+cf_v2_move_l_i1")
23727 +;; Multiplication with emac.
23728 +;; Takes 4 cycles.
23729 +(define_reservation "cfv123_emac_00"
23730 + "cf_dsoc,cf_agex+cf_mac1,cf_mac2,cf_mac3,cf_mac4")
23731
23732 -(define_insn_reservation "cf_v2_move_1i_2" 0
23733 - (and (and (and (eq_attr "cpu" "cf_v2")
23734 - (eq_attr "type2" "alu_l,move"))
23735 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23736 - (eq_attr "op_mem" "1i"))
23737 - "cf_v2_ib2+cf_v2_move_1i")
23738 +;; Multiplication with emac.
23739 +;; Takes 6 cycles.
23740 +(define_reservation "cfv12_emac_10"
23741 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem,cf_agex+cf_mac1,cf_mac2,cf_mac3,cf_mac4")
23742 +;; Takes 7 cycles.
23743 +(define_reservation "cfv3_emac_10"
23744 + "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex+cf_mac1,cf_mac2,cf_mac3,cf_mac4")
23745
23746 -(define_insn_reservation "cf_v2_move_1i_3" 0
23747 - (and (and (and (eq_attr "cpu" "cf_v2")
23748 - (eq_attr "type2" "alu_l,move"))
23749 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23750 - (eq_attr "op_mem" "1i"))
23751 - "cf_v2_ib3+cf_v2_move_1i")
23752 +;; Word multiplication with emac.
23753 +;; Takes 7 cycles.
23754 +(define_reservation "cfv12_emac_w_i0"
23755 + "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem,cf_agex+cf_mac1,cf_mac2,cf_mac3,cf_mac4")
23756 +;; Takes 8 cycles.
23757 +(define_reservation "cfv3_emac_w_i0"
23758 + "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex+cf_mac1,cf_mac2,cf_mac3,cf_mac4")
23759
23760 -(define_insn_reservation "cf_v2_move_l_1i_2" 0
23761 - (and (and (and (eq_attr "cpu" "cf_v2")
23762 - (eq_attr "type2" "move_l"))
23763 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23764 - (eq_attr "op_mem" "1i"))
23765 - "cf_v2_ib2+cf_v2_move_l_1i")
23766 +;; Return instruction.
23767 +;; ??? As return reads target address from stack, use a mem-read reservation
23768 +;; ??? for it.
23769 +;; ??? It's not clear what the core does during these 5 cycles.
23770 +;; ??? Luckily, we don't care that much about an insn that won't be moved.
23771 +;; Takes 5 cycles.
23772 +(define_reservation "cfv12_rts" "cfv12_alu_10")
23773 +;; Takes 8 cycles.
23774 +(define_reservation "cfv3_rts" "cfv3_alu_10")
23775
23776 -(define_insn_reservation "cf_v2_move_l_1i_3" 0
23777 - (and (and (and (eq_attr "cpu" "cf_v2")
23778 - (eq_attr "type2" "move_l"))
23779 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23780 - (eq_attr "op_mem" "1i"))
23781 - "cf_v2_ib3+cf_v2_move_l_1i")
23782 +;; Call instruction.
23783 +;; ??? It's not clear what reservation is best to use for calls.
23784 +;; ??? For now we use mem-write + return reservations to reflect the fact of
23785 +;; ??? pushing and poping return address to and from the stack.
23786 +;; Takes 3 cycles.
23787 +(define_reservation "cfv12_call" "cfv12_alu_01,cfv12_rts")
23788 +;; Takes 1/5 cycles.
23789 +(define_reservation "cfv3_call" "cfv3_alu_01,cfv3_rts")
23790
23791 -(define_insn_reservation "cf_v2_lea_10_1" 1
23792 - (and (and (and (eq_attr "cpu" "cf_v2")
23793 - (eq_attr "type2" "lea"))
23794 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
23795 - (eq_attr "op_mem" "10"))
23796 - "cf_v2_ib1+cf_v2_lea_10")
23797 +;; Conditional branch instruction.
23798 +;; ??? Branch reservations are unclear to me so far. Luckily, we don't care
23799 +;; ??? that much about branches.
23800 +;; Takes 2 cycles.
23801 +(define_reservation "cfv12_bcc" "cfv123_alu_00")
23802 +;; Takes 1 cycles.
23803 +(define_reservation "cfv3_bcc" "cfv123_alu_00")
23804
23805 -(define_insn_reservation "cf_v2_lea_10_2" 1
23806 - (and (and (and (eq_attr "cpu" "cf_v2")
23807 - (eq_attr "type2" "lea"))
23808 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23809 - (eq_attr "op_mem" "10"))
23810 - "cf_v2_ib2+cf_v2_lea_10")
23811 +;; Unconditional branch instruciton.
23812 +;; Takes 2 cycles.
23813 +(define_reservation "cfv12_bra" "cfv12_alu_01")
23814 +;; Takes 1 cycles.
23815 +(define_reservation "cfv3_bra" "cfv3_alu_01")
23816
23817 -(define_insn_reservation "cf_v2_lea_10_3" 1
23818 - (and (and (and (eq_attr "cpu" "cf_v2")
23819 - (eq_attr "type2" "lea"))
23820 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23821 - (eq_attr "op_mem" "10"))
23822 - "cf_v2_ib3+cf_v2_lea_10")
23823 +;; Computed jump instruction.
23824 +;; Takes 3 cycles.
23825 +(define_reservation "cfv12_jmp"
23826 + "(cf_dsoc+cf_agex)*3")
23827 +;; Takes 5 cycles.
23828 +(define_reservation "cfv3_jmp"
23829 + "(cf_dsoc+cf_agex)*5")
23830
23831 -(define_insn_reservation "cf_v2_lea_i0_2" 2
23832 - (and (and (and (eq_attr "cpu" "cf_v2")
23833 - (eq_attr "type2" "lea"))
23834 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
23835 - (eq_attr "op_mem" "i0"))
23836 - "cf_v2_ib2+cf_v2_lea_i0")
23837 +;; Instruction reservations.
23838
23839 -(define_insn_reservation "cf_v2_lea_i0_3" 2
23840 - (and (and (and (eq_attr "cpu" "cf_v2")
23841 - (eq_attr "type2" "lea"))
23842 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
23843 - (eq_attr "op_mem" "i0"))
23844 - "cf_v2_ib3+cf_v2_lea_i0")
23845 +;; Below reservations are simple derivation from the above reservations.
23846 +;; Each reservation from the above expands into 3 reservations below - one
23847 +;; for each instruction size.
23848 +;; A number in the end of reservation's name is the size of the instruction.
23849
23850 -(define_insn_reservation "cf_v2_pea_11_1" 0
23851 - (and (and (and (eq_attr "cpu" "cf_v2")
23852 - (eq_attr "type2" "pea"))
23853 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
23854 +(define_insn_reservation "cfv123_alu_00_1" 1
23855 + (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
23856 + (eq_attr "type" "
23857 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
23858 +clr,clr_l,mov3q_l,move,moveq_l,tst,
23859 +move_l,tst_l"))
23860 + (eq_attr "op_mem" "00"))
23861 + (eq_attr "size" "1"))
23862 + "cf_ib1+cfv123_alu_00")
23863 +
23864 +(define_insn_reservation "cfv123_alu_00_2" 1
23865 + (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
23866 + (eq_attr "type" "
23867 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
23868 +clr,clr_l,mov3q_l,move,moveq_l,tst,
23869 +move_l,tst_l"))
23870 + (eq_attr "op_mem" "00"))
23871 + (eq_attr "size" "2"))
23872 + "cf_ib2+cfv123_alu_00")
23873 +
23874 +(define_insn_reservation "cfv123_alu_00_3" 1
23875 + (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
23876 + (eq_attr "type" "
23877 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
23878 +clr,clr_l,mov3q_l,move,moveq_l,tst,
23879 +move_l,tst_l"))
23880 + (eq_attr "op_mem" "00"))
23881 + (eq_attr "size" "3"))
23882 + "cf_ib3+cfv123_alu_00")
23883 +
23884 +(define_insn_reservation "cfv1_alu_10_1" 3
23885 + (and (and (and (eq_attr "cpu" "cfv1")
23886 + (eq_attr "type" "
23887 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift"))
23888 + (eq_attr "op_mem" "10"))
23889 + (eq_attr "size" "1"))
23890 + "cf_ib1+cfv12_alu_10")
23891 +
23892 +(define_insn_reservation "cfv1_alu_10_2" 3
23893 + (and (and (and (eq_attr "cpu" "cfv1")
23894 + (eq_attr "type" "
23895 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift"))
23896 + (eq_attr "op_mem" "10"))
23897 + (eq_attr "size" "2"))
23898 + "cf_ib2+cfv12_alu_10")
23899 +
23900 +(define_insn_reservation "cfv1_alu_10_3" 3
23901 + (and (and (and (eq_attr "cpu" "cfv1")
23902 + (eq_attr "type" "
23903 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift"))
23904 + (eq_attr "op_mem" "10"))
23905 + (eq_attr "size" "3"))
23906 + "cf_ib3+cfv12_alu_10")
23907 +
23908 +(define_insn_reservation "cfv1_omove_10_1" 2
23909 + (and (and (and (eq_attr "cpu" "cfv1")
23910 + (eq_attr "type" "
23911 +clr,clr_l,mov3q_l,move,moveq_l,tst,
23912 +move_l,tst_l"))
23913 + (eq_attr "op_mem" "10"))
23914 + (eq_attr "size" "1"))
23915 + "cf_ib1+cfv12_omove_10")
23916 +
23917 +(define_insn_reservation "cfv1_omove_10_2" 2
23918 + (and (and (and (eq_attr "cpu" "cfv1")
23919 + (eq_attr "type" "
23920 +clr,clr_l,mov3q_l,move,moveq_l,tst,
23921 +move_l,tst_l"))
23922 + (eq_attr "op_mem" "10"))
23923 + (eq_attr "size" "2"))
23924 + "cf_ib2+cfv12_omove_10")
23925 +
23926 +(define_insn_reservation "cfv1_omove_10_3" 2
23927 + (and (and (and (eq_attr "cpu" "cfv1")
23928 + (eq_attr "type" "
23929 +clr,clr_l,mov3q_l,move,moveq_l,tst,
23930 +move_l,tst_l"))
23931 + (eq_attr "op_mem" "10"))
23932 + (eq_attr "size" "3"))
23933 + "cf_ib3+cfv12_omove_10")
23934 +
23935 +(define_insn_reservation "cfv2_alu_10_1" 3
23936 + (and (and (and (eq_attr "cpu" "cfv2")
23937 + (eq_attr "type" "
23938 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
23939 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
23940 + (eq_attr "op_mem" "10"))
23941 + (eq_attr "size" "1"))
23942 + "cf_ib1+cfv12_alu_10")
23943 +
23944 +(define_insn_reservation "cfv2_alu_10_2" 3
23945 + (and (and (and (eq_attr "cpu" "cfv2")
23946 + (eq_attr "type" "
23947 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
23948 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
23949 + (eq_attr "op_mem" "10"))
23950 + (eq_attr "size" "2"))
23951 + "cf_ib2+cfv12_alu_10")
23952 +
23953 +(define_insn_reservation "cfv2_alu_10_3" 3
23954 + (and (and (and (eq_attr "cpu" "cfv2")
23955 + (eq_attr "type" "
23956 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
23957 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
23958 + (eq_attr "op_mem" "10"))
23959 + (eq_attr "size" "3"))
23960 + "cf_ib3+cfv12_alu_10")
23961 +
23962 +(define_insn_reservation "cfv2_omove_10_1" 2
23963 + (and (and (and (eq_attr "cpu" "cfv2")
23964 + (eq_attr "type" "
23965 +move_l,tst_l"))
23966 + (eq_attr "op_mem" "10"))
23967 + (eq_attr "size" "1"))
23968 + "cf_ib1+cfv12_omove_10")
23969 +
23970 +(define_insn_reservation "cfv2_omove_10_2" 2
23971 + (and (and (and (eq_attr "cpu" "cfv2")
23972 + (eq_attr "type" "
23973 +move_l,tst_l"))
23974 + (eq_attr "op_mem" "10"))
23975 + (eq_attr "size" "2"))
23976 + "cf_ib2+cfv12_omove_10")
23977 +
23978 +(define_insn_reservation "cfv2_omove_10_3" 2
23979 + (and (and (and (eq_attr "cpu" "cfv2")
23980 + (eq_attr "type" "
23981 +move_l,tst_l"))
23982 + (eq_attr "op_mem" "10"))
23983 + (eq_attr "size" "3"))
23984 + "cf_ib3+cfv12_omove_10")
23985 +
23986 +(define_insn_reservation "cfv3_alu_10_1" 4
23987 + (and (and (and (eq_attr "cpu" "cfv3")
23988 + (eq_attr "type" "
23989 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
23990 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
23991 + (eq_attr "op_mem" "10"))
23992 + (eq_attr "size" "1"))
23993 + "cf_ib1+cfv3_alu_10")
23994 +
23995 +(define_insn_reservation "cfv3_alu_10_2" 4
23996 + (and (and (and (eq_attr "cpu" "cfv3")
23997 + (eq_attr "type" "
23998 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
23999 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24000 + (eq_attr "op_mem" "10"))
24001 + (eq_attr "size" "2"))
24002 + "cf_ib2+cfv3_alu_10")
24003 +
24004 +(define_insn_reservation "cfv3_alu_10_3" 4
24005 + (and (and (and (eq_attr "cpu" "cfv3")
24006 + (eq_attr "type" "
24007 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24008 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24009 + (eq_attr "op_mem" "10"))
24010 + (eq_attr "size" "3"))
24011 + "cf_ib3+cfv3_alu_10")
24012 +
24013 +(define_insn_reservation "cfv3_omove_10_1" 3
24014 + (and (and (and (eq_attr "cpu" "cfv3")
24015 + (eq_attr "type" "
24016 +move_l,tst_l"))
24017 + (eq_attr "op_mem" "10"))
24018 + (eq_attr "size" "1"))
24019 + "cf_ib1+cfv3_omove_10")
24020 +
24021 +(define_insn_reservation "cfv3_omove_10_2" 3
24022 + (and (and (and (eq_attr "cpu" "cfv3")
24023 + (eq_attr "type" "
24024 +move_l,tst_l"))
24025 + (eq_attr "op_mem" "10"))
24026 + (eq_attr "size" "2"))
24027 + "cf_ib2+cfv3_omove_10")
24028 +
24029 +(define_insn_reservation "cfv3_omove_10_3" 3
24030 + (and (and (and (eq_attr "cpu" "cfv3")
24031 + (eq_attr "type" "
24032 +move_l,tst_l"))
24033 + (eq_attr "op_mem" "10"))
24034 + (eq_attr "size" "3"))
24035 + "cf_ib3+cfv3_omove_10")
24036 +
24037 +(define_insn_reservation "cfv1_alu_i0_2" 4
24038 + (and (and (and (eq_attr "cpu" "cfv1")
24039 + (eq_attr "type" "
24040 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift"))
24041 + (eq_attr "op_mem" "i0"))
24042 + (eq_attr "size" "1,2"))
24043 + "cf_ib2+cfv12_alu_i0")
24044 +
24045 +(define_insn_reservation "cfv1_alu_i0_3" 4
24046 + (and (and (and (eq_attr "cpu" "cfv1")
24047 + (eq_attr "type" "
24048 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift"))
24049 + (eq_attr "op_mem" "i0"))
24050 + (eq_attr "size" "3"))
24051 + "cf_ib3+cfv12_alu_i0")
24052 +
24053 +(define_insn_reservation "cfv1_omove_i0_2" 3
24054 + (and (and (and (eq_attr "cpu" "cfv1")
24055 + (eq_attr "type" "
24056 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24057 +move_l,tst_l"))
24058 + (eq_attr "op_mem" "i0"))
24059 + (eq_attr "size" "1,2"))
24060 + "cf_ib2+cfv12_omove_i0")
24061 +
24062 +(define_insn_reservation "cfv1_omove_i0_3" 3
24063 + (and (and (and (eq_attr "cpu" "cfv1")
24064 + (eq_attr "type" "
24065 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24066 +move_l,tst_l"))
24067 + (eq_attr "op_mem" "i0"))
24068 + (eq_attr "size" "3"))
24069 + "cf_ib3+cfv12_omove_i0")
24070 +
24071 +(define_insn_reservation "cfv2_alu_i0_2" 4
24072 + (and (and (and (eq_attr "cpu" "cfv2")
24073 + (eq_attr "type" "
24074 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24075 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24076 + (eq_attr "op_mem" "i0"))
24077 + (eq_attr "size" "1,2"))
24078 + "cf_ib2+cfv12_alu_i0")
24079 +
24080 +(define_insn_reservation "cfv2_alu_i0_3" 4
24081 + (and (and (and (eq_attr "cpu" "cfv2")
24082 + (eq_attr "type" "
24083 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24084 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24085 + (eq_attr "op_mem" "i0"))
24086 + (eq_attr "size" "3"))
24087 + "cf_ib3+cfv12_alu_i0")
24088 +
24089 +(define_insn_reservation "cfv2_omove_i0_2" 3
24090 + (and (and (and (eq_attr "cpu" "cfv2")
24091 + (eq_attr "type" "
24092 +move_l,tst_l"))
24093 + (eq_attr "op_mem" "i0"))
24094 + (eq_attr "size" "1,2"))
24095 + "cf_ib2+cfv12_omove_i0")
24096 +
24097 +(define_insn_reservation "cfv2_omove_i0_3" 3
24098 + (and (and (and (eq_attr "cpu" "cfv2")
24099 + (eq_attr "type" "
24100 +move_l,tst_l"))
24101 + (eq_attr "op_mem" "i0"))
24102 + (eq_attr "size" "3"))
24103 + "cf_ib3+cfv12_omove_i0")
24104 +
24105 +(define_insn_reservation "cfv3_alu_i0_2" 5
24106 + (and (and (and (eq_attr "cpu" "cfv3")
24107 + (eq_attr "type" "
24108 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24109 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24110 + (eq_attr "op_mem" "i0"))
24111 + (eq_attr "size" "1,2"))
24112 + "cf_ib2+cfv3_alu_i0")
24113 +
24114 +(define_insn_reservation "cfv3_alu_i0_3" 5
24115 + (and (and (and (eq_attr "cpu" "cfv3")
24116 + (eq_attr "type" "
24117 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24118 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24119 + (eq_attr "op_mem" "i0"))
24120 + (eq_attr "size" "3"))
24121 + "cf_ib3+cfv3_alu_i0")
24122 +
24123 +(define_insn_reservation "cfv3_omove_i0_2" 4
24124 + (and (and (and (eq_attr "cpu" "cfv3")
24125 + (eq_attr "type" "
24126 +move_l,tst_l"))
24127 + (eq_attr "op_mem" "i0"))
24128 + (eq_attr "size" "1,2"))
24129 + "cf_ib2+cfv3_omove_i0")
24130 +
24131 +(define_insn_reservation "cfv3_omove_i0_3" 4
24132 + (and (and (and (eq_attr "cpu" "cfv3")
24133 + (eq_attr "type" "
24134 +move_l,tst_l"))
24135 + (eq_attr "op_mem" "i0"))
24136 + (eq_attr "size" "3"))
24137 + "cf_ib3+cfv3_omove_i0")
24138 +
24139 +(define_insn_reservation "cfv12_alu_01_1" 1
24140 + (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24141 + (eq_attr "type" "
24142 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24143 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24144 +move_l,tst_l"))
24145 + (eq_attr "op_mem" "01"))
24146 + (eq_attr "size" "1"))
24147 + "cf_ib1+cfv12_alu_01")
24148 +
24149 +(define_insn_reservation "cfv12_alu_01_2" 1
24150 + (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24151 + (eq_attr "type" "
24152 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24153 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24154 +move_l,tst_l"))
24155 + (eq_attr "op_mem" "01"))
24156 + (eq_attr "size" "2"))
24157 + "cf_ib2+cfv12_alu_01")
24158 +
24159 +(define_insn_reservation "cfv12_alu_01_3" 1
24160 + (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24161 + (eq_attr "type" "
24162 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24163 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24164 +move_l,tst_l"))
24165 + (eq_attr "op_mem" "01"))
24166 + (eq_attr "size" "3"))
24167 + "cf_ib3+cfv12_alu_01")
24168 +
24169 +(define_insn_reservation "cfv3_alu_01_1" 1
24170 + (and (and (and (eq_attr "cpu" "cfv3")
24171 + (eq_attr "type" "
24172 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24173 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24174 +move_l,tst_l"))
24175 + (eq_attr "op_mem" "01"))
24176 + (eq_attr "size" "1"))
24177 + "cf_ib1+cfv3_alu_01")
24178 +
24179 +(define_insn_reservation "cfv3_alu_01_2" 1
24180 + (and (and (and (eq_attr "cpu" "cfv3")
24181 + (eq_attr "type" "
24182 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24183 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24184 +move_l,tst_l"))
24185 + (eq_attr "op_mem" "01"))
24186 + (eq_attr "size" "2"))
24187 + "cf_ib2+cfv3_alu_01")
24188 +
24189 +(define_insn_reservation "cfv3_alu_01_3" 1
24190 + (and (and (and (eq_attr "cpu" "cfv3")
24191 + (eq_attr "type" "
24192 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24193 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24194 +move_l,tst_l"))
24195 + (eq_attr "op_mem" "01"))
24196 + (eq_attr "size" "3"))
24197 + "cf_ib3+cfv3_alu_01")
24198 +
24199 +(define_insn_reservation "cfv12_alu_0i_2" 2
24200 + (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24201 + (eq_attr "type" "
24202 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24203 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24204 +move_l,tst_l"))
24205 + (eq_attr "op_mem" "0i"))
24206 + (eq_attr "size" "1,2"))
24207 + "cf_ib2+cfv12_alu_0i")
24208 +
24209 +(define_insn_reservation "cfv12_alu_0i_3" 2
24210 + (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24211 + (eq_attr "type" "
24212 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24213 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24214 +move_l,tst_l"))
24215 + (eq_attr "op_mem" "0i"))
24216 + (eq_attr "size" "3"))
24217 + "cf_ib3+cfv12_alu_0i")
24218 +
24219 +(define_insn_reservation "cfv3_alu_0i_2" 2
24220 + (and (and (and (eq_attr "cpu" "cfv3")
24221 + (eq_attr "type" "
24222 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24223 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24224 +move_l,tst_l"))
24225 + (eq_attr "op_mem" "0i"))
24226 + (eq_attr "size" "1,2"))
24227 + "cf_ib2+cfv3_alu_0i")
24228 +
24229 +(define_insn_reservation "cfv3_alu_0i_3" 2
24230 + (and (and (and (eq_attr "cpu" "cfv3")
24231 + (eq_attr "type" "
24232 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24233 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24234 +move_l,tst_l"))
24235 + (eq_attr "op_mem" "0i"))
24236 + (eq_attr "size" "3"))
24237 + "cf_ib3+cfv3_alu_0i")
24238 +
24239 +(define_insn_reservation "cfv1_alu_11_1" 1
24240 + (and (and (and (eq_attr "cpu" "cfv1")
24241 + (eq_attr "type" "
24242 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift"))
24243 + (eq_attr "op_mem" "11"))
24244 + (eq_attr "size" "1"))
24245 + "cf_ib1+cfv12_alu_11")
24246 +
24247 +(define_insn_reservation "cfv1_alu_11_2" 1
24248 + (and (and (and (eq_attr "cpu" "cfv1")
24249 + (eq_attr "type" "
24250 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift"))
24251 + (eq_attr "op_mem" "11"))
24252 + (eq_attr "size" "2"))
24253 + "cf_ib2+cfv12_alu_11")
24254 +
24255 +(define_insn_reservation "cfv1_alu_11_3" 1
24256 + (and (and (and (eq_attr "cpu" "cfv1")
24257 + (eq_attr "type" "
24258 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift"))
24259 + (eq_attr "op_mem" "11"))
24260 + (eq_attr "size" "3"))
24261 + "cf_ib3+cfv12_alu_11")
24262 +
24263 +(define_insn_reservation "cfv1_omove_11_1" 1
24264 + (and (and (and (eq_attr "cpu" "cfv1")
24265 + (eq_attr "type" "
24266 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24267 +move_l,tst_l"))
24268 + (eq_attr "op_mem" "11"))
24269 + (eq_attr "size" "1"))
24270 + "cf_ib1+cfv12_omove_11")
24271 +
24272 +(define_insn_reservation "cfv1_omove_11_2" 1
24273 + (and (and (and (eq_attr "cpu" "cfv1")
24274 + (eq_attr "type" "
24275 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24276 +move_l,tst_l"))
24277 + (eq_attr "op_mem" "11"))
24278 + (eq_attr "size" "2"))
24279 + "cf_ib2+cfv12_omove_11")
24280 +
24281 +(define_insn_reservation "cfv1_omove_11_3" 1
24282 + (and (and (and (eq_attr "cpu" "cfv1")
24283 + (eq_attr "type" "
24284 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24285 +move_l,tst_l"))
24286 + (eq_attr "op_mem" "11"))
24287 + (eq_attr "size" "3"))
24288 + "cf_ib3+cfv12_omove_11")
24289 +
24290 +(define_insn_reservation "cfv2_alu_11_1" 1
24291 + (and (and (and (eq_attr "cpu" "cfv2")
24292 + (eq_attr "type" "
24293 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24294 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24295 + (eq_attr "op_mem" "11"))
24296 + (eq_attr "size" "1"))
24297 + "cf_ib1+cfv12_alu_11")
24298 +
24299 +(define_insn_reservation "cfv2_alu_11_2" 1
24300 + (and (and (and (eq_attr "cpu" "cfv2")
24301 + (eq_attr "type" "
24302 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24303 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24304 + (eq_attr "op_mem" "11"))
24305 + (eq_attr "size" "2"))
24306 + "cf_ib2+cfv12_alu_11")
24307 +
24308 +(define_insn_reservation "cfv2_alu_11_3" 1
24309 + (and (and (and (eq_attr "cpu" "cfv2")
24310 + (eq_attr "type" "
24311 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24312 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24313 + (eq_attr "op_mem" "11"))
24314 + (eq_attr "size" "3"))
24315 + "cf_ib3+cfv12_alu_11")
24316 +
24317 +(define_insn_reservation "cfv2_omove_11_1" 1
24318 + (and (and (and (eq_attr "cpu" "cfv2")
24319 + (eq_attr "type" "
24320 +move_l,tst_l"))
24321 + (eq_attr "op_mem" "11"))
24322 + (eq_attr "size" "1"))
24323 + "cf_ib1+cfv12_omove_11")
24324 +
24325 +(define_insn_reservation "cfv2_omove_11_2" 1
24326 + (and (and (and (eq_attr "cpu" "cfv2")
24327 + (eq_attr "type" "
24328 +move_l,tst_l"))
24329 + (eq_attr "op_mem" "11"))
24330 + (eq_attr "size" "2"))
24331 + "cf_ib2+cfv12_omove_11")
24332 +
24333 +(define_insn_reservation "cfv2_omove_11_3" 1
24334 + (and (and (and (eq_attr "cpu" "cfv2")
24335 + (eq_attr "type" "
24336 +move_l,tst_l"))
24337 + (eq_attr "op_mem" "11"))
24338 + (eq_attr "size" "3"))
24339 + "cf_ib3+cfv12_omove_11")
24340 +
24341 +(define_insn_reservation "cfv3_alu_11_1" 1
24342 + (and (and (and (eq_attr "cpu" "cfv3")
24343 + (eq_attr "type" "
24344 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24345 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24346 + (eq_attr "op_mem" "11"))
24347 + (eq_attr "size" "1"))
24348 + "cf_ib1+cfv3_alu_11")
24349 +
24350 +(define_insn_reservation "cfv3_alu_11_2" 1
24351 + (and (and (and (eq_attr "cpu" "cfv3")
24352 + (eq_attr "type" "
24353 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24354 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24355 + (eq_attr "size" "2"))
24356 (eq_attr "op_mem" "11"))
24357 - "cf_v2_ib1+cf_v2_pea_11")
24358 + "cf_ib2+cfv3_alu_11")
24359
24360 -(define_insn_reservation "cf_v2_pea_11_2" 0
24361 - (and (and (and (eq_attr "cpu" "cf_v2")
24362 - (eq_attr "type2" "pea"))
24363 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
24364 +(define_insn_reservation "cfv3_alu_11_3" 1
24365 + (and (and (and (eq_attr "cpu" "cfv3")
24366 + (eq_attr "type" "
24367 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24368 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24369 + (eq_attr "op_mem" "11"))
24370 + (eq_attr "size" "3"))
24371 + "cf_ib3+cfv3_alu_11")
24372 +
24373 +(define_insn_reservation "cfv3_omove_11_1" 1
24374 + (and (and (and (eq_attr "cpu" "cfv3")
24375 + (eq_attr "type" "
24376 +move_l,tst_l"))
24377 + (eq_attr "op_mem" "11"))
24378 + (eq_attr "size" "1"))
24379 + "cf_ib1+cfv3_omove_11")
24380 +
24381 +(define_insn_reservation "cfv3_omove_11_2" 1
24382 + (and (and (and (eq_attr "cpu" "cfv3")
24383 + (eq_attr "type" "
24384 +move_l,tst_l"))
24385 + (eq_attr "size" "2"))
24386 (eq_attr "op_mem" "11"))
24387 - "cf_v2_ib2+cf_v2_pea_11")
24388 + "cf_ib2+cfv3_omove_11")
24389
24390 -(define_insn_reservation "cf_v2_pea_11_3" 0
24391 - (and (and (and (eq_attr "cpu" "cf_v2")
24392 - (eq_attr "type2" "pea"))
24393 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
24394 - (eq_attr "op_mem" "11"))
24395 - "cf_v2_ib3+cf_v2_pea_11")
24396 +(define_insn_reservation "cfv3_omove_11_3" 1
24397 + (and (and (and (eq_attr "cpu" "cfv3")
24398 + (eq_attr "type" "
24399 +move_l,tst_l"))
24400 + (eq_attr "op_mem" "11"))
24401 + (eq_attr "size" "3"))
24402 + "cf_ib3+cfv3_omove_11")
24403 +
24404 +(define_insn_reservation "cfv1_alu_i1_2" 2
24405 + (and (and (and (eq_attr "cpu" "cfv1")
24406 + (eq_attr "type" "
24407 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift"))
24408 + (eq_attr "op_mem" "i1"))
24409 + (eq_attr "size" "1,2"))
24410 + "cf_ib2+cfv12_alu_i1")
24411 +
24412 +(define_insn_reservation "cfv1_alu_i1_3" 2
24413 + (and (and (and (eq_attr "cpu" "cfv1")
24414 + (eq_attr "type" "
24415 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift"))
24416 + (eq_attr "op_mem" "i1"))
24417 + (eq_attr "size" "3"))
24418 + "cf_ib3+cfv12_alu_i1")
24419 +
24420 +(define_insn_reservation "cfv1_omove_i1_2" 2
24421 + (and (and (and (eq_attr "cpu" "cfv1")
24422 + (eq_attr "type" "
24423 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24424 +move_l,tst_l"))
24425 + (eq_attr "op_mem" "i1"))
24426 + (eq_attr "size" "1,2"))
24427 + "cf_ib2+cfv12_omove_i1")
24428 +
24429 +(define_insn_reservation "cfv1_omove_i1_3" 2
24430 + (and (and (and (eq_attr "cpu" "cfv1")
24431 + (eq_attr "type" "
24432 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24433 +move_l,tst_l"))
24434 + (eq_attr "op_mem" "i1"))
24435 + (eq_attr "size" "3"))
24436 + "cf_ib3+cfv12_omove_i1")
24437 +
24438 +(define_insn_reservation "cfv2_alu_i1_2" 2
24439 + (and (and (and (eq_attr "cpu" "cfv2")
24440 + (eq_attr "type" "
24441 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24442 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24443 + (eq_attr "op_mem" "i1"))
24444 + (eq_attr "size" "1,2"))
24445 + "cf_ib2+cfv12_alu_i1")
24446 +
24447 +(define_insn_reservation "cfv2_alu_i1_3" 2
24448 + (and (and (and (eq_attr "cpu" "cfv2")
24449 + (eq_attr "type" "
24450 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24451 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24452 + (eq_attr "op_mem" "i1"))
24453 + (eq_attr "size" "3"))
24454 + "cf_ib3+cfv12_alu_i1")
24455 +
24456 +(define_insn_reservation "cfv2_omove_i1_2" 2
24457 + (and (and (and (eq_attr "cpu" "cfv2")
24458 + (eq_attr "type" "
24459 +move_l,tst_l"))
24460 + (eq_attr "op_mem" "i1"))
24461 + (eq_attr "size" "1,2"))
24462 + "cf_ib2+cfv12_omove_i1")
24463 +
24464 +(define_insn_reservation "cfv2_omove_i1_3" 2
24465 + (and (and (and (eq_attr "cpu" "cfv2")
24466 + (eq_attr "type" "
24467 +move_l,tst_l"))
24468 + (eq_attr "op_mem" "i1"))
24469 + (eq_attr "size" "3"))
24470 + "cf_ib3+cfv12_omove_i1")
24471 +
24472 +(define_insn_reservation "cfv3_alu_i1_2" 2
24473 + (and (and (and (eq_attr "cpu" "cfv3")
24474 + (eq_attr "type" "
24475 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24476 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24477 + (eq_attr "op_mem" "i1"))
24478 + (eq_attr "size" "1,2"))
24479 + "cf_ib2+cfv3_alu_i1")
24480 +
24481 +(define_insn_reservation "cfv3_alu_i1_3" 2
24482 + (and (and (and (eq_attr "cpu" "cfv3")
24483 + (eq_attr "type" "
24484 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24485 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24486 + (eq_attr "op_mem" "i1"))
24487 + (eq_attr "size" "3"))
24488 + "cf_ib3+cfv3_alu_i1")
24489 +
24490 +(define_insn_reservation "cfv3_omove_i1_2" 2
24491 + (and (and (and (eq_attr "cpu" "cfv3")
24492 + (eq_attr "type" "
24493 +move_l,tst_l"))
24494 + (eq_attr "op_mem" "i1"))
24495 + (eq_attr "size" "1,2"))
24496 + "cf_ib2+cfv3_omove_i1")
24497 +
24498 +(define_insn_reservation "cfv3_omove_i1_3" 2
24499 + (and (and (and (eq_attr "cpu" "cfv3")
24500 + (eq_attr "type" "
24501 +move_l,tst_l"))
24502 + (eq_attr "op_mem" "i1"))
24503 + (eq_attr "size" "3"))
24504 + "cf_ib3+cfv3_omove_i1")
24505 +
24506 +(define_insn_reservation "cfv1_alu_1i_2" 2
24507 + (and (and (and (eq_attr "cpu" "cfv1")
24508 + (eq_attr "type" "
24509 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift"))
24510 + (eq_attr "op_mem" "1i"))
24511 + (eq_attr "size" "1,2"))
24512 + "cf_ib2+cfv12_alu_1i")
24513 +
24514 +(define_insn_reservation "cfv1_alu_1i_3" 2
24515 + (and (and (and (eq_attr "cpu" "cfv1")
24516 + (eq_attr "type" "
24517 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift"))
24518 + (eq_attr "op_mem" "1i"))
24519 + (eq_attr "size" "3"))
24520 + "cf_ib3+cfv12_alu_1i")
24521 +
24522 +(define_insn_reservation "cfv1_omove_1i_2" 2
24523 + (and (and (and (eq_attr "cpu" "cfv1")
24524 + (eq_attr "type" "
24525 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24526 +move_l,tst_l"))
24527 + (eq_attr "op_mem" "1i"))
24528 + (eq_attr "size" "1,2"))
24529 + "cf_ib2+cfv12_omove_1i")
24530 +
24531 +(define_insn_reservation "cfv1_omove_1i_3" 2
24532 + (and (and (and (eq_attr "cpu" "cfv1")
24533 + (eq_attr "type" "
24534 +clr,clr_l,mov3q_l,move,moveq_l,tst,
24535 +move_l,tst_l"))
24536 + (eq_attr "op_mem" "1i"))
24537 + (eq_attr "size" "3"))
24538 + "cf_ib3+cfv12_omove_1i")
24539 +
24540 +(define_insn_reservation "cfv2_alu_1i_2" 2
24541 + (and (and (and (eq_attr "cpu" "cfv2")
24542 + (eq_attr "type" "
24543 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24544 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24545 + (eq_attr "op_mem" "1i"))
24546 + (eq_attr "size" "1,2"))
24547 + "cf_ib2+cfv12_alu_1i")
24548 +
24549 +(define_insn_reservation "cfv2_alu_1i_3" 2
24550 + (and (and (and (eq_attr "cpu" "cfv2")
24551 + (eq_attr "type" "
24552 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24553 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24554 + (eq_attr "op_mem" "1i"))
24555 + (eq_attr "size" "3"))
24556 + "cf_ib3+cfv12_alu_1i")
24557 +
24558 +(define_insn_reservation "cfv2_omove_1i_2" 2
24559 + (and (and (and (eq_attr "cpu" "cfv2")
24560 + (eq_attr "type" "
24561 +move_l,tst_l"))
24562 + (eq_attr "op_mem" "1i"))
24563 + (eq_attr "size" "1,2"))
24564 + "cf_ib2+cfv12_omove_1i")
24565 +
24566 +(define_insn_reservation "cfv2_omove_1i_3" 2
24567 + (and (and (and (eq_attr "cpu" "cfv2")
24568 + (eq_attr "type" "
24569 +move_l,tst_l"))
24570 + (eq_attr "op_mem" "1i"))
24571 + (eq_attr "size" "3"))
24572 + "cf_ib3+cfv12_omove_1i")
24573 +
24574 +(define_insn_reservation "cfv3_alu_1i_2" 2
24575 + (and (and (and (eq_attr "cpu" "cfv3")
24576 + (eq_attr "type" "
24577 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24578 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24579 + (eq_attr "op_mem" "1i"))
24580 + (eq_attr "size" "1,2"))
24581 + "cf_ib2+cfv3_alu_1i")
24582 +
24583 +(define_insn_reservation "cfv3_alu_1i_3" 2
24584 + (and (and (and (eq_attr "cpu" "cfv3")
24585 + (eq_attr "type" "
24586 +alu_l,aluq_l,bitr,bitrw,cmp,cmp_l,alux_l,ext,neg_l,scc,shift,
24587 +clr,clr_l,mov3q_l,move,moveq_l,tst"))
24588 + (eq_attr "op_mem" "1i"))
24589 + (eq_attr "size" "3"))
24590 + "cf_ib3+cfv3_alu_1i")
24591 +
24592 +(define_insn_reservation "cfv3_omove_1i_2" 2
24593 + (and (and (and (eq_attr "cpu" "cfv3")
24594 + (eq_attr "type" "
24595 +move_l,tst_l"))
24596 + (eq_attr "op_mem" "1i"))
24597 + (eq_attr "size" "1,2"))
24598 + "cf_ib2+cfv3_omove_1i")
24599 +
24600 +(define_insn_reservation "cfv3_omove_1i_3" 2
24601 + (and (and (and (eq_attr "cpu" "cfv3")
24602 + (eq_attr "type" "
24603 +move_l,tst_l"))
24604 + (eq_attr "op_mem" "1i"))
24605 + (eq_attr "size" "3"))
24606 + "cf_ib3+cfv3_omove_1i")
24607 +
24608 +(define_insn_reservation "cfv123_lea_10_1" 1
24609 + (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24610 + (eq_attr "type" "lea"))
24611 + (eq_attr "op_mem" "10,11,1i"))
24612 + (eq_attr "size" "1"))
24613 + "cf_ib1+cfv123_lea_10")
24614 +
24615 +(define_insn_reservation "cfv123_lea_10_2" 1
24616 + (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24617 + (eq_attr "type" "lea"))
24618 + (eq_attr "op_mem" "10,11,1i"))
24619 + (eq_attr "size" "2"))
24620 + "cf_ib2+cfv123_lea_10")
24621 +
24622 +(define_insn_reservation "cfv123_lea_10_3" 1
24623 + (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24624 + (eq_attr "type" "lea"))
24625 + (eq_attr "op_mem" "10,11,1i"))
24626 + (eq_attr "size" "3"))
24627 + "cf_ib3+cfv123_lea_10")
24628 +
24629 +(define_insn_reservation "cfv123_lea_i0_2" 2
24630 + (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24631 + (eq_attr "type" "lea"))
24632 + (eq_attr "op_mem" "i0,i1"))
24633 + (eq_attr "size" "1,2"))
24634 + "cf_ib2+cfv123_lea_i0")
24635 +
24636 +(define_insn_reservation "cfv123_lea_i0_3" 2
24637 + (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24638 + (eq_attr "type" "lea"))
24639 + (eq_attr "op_mem" "i0,i1"))
24640 + (eq_attr "size" "3"))
24641 + "cf_ib3+cfv123_lea_i0")
24642 +
24643 +(define_insn_reservation "cfv12_pea_11_1" 1
24644 + (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24645 + (eq_attr "type" "pea"))
24646 + (eq_attr "op_mem" "11"))
24647 + (eq_attr "size" "1"))
24648 + "cf_ib1+cfv12_pea_11")
24649 +
24650 +(define_insn_reservation "cfv12_pea_11_2" 1
24651 + (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24652 + (eq_attr "type" "pea"))
24653 + (eq_attr "op_mem" "11"))
24654 + (eq_attr "size" "2"))
24655 + "cf_ib2+cfv12_pea_11")
24656 +
24657 +(define_insn_reservation "cfv12_pea_11_3" 1
24658 + (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24659 + (eq_attr "type" "pea"))
24660 + (eq_attr "op_mem" "11"))
24661 + (eq_attr "size" "3"))
24662 + "cf_ib3+cfv12_pea_11")
24663 +
24664 +(define_insn_reservation "cfv3_pea_11_1" 1
24665 + (and (and (and (eq_attr "cpu" "cfv3")
24666 + (eq_attr "type" "pea"))
24667 + (eq_attr "op_mem" "11"))
24668 + (eq_attr "size" "1"))
24669 + "cf_ib1+cfv3_pea_11")
24670 +
24671 +(define_insn_reservation "cfv3_pea_11_2" 1
24672 + (and (and (and (eq_attr "cpu" "cfv3")
24673 + (eq_attr "type" "pea"))
24674 + (eq_attr "op_mem" "11"))
24675 + (eq_attr "size" "2"))
24676 + "cf_ib2+cfv3_pea_11")
24677 +
24678 +(define_insn_reservation "cfv3_pea_11_3" 1
24679 + (and (and (and (eq_attr "cpu" "cfv3")
24680 + (eq_attr "type" "pea"))
24681 + (eq_attr "op_mem" "11"))
24682 + (eq_attr "size" "3"))
24683 + "cf_ib3+cfv3_pea_11")
24684 +
24685 +(define_insn_reservation "cfv12_pea_i1_2" 2
24686 + (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24687 + (eq_attr "type" "pea"))
24688 + (eq_attr "op_mem" "i1"))
24689 + (eq_attr "size" "1,2"))
24690 + "cf_ib2+cfv12_pea_i1")
24691 +
24692 +(define_insn_reservation "cfv12_pea_i1_3" 2
24693 + (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24694 + (eq_attr "type" "pea"))
24695 + (eq_attr "op_mem" "i1"))
24696 + (eq_attr "size" "3"))
24697 + "cf_ib3+cfv12_pea_i1")
24698 +
24699 +(define_insn_reservation "cfv3_pea_i1_2" 2
24700 + (and (and (and (eq_attr "cpu" "cfv3")
24701 + (eq_attr "type" "pea"))
24702 + (eq_attr "op_mem" "i1"))
24703 + (eq_attr "size" "1,2"))
24704 + "cf_ib2+cfv3_pea_i1")
24705 +
24706 +(define_insn_reservation "cfv3_pea_i1_3" 2
24707 + (and (and (and (eq_attr "cpu" "cfv3")
24708 + (eq_attr "type" "pea"))
24709 + (eq_attr "op_mem" "i1"))
24710 + (eq_attr "size" "3"))
24711 + "cf_ib3+cfv3_pea_i1")
24712 +
24713 +(define_insn_reservation "cfv123_mul_l_00_1" 18
24714 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24715 + (eq_attr "mac" "no"))
24716 + (eq_attr "type" "mul_l"))
24717 + (eq_attr "op_mem" "00,01,0i"))
24718 + (eq_attr "size" "1"))
24719 + "cf_ib1+cfv123_mul_l_00")
24720 +
24721 +(define_insn_reservation "cfv123_mul_l_00_2" 18
24722 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24723 + (eq_attr "mac" "no"))
24724 + (eq_attr "type" "mul_l"))
24725 + (eq_attr "op_mem" "00,01,0i"))
24726 + (eq_attr "size" "2"))
24727 + "cf_ib2+cfv123_mul_l_00")
24728 +
24729 +(define_insn_reservation "cfv123_mul_l_00_3" 18
24730 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24731 + (eq_attr "mac" "no"))
24732 + (eq_attr "type" "mul_l"))
24733 + (eq_attr "op_mem" "00,01,0i"))
24734 + (eq_attr "size" "3"))
24735 + "cf_ib3+cfv123_mul_l_00")
24736 +
24737 +(define_insn_reservation "cfv123_mul_w_00_1" 9
24738 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24739 + (eq_attr "mac" "no"))
24740 + (eq_attr "type" "mul_w"))
24741 + (eq_attr "op_mem" "00,01,0i"))
24742 + (eq_attr "size" "1"))
24743 + "cf_ib1+cfv123_mul_w_00")
24744 +
24745 +(define_insn_reservation "cfv123_mul_w_00_2" 9
24746 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24747 + (eq_attr "mac" "no"))
24748 + (eq_attr "type" "mul_w"))
24749 + (eq_attr "op_mem" "00,01,0i"))
24750 + (eq_attr "size" "2"))
24751 + "cf_ib2+cfv123_mul_w_00")
24752 +
24753 +(define_insn_reservation "cfv123_mul_w_00_3" 9
24754 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24755 + (eq_attr "mac" "no"))
24756 + (eq_attr "type" "mul_w"))
24757 + (eq_attr "op_mem" "00,01,0i"))
24758 + (eq_attr "size" "3"))
24759 + "cf_ib3+cfv123_mul_w_00")
24760 +
24761 +(define_insn_reservation "cfv12_mul_l_10_1" 20
24762 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24763 + (eq_attr "mac" "no"))
24764 + (eq_attr "type" "mul_l"))
24765 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
24766 + (eq_attr "size" "1"))
24767 + "cf_ib1+cfv12_mul_l_10")
24768 +
24769 +(define_insn_reservation "cfv12_mul_l_10_2" 20
24770 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24771 + (eq_attr "mac" "no"))
24772 + (eq_attr "type" "mul_l"))
24773 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
24774 + (eq_attr "size" "2"))
24775 + "cf_ib2+cfv12_mul_l_10")
24776 +
24777 +(define_insn_reservation "cfv12_mul_l_10_3" 20
24778 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24779 + (eq_attr "mac" "no"))
24780 + (eq_attr "type" "mul_l"))
24781 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
24782 + (eq_attr "size" "3"))
24783 + "cf_ib3+cfv12_mul_l_10")
24784 +
24785 +(define_insn_reservation "cfv3_mul_l_10_1" 21
24786 + (and (and (and (and (eq_attr "cpu" "cfv3")
24787 + (eq_attr "mac" "no"))
24788 + (eq_attr "type" "mul_l"))
24789 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
24790 + (eq_attr "size" "1"))
24791 + "cf_ib1+cfv3_mul_l_10")
24792 +
24793 +(define_insn_reservation "cfv3_mul_l_10_2" 21
24794 + (and (and (and (and (eq_attr "cpu" "cfv3")
24795 + (eq_attr "mac" "no"))
24796 + (eq_attr "type" "mul_l"))
24797 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
24798 + (eq_attr "size" "2"))
24799 + "cf_ib2+cfv3_mul_l_10")
24800 +
24801 +(define_insn_reservation "cfv3_mul_l_10_3" 21
24802 + (and (and (and (and (eq_attr "cpu" "cfv3")
24803 + (eq_attr "mac" "no"))
24804 + (eq_attr "type" "mul_l"))
24805 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
24806 + (eq_attr "size" "3"))
24807 + "cf_ib3+cfv3_mul_l_10")
24808 +
24809 +(define_insn_reservation "cfv12_mul_w_10_1" 11
24810 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24811 + (eq_attr "mac" "no"))
24812 + (eq_attr "type" "mul_w"))
24813 + (eq_attr "op_mem" "10,11,1i"))
24814 + (eq_attr "size" "1"))
24815 + "cf_ib1+cfv12_mul_w_10")
24816 +
24817 +(define_insn_reservation "cfv12_mul_w_10_2" 11
24818 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24819 + (eq_attr "mac" "no"))
24820 + (eq_attr "type" "mul_w"))
24821 + (eq_attr "op_mem" "10,11,1i"))
24822 + (eq_attr "size" "2"))
24823 + "cf_ib2+cfv12_mul_w_10")
24824 +
24825 +(define_insn_reservation "cfv12_mul_w_10_3" 11
24826 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24827 + (eq_attr "mac" "no"))
24828 + (eq_attr "type" "mul_w"))
24829 + (eq_attr "op_mem" "10,11,1i"))
24830 + (eq_attr "size" "3"))
24831 + "cf_ib3+cfv12_mul_w_10")
24832 +
24833 +(define_insn_reservation "cfv3_mul_w_10_1" 12
24834 + (and (and (and (and (eq_attr "cpu" "cfv3")
24835 + (eq_attr "mac" "no"))
24836 + (eq_attr "type" "mul_w"))
24837 + (eq_attr "op_mem" "10,11,1i"))
24838 + (eq_attr "size" "1"))
24839 + "cf_ib1+cfv3_mul_w_10")
24840 +
24841 +(define_insn_reservation "cfv3_mul_w_10_2" 12
24842 + (and (and (and (and (eq_attr "cpu" "cfv3")
24843 + (eq_attr "mac" "no"))
24844 + (eq_attr "type" "mul_w"))
24845 + (eq_attr "op_mem" "10,11,1i"))
24846 + (eq_attr "size" "2"))
24847 + "cf_ib2+cfv3_mul_w_10")
24848 +
24849 +(define_insn_reservation "cfv3_mul_w_10_3" 12
24850 + (and (and (and (and (eq_attr "cpu" "cfv3")
24851 + (eq_attr "mac" "no"))
24852 + (eq_attr "type" "mul_w"))
24853 + (eq_attr "op_mem" "10,11,1i"))
24854 + (eq_attr "size" "3"))
24855 + "cf_ib3+cfv3_mul_w_10")
24856 +
24857 +(define_insn_reservation "cfv12_mul_w_i0_2" 12
24858 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24859 + (eq_attr "mac" "no"))
24860 + (eq_attr "type" "mul_w"))
24861 + (eq_attr "op_mem" "i0,i1"))
24862 + (eq_attr "size" "1,2"))
24863 + "cf_ib2+cfv12_mul_w_i0")
24864 +
24865 +(define_insn_reservation "cfv12_mul_w_i0_3" 12
24866 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24867 + (eq_attr "mac" "no"))
24868 + (eq_attr "type" "mul_w"))
24869 + (eq_attr "op_mem" "i0,i1"))
24870 + (eq_attr "size" "3"))
24871 + "cf_ib3+cfv12_mul_w_i0")
24872 +
24873 +(define_insn_reservation "cfv3_mul_w_i0_2" 13
24874 + (and (and (and (and (eq_attr "cpu" "cfv3")
24875 + (eq_attr "mac" "no"))
24876 + (eq_attr "type" "mul_w"))
24877 + (eq_attr "op_mem" "i0,i1"))
24878 + (eq_attr "size" "1,2"))
24879 + "cf_ib2+cfv3_mul_w_i0")
24880 +
24881 +(define_insn_reservation "cfv3_mul_w_i0_3" 13
24882 + (and (and (and (and (eq_attr "cpu" "cfv3")
24883 + (eq_attr "mac" "no"))
24884 + (eq_attr "type" "mul_w"))
24885 + (eq_attr "op_mem" "i0,i1"))
24886 + (eq_attr "size" "3"))
24887 + "cf_ib3+cfv3_mul_w_i0")
24888 +
24889 +(define_insn_reservation "cfv123_mac_l_00_1" 5
24890 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24891 + (eq_attr "mac" "cf_mac"))
24892 + (eq_attr "type" "mul_l"))
24893 + (eq_attr "op_mem" "00,01,0i"))
24894 + (eq_attr "size" "1"))
24895 + "cf_ib1+cfv123_mac_l_00")
24896 +
24897 +(define_insn_reservation "cfv123_mac_l_00_2" 5
24898 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24899 + (eq_attr "mac" "cf_mac"))
24900 + (eq_attr "type" "mul_l"))
24901 + (eq_attr "op_mem" "00,01,0i"))
24902 + (eq_attr "size" "2"))
24903 + "cf_ib2+cfv123_mac_l_00")
24904 +
24905 +(define_insn_reservation "cfv123_mac_l_00_3" 5
24906 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24907 + (eq_attr "mac" "cf_mac"))
24908 + (eq_attr "type" "mul_l"))
24909 + (eq_attr "op_mem" "00,01,0i"))
24910 + (eq_attr "size" "3"))
24911 + "cf_ib3+cfv123_mac_l_00")
24912 +
24913 +(define_insn_reservation "cfv123_mac_w_00_1" 3
24914 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24915 + (eq_attr "mac" "cf_mac"))
24916 + (eq_attr "type" "mul_w"))
24917 + (eq_attr "op_mem" "00,01,0i"))
24918 + (eq_attr "size" "1"))
24919 + "cf_ib1+cfv123_mac_w_00")
24920 +
24921 +(define_insn_reservation "cfv123_mac_w_00_2" 3
24922 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24923 + (eq_attr "mac" "cf_mac"))
24924 + (eq_attr "type" "mul_w"))
24925 + (eq_attr "op_mem" "00,01,0i"))
24926 + (eq_attr "size" "2"))
24927 + "cf_ib2+cfv123_mac_w_00")
24928 +
24929 +(define_insn_reservation "cfv123_mac_w_00_3" 3
24930 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
24931 + (eq_attr "mac" "cf_mac"))
24932 + (eq_attr "type" "mul_w"))
24933 + (eq_attr "op_mem" "00,01,0i"))
24934 + (eq_attr "size" "3"))
24935 + "cf_ib3+cfv123_mac_w_00")
24936 +
24937 +(define_insn_reservation "cfv12_mac_l_10_1" 7
24938 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24939 + (eq_attr "mac" "cf_mac"))
24940 + (eq_attr "type" "mul_l"))
24941 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
24942 + (eq_attr "size" "1"))
24943 + "cf_ib1+cfv12_mac_l_10")
24944 +
24945 +(define_insn_reservation "cfv12_mac_l_10_2" 7
24946 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24947 + (eq_attr "mac" "cf_mac"))
24948 + (eq_attr "type" "mul_l"))
24949 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
24950 + (eq_attr "size" "2"))
24951 + "cf_ib2+cfv12_mac_l_10")
24952 +
24953 +(define_insn_reservation "cfv12_mac_l_10_3" 7
24954 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24955 + (eq_attr "mac" "cf_mac"))
24956 + (eq_attr "type" "mul_l"))
24957 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
24958 + (eq_attr "size" "3"))
24959 + "cf_ib3+cfv12_mac_l_10")
24960 +
24961 +(define_insn_reservation "cfv3_mac_l_10_1" 8
24962 + (and (and (and (and (eq_attr "cpu" "cfv3")
24963 + (eq_attr "mac" "cf_mac"))
24964 + (eq_attr "type" "mul_l"))
24965 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
24966 + (eq_attr "size" "1"))
24967 + "cf_ib1+cfv3_mac_l_10")
24968 +
24969 +(define_insn_reservation "cfv3_mac_l_10_2" 8
24970 + (and (and (and (and (eq_attr "cpu" "cfv3")
24971 + (eq_attr "mac" "cf_mac"))
24972 + (eq_attr "type" "mul_l"))
24973 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
24974 + (eq_attr "size" "2"))
24975 + "cf_ib2+cfv3_mac_l_10")
24976 +
24977 +(define_insn_reservation "cfv3_mac_l_10_3" 8
24978 + (and (and (and (and (eq_attr "cpu" "cfv3")
24979 + (eq_attr "mac" "cf_mac"))
24980 + (eq_attr "type" "mul_l"))
24981 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
24982 + (eq_attr "size" "3"))
24983 + "cf_ib3+cfv3_mac_l_10")
24984 +
24985 +(define_insn_reservation "cfv12_mac_w_10_1" 5
24986 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24987 + (eq_attr "mac" "cf_mac"))
24988 + (eq_attr "type" "mul_w"))
24989 + (eq_attr "op_mem" "10,11,1i"))
24990 + (eq_attr "size" "1"))
24991 + "cf_ib1+cfv12_mac_w_10")
24992 +
24993 +(define_insn_reservation "cfv12_mac_w_10_2" 5
24994 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
24995 + (eq_attr "mac" "cf_mac"))
24996 + (eq_attr "type" "mul_w"))
24997 + (eq_attr "op_mem" "10,11,1i"))
24998 + (eq_attr "size" "2"))
24999 + "cf_ib2+cfv12_mac_w_10")
25000 +
25001 +(define_insn_reservation "cfv12_mac_w_10_3" 5
25002 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
25003 + (eq_attr "mac" "cf_mac"))
25004 + (eq_attr "type" "mul_w"))
25005 + (eq_attr "op_mem" "10,11,1i"))
25006 + (eq_attr "size" "3"))
25007 + "cf_ib3+cfv12_mac_w_10")
25008 +
25009 +(define_insn_reservation "cfv3_mac_w_10_1" 6
25010 + (and (and (and (and (eq_attr "cpu" "cfv3")
25011 + (eq_attr "mac" "cf_mac"))
25012 + (eq_attr "type" "mul_w"))
25013 + (eq_attr "op_mem" "10,11,1i"))
25014 + (eq_attr "size" "1"))
25015 + "cf_ib1+cfv3_mac_w_10")
25016 +
25017 +(define_insn_reservation "cfv3_mac_w_10_2" 6
25018 + (and (and (and (and (eq_attr "cpu" "cfv3")
25019 + (eq_attr "mac" "cf_mac"))
25020 + (eq_attr "type" "mul_w"))
25021 + (eq_attr "op_mem" "10,11,1i"))
25022 + (eq_attr "size" "2"))
25023 + "cf_ib2+cfv3_mac_w_10")
25024 +
25025 +(define_insn_reservation "cfv3_mac_w_10_3" 6
25026 + (and (and (and (and (eq_attr "cpu" "cfv3")
25027 + (eq_attr "mac" "cf_mac"))
25028 + (eq_attr "type" "mul_w"))
25029 + (eq_attr "op_mem" "10,11,1i"))
25030 + (eq_attr "size" "3"))
25031 + "cf_ib3+cfv3_mac_w_10")
25032 +
25033 +(define_insn_reservation "cfv12_mac_w_i0_2" 6
25034 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
25035 + (eq_attr "mac" "cf_mac"))
25036 + (eq_attr "type" "mul_w"))
25037 + (eq_attr "op_mem" "i0,i1"))
25038 + (eq_attr "size" "1,2"))
25039 + "cf_ib2+cfv12_mac_w_i0")
25040 +
25041 +(define_insn_reservation "cfv12_mac_w_i0_3" 6
25042 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
25043 + (eq_attr "mac" "cf_mac"))
25044 + (eq_attr "type" "mul_w"))
25045 + (eq_attr "op_mem" "i0,i1"))
25046 + (eq_attr "size" "3"))
25047 + "cf_ib3+cfv12_mac_w_i0")
25048 +
25049 +(define_insn_reservation "cfv3_mac_w_i0_2" 7
25050 + (and (and (and (and (eq_attr "cpu" "cfv3")
25051 + (eq_attr "mac" "cf_mac"))
25052 + (eq_attr "type" "mul_w"))
25053 + (eq_attr "op_mem" "i0,i1"))
25054 + (eq_attr "size" "1,2"))
25055 + "cf_ib2+cfv3_mac_w_i0")
25056 +
25057 +(define_insn_reservation "cfv3_mac_w_i0_3" 7
25058 + (and (and (and (and (eq_attr "cpu" "cfv3")
25059 + (eq_attr "mac" "cf_mac"))
25060 + (eq_attr "type" "mul_w"))
25061 + (eq_attr "op_mem" "i0,i1"))
25062 + (eq_attr "size" "3"))
25063 + "cf_ib3+cfv3_mac_w_i0")
25064 +
25065 +(define_insn_reservation "cfv123_emac_00_1" 4
25066 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
25067 + (eq_attr "mac" "cf_emac"))
25068 + (eq_attr "type" "mul_l,mul_w"))
25069 + (eq_attr "op_mem" "00,01,0i"))
25070 + (eq_attr "size" "1"))
25071 + "cf_ib1+cfv123_emac_00")
25072 +
25073 +(define_insn_reservation "cfv123_emac_00_2" 4
25074 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
25075 + (eq_attr "mac" "cf_emac"))
25076 + (eq_attr "type" "mul_l,mul_w"))
25077 + (eq_attr "op_mem" "00,01,0i"))
25078 + (eq_attr "size" "2"))
25079 + "cf_ib2+cfv123_emac_00")
25080 +
25081 +(define_insn_reservation "cfv123_emac_00_3" 4
25082 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
25083 + (eq_attr "mac" "cf_emac"))
25084 + (eq_attr "type" "mul_l,mul_w"))
25085 + (eq_attr "op_mem" "00,01,0i"))
25086 + (eq_attr "size" "3"))
25087 + "cf_ib3+cfv123_emac_00")
25088 +
25089 +(define_insn_reservation "cfv12_emac_l_10_1" 6
25090 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
25091 + (eq_attr "mac" "cf_emac"))
25092 + (eq_attr "type" "mul_l"))
25093 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
25094 + (eq_attr "size" "1"))
25095 + "cf_ib1+cfv12_emac_10")
25096 +
25097 +(define_insn_reservation "cfv12_emac_l_10_2" 6
25098 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
25099 + (eq_attr "mac" "cf_emac"))
25100 + (eq_attr "type" "mul_l"))
25101 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
25102 + (eq_attr "size" "2"))
25103 + "cf_ib2+cfv12_emac_10")
25104 +
25105 +(define_insn_reservation "cfv12_emac_l_10_3" 6
25106 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
25107 + (eq_attr "mac" "cf_emac"))
25108 + (eq_attr "type" "mul_l"))
25109 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
25110 + (eq_attr "size" "3"))
25111 + "cf_ib3+cfv12_emac_10")
25112 +
25113 +(define_insn_reservation "cfv3_emac_l_10_1" 7
25114 + (and (and (and (and (eq_attr "cpu" "cfv3")
25115 + (eq_attr "mac" "cf_emac"))
25116 + (eq_attr "type" "mul_l"))
25117 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
25118 + (eq_attr "size" "1"))
25119 + "cf_ib1+cfv3_emac_10")
25120 +
25121 +(define_insn_reservation "cfv3_emac_l_10_2" 7
25122 + (and (and (and (and (eq_attr "cpu" "cfv3")
25123 + (eq_attr "mac" "cf_emac"))
25124 + (eq_attr "type" "mul_l"))
25125 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
25126 + (eq_attr "size" "2"))
25127 + "cf_ib2+cfv3_emac_10")
25128 +
25129 +(define_insn_reservation "cfv3_emac_l_10_3" 7
25130 + (and (and (and (and (eq_attr "cpu" "cfv3")
25131 + (eq_attr "mac" "cf_emac"))
25132 + (eq_attr "type" "mul_l"))
25133 + (eq_attr "op_mem" "10,i0,i1,11,1i"))
25134 + (eq_attr "size" "3"))
25135 + "cf_ib3+cfv3_emac_10")
25136 +
25137 +(define_insn_reservation "cfv12_emac_w_10_1" 6
25138 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
25139 + (eq_attr "mac" "cf_emac"))
25140 + (eq_attr "type" "mul_w"))
25141 + (eq_attr "op_mem" "10,11,1i"))
25142 + (eq_attr "size" "1"))
25143 + "cf_ib1+cfv12_emac_10")
25144 +
25145 +(define_insn_reservation "cfv12_emac_w_10_2" 6
25146 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
25147 + (eq_attr "mac" "cf_emac"))
25148 + (eq_attr "type" "mul_w"))
25149 + (eq_attr "op_mem" "10,11,1i"))
25150 + (eq_attr "size" "2"))
25151 + "cf_ib2+cfv12_emac_10")
25152 +
25153 +(define_insn_reservation "cfv12_emac_w_10_3" 6
25154 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
25155 + (eq_attr "mac" "cf_emac"))
25156 + (eq_attr "type" "mul_w"))
25157 + (eq_attr "op_mem" "10,11,1i"))
25158 + (eq_attr "size" "3"))
25159 + "cf_ib3+cfv12_emac_10")
25160 +
25161 +(define_insn_reservation "cfv3_emac_w_10_1" 7
25162 + (and (and (and (and (eq_attr "cpu" "cfv3")
25163 + (eq_attr "mac" "cf_emac"))
25164 + (eq_attr "type" "mul_w"))
25165 + (eq_attr "op_mem" "10,11,1i"))
25166 + (eq_attr "size" "1"))
25167 + "cf_ib1+cfv3_emac_10")
25168 +
25169 +(define_insn_reservation "cfv3_emac_w_10_2" 7
25170 + (and (and (and (and (eq_attr "cpu" "cfv3")
25171 + (eq_attr "mac" "cf_emac"))
25172 + (eq_attr "type" "mul_w"))
25173 + (eq_attr "op_mem" "10,11,1i"))
25174 + (eq_attr "size" "2"))
25175 + "cf_ib2+cfv3_emac_10")
25176 +
25177 +(define_insn_reservation "cfv3_emac_w_10_3" 7
25178 + (and (and (and (and (eq_attr "cpu" "cfv3")
25179 + (eq_attr "mac" "cf_emac"))
25180 + (eq_attr "type" "mul_w"))
25181 + (eq_attr "op_mem" "10,11,1i"))
25182 + (eq_attr "size" "3"))
25183 + "cf_ib3+cfv3_emac_10")
25184 +
25185 +(define_insn_reservation "cfv12_emac_w_i0_2" 7
25186 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
25187 + (eq_attr "mac" "cf_emac"))
25188 + (eq_attr "type" "mul_w"))
25189 + (eq_attr "op_mem" "i0,i1"))
25190 + (eq_attr "size" "1,2"))
25191 + "cf_ib2+cfv12_emac_w_i0")
25192 +
25193 +(define_insn_reservation "cfv12_emac_w_i0_3" 7
25194 + (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
25195 + (eq_attr "mac" "cf_emac"))
25196 + (eq_attr "type" "mul_w"))
25197 + (eq_attr "op_mem" "i0,i1"))
25198 + (eq_attr "size" "3"))
25199 + "cf_ib3+cfv12_emac_w_i0")
25200 +
25201 +(define_insn_reservation "cfv3_emac_w_i0_2" 8
25202 + (and (and (and (and (eq_attr "cpu" "cfv3")
25203 + (eq_attr "mac" "cf_emac"))
25204 + (eq_attr "type" "mul_w"))
25205 + (eq_attr "op_mem" "i0,i1"))
25206 + (eq_attr "size" "1,2"))
25207 + "cf_ib2+cfv3_emac_w_i0")
25208 +
25209 +(define_insn_reservation "cfv3_emac_w_i0_3" 8
25210 + (and (and (and (and (eq_attr "cpu" "cfv3")
25211 + (eq_attr "mac" "cf_emac"))
25212 + (eq_attr "type" "mul_w"))
25213 + (eq_attr "op_mem" "i0,i1"))
25214 + (eq_attr "size" "3"))
25215 + "cf_ib3+cfv3_emac_w_i0")
25216 +
25217 +(define_insn_reservation "cfv12_rts" 5
25218 + (and (eq_attr "cpu" "cfv1,cfv2")
25219 + (eq_attr "type" "rts"))
25220 + "cf_ib1+cfv12_rts")
25221 +
25222 +(define_insn_reservation "cfv3_rts" 8
25223 + (and (eq_attr "cpu" "cfv3")
25224 + (eq_attr "type" "rts"))
25225 + "cf_ib1+cfv3_rts")
25226 +
25227 +(define_insn_reservation "cfv12_call_1" 3
25228 + (and (and (eq_attr "cpu" "cfv1,cfv2")
25229 + (eq_attr "type" "bsr,jsr"))
25230 + (eq_attr "size" "1"))
25231 + "cf_ib1+cfv12_call")
25232 +
25233 +(define_insn_reservation "cfv12_call_2" 3
25234 + (and (and (eq_attr "cpu" "cfv1,cfv2")
25235 + (eq_attr "type" "bsr,jsr"))
25236 + (eq_attr "size" "2"))
25237 + "cf_ib2+cfv12_call")
25238 +
25239 +(define_insn_reservation "cfv12_call_3" 3
25240 + (and (and (eq_attr "cpu" "cfv1,cfv2")
25241 + (eq_attr "type" "bsr,jsr"))
25242 + (eq_attr "size" "3"))
25243 + "cf_ib3+cfv12_call")
25244 +
25245 +(define_insn_reservation "cfv3_call_1" 1
25246 + (and (and (eq_attr "cpu" "cfv3")
25247 + (eq_attr "type" "bsr,jsr"))
25248 + (eq_attr "size" "1"))
25249 + "cf_ib1+cfv3_call")
25250 +
25251 +(define_insn_reservation "cfv3_call_2" 1
25252 + (and (and (eq_attr "cpu" "cfv3")
25253 + (eq_attr "type" "bsr,jsr"))
25254 + (eq_attr "size" "2"))
25255 + "cf_ib2+cfv3_call")
25256 +
25257 +(define_insn_reservation "cfv3_call_3" 1
25258 + (and (and (eq_attr "cpu" "cfv3")
25259 + (eq_attr "type" "bsr,jsr"))
25260 + (eq_attr "size" "3"))
25261 + "cf_ib3+cfv3_call")
25262 +
25263 +(define_insn_reservation "cfv12_bcc_1" 2
25264 + (and (and (eq_attr "cpu" "cfv1,cfv2")
25265 + (eq_attr "type" "bcc"))
25266 + (eq_attr "size" "1"))
25267 + "cf_ib1+cfv12_bcc")
25268 +
25269 +(define_insn_reservation "cfv12_bcc_2" 2
25270 + (and (and (eq_attr "cpu" "cfv1,cfv2")
25271 + (eq_attr "type" "bcc"))
25272 + (eq_attr "size" "2"))
25273 + "cf_ib2+cfv12_bcc")
25274 +
25275 +(define_insn_reservation "cfv12_bcc_3" 2
25276 + (and (and (eq_attr "cpu" "cfv1,cfv2")
25277 + (eq_attr "type" "bcc"))
25278 + (eq_attr "size" "3"))
25279 + "cf_ib3+cfv12_bcc")
25280 +
25281 +(define_insn_reservation "cfv3_bcc_1" 1
25282 + (and (and (eq_attr "cpu" "cfv3")
25283 + (eq_attr "type" "bcc"))
25284 + (eq_attr "size" "1"))
25285 + "cf_ib1+cfv3_bcc")
25286 +
25287 +(define_insn_reservation "cfv3_bcc_2" 1
25288 + (and (and (eq_attr "cpu" "cfv3")
25289 + (eq_attr "type" "bcc"))
25290 + (eq_attr "size" "2"))
25291 + "cf_ib2+cfv3_bcc")
25292 +
25293 +(define_insn_reservation "cfv3_bcc_3" 1
25294 + (and (and (eq_attr "cpu" "cfv3")
25295 + (eq_attr "type" "bcc"))
25296 + (eq_attr "size" "3"))
25297 + "cf_ib3+cfv3_bcc")
25298 +
25299 +(define_insn_reservation "cfv12_bra_1" 2
25300 + (and (and (eq_attr "cpu" "cfv1,cfv2")
25301 + (eq_attr "type" "bra"))
25302 + (eq_attr "size" "1"))
25303 + "cf_ib1+cfv12_bra")
25304 +
25305 +(define_insn_reservation "cfv12_bra_2" 2
25306 + (and (and (eq_attr "cpu" "cfv1,cfv2")
25307 + (eq_attr "type" "bra"))
25308 + (eq_attr "size" "2"))
25309 + "cf_ib2+cfv12_bra")
25310 +
25311 +(define_insn_reservation "cfv12_bra_3" 2
25312 + (and (and (eq_attr "cpu" "cfv1,cfv2")
25313 + (eq_attr "type" "bra"))
25314 + (eq_attr "size" "3"))
25315 + "cf_ib3+cfv12_bra")
25316 +
25317 +(define_insn_reservation "cfv3_bra_1" 1
25318 + (and (and (eq_attr "cpu" "cfv3")
25319 + (eq_attr "type" "bra"))
25320 + (eq_attr "size" "1"))
25321 + "cf_ib1+cfv3_bra")
25322 +
25323 +(define_insn_reservation "cfv3_bra_2" 1
25324 + (and (and (eq_attr "cpu" "cfv3")
25325 + (eq_attr "type" "bra"))
25326 + (eq_attr "size" "2"))
25327 + "cf_ib2+cfv3_bra")
25328 +
25329 +(define_insn_reservation "cfv3_bra_3" 1
25330 + (and (and (eq_attr "cpu" "cfv3")
25331 + (eq_attr "type" "bra"))
25332 + (eq_attr "size" "3"))
25333 + "cf_ib3+cfv3_bra")
25334 +
25335 +(define_insn_reservation "cfv12_jmp_1" 3
25336 + (and (and (eq_attr "cpu" "cfv1,cfv2")
25337 + (eq_attr "type" "jmp"))
25338 + (eq_attr "size" "1"))
25339 + "cf_ib1+cfv12_jmp")
25340 +
25341 +(define_insn_reservation "cfv12_jmp_2" 3
25342 + (and (and (eq_attr "cpu" "cfv1,cfv2")
25343 + (eq_attr "type" "jmp"))
25344 + (eq_attr "size" "2"))
25345 + "cf_ib2+cfv12_jmp")
25346 +
25347 +(define_insn_reservation "cfv12_jmp_3" 3
25348 + (and (and (eq_attr "cpu" "cfv1,cfv2")
25349 + (eq_attr "type" "jmp"))
25350 + (eq_attr "size" "3"))
25351 + "cf_ib3+cfv12_jmp")
25352 +
25353 +(define_insn_reservation "cfv3_jmp_1" 5
25354 + (and (and (eq_attr "cpu" "cfv3")
25355 + (eq_attr "type" "jmp"))
25356 + (eq_attr "size" "1"))
25357 + "cf_ib1+cfv3_jmp")
25358 +
25359 +(define_insn_reservation "cfv3_jmp_2" 5
25360 + (and (and (eq_attr "cpu" "cfv3")
25361 + (eq_attr "type" "jmp"))
25362 + (eq_attr "size" "2"))
25363 + "cf_ib2+cfv3_jmp")
25364 +
25365 +(define_insn_reservation "cfv3_jmp_3" 5
25366 + (and (and (eq_attr "cpu" "cfv3")
25367 + (eq_attr "type" "jmp"))
25368 + (eq_attr "size" "3"))
25369 + "cf_ib3+cfv3_jmp")
25370 +
25371 +(define_insn_reservation "cfv12_unlk" 2
25372 + (and (eq_attr "cpu" "cfv1,cfv2")
25373 + (eq_attr "type" "unlk"))
25374 + "cf_ib1+cfv12_alu_10")
25375 +
25376 +(define_insn_reservation "cfv3_unlk" 3
25377 + (and (eq_attr "cpu" "cfv3")
25378 + (eq_attr "type" "unlk"))
25379 + "cf_ib1+cfv3_alu_10")
25380 +
25381 +;; Dummy reservation for instructions that are not handled.
25382 +(define_insn_reservation "cfv123_guess" 3
25383 + (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
25384 + (eq_attr "type" "falu,fbcc,fcmp,fdiv,fmove,fmul,fneg,fsqrt,ftst,
25385 + div_w,div_l,link,mvsz,nop,trap,unknown"))
25386 + "cf_ib3+cfv123_guess+cf_dsoc+cf_agex+cf_mem")
25387 +
25388 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25389 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25390 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25391 +
25392 +;; Below is pipeline description of ColdFire V4 core.
25393 +;; It is substantially different from the description of V1, V2 or V3 cores,
25394 +;; primarily due to no need to model the instruction buffer.
25395 +;;
25396 +;; V4 pipeline model uses a completely separate set of cpu units.
25397
25398 -(define_insn_reservation "cf_v2_pea_i1_2" 0
25399 - (and (and (and (eq_attr "cpu" "cf_v2")
25400 - (eq_attr "type2" "pea"))
25401 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
25402 - (eq_attr "op_mem" "i1"))
25403 - "cf_v2_ib2+cf_v2_pea_i1")
25404 +;; Operand Execution Pipeline.
25405 +(define_automaton "cfv4_oep")
25406
25407 -(define_insn_reservation "cf_v2_pea_i1_3" 0
25408 - (and (and (and (eq_attr "cpu" "cf_v2")
25409 - (eq_attr "type2" "pea"))
25410 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
25411 - (eq_attr "op_mem" "i1"))
25412 - "cf_v2_ib3+cf_v2_pea_i1")
25413 +(define_cpu_unit "cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex,cfv4_da"
25414 + "cfv4_oep")
25415
25416 -(define_insn_reservation "cf_v2_mul_00_1" 4
25417 - (and (and (and (eq_attr "cpu" "cf_v2")
25418 - (eq_attr "type2" "mul"))
25419 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
25420 +;; This automaton is used to support CFv4 dual-issue.
25421 +(define_automaton "cfv4_ds")
25422 +
25423 +;; V4 has 3 cases of dual-issue.
25424 +;; After issuing a cfv4_pOEPx instruction, it'll be possible to issue
25425 +;; a cfv4_sOEPx instruction on the same cycle (see final_presence_sets below).
25426 +(define_cpu_unit "cfv4_pOEP1,cfv4_sOEP1,
25427 + cfv4_pOEP2,cfv4_sOEP2,
25428 + cfv4_pOEP3,cfv4_sOEP3" "cfv4_ds")
25429 +
25430 +(final_presence_set "cfv4_sOEP1" "cfv4_pOEP1")
25431 +(final_presence_set "cfv4_sOEP2" "cfv4_pOEP2")
25432 +(final_presence_set "cfv4_sOEP3" "cfv4_pOEP3")
25433 +
25434 +;; Reservation for instructions that don't allow dual-issue.
25435 +(define_reservation "cfv4_ds" "cfv4_pOEP1+cfv4_sOEP1+
25436 + cfv4_pOEP2+cfv4_sOEP2+
25437 + cfv4_pOEP3+cfv4_sOEP3")
25438 +
25439 +;; Memory access resource.
25440 +(define_automaton "cfv4_mem")
25441 +
25442 +(define_cpu_unit "cfv4_mem" "cfv4_mem")
25443 +
25444 +;; EMAC.
25445 +(define_automaton "cfv4_emac")
25446 +
25447 +(define_cpu_unit "cfv4_emac" "cfv4_emac")
25448 +
25449 +;; FPU.
25450 +(define_automaton "cfv4_fp")
25451 +
25452 +(define_cpu_unit "cfv4_fp" "cfv4_fp")
25453 +
25454 +;; Automaton for unknown instruction.
25455 +(define_automaton "cfv4_guess")
25456 +
25457 +(define_query_cpu_unit "cfv4_guess" "cfv4_guess")
25458 +
25459 +;; This bypass allows 1st case of dual-issue.
25460 +(define_bypass 0 "cfv4_00_oag_pOEP1,cfv4_10_pOEP1,cfv4_i0_pOEP1"
25461 + "cfv4_00_oag,cfv4_00_oag_pOEP3_sOEP12,cfv4_00_oag_pOEP1,
25462 + cfv4_00_oag_moveql,cfv4_00_ex_sOEP13")
25463 +
25464 +;; The following bypasses decrease the latency of producers if it modifies
25465 +;; a target register in the EX stage and the consumer also uses
25466 +;; that register in the EX stage.
25467 +(define_bypass 1 "cfv4_00_ex" "cfv4_00_ex,cfv4_00_ex_sOEP13")
25468 +(define_bypass 1 "cfv4_00_ex" "cfv4_10,cfv4_10_pOEP1,cfv4_i0,cfv4_i0_pOEP1"
25469 + "!m68k_sched_address_bypass_p")
25470 +
25471 +;; Indexed loads with scale factors 2 and 4 require an update of the index
25472 +;; register in the register file. Considering that the index register is
25473 +;; only needed at the second cycle of address generation, we get
25474 +;; a latency of 4.
25475 +;; Producers for indexed loads with scale factor 1 should have
25476 +;; a latency of 3. Since we're only allowed one bypass, we handle it
25477 +;; in the adjust_cost hook.
25478 +(define_bypass 4
25479 + "cfv4_00_oag,cfv4_00_oag_pOEP3_sOEP12,cfv4_00_oag_lea,cfv4_00_oag_pOEP1,
25480 + cfv4_00_oag_moveql"
25481 + "cfv4_i0,cfv4_i0_pOEP1"
25482 + "m68k_sched_indexed_address_bypass_p")
25483 +
25484 +;; First part of cfv4_00.
25485 +;; If issued in pairs with cfv4_movel_?0, the cost should be increased.
25486 +;; ??? Is it possible that combined cfv4_movel_00 and cfv4_oag_00 instructions
25487 +;; have longer latency than the two instructions emitted sequentially?
25488 +;; Due to register renaming, the result of the sequence would be available
25489 +;; after 3 cycles, instead of 4 for combined instruction?
25490 +(define_insn_reservation "cfv4_00_oag" 1
25491 + (and (and (eq_attr "cpu" "cfv4")
25492 + (eq_attr "type" "alu_l,aluq_l,clr_l,cmp_l,mov3q_l,neg_l"))
25493 (eq_attr "op_mem" "00"))
25494 - "cf_v2_ib1+cf_v2_mul_00")
25495 + "cfv4_sOEP1|cfv4_sOEP3|(cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex)")
25496
25497 -(define_insn_reservation "cf_v2_mul_00_2" 4
25498 - (and (and (and (eq_attr "cpu" "cf_v2")
25499 - (eq_attr "type2" "mul"))
25500 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
25501 +(define_insn_reservation "cfv4_00_oag_pOEP3_sOEP12" 1
25502 + (and (and (eq_attr "cpu" "cfv4")
25503 + (eq_attr "type" "move_l,mov3q_l,clr_l"))
25504 + (and (eq_attr "op_mem" "00")
25505 + (and (eq_attr "opx_type" "Rn")
25506 + (eq_attr "opy_type" "none,imm_q,imm_w,imm_l"))))
25507 + "cfv4_sOEP1|cfv4_sOEP2|(cfv4_pOEP3,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex)")
25508 +
25509 +(define_insn_reservation "cfv4_00_oag_lea" 1
25510 + (and (eq_attr "cpu" "cfv4")
25511 + (eq_attr "type" "lea"))
25512 + "cfv4_pOEP3,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex")
25513 +
25514 +(define_insn_reservation "cfv4_00_oag_pOEP1" 1
25515 + (and (and (eq_attr "cpu" "cfv4")
25516 + (eq_attr "type" "move_l,mov3q_l,clr_l"))
25517 + (and (eq_attr "op_mem" "00")
25518 + (ior (eq_attr "opx_type" "!Rn")
25519 + (eq_attr "opy_type" "!none,imm_q,imm_w,imm_l"))))
25520 + "cfv4_sOEP1|(cfv4_pOEP1,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex)")
25521 +
25522 +(define_insn_reservation "cfv4_00_oag_moveql" 1
25523 + (and (and (eq_attr "cpu" "cfv4")
25524 + (eq_attr "type" "moveq_l"))
25525 (eq_attr "op_mem" "00"))
25526 - "cf_v2_ib2+cf_v2_mul_00")
25527 + "cfv4_sOEP1|cfv4_sOEP2|cfv4_sOEP3|(cfv4_pOEP3,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex)")
25528
25529 -(define_insn_reservation "cf_v2_mul_00_3" 4
25530 - (and (and (and (eq_attr "cpu" "cf_v2")
25531 - (eq_attr "type2" "mul"))
25532 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
25533 +;; Second part of cfv4_00.
25534 +;; Latency is either 1 or 4 depending on which stage the consumer
25535 +;; will need the data.
25536 +
25537 +(define_insn_reservation "cfv4_00_ex" 4
25538 + (and (and (eq_attr "cpu" "cfv4")
25539 + (eq_attr "type" "bitr,bitrw,clr,cmp,move,mvsz,scc,tst"))
25540 (eq_attr "op_mem" "00"))
25541 - "cf_v2_ib3+cf_v2_mul_00")
25542 + "cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex")
25543
25544 -(define_insn_reservation "cf_v2_mul_10_1" 6
25545 - (and (and (and (eq_attr "cpu" "cf_v2")
25546 - (eq_attr "type2" "mul"))
25547 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
25548 - (eq_attr "op_mem" "10"))
25549 - "cf_v2_ib1+cf_v2_mul_10")
25550 +(define_insn_reservation "cfv4_00_ex_sOEP13" 4
25551 + (and (and (eq_attr "cpu" "cfv4")
25552 + (eq_attr "type" "alux_l,ext,shift,tst_l"))
25553 + (eq_attr "op_mem" "00"))
25554 + "cfv4_sOEP1|cfv4_sOEP3|(cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex)")
25555
25556 -(define_insn_reservation "cf_v2_mul_10_2" 6
25557 - (and (and (and (eq_attr "cpu" "cf_v2")
25558 - (eq_attr "type2" "mul"))
25559 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
25560 +;; Several types mentioned in this reservation (e.g., ext and shift) don't
25561 +;; support implicit load. But we handle them anyway due to first scheduling
25562 +;; pass, which handles non-strict rtl.
25563 +;;
25564 +;; Latency is either 1 or 4 depending in which stage the consumer
25565 +;; will need the data.
25566 +(define_insn_reservation "cfv4_10" 4
25567 + (and (and (eq_attr "cpu" "cfv4")
25568 + (eq_attr "type" "alu_l,aluq_l,alux_l,bitr,bitrw,
25569 + clr,clr_l,cmp,cmp_l,ext,
25570 + mov3q_l,move,moveq_l,mvsz,neg_l,
25571 + shift,tst,tst_l"))
25572 (eq_attr "op_mem" "10"))
25573 - "cf_v2_ib2+cf_v2_mul_10")
25574 + "cfv4_ds,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex")
25575
25576 -(define_insn_reservation "cf_v2_mul_10_3" 6
25577 - (and (and (and (eq_attr "cpu" "cf_v2")
25578 - (eq_attr "type2" "mul"))
25579 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
25580 +;; Specialization of cfv4_10.
25581 +;; move.l has OC2-to-DS forwarding path, that saves one cycle of latency.
25582 +(define_insn_reservation "cfv4_10_pOEP1" 3
25583 + (and (and (eq_attr "cpu" "cfv4")
25584 + (eq_attr "type" "move_l"))
25585 (eq_attr "op_mem" "10"))
25586 - "cf_v2_ib3+cf_v2_mul_10")
25587 + "cfv4_pOEP1,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex")
25588
25589 -(define_insn_reservation "cf_v2_mul_i0_2" 7
25590 - (and (and (and (eq_attr "cpu" "cf_v2")
25591 - (eq_attr "type2" "mul"))
25592 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
25593 +;; Same here. But +1 to latency due to longer OAG.
25594 +(define_insn_reservation "cfv4_i0" 5
25595 + (and (and (eq_attr "cpu" "cfv4")
25596 + (eq_attr "type" "alu_l,aluq_l,alux_l,bitr,bitrw,
25597 + clr,clr_l,cmp,cmp_l,ext,
25598 + mov3q_l,move,moveq_l,mvsz,neg_l,
25599 + shift,tst,tst_l"))
25600 (eq_attr "op_mem" "i0"))
25601 - "cf_v2_ib2+cf_v2_mul_i0")
25602 + "cfv4_ds,cfv4_oag,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex")
25603
25604 -(define_insn_reservation "cf_v2_mul_i0_3" 7
25605 - (and (and (and (eq_attr "cpu" "cf_v2")
25606 - (eq_attr "type2" "mul"))
25607 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
25608 +;; ??? Does indexed load trigger dual-issue?
25609 +;; ??? Does OC2-to-DS forwarding path saves a cycle?
25610 +(define_insn_reservation "cfv4_i0_pOEP1" 4
25611 + (and (and (eq_attr "cpu" "cfv4")
25612 + (eq_attr "type" "move_l"))
25613 (eq_attr "op_mem" "i0"))
25614 - "cf_v2_ib3+cf_v2_mul_i0")
25615 + "cfv4_ds,cfv4_oag,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex")
25616
25617 -;; ??? As return reads target address from stack, use a mem-read reservation
25618 -;; for it.
25619 -(define_reservation "cf_v2_rts" "cf_v2_move_10")
25620 -
25621 -;; ??? It's not clear what the core does during these 5 cycles.
25622 -;; Luckily, we don't care that much about an insn that won't be moved.
25623 -(define_insn_reservation "cf_v2_rts_1" 5
25624 - (and (and (eq_attr "cpu" "cf_v2")
25625 - (eq_attr "type2" "rts"))
25626 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
25627 - "cf_v2_ib1+cf_v2_rts")
25628 +;; This reservation is for moves and clr. Arithmetic instructions
25629 +;; don't write to memory unless they also read from it.
25630 +;; But, before reload we can have all sorts of things.
25631 +;; With cfv4_pOEP2 allow dual-issue for type 2 cases.
25632 +(define_insn_reservation "cfv4_01" 1
25633 + (and (and (eq_attr "cpu" "cfv4")
25634 + (eq_attr "type" "alu_l,aluq_l,alux_l,bitr,bitrw,
25635 + clr,clr_l,cmp,cmp_l,ext,
25636 + mov3q_l,move,move_l,moveq_l,mvsz,neg_l,
25637 + shift"))
25638 + (eq_attr "op_mem" "01"))
25639 + "cfv4_pOEP2,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex,cfv4_da,cfv4_mem")
25640
25641 -;; Call instructions reservations.
25642 +;; ??? Does indexed store trigger dual-issue?
25643 +(define_insn_reservation "cfv4_0i" 2
25644 + (and (and (eq_attr "cpu" "cfv4")
25645 + (eq_attr "type" "alu_l,aluq_l,alux_l,bitr,bitrw,
25646 + clr,clr_l,cmp,cmp_l,ext,
25647 + mov3q_l,move,move_l,moveq_l,mvsz,neg_l,
25648 + shift"))
25649 + (eq_attr "op_mem" "0i"))
25650 + "cfv4_pOEP2,cfv4_oag,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex,cfv4_da,cfv4_mem")
25651
25652 -;; ??? It's not clear what reservation is best to use for calls.
25653 -;; For now we use mem-write + return reservations to reflect the fact of
25654 -;; pushing and poping return address to and from the stack.
25655 +(define_insn_reservation "cfv4_11" 1
25656 + (and (and (eq_attr "cpu" "cfv4")
25657 + (eq_attr "type" "alu_l,aluq_l,alux_l,bitr,bitrw,
25658 + clr,clr_l,cmp,cmp_l,ext,
25659 + mov3q_l,move,move_l,moveq_l,mvsz,neg_l,
25660 + shift"))
25661 + (eq_attr "op_mem" "11"))
25662 + "cfv4_ds,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex,cfv4_da,cfv4_mem")
25663
25664 -(define_insn_reservation "cf_v2_call_1" 3
25665 - (and (and (eq_attr "cpu" "cf_v2")
25666 - (eq_attr "type2" "call"))
25667 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
25668 - "cf_v2_ib1+cf_v2_move_10,cf_v2_rts")
25669 -
25670 -(define_insn_reservation "cf_v2_call_2" 3
25671 - (and (and (eq_attr "cpu" "cf_v2")
25672 - (eq_attr "type2" "call"))
25673 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
25674 - "cf_v2_ib2+cf_v2_move_10,cf_v2_rts")
25675 -
25676 -(define_insn_reservation "cf_v2_call_3" 3
25677 - (and (and (eq_attr "cpu" "cf_v2")
25678 - (eq_attr "type2" "call"))
25679 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
25680 - "cf_v2_ib3+cf_v2_move_10,cf_v2_rts")
25681 +;; Latency is 2 due to long OAG stage.
25682 +(define_insn_reservation "cfv4_i1" 2
25683 + (and (and (eq_attr "cpu" "cfv4")
25684 + (eq_attr "type" "alu_l,aluq_l,alux_l,bitr,bitrw,
25685 + clr,clr_l,cmp,cmp_l,ext,
25686 + mov3q_l,move,move_l,moveq_l,mvsz,neg_l,
25687 + shift"))
25688 + (eq_attr "op_mem" "i1"))
25689 + "cfv4_ds,cfv4_oag,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex,cfv4_da,cfv4_mem")
25690
25691 -;; Branch reservations.
25692 +;; This one is the same as cfv4_i1.
25693 +;; ??? Should it be different?
25694 +(define_insn_reservation "cfv4_1i" 2
25695 + (and (and (eq_attr "cpu" "cfv4")
25696 + (eq_attr "type" "alu_l,aluq_l,alux_l,bitr,bitrw,
25697 + clr,clr_l,cmp,cmp_l,ext,
25698 + mov3q_l,move,move_l,moveq_l,mvsz,neg_l,
25699 + shift"))
25700 + (eq_attr "op_mem" "1i"))
25701 + "cfv4_ds,cfv4_oag,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex,cfv4_da,cfv4_mem")
25702
25703 -;; ??? Branch reservations are unclear to me so far. Luckily, we don't care
25704 -;; ??? that much about branches.
25705 -(define_reservation "cf_v2_bcc" "cf_v2_move_00")
25706 +;; ??? Does pea indeed support case 2 of dual-issue?
25707 +(define_insn_reservation "cfv4_11_pea" 1
25708 + (and (and (eq_attr "cpu" "cfv4")
25709 + (eq_attr "type" "pea"))
25710 + (eq_attr "op_mem" "11,00,01,0i,10"))
25711 + "cfv4_pOEP2,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex,cfv4_da,cfv4_mem")
25712 +
25713 +;; ??? Does pea indeed support case 2 of dual-issue?
25714 +;; ??? Does indexed store trigger dual-issue?
25715 +(define_insn_reservation "cfv4_i1_pea" 1
25716 + (and (and (eq_attr "cpu" "cfv4")
25717 + (eq_attr "type" "pea"))
25718 + (eq_attr "op_mem" "i1,1i"))
25719 + "cfv4_pOEP2,cfv4_oag,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex,cfv4_da,cfv4_mem")
25720 +
25721 +(define_insn_reservation "cfv4_link" 2
25722 + (and (eq_attr "cpu" "cfv4")
25723 + (eq_attr "type" "link"))
25724 + "cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex,cfv4_ex,cfv4_da,cfv4_mem")
25725 +
25726 +(define_insn_reservation "cfv4_unlink" 2
25727 + (and (eq_attr "cpu" "cfv4")
25728 + (eq_attr "type" "unlk"))
25729 + "cfv4_ds,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex")
25730 +
25731 +(define_insn_reservation "cfv4_divw_00" 20
25732 + (and (and (eq_attr "cpu" "cfv4")
25733 + (eq_attr "type" "div_w"))
25734 + (eq_attr "op_mem" "00,01,0i"))
25735 + "cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex*15")
25736 +
25737 +(define_insn_reservation "cfv4_divw_10" 20
25738 + (and (and (eq_attr "cpu" "cfv4")
25739 + (eq_attr "type" "div_w"))
25740 + (eq_attr "op_mem" "10,11,1i"))
25741 + "cfv4_ds,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex*15")
25742 +
25743 +(define_insn_reservation "cfv4_divw_i0" 21
25744 + (and (and (eq_attr "cpu" "cfv4")
25745 + (eq_attr "type" "div_w"))
25746 + (eq_attr "op_mem" "i0,i1"))
25747 + "cfv4_ds,cfv4_oag,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex*15")
25748 +
25749 +(define_insn_reservation "cfv4_divl_00" 35
25750 + (and (and (eq_attr "cpu" "cfv4")
25751 + (eq_attr "type" "div_l"))
25752 + (eq_attr "op_mem" "00,01,0i"))
25753 + "cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex*30")
25754 +
25755 +(define_insn_reservation "cfv4_divl_10" 35
25756 + (and (and (eq_attr "cpu" "cfv4")
25757 + (eq_attr "type" "div_l"))
25758 + (eq_attr "op_mem" "10,11,1i,i0,i1"))
25759 + "cfv4_ds,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex*30")
25760 +
25761 +(define_insn_reservation "cfv4_emac_mul_00" 7
25762 + (and (and (eq_attr "cpu" "cfv4")
25763 + (eq_attr "type" "mul_w,mul_l"))
25764 + (eq_attr "op_mem" "00,01,0i"))
25765 + "cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex,cfv4_emac")
25766 +
25767 +(define_insn_reservation "cfv4_emac_mul_10" 7
25768 + (and (and (eq_attr "cpu" "cfv4")
25769 + (eq_attr "type" "mul_w,mul_l"))
25770 + (eq_attr "op_mem" "10,11,1i"))
25771 + "cfv4_ds,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex,cfv4_emac")
25772 +
25773 +(define_insn_reservation "cfv4_emac_mul_i0" 8
25774 + (and (and (eq_attr "cpu" "cfv4")
25775 + (eq_attr "type" "mul_w,mul_l"))
25776 + (eq_attr "op_mem" "i0,i1"))
25777 + "cfv4_ds,cfv4_oag,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex,cfv4_emac")
25778 +
25779 +(define_insn_reservation "cfv4_falu_00" 7
25780 + (and (and (eq_attr "cpu" "cfv4")
25781 + (eq_attr "type" "falu,fcmp,fmul"))
25782 + (eq_attr "op_mem" "00,01,0i"))
25783 + "cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex,cfv4_fp")
25784 +
25785 +(define_insn_reservation "cfv4_falu_10" 7
25786 + (and (and (eq_attr "cpu" "cfv4")
25787 + (eq_attr "type" "falu,fcmp,fmul"))
25788 + (eq_attr "op_mem" "10,i0,11,1i,i1"))
25789 + "cfv4_ds,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex,cfv4_fp")
25790 +
25791 +(define_insn_reservation "cfv4_fneg_00" 4
25792 + (and (and (eq_attr "cpu" "cfv4")
25793 + (eq_attr "type" "fmove,fneg,ftst"))
25794 + (eq_attr "op_mem" "00"))
25795 + "cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex,cfv4_fp")
25796
25797 -(define_insn_reservation "cf_v2_bcc_1" 2
25798 - (and (and (eq_attr "cpu" "cf_v2")
25799 - (eq_attr "type2" "bcc"))
25800 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
25801 - "cf_v2_ib1+cf_v2_bcc")
25802 -
25803 -(define_insn_reservation "cf_v2_bcc_2" 2
25804 - (and (and (eq_attr "cpu" "cf_v2")
25805 - (eq_attr "type2" "bcc"))
25806 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
25807 - "cf_v2_ib2+cf_v2_bcc")
25808 -
25809 -(define_insn_reservation "cf_v2_bcc_3" 2
25810 - (and (and (eq_attr "cpu" "cf_v2")
25811 - (eq_attr "type2" "bcc"))
25812 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
25813 - "cf_v2_ib3+cf_v2_bcc")
25814 -
25815 -(define_reservation "cf_v2_bra" "cf_v2_move_01")
25816 -
25817 -(define_insn_reservation "cf_v2_bra_1" 2
25818 - (and (and (eq_attr "cpu" "cf_v2")
25819 - (eq_attr "type2" "bra"))
25820 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
25821 - "cf_v2_ib1+cf_v2_bra")
25822 -
25823 -(define_insn_reservation "cf_v2_bra_2" 2
25824 - (and (and (eq_attr "cpu" "cf_v2")
25825 - (eq_attr "type2" "bra"))
25826 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
25827 - "cf_v2_ib2+cf_v2_bra")
25828 -
25829 -(define_insn_reservation "cf_v2_bra_3" 2
25830 - (and (and (eq_attr "cpu" "cf_v2")
25831 - (eq_attr "type2" "bra"))
25832 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
25833 - "cf_v2_ib3+cf_v2_bra")
25834 -
25835 -;; Computed jump.
25836 -;; Takes 3 cycles.
25837 -(define_reservation "cf_v2_jmp"
25838 - "cf_v2_dsoc,cf_v2_agex,cf_v2_dsoc,cf_v2_agex")
25839 -
25840 -(define_insn_reservation "cf_v2_jmp_1" 3
25841 - (and (and (eq_attr "cpu" "cf_v2")
25842 - (eq_attr "type2" "jmp"))
25843 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
25844 - "cf_v2_ib1+cf_v2_jmp")
25845 -
25846 -(define_insn_reservation "cf_v2_jmp_2" 3
25847 - (and (and (eq_attr "cpu" "cf_v2")
25848 - (eq_attr "type2" "jmp"))
25849 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
25850 - "cf_v2_ib2+cf_v2_jmp")
25851 -
25852 -(define_insn_reservation "cf_v2_jmp_3" 3
25853 - (and (and (eq_attr "cpu" "cf_v2")
25854 - (eq_attr "type2" "jmp"))
25855 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
25856 - "cf_v2_ib3+cf_v2_jmp")
25857 -
25858 -;; Misc reservations.
25859 -
25860 -(define_insn_reservation "cf_v2_unlk_1" 2
25861 - (and (and (eq_attr "cpu" "cf_v2")
25862 - (eq_attr "type2" "unlk"))
25863 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
25864 - "cf_v2_ib1+cf_v2_move_l_10")
25865 -
25866 -;; This automaton is used to gather statistics on insns that need reservations.
25867 -(define_automaton "cf_v2_guess")
25868 -
25869 -(define_query_cpu_unit "cf_v2_guess" "cf_v2_guess")
25870 -
25871 -;; Dummy reservation for instructions that are not handled yet.
25872 -
25873 -(define_insn_reservation "cf_v2_guess_1" 1
25874 - (and (and (eq_attr "cpu" "cf_v2")
25875 - (eq_attr "guess" "yes"))
25876 - (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
25877 - "cf_v2_ib1+cf_v2_guess+cf_v2_dsoc+cf_v2_agex")
25878 -
25879 -(define_insn_reservation "cf_v2_guess_2" 1
25880 - (and (and (eq_attr "cpu" "cf_v2")
25881 - (eq_attr "guess" "yes"))
25882 - (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
25883 - "cf_v2_ib2+cf_v2_guess+cf_v2_dsoc+cf_v2_agex")
25884 -
25885 -(define_insn_reservation "cf_v2_guess_3" 1
25886 - (and (and (eq_attr "cpu" "cf_v2")
25887 - (eq_attr "guess" "yes"))
25888 - (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
25889 - "cf_v2_ib3+cf_v2_guess+cf_v2_dsoc+cf_v2_agex")
25890 +(define_insn_reservation "cfv4_fmove_fneg_10" 4
25891 + (and (and (eq_attr "cpu" "cfv4")
25892 + (eq_attr "type" "fmove,fneg,ftst"))
25893 + (eq_attr "op_mem" "10,i0,11,1i,i1"))
25894 + "cfv4_ds,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex,cfv4_fp")
25895 +
25896 +(define_insn_reservation "cfv4_fmove_01" 1
25897 + (and (and (eq_attr "cpu" "cfv4")
25898 + (eq_attr "type" "fmove,fneg,ftst"))
25899 + (eq_attr "op_mem" "01,0i"))
25900 + "cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex,cfv4_fp,cfv4_da,cfv4_mem")
25901 +
25902 +(define_insn_reservation "cfv4_fdiv_00" 23
25903 + (and (and (eq_attr "cpu" "cfv4")
25904 + (eq_attr "type" "fdiv"))
25905 + (eq_attr "op_mem" "00,01,0i"))
25906 + "cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex,cfv4_fp*17")
25907 +
25908 +(define_insn_reservation "cfv4_fdiv_10" 23
25909 + (and (and (eq_attr "cpu" "cfv4")
25910 + (eq_attr "type" "fdiv"))
25911 + (eq_attr "op_mem" "10,i0,11,1i,i1"))
25912 + "cfv4_ds,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex,cfv4_fp*17")
25913 +
25914 +(define_insn_reservation "cfv4_fsqrt_00" 56
25915 + (and (and (eq_attr "cpu" "cfv4")
25916 + (eq_attr "type" "fsqrt"))
25917 + (eq_attr "op_mem" "00,01,0i"))
25918 + "cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex,cfv4_fp*50")
25919 +
25920 +(define_insn_reservation "cfv4_fsqrt_10" 56
25921 + (and (and (eq_attr "cpu" "cfv4")
25922 + (eq_attr "type" "fsqrt"))
25923 + (eq_attr "op_mem" "10,i0,11,1i,i1"))
25924 + "cfv4_ds,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex,cfv4_fp*50")
25925 +
25926 +(define_insn_reservation "cfv4_bcc" 0
25927 + (and (eq_attr "cpu" "cfv4")
25928 + (eq_attr "type" "bcc"))
25929 + "cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex")
25930 +
25931 +(define_insn_reservation "cfv4_fbcc" 2
25932 + (and (eq_attr "cpu" "cfv4")
25933 + (eq_attr "type" "fbcc"))
25934 + "cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex,cfv4_fp")
25935 +
25936 +;; ??? Why is bra said to write to memory: 1(0/1) ?
25937 +(define_insn_reservation "cfv4_bra_bsr" 1
25938 + (and (eq_attr "cpu" "cfv4")
25939 + (eq_attr "type" "bra,bsr"))
25940 + "cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex")
25941 +
25942 +(define_insn_reservation "cfv4_jmp_jsr" 5
25943 + (and (eq_attr "cpu" "cfv4")
25944 + (eq_attr "type" "jmp,jsr"))
25945 + "cfv4_ds,cfv4_oag,cfv4_oc1,cfv4_oc2,cfv4_ex")
25946 +
25947 +(define_insn_reservation "cfv4_rts" 2
25948 + (and (eq_attr "cpu" "cfv4")
25949 + (eq_attr "type" "rts"))
25950 + "cfv4_ds,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex")
25951 +
25952 +(define_insn_reservation "cfv4_nop" 1
25953 + (and (eq_attr "cpu" "cfv4")
25954 + (eq_attr "type" "nop"))
25955 + "cfv4_ds+cfv4_oag+cfv4_oc1+cfv4_mem+cfv4_oc2+cfv4_ex")
25956 +
25957 +(define_insn_reservation "cfv4_guess" 10
25958 + (and (eq_attr "cpu" "cfv4")
25959 + (eq_attr "type" "trap,unknown"))
25960 + "cfv4_guess+cfv4_ds,cfv4_oag,cfv4_oc1+cfv4_mem,cfv4_oc2,cfv4_ex,cfv4_emac+cfv4_fp")
25961 +
25962 +(define_insn_reservation "ignore" 0
25963 + (eq_attr "type" "ignore")
25964 + "nothing")
25965 --- a/gcc/config/m68k/constraints.md
25966 +++ b/gcc/config/m68k/constraints.md
25967 @@ -124,6 +124,11 @@
25968 (and (match_code "const_int")
25969 (match_test "ival < -0x8000 || ival > 0x7FFF")))
25970
25971 +(define_constraint "Cu"
25972 + "16-bit offset for wrapped symbols"
25973 + (and (match_code "const")
25974 + (match_test "m68k_unwrap_symbol (op, false) != op")))
25975 +
25976 (define_constraint "CQ"
25977 "Integers valid for mvq."
25978 (and (match_code "const_int")
25979 --- a/gcc/config/m68k/lb1sf68.asm
25980 +++ b/gcc/config/m68k/lb1sf68.asm
25981 @@ -129,10 +129,48 @@ Boston, MA 02110-1301, USA. */
25982
25983 #else /* __PIC__ */
25984
25985 - /* Common for -mid-shared-libary and -msep-data */
25986 +# if defined (__uClinux__)
25987 +
25988 + /* Versions for uClinux */
25989 +
25990 +# if defined(__ID_SHARED_LIBRARY__)
25991 +
25992 + /* -mid-shared-library versions */
25993 +
25994 + .macro PICLEA sym, reg
25995 + movel a5@(_current_shared_library_a5_offset_), \reg
25996 + movel \sym@GOT(\reg), \reg
25997 + .endm
25998 +
25999 + .macro PICPEA sym, areg
26000 + movel a5@(_current_shared_library_a5_offset_), \areg
26001 + movel \sym@GOT(\areg), sp@-
26002 + .endm
26003
26004 .macro PICCALL addr
26005 -#if defined (__mcoldfire__) && !defined (__mcfisab__)
26006 + PICLEA \addr,a0
26007 + jsr a0@
26008 + .endm
26009 +
26010 + .macro PICJUMP addr
26011 + PICLEA \addr,a0
26012 + jmp a0@
26013 + .endm
26014 +
26015 +# else /* !__ID_SHARED_LIBRARY__ */
26016 +
26017 + /* Versions for -msep-data */
26018 +
26019 + .macro PICLEA sym, reg
26020 + movel \sym@GOT(a5), \reg
26021 + .endm
26022 +
26023 + .macro PICPEA sym, areg
26024 + movel \sym@GOT(a5), sp@-
26025 + .endm
26026 +
26027 + .macro PICCALL addr
26028 +#if defined (__mcoldfire__) && !defined (__mcfisab__) && !defined (__mcfisac__)
26029 lea \addr-.-8,a0
26030 jsr pc@(a0)
26031 #else
26032 @@ -141,6 +179,9 @@ Boston, MA 02110-1301, USA. */
26033 .endm
26034
26035 .macro PICJUMP addr
26036 + /* ISA C has no bra.l instruction, and since this assembly file
26037 + gets assembled into multiple object files, we avoid the
26038 + bra instruction entirely. */
26039 #if defined (__mcoldfire__) && !defined (__mcfisab__)
26040 lea \addr-.-8,a0
26041 jmp pc@(a0)
26042 @@ -149,33 +190,46 @@ Boston, MA 02110-1301, USA. */
26043 #endif
26044 .endm
26045
26046 -# if defined(__ID_SHARED_LIBRARY__)
26047 +# endif
26048
26049 - /* -mid-shared-library versions */
26050 +# else /* !__uClinux__ */
26051 +
26052 + /* Versions for Linux */
26053
26054 .macro PICLEA sym, reg
26055 - movel a5@(_current_shared_library_a5_offset_), \reg
26056 + movel #_GLOBAL_OFFSET_TABLE_@GOTPC, \reg
26057 + lea (-6, pc, \reg), \reg
26058 movel \sym@GOT(\reg), \reg
26059 .endm
26060
26061 .macro PICPEA sym, areg
26062 - movel a5@(_current_shared_library_a5_offset_), \areg
26063 + movel #_GLOBAL_OFFSET_TABLE_@GOTPC, \areg
26064 + lea (-6, pc, \areg), \areg
26065 movel \sym@GOT(\areg), sp@-
26066 .endm
26067
26068 -# else /* !__ID_SHARED_LIBRARY__ */
26069 -
26070 - /* Versions for -msep-data */
26071 -
26072 - .macro PICLEA sym, reg
26073 - movel \sym@GOT(a5), \reg
26074 + .macro PICCALL addr
26075 +#if defined (__mcoldfire__) && !defined (__mcfisab__) && !defined (__mcfisac__)
26076 + lea \addr-.-8,a0
26077 + jsr pc@(a0)
26078 +#else
26079 + bsr \addr
26080 +#endif
26081 .endm
26082
26083 - .macro PICPEA sym, areg
26084 - movel \sym@GOT(a5), sp@-
26085 + .macro PICJUMP addr
26086 + /* ISA C has no bra.l instruction, and since this assembly file
26087 + gets assembled into multiple object files, we avoid the
26088 + bra instruction entirely. */
26089 +#if defined (__mcoldfire__) && !defined (__mcfisab__)
26090 + lea \addr-.-8,a0
26091 + jmp pc@(a0)
26092 +#else
26093 + bra \addr
26094 +#endif
26095 .endm
26096
26097 -# endif /* !__ID_SHARED_LIBRARY__ */
26098 +# endif
26099 #endif /* __PIC__ */
26100
26101
26102 @@ -622,6 +676,7 @@ ROUND_TO_MINUS = 3 | round result tow
26103 .globl SYM (__negdf2)
26104 .globl SYM (__cmpdf2)
26105 .globl SYM (__cmpdf2_internal)
26106 + .hidden SYM (__cmpdf2_internal)
26107
26108 .text
26109 .even
26110 @@ -2384,7 +2439,7 @@ SYM (__cmpdf2):
26111 movl a6@(16),sp@-
26112 movl a6@(12),sp@-
26113 movl a6@(8),sp@-
26114 - bsr SYM (__cmpdf2_internal)
26115 + PICCALL SYM (__cmpdf2_internal)
26116 unlk a6
26117 rts
26118
26119 @@ -2536,6 +2591,7 @@ ROUND_TO_MINUS = 3 | round result tow
26120 .globl SYM (__negsf2)
26121 .globl SYM (__cmpsf2)
26122 .globl SYM (__cmpsf2_internal)
26123 + .hidden SYM (__cmpsf2_internal)
26124
26125 | These are common routines to return and signal exceptions.
26126
26127 @@ -3790,7 +3846,7 @@ SYM (__cmpsf2):
26128 pea 1
26129 movl a6@(12),sp@-
26130 movl a6@(8),sp@-
26131 - bsr (__cmpsf2_internal)
26132 + PICCALL SYM (__cmpsf2_internal)
26133 unlk a6
26134 rts
26135
26136 @@ -4063,3 +4119,8 @@ SYM (__lesf2):
26137 unlk a6
26138 rts
26139 #endif /* L_lesf2 */
26140 +
26141 +#if defined (__ELF__) && defined (__linux__)
26142 + /* Make stack non-executable for ELF linux targets. */
26143 + .section .note.GNU-stack,"",@progbits
26144 +#endif
26145 --- a/gcc/config/m68k/m68k-devices.def
26146 +++ b/gcc/config/m68k/m68k-devices.def
26147 @@ -63,13 +63,17 @@
26148
26149 There is a bit of duplication between devices in the same family,
26150 but this approach makes scripting easier. We keep each entry on
26151 - a single line for the same reason. */
26152 + a single line for the same reason.
26153 +
26154 + As the compiler does not (currently) generate MAC or EMAC commands,
26155 + we do not need separate multilibs for cores that only differ in
26156 + their MAC functionality. */
26157
26158 /* 680x0 series processors. */
26159 M68K_DEVICE ("68000", m68000, "68000", "68000", 68000, isa_00, 0)
26160 M68K_DEVICE ("68010", m68010, "68010", "68000", 68010, isa_10, 0)
26161 -M68K_DEVICE ("68020", m68020, "68020", "68020", 68020, isa_20, FL_MMU)
26162 -M68K_DEVICE ("68030", m68030, "68030", "68020", 68030, isa_20, FL_MMU)
26163 +M68K_DEVICE ("68020", m68020, "68020", "68020", 68020, isa_20, FL_MMU | FL_UCLINUX)
26164 +M68K_DEVICE ("68030", m68030, "68030", "68020", 68030, isa_20, FL_MMU | FL_UCLINUX)
26165 M68K_DEVICE ("68040", m68040, "68040", "68040", 68040, isa_40, FL_MMU)
26166 M68K_DEVICE ("68060", m68060, "68060", "68060", 68060, isa_40, FL_MMU)
26167 M68K_DEVICE ("68302", m68302, "68302", "68000", 68000, isa_00, FL_MMU)
26168 @@ -77,7 +81,13 @@ M68K_DEVICE ("68332", m68332, "68332",
26169 M68K_DEVICE ("cpu32", cpu32, "cpu32", "cpu32", cpu32, isa_cpu32, FL_MMU)
26170
26171 /* ColdFire CFV1 processor. */
26172 -M68K_DEVICE ("51qe", mcf51qe, "51qe", "51qe", cfv1, isa_c, FL_CF_USP)
26173 +/* For historical reasons, the 51 multilib is named 51qe. */
26174 +M68K_DEVICE ("51", mcf51, "51", "51qe", cfv1, isa_c, FL_CF_USP)
26175 +M68K_DEVICE ("51ac", mcf51ac, "51", "51qe", cfv1, isa_c, FL_CF_USP)
26176 +M68K_DEVICE ("51cn", mcf51cn, "51", "51qe", cfv1, isa_c, FL_CF_USP)
26177 +M68K_DEVICE ("51em", mcf51em, "51", "51qe", cfv1, isa_c, FL_CF_USP | FL_CF_MAC)
26178 +M68K_DEVICE ("51jm", mcf51jm, "51", "51qe", cfv1, isa_c, FL_CF_USP)
26179 +M68K_DEVICE ("51qe", mcf51qe, "51", "51qe", cfv1, isa_c, FL_CF_USP)
26180
26181 /* ColdFire CFV2 processors. */
26182 M68K_DEVICE ("5202", mcf5202, "5206", "5206", cfv2, isa_a, 0)
26183 @@ -86,31 +96,39 @@ M68K_DEVICE ("5206", mcf5206, "5206",
26184 M68K_DEVICE ("5206e", mcf5206e, "5206e", "5206e", cfv2, isa_a, FL_CF_HWDIV | FL_CF_MAC)
26185 M68K_DEVICE ("5207", mcf5207, "5208", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26186 M68K_DEVICE ("5208", mcf5208, "5208", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26187 -M68K_DEVICE ("5210a", mcf5210a, "5211a", "5213", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26188 -M68K_DEVICE ("5211a", mcf5211a, "5211a", "5213", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26189 -M68K_DEVICE ("5211", mcf5211, "5213", "5213", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26190 -M68K_DEVICE ("5212", mcf5212, "5213", "5213", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26191 -M68K_DEVICE ("5213", mcf5213, "5213", "5213", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26192 +M68K_DEVICE ("5210a", mcf5210a, "5211a", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26193 +M68K_DEVICE ("5211a", mcf5211a, "5211a", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26194 +M68K_DEVICE ("5211", mcf5211, "5213", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26195 +M68K_DEVICE ("5212", mcf5212, "5213", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26196 +M68K_DEVICE ("5213", mcf5213, "5213", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26197 M68K_DEVICE ("5214", mcf5214, "5216", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26198 M68K_DEVICE ("5216", mcf5216, "5216", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26199 -M68K_DEVICE ("52221", mcf52221, "52223", "5213", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26200 -M68K_DEVICE ("52223", mcf52223, "52223", "5213", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26201 +M68K_DEVICE ("52221", mcf52221, "52223", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26202 +M68K_DEVICE ("52223", mcf52223, "52223", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26203 M68K_DEVICE ("52230", mcf52230, "52235", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26204 M68K_DEVICE ("52231", mcf52231, "52235", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26205 M68K_DEVICE ("52232", mcf52232, "52235", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26206 M68K_DEVICE ("52233", mcf52233, "52235", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26207 M68K_DEVICE ("52234", mcf52234, "52235", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26208 M68K_DEVICE ("52235", mcf52235, "52235", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26209 -M68K_DEVICE ("5224", mcf5224, "5225", "5213", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26210 -M68K_DEVICE ("5225", mcf5225, "5225", "5213", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26211 +M68K_DEVICE ("5224", mcf5224, "5225", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26212 +M68K_DEVICE ("5225", mcf5225, "5225", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_MAC)
26213 +M68K_DEVICE ("52252", mcf52252, "52259", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26214 +M68K_DEVICE ("52254", mcf52254, "52259", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26215 +M68K_DEVICE ("52255", mcf52255, "52259", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26216 +M68K_DEVICE ("52256", mcf52256, "52259", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26217 +M68K_DEVICE ("52258", mcf52258, "52259", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26218 +M68K_DEVICE ("52259", mcf52259, "52259", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26219 +M68K_DEVICE ("52274", mcf52274, "52277", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26220 +M68K_DEVICE ("52277", mcf52277, "52277", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26221 M68K_DEVICE ("5232", mcf5232, "5235", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26222 M68K_DEVICE ("5233", mcf5233, "5235", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26223 M68K_DEVICE ("5234", mcf5234, "5235", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26224 M68K_DEVICE ("5235", mcf5235, "5235", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26225 M68K_DEVICE ("523x", mcf523x, "5235", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26226 -M68K_DEVICE ("5249", mcf5249, "5249", "5249", cfv2, isa_a, FL_CF_HWDIV | FL_CF_EMAC)
26227 -M68K_DEVICE ("5250", mcf5250, "5250", "5249", cfv2, isa_a, FL_CF_HWDIV | FL_CF_EMAC)
26228 -M68K_DEVICE ("5253", mcf5253, "5253", "5249", cfv2, isa_a, FL_CF_HWDIV | FL_CF_EMAC)
26229 +M68K_DEVICE ("5249", mcf5249, "5249", "5206e", cfv2, isa_a, FL_CF_HWDIV | FL_CF_EMAC)
26230 +M68K_DEVICE ("5250", mcf5250, "5250", "5206e", cfv2, isa_a, FL_CF_HWDIV | FL_CF_EMAC)
26231 +M68K_DEVICE ("5253", mcf5253, "5253", "5206e", cfv2, isa_a, FL_CF_HWDIV | FL_CF_EMAC)
26232 M68K_DEVICE ("5270", mcf5270, "5271", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26233 M68K_DEVICE ("5271", mcf5271, "5271", "5208", cfv2, isa_aplus, FL_CF_HWDIV)
26234 M68K_DEVICE ("5272", mcf5272, "5272", "5206e", cfv2, isa_a, FL_CF_HWDIV | FL_CF_MAC)
26235 @@ -122,6 +140,13 @@ M68K_DEVICE ("5282", mcf5282, "5282",
26236 M68K_DEVICE ("528x", mcf528x, "5282", "5208", cfv2, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26237
26238 /* CFV3 processors. */
26239 +M68K_DEVICE ("53011", mcf53011, "53017", "5329", cfv3, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26240 +M68K_DEVICE ("53012", mcf53012, "53017", "5329", cfv3, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26241 +M68K_DEVICE ("53013", mcf53013, "53017", "5329", cfv3, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26242 +M68K_DEVICE ("53014", mcf53014, "53017", "5329", cfv3, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26243 +M68K_DEVICE ("53015", mcf53015, "53017", "5329", cfv3, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26244 +M68K_DEVICE ("53016", mcf53016, "53017", "5329", cfv3, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26245 +M68K_DEVICE ("53017", mcf53017, "53017", "5329", cfv3, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26246 M68K_DEVICE ("5307", mcf5307, "5307", "5307", cfv3, isa_a, FL_CF_HWDIV | FL_CF_MAC)
26247 M68K_DEVICE ("5327", mcf5327, "5329", "5329", cfv3, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26248 M68K_DEVICE ("5328", mcf5328, "5329", "5329", cfv3, isa_aplus, FL_CF_HWDIV | FL_CF_EMAC)
26249 @@ -133,12 +158,12 @@ M68K_DEVICE ("537x", mcf537x, "5373",
26250
26251 /* CFV4/CFV4e processors. */
26252 M68K_DEVICE ("5407", mcf5407, "5407", "5407", cfv4, isa_b, FL_CF_MAC)
26253 -M68K_DEVICE ("54450", mcf54450, "54455", "54455", cfv4, isa_c, FL_CF_HWDIV | FL_CF_USP | FL_CF_EMAC | FL_MMU)
26254 -M68K_DEVICE ("54451", mcf54451, "54455", "54455", cfv4, isa_c, FL_CF_HWDIV | FL_CF_USP | FL_CF_EMAC | FL_MMU)
26255 -M68K_DEVICE ("54452", mcf54452, "54455", "54455", cfv4, isa_c, FL_CF_HWDIV | FL_CF_USP | FL_CF_EMAC | FL_MMU)
26256 -M68K_DEVICE ("54453", mcf54453, "54455", "54455", cfv4, isa_c, FL_CF_HWDIV | FL_CF_USP | FL_CF_EMAC | FL_MMU)
26257 -M68K_DEVICE ("54454", mcf54454, "54455", "54455", cfv4, isa_c, FL_CF_HWDIV | FL_CF_USP | FL_CF_EMAC | FL_MMU)
26258 -M68K_DEVICE ("54455", mcf54455, "54455", "54455", cfv4, isa_c, FL_CF_HWDIV | FL_CF_USP | FL_CF_EMAC | FL_MMU)
26259 +M68K_DEVICE ("54450", mcf54450, "54455", "54455", cfv4, isa_c, FL_CF_HWDIV | FL_CF_USP | FL_CF_EMAC | FL_MMU | FL_UCLINUX)
26260 +M68K_DEVICE ("54451", mcf54451, "54455", "54455", cfv4, isa_c, FL_CF_HWDIV | FL_CF_USP | FL_CF_EMAC | FL_MMU | FL_UCLINUX)
26261 +M68K_DEVICE ("54452", mcf54452, "54455", "54455", cfv4, isa_c, FL_CF_HWDIV | FL_CF_USP | FL_CF_EMAC | FL_MMU | FL_UCLINUX)
26262 +M68K_DEVICE ("54453", mcf54453, "54455", "54455", cfv4, isa_c, FL_CF_HWDIV | FL_CF_USP | FL_CF_EMAC | FL_MMU | FL_UCLINUX)
26263 +M68K_DEVICE ("54454", mcf54454, "54455", "54455", cfv4, isa_c, FL_CF_HWDIV | FL_CF_USP | FL_CF_EMAC | FL_MMU | FL_UCLINUX)
26264 +M68K_DEVICE ("54455", mcf54455, "54455", "54455", cfv4, isa_c, FL_CF_HWDIV | FL_CF_USP | FL_CF_EMAC | FL_MMU | FL_UCLINUX)
26265 M68K_DEVICE ("5470", mcf5470, "5475", "5475", cfv4e, isa_b, FL_CF_USP | FL_CF_EMAC | FL_CF_FPU | FL_MMU)
26266 M68K_DEVICE ("5471", mcf5471, "5475", "5475", cfv4e, isa_b, FL_CF_USP | FL_CF_EMAC | FL_CF_FPU | FL_MMU)
26267 M68K_DEVICE ("5472", mcf5472, "5475", "5475", cfv4e, isa_b, FL_CF_USP | FL_CF_EMAC | FL_CF_FPU | FL_MMU)
26268 --- a/gcc/config/m68k/m68k-protos.h
26269 +++ b/gcc/config/m68k/m68k-protos.h
26270 @@ -50,14 +50,19 @@ extern bool strict_low_part_peephole_ok
26271 extern int standard_68881_constant_p (rtx);
26272 extern void print_operand_address (FILE *, rtx);
26273 extern void print_operand (FILE *, rtx, int);
26274 +extern bool m68k_output_addr_const_extra (FILE *, rtx);
26275 extern void notice_update_cc (rtx, rtx);
26276 extern bool m68k_legitimate_base_reg_p (rtx, bool);
26277 -extern bool m68k_legitimate_index_reg_p (rtx, bool);
26278 +extern bool m68k_legitimate_index_reg_p (enum machine_mode, rtx, bool);
26279 extern bool m68k_illegitimate_symbolic_constant_p (rtx);
26280 extern bool m68k_legitimate_address_p (enum machine_mode, rtx, bool);
26281 extern bool m68k_matches_q_p (rtx);
26282 extern bool m68k_matches_u_p (rtx);
26283 extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
26284 +extern rtx m68k_legitimize_tls_address (rtx);
26285 +extern bool m68k_tls_referenced_p (rtx);
26286 +extern bool m68k_tls_mentioned_p (rtx);
26287 +extern rtx m68k_legitimize_address (rtx, rtx, enum machine_mode);
26288 extern int valid_dbcc_comparison_p_2 (rtx, enum machine_mode);
26289 extern rtx m68k_libcall_value (enum machine_mode);
26290 extern rtx m68k_function_value (const_tree, const_tree);
26291 @@ -65,15 +70,19 @@ extern int emit_move_sequence (rtx *, en
26292 extern bool m68k_movem_pattern_p (rtx, rtx, HOST_WIDE_INT, bool);
26293 extern const char *m68k_output_movem (rtx *, rtx, HOST_WIDE_INT, bool);
26294
26295 +/* Functions from m68k.c used in constraints.md. */
26296 +extern rtx m68k_unwrap_symbol (rtx, bool);
26297 +
26298 +/* Functions from m68k.c used in genattrtab. */
26299 #ifdef HAVE_ATTR_cpu
26300 extern enum attr_cpu m68k_sched_cpu;
26301 +extern enum attr_mac m68k_sched_mac;
26302
26303 extern enum attr_opx_type m68k_sched_attr_opx_type (rtx, int);
26304 extern enum attr_opy_type m68k_sched_attr_opy_type (rtx, int);
26305 -extern int m68k_sched_attr_size (rtx);
26306 +extern enum attr_size m68k_sched_attr_size (rtx);
26307 extern enum attr_op_mem m68k_sched_attr_op_mem (rtx);
26308 extern enum attr_type m68k_sched_branch_type (rtx);
26309 -extern enum attr_type2 m68k_sched_attr_type2 (rtx);
26310 #endif /* HAVE_ATTR_cpu */
26311
26312 #endif /* RTX_CODE */
26313 --- a/gcc/config/m68k/m68k.c
26314 +++ b/gcc/config/m68k/m68k.c
26315 @@ -46,6 +46,7 @@ along with GCC; see the file COPYING3.
26316 /* ??? Need to add a dependency between m68k.o and sched-int.h. */
26317 #include "sched-int.h"
26318 #include "insn-codes.h"
26319 +#include "ggc.h"
26320
26321 enum reg_class regno_reg_class[] =
26322 {
26323 @@ -122,12 +123,14 @@ struct m68k_address {
26324 };
26325
26326 static int m68k_sched_adjust_cost (rtx, rtx, rtx, int);
26327 +static int m68k_sched_issue_rate (void);
26328 static int m68k_sched_variable_issue (FILE *, int, rtx, int);
26329 static void m68k_sched_md_init_global (FILE *, int, int);
26330 static void m68k_sched_md_finish_global (FILE *, int);
26331 static void m68k_sched_md_init (FILE *, int, int);
26332 static void m68k_sched_dfa_pre_advance_cycle (void);
26333 static void m68k_sched_dfa_post_advance_cycle (void);
26334 +static int m68k_sched_first_cycle_multipass_dfa_lookahead (void);
26335
26336 static bool m68k_handle_option (size_t, const char *, int);
26337 static rtx find_addr_reg (rtx);
26338 @@ -146,8 +149,9 @@ static bool m68k_save_reg (unsigned int
26339 static bool m68k_ok_for_sibcall_p (tree, tree);
26340 static bool m68k_rtx_costs (rtx, int, int, int *);
26341 #if M68K_HONOR_TARGET_STRICT_ALIGNMENT
26342 -static bool m68k_return_in_memory (tree, tree);
26343 +static bool m68k_return_in_memory (const_tree, const_tree);
26344 #endif
26345 +static void m68k_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED;
26346 \f
26347
26348 /* Specify the identification number of the library being built */
26349 @@ -199,6 +203,9 @@ int m68k_last_compare_had_fp_operands;
26350 #undef TARGET_SCHED_ADJUST_COST
26351 #define TARGET_SCHED_ADJUST_COST m68k_sched_adjust_cost
26352
26353 +#undef TARGET_SCHED_ISSUE_RATE
26354 +#define TARGET_SCHED_ISSUE_RATE m68k_sched_issue_rate
26355 +
26356 #undef TARGET_SCHED_VARIABLE_ISSUE
26357 #define TARGET_SCHED_VARIABLE_ISSUE m68k_sched_variable_issue
26358
26359 @@ -217,6 +224,10 @@ int m68k_last_compare_had_fp_operands;
26360 #undef TARGET_SCHED_DFA_POST_ADVANCE_CYCLE
26361 #define TARGET_SCHED_DFA_POST_ADVANCE_CYCLE m68k_sched_dfa_post_advance_cycle
26362
26363 +#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
26364 +#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD \
26365 + m68k_sched_first_cycle_multipass_dfa_lookahead
26366 +
26367 #undef TARGET_HANDLE_OPTION
26368 #define TARGET_HANDLE_OPTION m68k_handle_option
26369
26370 @@ -243,6 +254,14 @@ int m68k_last_compare_had_fp_operands;
26371 #define TARGET_RETURN_IN_MEMORY m68k_return_in_memory
26372 #endif
26373
26374 +#ifdef HAVE_AS_TLS
26375 +#undef TARGET_HAVE_TLS
26376 +#define TARGET_HAVE_TLS (true)
26377 +
26378 +#undef TARGET_ASM_OUTPUT_DWARF_DTPREL
26379 +#define TARGET_ASM_OUTPUT_DWARF_DTPREL m68k_output_dwarf_dtprel
26380 +#endif
26381 +
26382 static const struct attribute_spec m68k_attribute_table[] =
26383 {
26384 /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
26385 @@ -382,6 +401,9 @@ enum fpu_type m68k_fpu;
26386 /* The set of FL_* flags that apply to the target processor. */
26387 unsigned int m68k_cpu_flags;
26388
26389 +/* The set of FL_* flags that apply to the processor to be tuned for. */
26390 +unsigned int m68k_tune_flags;
26391 +
26392 /* Asm templates for calling or jumping to an arbitrary symbolic address,
26393 or NULL if such calls or jumps are not supported. The address is held
26394 in operand 0. */
26395 @@ -562,13 +584,23 @@ override_options (void)
26396 /* Set the directly-usable versions of the -mcpu and -mtune settings. */
26397 m68k_cpu = entry->device;
26398 if (m68k_tune_entry)
26399 - m68k_tune = m68k_tune_entry->microarch;
26400 + {
26401 + m68k_tune = m68k_tune_entry->microarch;
26402 + m68k_tune_flags = m68k_tune_entry->flags;
26403 + }
26404 #ifdef M68K_DEFAULT_TUNE
26405 else if (!m68k_cpu_entry && !m68k_arch_entry)
26406 - m68k_tune = M68K_DEFAULT_TUNE;
26407 + {
26408 + enum target_device dev;
26409 + dev = all_microarchs[M68K_DEFAULT_TUNE].device;
26410 + m68k_tune_flags = all_devices[dev]->flags;
26411 + }
26412 #endif
26413 else
26414 - m68k_tune = entry->microarch;
26415 + {
26416 + m68k_tune = entry->microarch;
26417 + m68k_tune_flags = entry->flags;
26418 + }
26419
26420 /* Set the type of FPU. */
26421 m68k_fpu = (!TARGET_HARD_FLOAT ? FPUTYPE_NONE
26422 @@ -666,8 +698,14 @@ override_options (void)
26423 SUBTARGET_OVERRIDE_OPTIONS;
26424
26425 /* Setup scheduling options. */
26426 - if (TUNE_CFV2)
26427 - m68k_sched_cpu = CPU_CF_V2;
26428 + if (TUNE_CFV1)
26429 + m68k_sched_cpu = CPU_CFV1;
26430 + else if (TUNE_CFV2)
26431 + m68k_sched_cpu = CPU_CFV2;
26432 + else if (TUNE_CFV3)
26433 + m68k_sched_cpu = CPU_CFV3;
26434 + else if (TUNE_CFV4)
26435 + m68k_sched_cpu = CPU_CFV4;
26436 else
26437 {
26438 m68k_sched_cpu = CPU_UNKNOWN;
26439 @@ -675,6 +713,16 @@ override_options (void)
26440 flag_schedule_insns_after_reload = 0;
26441 flag_modulo_sched = 0;
26442 }
26443 +
26444 + if (m68k_sched_cpu != CPU_UNKNOWN)
26445 + {
26446 + if ((m68k_cpu_flags & (FL_CF_EMAC | FL_CF_EMAC_B)) != 0)
26447 + m68k_sched_mac = MAC_CF_EMAC;
26448 + else if ((m68k_cpu_flags & FL_CF_MAC) != 0)
26449 + m68k_sched_mac = MAC_CF_MAC;
26450 + else
26451 + m68k_sched_mac = MAC_NO;
26452 + }
26453 }
26454
26455 /* Generate a macro of the form __mPREFIX_cpu_NAME, where PREFIX is the
26456 @@ -1023,6 +1071,11 @@ m68k_expand_prologue (void)
26457 stack_pointer_rtx,
26458 GEN_INT (-fsize_with_regs))));
26459 }
26460 +
26461 + /* If the frame pointer is needed, emit a special barrier that
26462 + will prevent the scheduler from moving stores to the frame
26463 + before the stack adjustment. */
26464 + emit_insn (gen_stack_tie (stack_pointer_rtx, frame_pointer_rtx));
26465 }
26466 else if (fsize_with_regs != 0)
26467 m68k_set_frame_related
26468 @@ -1103,8 +1156,7 @@ m68k_expand_prologue (void)
26469 current_frame.reg_mask, true, true));
26470 }
26471
26472 - if (flag_pic
26473 - && !TARGET_SEP_DATA
26474 + if (!TARGET_SEP_DATA
26475 && current_function_uses_pic_offset_table)
26476 insn = emit_insn (gen_load_got (pic_offset_table_rtx));
26477 }
26478 @@ -1666,15 +1718,16 @@ m68k_legitimate_base_reg_p (rtx x, bool
26479 whether we need strict checking. */
26480
26481 bool
26482 -m68k_legitimate_index_reg_p (rtx x, bool strict_p)
26483 +m68k_legitimate_index_reg_p (enum machine_mode mode, rtx x, bool strict_p)
26484 {
26485 if (!strict_p && GET_CODE (x) == SUBREG)
26486 x = SUBREG_REG (x);
26487
26488 return (REG_P (x)
26489 && (strict_p
26490 - ? REGNO_OK_FOR_INDEX_P (REGNO (x))
26491 - : REGNO_OK_FOR_INDEX_NONSTRICT_P (REGNO (x))));
26492 + ? REGNO_MODE_OK_FOR_INDEX_P (REGNO (x), mode)
26493 + : (MODE_OK_FOR_INDEX_P (mode)
26494 + && REGNO_OK_FOR_INDEX_NONSTRICT_P (REGNO (x)))));
26495 }
26496
26497 /* Return true if X is a legitimate index expression for a (d8,An,Xn) or
26498 @@ -1682,7 +1735,8 @@ m68k_legitimate_index_reg_p (rtx x, bool
26499 ADDRESS if so. STRICT_P says whether we need strict checking. */
26500
26501 static bool
26502 -m68k_decompose_index (rtx x, bool strict_p, struct m68k_address *address)
26503 +m68k_decompose_index (enum machine_mode mode, rtx x, bool strict_p,
26504 + struct m68k_address *address)
26505 {
26506 int scale;
26507
26508 @@ -1706,7 +1760,7 @@ m68k_decompose_index (rtx x, bool strict
26509 && GET_MODE (XEXP (x, 0)) == HImode)
26510 x = XEXP (x, 0);
26511
26512 - if (m68k_legitimate_index_reg_p (x, strict_p))
26513 + if (m68k_legitimate_index_reg_p (mode, x, strict_p))
26514 {
26515 address->scale = scale;
26516 address->index = x;
26517 @@ -1730,7 +1784,7 @@ m68k_illegitimate_symbolic_constant_p (r
26518 && !offset_within_block_p (base, INTVAL (offset)))
26519 return true;
26520 }
26521 - return false;
26522 + return m68k_tls_referenced_p (x);
26523 }
26524
26525 /* Return true if X is a legitimate constant address that can reach
26526 @@ -1758,7 +1812,7 @@ m68k_legitimate_constant_address_p (rtx
26527 return false;
26528 }
26529
26530 - return true;
26531 + return !m68k_tls_referenced_p (x);
26532 }
26533
26534 /* Return true if X is a LABEL_REF for a jump table. Assume that unplaced
26535 @@ -1778,6 +1832,40 @@ m68k_jump_table_ref_p (rtx x)
26536 return x && JUMP_TABLE_DATA_P (x);
26537 }
26538
26539 +/* Unwrap symbol from UNSPEC_RELOC16 and, if unwrap_reloc32_p,
26540 + UNSPEC_RELOC32 wrappers. */
26541 +
26542 +rtx
26543 +m68k_unwrap_symbol (rtx orig, bool unwrap_reloc32_p)
26544 +{
26545 + if (GET_CODE (orig) == CONST)
26546 + {
26547 + rtx x;
26548 +
26549 + x = XEXP (orig, 0);
26550 +
26551 + if (GET_CODE (x) == UNSPEC)
26552 + {
26553 + switch (XINT (x, 1))
26554 + {
26555 + case UNSPEC_RELOC16:
26556 + orig = XVECEXP (x, 0, 0);
26557 + break;
26558 +
26559 + case UNSPEC_RELOC32:
26560 + if (unwrap_reloc32_p)
26561 + orig = XVECEXP (x, 0, 0);
26562 + break;
26563 +
26564 + default:
26565 + break;
26566 + }
26567 + }
26568 + }
26569 +
26570 + return orig;
26571 +}
26572 +
26573 /* Return true if X is a legitimate address for values of mode MODE.
26574 STRICT_P says whether strict checking is needed. If the address
26575 is valid, describe its components in *ADDRESS. */
26576 @@ -1825,15 +1913,23 @@ m68k_decompose_address (enum machine_mod
26577 /* Check for GOT loads. These are (bd,An,Xn) addresses if
26578 TARGET_68020 && flag_pic == 2, otherwise they are (d16,An)
26579 addresses. */
26580 - if (flag_pic
26581 + if (pic_offset_table_rtx != NULL_RTX
26582 && GET_CODE (x) == PLUS
26583 - && XEXP (x, 0) == pic_offset_table_rtx
26584 - && (GET_CODE (XEXP (x, 1)) == SYMBOL_REF
26585 - || GET_CODE (XEXP (x, 1)) == LABEL_REF))
26586 + && XEXP (x, 0) == pic_offset_table_rtx)
26587 {
26588 - address->base = XEXP (x, 0);
26589 - address->offset = XEXP (x, 1);
26590 - return true;
26591 + rtx sym;
26592 +
26593 + /* As we are processing a PLUS, do not unwrap RELOC32
26594 + symbols here; they are invalid in this context. */
26595 + sym = m68k_unwrap_symbol (XEXP (x, 1), false);
26596 +
26597 + if (GET_CODE (sym) == SYMBOL_REF
26598 + || GET_CODE (sym) == LABEL_REF)
26599 + {
26600 + address->base = XEXP (x, 0);
26601 + address->offset = XEXP (x, 1);
26602 + return true;
26603 + }
26604 }
26605
26606 /* The ColdFire FPU only accepts addressing modes 2-5. */
26607 @@ -1858,7 +1954,7 @@ m68k_decompose_address (enum machine_mod
26608 accesses to unplaced labels in other cases. */
26609 if (GET_CODE (x) == PLUS
26610 && m68k_jump_table_ref_p (XEXP (x, 1))
26611 - && m68k_decompose_index (XEXP (x, 0), strict_p, address))
26612 + && m68k_decompose_index (mode, XEXP (x, 0), strict_p, address))
26613 {
26614 address->offset = XEXP (x, 1);
26615 return true;
26616 @@ -1890,7 +1986,7 @@ m68k_decompose_address (enum machine_mod
26617 worse code. */
26618 if (address->offset
26619 && symbolic_operand (address->offset, VOIDmode)
26620 - && m68k_decompose_index (x, strict_p, address))
26621 + && m68k_decompose_index (mode, x, strict_p, address))
26622 return true;
26623 }
26624 else
26625 @@ -1909,14 +2005,14 @@ m68k_decompose_address (enum machine_mod
26626 if (GET_CODE (x) == PLUS)
26627 {
26628 if (m68k_legitimate_base_reg_p (XEXP (x, 0), strict_p)
26629 - && m68k_decompose_index (XEXP (x, 1), strict_p, address))
26630 + && m68k_decompose_index (mode, XEXP (x, 1), strict_p, address))
26631 {
26632 address->base = XEXP (x, 0);
26633 return true;
26634 }
26635
26636 if (m68k_legitimate_base_reg_p (XEXP (x, 1), strict_p)
26637 - && m68k_decompose_index (XEXP (x, 0), strict_p, address))
26638 + && m68k_decompose_index (mode, XEXP (x, 0), strict_p, address))
26639 {
26640 address->base = XEXP (x, 1);
26641 return true;
26642 @@ -1978,6 +2074,115 @@ m68k_matches_u_p (rtx x)
26643 && !address.index);
26644 }
26645
26646 +/* Return GOT pointer. */
26647 +
26648 +static rtx
26649 +m68k_get_gp (void)
26650 +{
26651 + if (pic_offset_table_rtx == NULL_RTX)
26652 + pic_offset_table_rtx = gen_rtx_REG (Pmode, PIC_REG);
26653 +
26654 + current_function_uses_pic_offset_table = 1;
26655 +
26656 + return pic_offset_table_rtx;
26657 +}
26658 +
26659 +/* M68K relocations, used to distinguish GOT and TLS relocations in UNSPEC
26660 + wrappers. */
26661 +enum m68k_reloc { RELOC_GOT, RELOC_TLSGD, RELOC_TLSLDM, RELOC_TLSLDO,
26662 + RELOC_TLSIE, RELOC_TLSLE };
26663 +
26664 +#define TLS_RELOC_P(RELOC) ((RELOC) != RELOC_GOT)
26665 +
26666 +/* Wrap symbol X into unspec representing relocation RELOC.
26667 + If USE_X_P, use 32-bit relocations, otherwise use 16-bit relocs.
26668 + BASE_REG - register that should be added to the result.
26669 + TEMP_REG - if non-null, temporary register. */
26670 +
26671 +static rtx
26672 +m68k_wrap_symbol (rtx x, enum m68k_reloc reloc, rtx base_reg, rtx temp_reg)
26673 +{
26674 + bool use_x_p;
26675 +
26676 + use_x_p = (base_reg == pic_offset_table_rtx) ? TARGET_XGOT : TARGET_XTLS;
26677 +
26678 + if (TARGET_COLDFIRE && use_x_p)
26679 + /* When compiling with -mx{got, tls} switch the code will look like this:
26680 +
26681 + move.l <X>@<RELOC>,<TEMP_REG>
26682 + add.l <BASE_REG>,<TEMP_REG> */
26683 + {
26684 + /* Wrap X in UNSPEC_??? to tip m68k_output_addr_const_extra
26685 + to put @RELOC after reference. */
26686 + x = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, x, GEN_INT (reloc)),
26687 + UNSPEC_RELOC32);
26688 + x = gen_rtx_CONST (Pmode, x);
26689 +
26690 + if (temp_reg == NULL)
26691 + {
26692 + gcc_assert (can_create_pseudo_p ());
26693 + temp_reg = gen_reg_rtx (Pmode);
26694 + }
26695 +
26696 + emit_move_insn (temp_reg, x);
26697 + emit_insn (gen_addsi3 (temp_reg, temp_reg, base_reg));
26698 + x = temp_reg;
26699 + }
26700 + else
26701 + {
26702 + /* ??? It would be simplier to wrap 16-bit GOT relocs into UNSPEC too,
26703 + historically, we don't do this, but I'm not aware of any downside
26704 + of such a change. */
26705 + if (reloc != RELOC_GOT)
26706 + /* Wrap X into (const (unspec (X))). */
26707 + {
26708 + x = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, x, GEN_INT (reloc)),
26709 + UNSPEC_RELOC16);
26710 + x = gen_rtx_CONST (Pmode, x);
26711 + }
26712 +
26713 + x = gen_rtx_PLUS (Pmode, base_reg, x);
26714 + }
26715 +
26716 + return x;
26717 +}
26718 +
26719 +/* Move X to a register and add REG_EQUAL note pointing to ORIG.
26720 + If REG is non-null, use it; generate new pseudo otherwise. */
26721 +
26722 +static rtx
26723 +m68k_move_to_reg (rtx x, rtx orig, rtx reg)
26724 +{
26725 + rtx insn;
26726 +
26727 + if (reg == NULL_RTX)
26728 + {
26729 + gcc_assert (can_create_pseudo_p ());
26730 + reg = gen_reg_rtx (Pmode);
26731 + }
26732 +
26733 + insn = emit_move_insn (reg, x);
26734 + /* Put a REG_EQUAL note on this insn, so that it can be optimized
26735 + by loop. */
26736 + set_unique_reg_note (insn, REG_EQUAL, orig);
26737 +
26738 + return reg;
26739 +}
26740 +
26741 +/* Does the same as m68k_wrap_symbol, but returns a memory reference to
26742 + GOT slot. */
26743 +
26744 +static rtx
26745 +m68k_wrap_symbol_into_got_ref (rtx x, enum m68k_reloc reloc, rtx temp_reg)
26746 +{
26747 + x = m68k_wrap_symbol (x, reloc, m68k_get_gp (), temp_reg);
26748 +
26749 + x = gen_rtx_MEM (Pmode, x);
26750 + MEM_READONLY_P (x) = 1;
26751 +
26752 + return x;
26753 +}
26754 +
26755 /* Legitimize PIC addresses. If the address is already
26756 position-independent, we return ORIG. Newly generated
26757 position-independent addresses go to REG. If we need more
26758 @@ -2029,13 +2234,8 @@ legitimize_pic_address (rtx orig, enum m
26759 {
26760 gcc_assert (reg);
26761
26762 - pic_ref = gen_rtx_MEM (Pmode,
26763 - gen_rtx_PLUS (Pmode,
26764 - pic_offset_table_rtx, orig));
26765 - current_function_uses_pic_offset_table = 1;
26766 - MEM_READONLY_P (pic_ref) = 1;
26767 - emit_move_insn (reg, pic_ref);
26768 - return reg;
26769 + pic_ref = m68k_wrap_symbol_into_got_ref (orig, RELOC_GOT, reg);
26770 + pic_ref = m68k_move_to_reg (pic_ref, orig, reg);
26771 }
26772 else if (GET_CODE (orig) == CONST)
26773 {
26774 @@ -2046,6 +2246,10 @@ legitimize_pic_address (rtx orig, enum m
26775 && XEXP (XEXP (orig, 0), 0) == pic_offset_table_rtx)
26776 return orig;
26777
26778 + /* Handle the case where we have: const (UNSPEC_RELOC??). */
26779 + if (m68k_unwrap_symbol (orig, true) != orig)
26780 + return orig;
26781 +
26782 gcc_assert (reg);
26783
26784 /* legitimize both operands of the PLUS */
26785 @@ -2056,13 +2260,372 @@ legitimize_pic_address (rtx orig, enum m
26786 base == reg ? 0 : reg);
26787
26788 if (GET_CODE (orig) == CONST_INT)
26789 - return plus_constant (base, INTVAL (orig));
26790 - pic_ref = gen_rtx_PLUS (Pmode, base, orig);
26791 - /* Likewise, should we set special REG_NOTEs here? */
26792 + pic_ref = plus_constant (base, INTVAL (orig));
26793 + else
26794 + pic_ref = gen_rtx_PLUS (Pmode, base, orig);
26795 }
26796 +
26797 return pic_ref;
26798 }
26799
26800 +/* The __tls_get_addr symbol. */
26801 +static GTY(()) rtx m68k_tls_get_addr;
26802 +
26803 +/* Return SYMBOL_REF for __tls_get_addr. */
26804 +
26805 +static rtx
26806 +m68k_get_tls_get_addr (void)
26807 +{
26808 + if (m68k_tls_get_addr == NULL_RTX)
26809 + m68k_tls_get_addr = init_one_libfunc ("__tls_get_addr");
26810 +
26811 + return m68k_tls_get_addr;
26812 +}
26813 +
26814 +/* Return libcall result in A0 instead of usual D0. */
26815 +static bool m68k_libcall_value_in_a0_p = false;
26816 +
26817 +/* Emit instruction sequence that calls __tls_get_addr. X is
26818 + the TLS symbol we are referencing and RELOC is the symbol type to use
26819 + (either TLSGD or TLSLDM). EQV is the REG_EQUAL note for the sequence
26820 + emitted. A pseudo register with result of __tls_get_addr call is
26821 + returned. */
26822 +
26823 +static rtx
26824 +m68k_call_tls_get_addr (rtx x, rtx eqv, enum m68k_reloc reloc)
26825 +{
26826 + rtx a0;
26827 + rtx insns;
26828 + rtx dest;
26829 +
26830 + /* Emit the call sequence. */
26831 + start_sequence ();
26832 +
26833 + /* FIXME: Unfortunately, emit_library_call_value does not
26834 + consider (plus (%a5) (const (unspec))) to be a good enough
26835 + operand for push, so it forces it into a register. The bad
26836 + thing about this is that combiner, due to copy propagation and other
26837 + optimizations, sometimes can not later fix this. As a consequence,
26838 + additional register may be allocated resulting in a spill.
26839 + For reference, see args processing loops in
26840 + calls.c:emit_library_call_value_1.
26841 + For testcase, see gcc.target/m68k/tls-{gd, ld}.c */
26842 + x = m68k_wrap_symbol (x, reloc, m68k_get_gp (), NULL_RTX);
26843 +
26844 + /* __tls_get_addr() is not a libcall, but emitting a libcall_value
26845 + is the simpliest way of generating a call. The difference between
26846 + __tls_get_addr() and libcall is that the result is returned in D0
26847 + instead of A0. To workaround this, we use m68k_libcall_value_in_a0_p
26848 + which temporarily switches returning the result to A0. */
26849 +
26850 + m68k_libcall_value_in_a0_p = true;
26851 + a0 = emit_library_call_value (m68k_get_tls_get_addr (), NULL_RTX, LCT_PURE,
26852 + Pmode, 1, x, Pmode);
26853 + m68k_libcall_value_in_a0_p = false;
26854 +
26855 + insns = get_insns ();
26856 + end_sequence ();
26857 +
26858 + gcc_assert (can_create_pseudo_p ());
26859 + dest = gen_reg_rtx (Pmode);
26860 + emit_libcall_block (insns, dest, a0, eqv);
26861 +
26862 + return dest;
26863 +}
26864 +
26865 +/* The __tls_get_addr symbol. */
26866 +static GTY(()) rtx m68k_read_tp;
26867 +
26868 +/* Return SYMBOL_REF for __m68k_read_tp. */
26869 +
26870 +static rtx
26871 +m68k_get_m68k_read_tp (void)
26872 +{
26873 + if (m68k_read_tp == NULL_RTX)
26874 + m68k_read_tp = init_one_libfunc ("__m68k_read_tp");
26875 +
26876 + return m68k_read_tp;
26877 +}
26878 +
26879 +/* Emit instruction sequence that calls __m68k_read_tp.
26880 + A pseudo register with result of __m68k_read_tp call is returned. */
26881 +
26882 +static rtx
26883 +m68k_call_m68k_read_tp (void)
26884 +{
26885 + rtx a0;
26886 + rtx eqv;
26887 + rtx insns;
26888 + rtx dest;
26889 +
26890 + start_sequence ();
26891 +
26892 + /* __m68k_read_tp() is not a libcall, but emitting a libcall_value
26893 + is the simpliest way of generating a call. The difference between
26894 + __m68k_read_tp() and libcall is that the result is returned in D0
26895 + instead of A0. To workaround this, we use m68k_libcall_value_in_a0_p
26896 + which temporarily switches returning the result to A0. */
26897 +
26898 + /* Emit the call sequence. */
26899 + m68k_libcall_value_in_a0_p = true;
26900 + a0 = emit_library_call_value (m68k_get_m68k_read_tp (), NULL_RTX, LCT_PURE,
26901 + Pmode, 0);
26902 + m68k_libcall_value_in_a0_p = false;
26903 + insns = get_insns ();
26904 + end_sequence ();
26905 +
26906 + /* Attach a unique REG_EQUIV, to allow the RTL optimizers to
26907 + share the m68k_read_tp result with other IE/LE model accesses. */
26908 + eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const1_rtx), UNSPEC_RELOC32);
26909 +
26910 + gcc_assert (can_create_pseudo_p ());
26911 + dest = gen_reg_rtx (Pmode);
26912 + emit_libcall_block (insns, dest, a0, eqv);
26913 +
26914 + return dest;
26915 +}
26916 +
26917 +/* Return a legitimized address for accessing TLS SYMBOL_REF X.
26918 + For explanations on instructions sequences see TLS/NPTL ABI for m68k and
26919 + ColdFire. */
26920 +
26921 +rtx
26922 +m68k_legitimize_tls_address (rtx orig)
26923 +{
26924 + switch (SYMBOL_REF_TLS_MODEL (orig))
26925 + {
26926 + case TLS_MODEL_GLOBAL_DYNAMIC:
26927 + orig = m68k_call_tls_get_addr (orig, orig, RELOC_TLSGD);
26928 + break;
26929 +
26930 + case TLS_MODEL_LOCAL_DYNAMIC:
26931 + {
26932 + rtx eqv;
26933 + rtx a0;
26934 + rtx x;
26935 +
26936 + /* Attach a unique REG_EQUIV, to allow the RTL optimizers to
26937 + share the LDM result with other LD model accesses. */
26938 + eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx),
26939 + UNSPEC_RELOC32);
26940 +
26941 + a0 = m68k_call_tls_get_addr (orig, eqv, RELOC_TLSLDM);
26942 +
26943 + x = m68k_wrap_symbol (orig, RELOC_TLSLDO, a0, NULL_RTX);
26944 +
26945 + if (can_create_pseudo_p ())
26946 + x = m68k_move_to_reg (x, orig, NULL_RTX);
26947 +
26948 + orig = x;
26949 + break;
26950 + }
26951 +
26952 + case TLS_MODEL_INITIAL_EXEC:
26953 + {
26954 + rtx a0;
26955 + rtx x;
26956 +
26957 + a0 = m68k_call_m68k_read_tp ();
26958 +
26959 + x = m68k_wrap_symbol_into_got_ref (orig, RELOC_TLSIE, NULL_RTX);
26960 + x = gen_rtx_PLUS (Pmode, x, a0);
26961 +
26962 + if (can_create_pseudo_p ())
26963 + x = m68k_move_to_reg (x, orig, NULL_RTX);
26964 +
26965 + orig = x;
26966 + break;
26967 + }
26968 +
26969 + case TLS_MODEL_LOCAL_EXEC:
26970 + {
26971 + rtx a0;
26972 + rtx x;
26973 +
26974 + a0 = m68k_call_m68k_read_tp ();
26975 +
26976 + x = m68k_wrap_symbol (orig, RELOC_TLSLE, a0, NULL_RTX);
26977 +
26978 + if (can_create_pseudo_p ())
26979 + x = m68k_move_to_reg (x, orig, NULL_RTX);
26980 +
26981 + orig = x;
26982 + break;
26983 + }
26984 +
26985 + default:
26986 + gcc_unreachable ();
26987 + }
26988 +
26989 + return orig;
26990 +}
26991 +
26992 +/* Return true if X is a TLS symbol. */
26993 +
26994 +static bool
26995 +m68k_tls_symbol_p (rtx x)
26996 +{
26997 + if (!TARGET_HAVE_TLS)
26998 + return false;
26999 +
27000 + if (GET_CODE (x) != SYMBOL_REF)
27001 + return false;
27002 +
27003 + return SYMBOL_REF_TLS_MODEL (x) != 0;
27004 +}
27005 +
27006 +/* Helper for m68k_tls_referenced_p. */
27007 +
27008 +static int
27009 +m68k_tls_referenced_p_1 (rtx *x, void *data ATTRIBUTE_UNUSED)
27010 +{
27011 + if (GET_CODE (*x) == SYMBOL_REF)
27012 + return SYMBOL_REF_TLS_MODEL (*x) != 0;
27013 +
27014 + /* Don't recurse into UNSPEC_TLS looking for TLS symbols; these are
27015 + TLS offsets, not real symbol references. */
27016 + if (GET_CODE (*x) == UNSPEC
27017 + && (XINT (*x, 1) == UNSPEC_RELOC16 || XINT (*x, 1) == UNSPEC_RELOC32)
27018 + && TLS_RELOC_P (INTVAL (XVECEXP (*x, 0, 1))))
27019 + return -1;
27020 +
27021 + return 0;
27022 +}
27023 +
27024 +/* Return true if X contains any TLS symbol references. */
27025 +
27026 +bool
27027 +m68k_tls_referenced_p (rtx x)
27028 +{
27029 + if (!TARGET_HAVE_TLS)
27030 + return false;
27031 +
27032 + return for_each_rtx (&x, m68k_tls_referenced_p_1, NULL);
27033 +}
27034 +
27035 +/* Return true if X is legitimate TLS symbol reference. */
27036 +
27037 +bool
27038 +m68k_tls_mentioned_p (rtx x)
27039 +{
27040 + switch (GET_CODE (x))
27041 + {
27042 + case CONST:
27043 + return m68k_tls_mentioned_p (XEXP (x, 0));
27044 +
27045 + case UNSPEC:
27046 + if ((XINT (x, 1) == UNSPEC_RELOC16 || XINT (x, 1) == UNSPEC_RELOC32)
27047 + && TLS_RELOC_P (INTVAL (XVECEXP (x, 0, 1))))
27048 + return 1;
27049 +
27050 + default:
27051 + return 0;
27052 + }
27053 +}
27054 +
27055 +/* Legitimize X. */
27056 +
27057 +rtx
27058 +m68k_legitimize_address (rtx x, rtx oldx, enum machine_mode mode)
27059 +{
27060 + if (m68k_tls_symbol_p (x))
27061 + return m68k_legitimize_tls_address (x);
27062 +
27063 + if (GET_CODE (x) == PLUS)
27064 + {
27065 + bool ch;
27066 + bool copied;
27067 +
27068 + ch = (x != oldx);
27069 + copied = 0;
27070 +
27071 + /* For the 68000, we handle X+REG by loading X into a register R and
27072 + using R+REG. R will go in an address reg and indexing will be used.
27073 + However, if REG is a broken-out memory address or multiplication,
27074 + nothing needs to be done because REG can certainly go in an address
27075 + reg. */
27076 +#define COPY_ONCE(Y) if (!copied) { Y = copy_rtx (Y); copied = ch = true; }
27077 +
27078 + if (GET_CODE (XEXP (x, 0)) == MULT)
27079 + {
27080 + COPY_ONCE (x);
27081 + XEXP (x, 0) = force_operand (XEXP (x, 0), 0);
27082 + }
27083 +
27084 + if (GET_CODE (XEXP (x, 1)) == MULT)
27085 + {
27086 + COPY_ONCE (x);
27087 + XEXP (x, 1) = force_operand (XEXP (x, 1), 0);
27088 + }
27089 +
27090 + if (ch
27091 + && GET_CODE (XEXP (x, 1)) == REG
27092 + && GET_CODE (XEXP (x, 0)) == REG)
27093 + {
27094 + if (TARGET_COLDFIRE_FPU
27095 + && GET_MODE_CLASS (mode) == MODE_FLOAT)
27096 + {
27097 + COPY_ONCE (x);
27098 + x = force_operand (x, 0);
27099 + }
27100 +
27101 + return x;
27102 + }
27103 +
27104 + if (ch && m68k_legitimate_address_p (mode, x, REG_STRICT_P))
27105 + return x;
27106 +
27107 + if (GET_CODE (XEXP (x, 0)) == REG
27108 + || (GET_CODE (XEXP (x, 0)) == SIGN_EXTEND
27109 + && GET_CODE (XEXP (XEXP (x, 0), 0)) == REG
27110 + && GET_MODE (XEXP (XEXP (x, 0), 0)) == HImode))
27111 + {
27112 + rtx temp;
27113 + rtx val;
27114 +
27115 + temp = gen_reg_rtx (Pmode);
27116 + val = force_operand (XEXP (x, 1), 0);
27117 +
27118 + emit_move_insn (temp, val);
27119 + COPY_ONCE (x);
27120 + XEXP (x, 1) = temp;
27121 +
27122 + if (TARGET_COLDFIRE_FPU
27123 + && GET_MODE_CLASS (mode) == MODE_FLOAT
27124 + && GET_CODE (XEXP (x, 0)) == REG)
27125 + x = force_operand (x, 0);
27126 +
27127 + return x;
27128 + }
27129 + else if (GET_CODE (XEXP (x, 1)) == REG
27130 + || (GET_CODE (XEXP (x, 1)) == SIGN_EXTEND
27131 + && GET_CODE (XEXP (XEXP (x, 1), 0)) == REG
27132 + && GET_MODE (XEXP (XEXP (x, 1), 0)) == HImode))
27133 + {
27134 + rtx temp;
27135 + rtx val;
27136 +
27137 + temp = gen_reg_rtx (Pmode);
27138 + val = force_operand (XEXP (x, 0), 0);
27139 +
27140 + emit_move_insn (temp, val);
27141 + COPY_ONCE (x);
27142 + XEXP (x, 0) = temp;
27143 +
27144 + if (TARGET_COLDFIRE_FPU
27145 + && GET_MODE_CLASS (mode) == MODE_FLOAT
27146 + && GET_CODE (XEXP (x, 1)) == REG)
27147 + x = force_operand (x, 0);
27148 +
27149 + return x;
27150 + }
27151 +
27152 +#undef COPY_ONCE
27153 + }
27154 +
27155 + return NULL_RTX;
27156 +}
27157 +
27158 \f
27159
27160 #define USE_MOVQ(i) ((unsigned) ((i) + 128) <= 255)
27161 @@ -2175,13 +2738,18 @@ m68k_rtx_costs (rtx x, int code, int out
27162 #define MULL_COST \
27163 (TUNE_68060 ? 2 \
27164 : TUNE_68040 ? 5 \
27165 - : TUNE_CFV2 ? 10 \
27166 + : (TUNE_CFV2 && TUNE_EMAC) ? 3 \
27167 + : (TUNE_CFV2 && TUNE_MAC) ? 4 \
27168 + : TUNE_CFV2 ? 8 \
27169 : TARGET_COLDFIRE ? 3 : 13)
27170
27171 #define MULW_COST \
27172 (TUNE_68060 ? 2 \
27173 : TUNE_68040 ? 3 \
27174 - : TUNE_68000_10 || TUNE_CFV2 ? 5 \
27175 + : TUNE_68000_10 ? 5 \
27176 + : (TUNE_CFV2 && TUNE_EMAC) ? 3 \
27177 + : (TUNE_CFV2 && TUNE_MAC) ? 2 \
27178 + : TUNE_CFV2 ? 8 \
27179 : TARGET_COLDFIRE ? 2 : 8)
27180
27181 #define DIVW_COST \
27182 @@ -3531,9 +4099,7 @@ notice_update_cc (rtx exp, rtx insn)
27183 case ROTATE: case ROTATERT:
27184 /* These instructions always clear the overflow bit, and set
27185 the carry to the bit shifted out. */
27186 - /* ??? We don't currently have a way to signal carry not valid,
27187 - nor do we check for it in the branch insns. */
27188 - CC_STATUS_INIT;
27189 + cc_status.flags |= CC_OVERFLOW_UNUSABLE | CC_NO_CARRY;
27190 break;
27191
27192 case PLUS: case MINUS: case MULT:
27193 @@ -3839,7 +4405,75 @@ print_operand (FILE *file, rtx op, int l
27194 }
27195 }
27196
27197 -\f
27198 +/* Return string for TLS relocation RELOC. */
27199 +
27200 +static const char *
27201 +m68k_get_reloc_decoration (enum m68k_reloc reloc)
27202 +{
27203 + switch (reloc)
27204 + {
27205 + case RELOC_GOT:
27206 + return "@GOT";
27207 +
27208 + case RELOC_TLSGD:
27209 + return "@TLSGD";
27210 +
27211 + case RELOC_TLSLDM:
27212 + return "@TLSLDM";
27213 +
27214 + case RELOC_TLSLDO:
27215 + return "@TLSLDO";
27216 +
27217 + case RELOC_TLSIE:
27218 + return "@TLSIE";
27219 +
27220 + case RELOC_TLSLE:
27221 + return "@TLSLE";
27222 +
27223 + default:
27224 + gcc_unreachable ();
27225 + }
27226 +}
27227 +
27228 +/* m68k implementation of OUTPUT_ADDR_CONST_EXTRA. */
27229 +
27230 +bool
27231 +m68k_output_addr_const_extra (FILE *file, rtx x)
27232 +{
27233 + if (GET_CODE (x) == UNSPEC)
27234 + {
27235 + switch (XINT (x, 1))
27236 + {
27237 + /* ??? It would be cleaner to wrap normal GOT references into
27238 + UNSPEC_GOT too, then we won't have to handle them separately
27239 + in print_operand_address. I'm not aware of any downside of
27240 + such clean up. */
27241 + case UNSPEC_RELOC16:
27242 + case UNSPEC_RELOC32:
27243 + output_addr_const (file, XVECEXP (x, 0, 0));
27244 + fputs (m68k_get_reloc_decoration (INTVAL (XVECEXP (x, 0, 1))), file);
27245 + return true;
27246 +
27247 + default:
27248 + break;
27249 + }
27250 + }
27251 +
27252 + return false;
27253 +}
27254 +
27255 +/* M68K implementation of TARGET_ASM_OUTPUT_DWARF_DTPREL. */
27256 +
27257 +static void
27258 +m68k_output_dwarf_dtprel (FILE *file, int size, rtx x)
27259 +{
27260 + gcc_assert (size == 4);
27261 + fputs ("\t.long\t", file);
27262 + output_addr_const (file, x);
27263 + fputs ("@TLSLDO+0x8000", file);
27264 +}
27265 +
27266 +\f
27267 /* A C compound statement to output to stdio stream STREAM the
27268 assembler syntax for an instruction operand that is a memory
27269 reference whose address is ADDR. ADDR is an RTL expression.
27270 @@ -3928,7 +4562,9 @@ print_operand_address (FILE *file, rtx a
27271 if (address.offset)
27272 {
27273 output_addr_const (file, address.offset);
27274 - if (flag_pic && address.base == pic_offset_table_rtx)
27275 + if (flag_pic && address.base == pic_offset_table_rtx
27276 + && (m68k_unwrap_symbol (address.offset, false)
27277 + == address.offset))
27278 {
27279 fprintf (file, "@GOT");
27280 if (flag_pic == 1 && TARGET_68020)
27281 @@ -4486,7 +5122,8 @@ m68k_libcall_value (enum machine_mode mo
27282 default:
27283 break;
27284 }
27285 - return gen_rtx_REG (mode, D0_REG);
27286 +
27287 + return gen_rtx_REG (mode, m68k_libcall_value_in_a0_p ? A0_REG : D0_REG);
27288 }
27289
27290 rtx
27291 @@ -4533,7 +5170,7 @@ m68k_function_value (const_tree valtype,
27292 /* Worker function for TARGET_RETURN_IN_MEMORY. */
27293 #if M68K_HONOR_TARGET_STRICT_ALIGNMENT
27294 static bool
27295 -m68k_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
27296 +m68k_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
27297 {
27298 enum machine_mode mode = TYPE_MODE (type);
27299
27300 @@ -4555,14 +5192,20 @@ m68k_return_in_memory (tree type, tree f
27301 /* CPU to schedule the program for. */
27302 enum attr_cpu m68k_sched_cpu;
27303
27304 +/* MAC to schedule the program for. */
27305 +enum attr_mac m68k_sched_mac;
27306 +
27307 /* Operand type. */
27308 enum attr_op_type
27309 {
27310 /* No operand. */
27311 OP_TYPE_NONE,
27312
27313 - /* Register. */
27314 - OP_TYPE_REG,
27315 + /* Integer register. */
27316 + OP_TYPE_RN,
27317 +
27318 + /* FP register. */
27319 + OP_TYPE_FPN,
27320
27321 /* Implicit mem reference (e.g. stack). */
27322 OP_TYPE_MEM1,
27323 @@ -4589,19 +5232,19 @@ enum attr_op_type
27324 OP_TYPE_IMM_L
27325 };
27326
27327 -/* True if current insn doesn't have complete pipeline description. */
27328 -static bool sched_guess_p;
27329 -
27330 /* Return type of memory ADDR_RTX refers to. */
27331 static enum attr_op_type
27332 sched_address_type (enum machine_mode mode, rtx addr_rtx)
27333 {
27334 struct m68k_address address;
27335
27336 + if (symbolic_operand (addr_rtx, VOIDmode))
27337 + return OP_TYPE_MEM7;
27338 +
27339 if (!m68k_decompose_address (mode, addr_rtx,
27340 reload_completed, &address))
27341 {
27342 - gcc_assert (sched_guess_p);
27343 + gcc_assert (!reload_completed);
27344 /* Reload will likely fix the address to be in the register. */
27345 return OP_TYPE_MEM234;
27346 }
27347 @@ -4622,12 +5265,42 @@ sched_address_type (enum machine_mode mo
27348 return OP_TYPE_MEM7;
27349 }
27350
27351 -/* Return type of the operand OP.
27352 - If ADDRESS_P is true, return type of memory location OP refers to. */
27353 +/* Return X or Y (depending on OPX_P) operand of INSN. */
27354 +static rtx
27355 +sched_get_operand (rtx insn, bool opx_p)
27356 +{
27357 + int i;
27358 +
27359 + if (recog_memoized (insn) < 0)
27360 + gcc_unreachable ();
27361 +
27362 + extract_constrain_insn_cached (insn);
27363 +
27364 + if (opx_p)
27365 + i = get_attr_opx (insn);
27366 + else
27367 + i = get_attr_opy (insn);
27368 +
27369 + if (i >= recog_data.n_operands)
27370 + return NULL;
27371 +
27372 + return recog_data.operand[i];
27373 +}
27374 +
27375 +/* Return type of INSN's operand X (if OPX_P) or operand Y (if !OPX_P).
27376 + If ADDRESS_P is true, return type of memory location operand refers to. */
27377 static enum attr_op_type
27378 -sched_operand_type (rtx op, bool address_p)
27379 +sched_attr_op_type (rtx insn, bool opx_p, bool address_p)
27380 {
27381 - gcc_assert (op != NULL_RTX);
27382 + rtx op;
27383 +
27384 + op = sched_get_operand (insn, opx_p);
27385 +
27386 + if (op == NULL)
27387 + {
27388 + gcc_assert (!reload_completed);
27389 + return OP_TYPE_RN;
27390 + }
27391
27392 if (address_p)
27393 return sched_address_type (QImode, op);
27394 @@ -4636,13 +5309,49 @@ sched_operand_type (rtx op, bool address
27395 return sched_address_type (GET_MODE (op), XEXP (op, 0));
27396
27397 if (register_operand (op, VOIDmode))
27398 - return OP_TYPE_REG;
27399 + {
27400 + if ((!reload_completed && FLOAT_MODE_P (GET_MODE (op)))
27401 + || (reload_completed && FP_REG_P (op)))
27402 + return OP_TYPE_FPN;
27403 +
27404 + return OP_TYPE_RN;
27405 + }
27406
27407 if (GET_CODE (op) == CONST_INT)
27408 {
27409 - /* ??? Below condition should probably check if the operation is
27410 - signed or unsigned. */
27411 - if (IN_RANGE (INTVAL (op), -0x8000, 0x7fff))
27412 + int ival;
27413 +
27414 + ival = INTVAL (op);
27415 +
27416 + /* Check for quick constants. */
27417 + switch (get_attr_type (insn))
27418 + {
27419 + case TYPE_ALUQ_L:
27420 + if (IN_RANGE (ival, 1, 8) || IN_RANGE (ival, -8, -1))
27421 + return OP_TYPE_IMM_Q;
27422 +
27423 + gcc_assert (!reload_completed);
27424 + break;
27425 +
27426 + case TYPE_MOVEQ_L:
27427 + if (USE_MOVQ (ival))
27428 + return OP_TYPE_IMM_Q;
27429 +
27430 + gcc_assert (!reload_completed);
27431 + break;
27432 +
27433 + case TYPE_MOV3Q_L:
27434 + if (valid_mov3q_const (ival))
27435 + return OP_TYPE_IMM_Q;
27436 +
27437 + gcc_assert (!reload_completed);
27438 + break;
27439 +
27440 + default:
27441 + break;
27442 + }
27443 +
27444 + if (IN_RANGE (ival, -0x8000, 0x7fff))
27445 return OP_TYPE_IMM_W;
27446
27447 return OP_TYPE_IMM_L;
27448 @@ -4664,7 +5373,8 @@ sched_operand_type (rtx op, bool address
27449 }
27450 }
27451
27452 - if (symbolic_operand (op, VOIDmode)
27453 + if (GET_CODE (op) == CONST
27454 + || symbolic_operand (op, VOIDmode)
27455 || LABEL_P (op))
27456 {
27457 switch (GET_MODE (op))
27458 @@ -4679,41 +5389,20 @@ sched_operand_type (rtx op, bool address
27459 return OP_TYPE_IMM_L;
27460
27461 default:
27462 - if (GET_CODE (op) == SYMBOL_REF)
27463 - /* ??? Just a guess. Probably we can guess better using length
27464 - attribute of the instructions. */
27465 + if (symbolic_operand (m68k_unwrap_symbol (op, false), VOIDmode))
27466 + /* Just a guess. */
27467 return OP_TYPE_IMM_W;
27468
27469 return OP_TYPE_IMM_L;
27470 }
27471 }
27472
27473 - gcc_assert (sched_guess_p);
27474 -
27475 - return OP_TYPE_REG;
27476 -}
27477 -
27478 -/* Return type of INSN's operand X (if OPX_P) or operand Y (if !OPX_P).
27479 - If ADDRESS_P is true, return type of memory location operand refers to. */
27480 -static enum attr_op_type
27481 -sched_attr_op_type (rtx insn, bool opx_p, bool address_p)
27482 -{
27483 - int i;
27484 -
27485 - extract_constrain_insn_cached (insn);
27486 -
27487 - if (opx_p)
27488 - i = get_attr_opx (insn);
27489 - else
27490 - i = get_attr_opy (insn);
27491 + gcc_assert (!reload_completed);
27492
27493 - if (i >= recog_data.n_operands)
27494 - {
27495 - gcc_assert (sched_guess_p);
27496 - return OP_TYPE_REG;
27497 - }
27498 + if (FLOAT_MODE_P (GET_MODE (op)))
27499 + return OP_TYPE_FPN;
27500
27501 - return sched_operand_type (recog_data.operand[i], address_p);
27502 + return OP_TYPE_RN;
27503 }
27504
27505 /* Implement opx_type attribute.
27506 @@ -4722,12 +5411,13 @@ sched_attr_op_type (rtx insn, bool opx_p
27507 enum attr_opx_type
27508 m68k_sched_attr_opx_type (rtx insn, int address_p)
27509 {
27510 - sched_guess_p = (get_attr_guess (insn) == GUESS_YES);
27511 -
27512 switch (sched_attr_op_type (insn, true, address_p != 0))
27513 {
27514 - case OP_TYPE_REG:
27515 - return OPX_TYPE_REG;
27516 + case OP_TYPE_RN:
27517 + return OPX_TYPE_RN;
27518 +
27519 + case OP_TYPE_FPN:
27520 + return OPX_TYPE_FPN;
27521
27522 case OP_TYPE_MEM1:
27523 return OPX_TYPE_MEM1;
27524 @@ -4765,12 +5455,13 @@ m68k_sched_attr_opx_type (rtx insn, int
27525 enum attr_opy_type
27526 m68k_sched_attr_opy_type (rtx insn, int address_p)
27527 {
27528 - sched_guess_p = (get_attr_guess (insn) == GUESS_YES);
27529 -
27530 switch (sched_attr_op_type (insn, false, address_p != 0))
27531 {
27532 - case OP_TYPE_REG:
27533 - return OPY_TYPE_REG;
27534 + case OP_TYPE_RN:
27535 + return OPY_TYPE_RN;
27536 +
27537 + case OP_TYPE_FPN:
27538 + return OPY_TYPE_FPN;
27539
27540 case OP_TYPE_MEM1:
27541 return OPY_TYPE_MEM1;
27542 @@ -4802,17 +5493,21 @@ m68k_sched_attr_opy_type (rtx insn, int
27543 }
27544 }
27545
27546 -/* Return the size of INSN. */
27547 -int
27548 -m68k_sched_attr_size (rtx insn)
27549 +/* Return size of INSN as int. */
27550 +static int
27551 +sched_get_attr_size_int (rtx insn)
27552 {
27553 int size;
27554
27555 - sched_guess_p = (get_attr_guess (insn) == GUESS_YES);
27556 -
27557 - switch (get_attr_type1 (insn))
27558 + switch (get_attr_type (insn))
27559 {
27560 - case TYPE1_MUL_L:
27561 + case TYPE_IGNORE:
27562 + /* There should be no references to m68k_sched_attr_size for 'ignore'
27563 + instructions. */
27564 + gcc_unreachable ();
27565 + return 0;
27566 +
27567 + case TYPE_MUL_L:
27568 size = 2;
27569 break;
27570
27571 @@ -4824,7 +5519,8 @@ m68k_sched_attr_size (rtx insn)
27572 switch (get_attr_opx_type (insn))
27573 {
27574 case OPX_TYPE_NONE:
27575 - case OPX_TYPE_REG:
27576 + case OPX_TYPE_RN:
27577 + case OPX_TYPE_FPN:
27578 case OPX_TYPE_MEM1:
27579 case OPX_TYPE_MEM234:
27580 case OPY_TYPE_IMM_Q:
27581 @@ -4849,7 +5545,8 @@ m68k_sched_attr_size (rtx insn)
27582 switch (get_attr_opy_type (insn))
27583 {
27584 case OPY_TYPE_NONE:
27585 - case OPY_TYPE_REG:
27586 + case OPY_TYPE_RN:
27587 + case OPY_TYPE_FPN:
27588 case OPY_TYPE_MEM1:
27589 case OPY_TYPE_MEM234:
27590 case OPY_TYPE_IMM_Q:
27591 @@ -4873,7 +5570,7 @@ m68k_sched_attr_size (rtx insn)
27592
27593 if (size > 3)
27594 {
27595 - gcc_assert (sched_guess_p);
27596 + gcc_assert (!reload_completed);
27597
27598 size = 3;
27599 }
27600 @@ -4881,22 +5578,100 @@ m68k_sched_attr_size (rtx insn)
27601 return size;
27602 }
27603
27604 +/* Return size of INSN as attribute enum value. */
27605 +enum attr_size
27606 +m68k_sched_attr_size (rtx insn)
27607 +{
27608 + switch (sched_get_attr_size_int (insn))
27609 + {
27610 + case 1:
27611 + return SIZE_1;
27612 +
27613 + case 2:
27614 + return SIZE_2;
27615 +
27616 + case 3:
27617 + return SIZE_3;
27618 +
27619 + default:
27620 + gcc_unreachable ();
27621 + return 0;
27622 + }
27623 +}
27624 +
27625 +/* Return operand X or Y (depending on OPX_P) of INSN,
27626 + if it is a MEM, or NULL overwise. */
27627 +static enum attr_op_type
27628 +sched_get_opxy_mem_type (rtx insn, bool opx_p)
27629 +{
27630 + if (opx_p)
27631 + {
27632 + switch (get_attr_opx_type (insn))
27633 + {
27634 + case OPX_TYPE_NONE:
27635 + case OPX_TYPE_RN:
27636 + case OPX_TYPE_FPN:
27637 + case OPX_TYPE_IMM_Q:
27638 + case OPX_TYPE_IMM_W:
27639 + case OPX_TYPE_IMM_L:
27640 + return OP_TYPE_RN;
27641 +
27642 + case OPX_TYPE_MEM1:
27643 + case OPX_TYPE_MEM234:
27644 + case OPX_TYPE_MEM5:
27645 + case OPX_TYPE_MEM7:
27646 + return OP_TYPE_MEM1;
27647 +
27648 + case OPX_TYPE_MEM6:
27649 + return OP_TYPE_MEM6;
27650 +
27651 + default:
27652 + gcc_unreachable ();
27653 + return 0;
27654 + }
27655 + }
27656 + else
27657 + {
27658 + switch (get_attr_opy_type (insn))
27659 + {
27660 + case OPY_TYPE_NONE:
27661 + case OPY_TYPE_RN:
27662 + case OPY_TYPE_FPN:
27663 + case OPY_TYPE_IMM_Q:
27664 + case OPY_TYPE_IMM_W:
27665 + case OPY_TYPE_IMM_L:
27666 + return OP_TYPE_RN;
27667 +
27668 + case OPY_TYPE_MEM1:
27669 + case OPY_TYPE_MEM234:
27670 + case OPY_TYPE_MEM5:
27671 + case OPY_TYPE_MEM7:
27672 + return OP_TYPE_MEM1;
27673 +
27674 + case OPY_TYPE_MEM6:
27675 + return OP_TYPE_MEM6;
27676 +
27677 + default:
27678 + gcc_unreachable ();
27679 + return 0;
27680 + }
27681 + }
27682 +}
27683 +
27684 /* Implement op_mem attribute. */
27685 enum attr_op_mem
27686 m68k_sched_attr_op_mem (rtx insn)
27687 {
27688 - enum attr_opy_mem opy;
27689 - enum attr_opx_mem opx;
27690 + enum attr_op_type opx;
27691 + enum attr_op_type opy;
27692
27693 - sched_guess_p = (get_attr_guess (insn) == GUESS_YES);
27694 + opx = sched_get_opxy_mem_type (insn, true);
27695 + opy = sched_get_opxy_mem_type (insn, false);
27696
27697 - opy = get_attr_opy_mem (insn);
27698 - opx = get_attr_opx_mem (insn);
27699 -
27700 - if (opy == OPY_MEM_R && opx == OPX_MEM_R)
27701 + if (opy == OP_TYPE_RN && opx == OP_TYPE_RN)
27702 return OP_MEM_00;
27703
27704 - if (opy == OPY_MEM_R && opx == OPX_MEM_M)
27705 + if (opy == OP_TYPE_RN && opx == OP_TYPE_MEM1)
27706 {
27707 switch (get_attr_opx_access (insn))
27708 {
27709 @@ -4910,12 +5685,12 @@ m68k_sched_attr_op_mem (rtx insn)
27710 return OP_MEM_11;
27711
27712 default:
27713 - gcc_assert (sched_guess_p);
27714 - return OP_MEM_UNKNOWN;
27715 + gcc_unreachable ();
27716 + return 0;
27717 }
27718 }
27719
27720 - if (opy == OPY_MEM_R && opx == OPX_MEM_I)
27721 + if (opy == OP_TYPE_RN && opx == OP_TYPE_MEM6)
27722 {
27723 switch (get_attr_opx_access (insn))
27724 {
27725 @@ -4929,15 +5704,15 @@ m68k_sched_attr_op_mem (rtx insn)
27726 return OP_MEM_I1;
27727
27728 default:
27729 - gcc_assert (sched_guess_p);
27730 - return OP_MEM_UNKNOWN;
27731 + gcc_unreachable ();
27732 + return 0;
27733 }
27734 }
27735
27736 - if (opy == OPY_MEM_M && opx == OPX_MEM_R)
27737 + if (opy == OP_TYPE_MEM1 && opx == OP_TYPE_RN)
27738 return OP_MEM_10;
27739
27740 - if (opy == OPY_MEM_M && opx == OPX_MEM_M)
27741 + if (opy == OP_TYPE_MEM1 && opx == OP_TYPE_MEM1)
27742 {
27743 switch (get_attr_opx_access (insn))
27744 {
27745 @@ -4945,12 +5720,12 @@ m68k_sched_attr_op_mem (rtx insn)
27746 return OP_MEM_11;
27747
27748 default:
27749 - gcc_assert (sched_guess_p);
27750 - return OP_MEM_UNKNOWN;
27751 + gcc_assert (!reload_completed);
27752 + return OP_MEM_11;
27753 }
27754 }
27755
27756 - if (opy == OPY_MEM_M && opx == OPX_MEM_I)
27757 + if (opy == OP_TYPE_MEM1 && opx == OP_TYPE_MEM6)
27758 {
27759 switch (get_attr_opx_access (insn))
27760 {
27761 @@ -4958,16 +5733,15 @@ m68k_sched_attr_op_mem (rtx insn)
27762 return OP_MEM_1I;
27763
27764 default:
27765 - gcc_assert (sched_guess_p);
27766 - return OP_MEM_UNKNOWN;
27767 + gcc_assert (!reload_completed);
27768 + return OP_MEM_1I;
27769 }
27770 }
27771
27772 - if (opy == OPY_MEM_I && opx == OPX_MEM_R)
27773 + if (opy == OP_TYPE_MEM6 && opx == OP_TYPE_RN)
27774 return OP_MEM_I0;
27775
27776 -
27777 - if (opy == OPY_MEM_I && opx == OPX_MEM_M)
27778 + if (opy == OP_TYPE_MEM6 && opx == OP_TYPE_MEM1)
27779 {
27780 switch (get_attr_opx_access (insn))
27781 {
27782 @@ -4975,13 +5749,14 @@ m68k_sched_attr_op_mem (rtx insn)
27783 return OP_MEM_I1;
27784
27785 default:
27786 - gcc_assert (sched_guess_p);
27787 - return OP_MEM_UNKNOWN;
27788 + gcc_assert (!reload_completed);
27789 + return OP_MEM_I1;
27790 }
27791 }
27792
27793 - gcc_assert (sched_guess_p);
27794 - return OP_MEM_UNKNOWN;
27795 + gcc_assert (opy == OP_TYPE_MEM6 && opx == OP_TYPE_MEM6);
27796 + gcc_assert (!reload_completed);
27797 + return OP_MEM_I1;
27798 }
27799
27800 /* Jump instructions types. Indexed by INSN_UID.
27801 @@ -5004,66 +5779,21 @@ m68k_sched_branch_type (rtx insn)
27802 return type;
27803 }
27804
27805 -/* Implement type2 attribute. */
27806 -enum attr_type2
27807 -m68k_sched_attr_type2 (rtx insn)
27808 +/* Data for ColdFire V4 index bypass.
27809 + Producer modifies register that is used as index in consumer with
27810 + specified scale. */
27811 +static struct
27812 {
27813 - switch (get_attr_type1 (insn))
27814 - {
27815 - case TYPE1_ALU_REG1:
27816 - case TYPE1_ALU_REGX:
27817 - return TYPE2_ALU;
27818 -
27819 - case TYPE1_ALU_L:
27820 - case TYPE1_ALUQ_L:
27821 - case TYPE1_CMP_L:
27822 - return TYPE2_ALU_L;
27823 -
27824 - case TYPE1_BCC:
27825 - return TYPE2_BCC;
27826 -
27827 - case TYPE1_BRA:
27828 - return TYPE2_BRA;
27829 -
27830 - case TYPE1_BSR:
27831 - case TYPE1_JSR:
27832 - return TYPE2_CALL;
27833 -
27834 - case TYPE1_JMP:
27835 - return TYPE2_JMP;
27836 -
27837 - case TYPE1_LEA:
27838 - return TYPE2_LEA;
27839 -
27840 - case TYPE1_CLR:
27841 - case TYPE1_MOV3Q_L:
27842 - case TYPE1_MOVE:
27843 - case TYPE1_MOVEQ_L:
27844 - case TYPE1_TST:
27845 - return TYPE2_MOVE;
27846 -
27847 - case TYPE1_MOVE_L:
27848 - case TYPE1_TST_L:
27849 - return TYPE2_MOVE_L;
27850 + /* Producer instruction. */
27851 + rtx pro;
27852
27853 - case TYPE1_MUL_W:
27854 - case TYPE1_MUL_L:
27855 - return TYPE2_MUL;
27856 + /* Consumer instruction. */
27857 + rtx con;
27858
27859 - case TYPE1_PEA:
27860 - return TYPE2_PEA;
27861 -
27862 - case TYPE1_RTS:
27863 - return TYPE2_RTS;
27864 -
27865 - case TYPE1_UNLK:
27866 - return TYPE2_UNLK;
27867 -
27868 - default:
27869 - gcc_assert (get_attr_guess (insn) == GUESS_YES);
27870 - return TYPE2_UNKNOWN;
27871 - }
27872 -}
27873 + /* Scale of indexed memory access within consumer.
27874 + Or zero if bypass should not be effective at the moment. */
27875 + int scale;
27876 +} sched_cfv4_bypass_data;
27877
27878 /* An empty state that is used in m68k_sched_adjust_cost. */
27879 static state_t sched_adjust_cost_state;
27880 @@ -5080,13 +5810,33 @@ m68k_sched_adjust_cost (rtx insn, rtx li
27881 || recog_memoized (insn) < 0)
27882 return cost;
27883
27884 + if (sched_cfv4_bypass_data.scale == 1)
27885 + /* Handle ColdFire V4 bypass for indexed address with 1x scale. */
27886 + {
27887 + /* haifa-sched.c: insn_cost () calls bypass_p () just before
27888 + targetm.sched.adjust_cost (). Hence, we can be relatively sure
27889 + that the data in sched_cfv4_bypass_data is up to date. */
27890 + gcc_assert (sched_cfv4_bypass_data.pro == def_insn
27891 + && sched_cfv4_bypass_data.con == insn);
27892 +
27893 + if (cost < 3)
27894 + cost = 3;
27895 +
27896 + sched_cfv4_bypass_data.pro = NULL;
27897 + sched_cfv4_bypass_data.con = NULL;
27898 + sched_cfv4_bypass_data.scale = 0;
27899 + }
27900 + else
27901 + gcc_assert (sched_cfv4_bypass_data.pro == NULL
27902 + && sched_cfv4_bypass_data.con == NULL
27903 + && sched_cfv4_bypass_data.scale == 0);
27904 +
27905 /* Don't try to issue INSN earlier than DFA permits.
27906 This is especially useful for instructions that write to memory,
27907 as their true dependence (default) latency is better to be set to 0
27908 to workaround alias analysis limitations.
27909 This is, in fact, a machine independent tweak, so, probably,
27910 it should be moved to haifa-sched.c: insn_cost (). */
27911 -
27912 delay = min_insn_conflict_delay (sched_adjust_cost_state, def_insn, insn);
27913 if (delay > cost)
27914 cost = delay;
27915 @@ -5094,237 +5844,147 @@ m68k_sched_adjust_cost (rtx insn, rtx li
27916 return cost;
27917 }
27918
27919 -/* Size of the instruction buffer in words. */
27920 -static int sched_ib_size;
27921 -
27922 -/* Number of filled words in the instruction buffer. */
27923 -static int sched_ib_filled;
27924 -
27925 -/* An insn that reserves (marks empty) one word in the instruction buffer. */
27926 -static rtx sched_ib_insn;
27927 -
27928 -/* ID of memory unit. */
27929 -static int sched_mem_unit_code;
27930 -
27931 -/* Implementation of the targetm.sched.variable_issue () hook.
27932 - It is called after INSN was issued. It returns the number of insns
27933 - that can possibly get scheduled on the current cycle.
27934 - It is used here to determine the effect of INSN on the instruction
27935 - buffer. */
27936 +/* Return maximal number of insns that can be scheduled on a single cycle. */
27937 static int
27938 -m68k_sched_variable_issue (FILE *sched_dump ATTRIBUTE_UNUSED,
27939 - int sched_verbose ATTRIBUTE_UNUSED,
27940 - rtx insn, int can_issue_more)
27941 -{
27942 - int insn_size;
27943 -
27944 - if (recog_memoized (insn) >= 0)
27945 - {
27946 - insn_size = get_attr_size (insn);
27947 -
27948 - gcc_assert (insn_size <= sched_ib_filled);
27949 -
27950 - --can_issue_more;
27951 - }
27952 - else if (GET_CODE (PATTERN (insn)) == ASM_INPUT
27953 - || asm_noperands (PATTERN (insn)) >= 0)
27954 - insn_size = sched_ib_filled;
27955 - else
27956 - insn_size = 0;
27957 -
27958 - sched_ib_filled -= insn_size;
27959 -
27960 - return can_issue_more;
27961 -}
27962 -
27963 -/* Statistics gatherer. */
27964 -
27965 -typedef enum
27966 - {
27967 - /* Something needs to be done for this insn. */
27968 - SCHED_DUMP_TODO,
27969 -
27970 - /* Support for this insn is complete. */
27971 - SCHED_DUMP_DONE,
27972 -
27973 - /* This insn didn't require much effort to support it. */
27974 - SCHED_DUMP_NOTHING
27975 - } sched_dump_class_def;
27976 -
27977 -/* Pointer to functions that classifies insns into 3 above classes. */
27978 -typedef sched_dump_class_def (*sched_dump_class_func_t) (rtx);
27979 -
27980 -/* Return statistical type of INSN regarding splits. */
27981 -static sched_dump_class_def
27982 -sched_dump_split_class (rtx insn)
27983 +m68k_sched_issue_rate (void)
27984 {
27985 - int i;
27986 -
27987 - i = recog_memoized (insn);
27988 - gcc_assert (i >= 0);
27989 -
27990 - switch (get_attr_split (insn))
27991 + switch (m68k_sched_cpu)
27992 {
27993 - case SPLIT_TODO:
27994 - return SCHED_DUMP_TODO;
27995 -
27996 - case SPLIT_DONE:
27997 - return SCHED_DUMP_DONE;
27998 + case CPU_CFV1:
27999 + case CPU_CFV2:
28000 + case CPU_CFV3:
28001 + return 1;
28002
28003 - case SPLIT_NOTHING:
28004 - return SCHED_DUMP_NOTHING;
28005 + case CPU_CFV4:
28006 + return 2;
28007
28008 default:
28009 gcc_unreachable ();
28010 + return 0;
28011 }
28012 }
28013
28014 -/* ID of the guess unit. */
28015 -static int sched_dump_dfa_guess_unit_code;
28016 +/* Maximal length of instruction for current CPU.
28017 + E.g. it is 3 for any ColdFire core. */
28018 +static int max_insn_size;
28019
28020 -/* DFA state for use in sched_dump_dfa_class (). */
28021 -static state_t sched_dump_dfa_state;
28022 -
28023 -/* Return statistical type of INSN regarding DFA reservations. */
28024 -static sched_dump_class_def
28025 -sched_dump_dfa_class (rtx insn)
28026 +/* Data to model instruction buffer of CPU. */
28027 +struct _sched_ib
28028 {
28029 - int i;
28030 + /* True if instruction buffer model is modeled for current CPU. */
28031 + bool enabled_p;
28032
28033 - i = recog_memoized (insn);
28034 - gcc_assert (i >= 0 && insn_has_dfa_reservation_p (insn));
28035 + /* Size of the instruction buffer in words. */
28036 + int size;
28037
28038 - if (sched_dump_split_class (insn) == SCHED_DUMP_TODO)
28039 - /* Insn is not yet ready for reservations. */
28040 - return SCHED_DUMP_NOTHING;
28041 + /* Number of filled words in the instruction buffer. */
28042 + int filled;
28043
28044 - state_reset (sched_dump_dfa_state);
28045 + /* Additional information about instruction buffer for CPUs that have
28046 + a buffer of instruction records, rather then a plain buffer
28047 + of instruction words. */
28048 + struct _sched_ib_records
28049 + {
28050 + /* Size of buffer in records. */
28051 + int n_insns;
28052
28053 - if (state_transition (sched_dump_dfa_state, insn) >= 0)
28054 - gcc_unreachable ();
28055 + /* Array to hold data on adjustements made to the size of the buffer. */
28056 + int *adjust;
28057
28058 - if (cpu_unit_reservation_p (sched_dump_dfa_state,
28059 - sched_dump_dfa_guess_unit_code))
28060 - return SCHED_DUMP_TODO;
28061 + /* Index of the above array. */
28062 + int adjust_index;
28063 + } records;
28064
28065 - return SCHED_DUMP_DONE;
28066 -}
28067 -
28068 -/* Dump statistics on current function into file DUMP_FILENAME and prefix
28069 - each entry with PREFIX.
28070 - Instructions are classified with DUMP_CLASS. */
28071 -static void
28072 -m68k_sched_dump (sched_dump_class_func_t dump_class,
28073 - const char *prefix, FILE *dump)
28074 -{
28075 - sbitmap present;
28076 - int *todos;
28077 - int *dones;
28078 - int *nothings;
28079 + /* An insn that reserves (marks empty) one word in the instruction buffer. */
28080 rtx insn;
28081 +};
28082
28083 - gcc_assert (dump != NULL);
28084 +static struct _sched_ib sched_ib;
28085
28086 - present = sbitmap_alloc (CODE_FOR_nothing);
28087 - sbitmap_zero (present);
28088 +/* ID of memory unit. */
28089 +static int sched_mem_unit_code;
28090
28091 - todos = xcalloc (CODE_FOR_nothing, sizeof (*todos));
28092 - dones = xcalloc (CODE_FOR_nothing, sizeof (*dones));
28093 - nothings = xcalloc (CODE_FOR_nothing, sizeof (*nothings));
28094 +/* Implementation of the targetm.sched.variable_issue () hook.
28095 + It is called after INSN was issued. It returns the number of insns
28096 + that can possibly get scheduled on the current cycle.
28097 + It is used here to determine the effect of INSN on the instruction
28098 + buffer. */
28099 +static int
28100 +m68k_sched_variable_issue (FILE *sched_dump ATTRIBUTE_UNUSED,
28101 + int sched_verbose ATTRIBUTE_UNUSED,
28102 + rtx insn, int can_issue_more)
28103 +{
28104 + int insn_size;
28105
28106 - /* Gather statistics. */
28107 - for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn))
28108 + if (recog_memoized (insn) >= 0 && get_attr_type (insn) != TYPE_IGNORE)
28109 {
28110 - if (INSN_P (insn) && recog_memoized (insn) >= 0)
28111 + switch (m68k_sched_cpu)
28112 {
28113 - enum insn_code code;
28114 + case CPU_CFV1:
28115 + case CPU_CFV2:
28116 + insn_size = sched_get_attr_size_int (insn);
28117 + break;
28118 +
28119 + case CPU_CFV3:
28120 + insn_size = sched_get_attr_size_int (insn);
28121 +
28122 + /* ColdFire V3 and V4 cores have instruction buffers that can
28123 + accumulate up to 8 instructions regardless of instructions'
28124 + sizes. So we should take care not to "prefetch" 24 one-word
28125 + or 12 two-words instructions.
28126 + To model this behavior we temporarily decrease size of the
28127 + buffer by (max_insn_size - insn_size) for next 7 instructions. */
28128 + {
28129 + int adjust;
28130
28131 - code = INSN_CODE (insn);
28132 - gcc_assert (code < CODE_FOR_nothing);
28133 + adjust = max_insn_size - insn_size;
28134 + sched_ib.size -= adjust;
28135
28136 - SET_BIT (present, code);
28137 + if (sched_ib.filled > sched_ib.size)
28138 + sched_ib.filled = sched_ib.size;
28139
28140 - switch (dump_class (insn))
28141 - {
28142 - case SCHED_DUMP_TODO:
28143 - ++todos[code];
28144 - break;
28145 + sched_ib.records.adjust[sched_ib.records.adjust_index] = adjust;
28146 + }
28147
28148 - case SCHED_DUMP_DONE:
28149 - ++dones[code];
28150 - break;
28151 + ++sched_ib.records.adjust_index;
28152 + if (sched_ib.records.adjust_index == sched_ib.records.n_insns)
28153 + sched_ib.records.adjust_index = 0;
28154 +
28155 + /* Undo adjustement we did 7 instructions ago. */
28156 + sched_ib.size
28157 + += sched_ib.records.adjust[sched_ib.records.adjust_index];
28158 +
28159 + break;
28160 +
28161 + case CPU_CFV4:
28162 + gcc_assert (!sched_ib.enabled_p);
28163 + insn_size = 0;
28164 + break;
28165
28166 - case SCHED_DUMP_NOTHING:
28167 - ++nothings[code];
28168 - break;
28169 - }
28170 + default:
28171 + gcc_unreachable ();
28172 }
28173 - }
28174 -
28175 - /* Print statisctics. */
28176 - {
28177 - unsigned int i;
28178 - sbitmap_iterator si;
28179 - int total_todo;
28180 - int total_done;
28181 - int total_nothing;
28182 -
28183 - total_todo = 0;
28184 - total_done = 0;
28185 - total_nothing = 0;
28186 -
28187 - EXECUTE_IF_SET_IN_SBITMAP (present, 0, i, si)
28188 - {
28189 - int todo;
28190 - int done;
28191 - int nothing;
28192 - enum insn_code code;
28193 -
28194 - code = (enum insn_code) i;
28195 -
28196 - todo = todos[code];
28197 - done = dones[code];
28198 - nothing = nothings[code];
28199 -
28200 - total_todo += todo;
28201 - total_done += done;
28202 - total_nothing += nothing;
28203
28204 - if (todo != 0)
28205 - {
28206 - fprintf (dump,
28207 - "%s: %3d: %d / %d / %d ;",
28208 - prefix, code, todo, done, nothing);
28209 -
28210 - {
28211 - const char *name;
28212 -
28213 - name = get_insn_name (code);
28214 -
28215 - if (name != NULL)
28216 - fprintf (dump, " {%s}\n", name);
28217 - else
28218 - fprintf (dump, " {unknown}\n");
28219 - }
28220 - }
28221 - }
28222 -
28223 - gcc_assert (CODE_FOR_nothing < 999);
28224 + gcc_assert (insn_size <= sched_ib.filled);
28225 + --can_issue_more;
28226 + }
28227 + else if (GET_CODE (PATTERN (insn)) == ASM_INPUT
28228 + || asm_noperands (PATTERN (insn)) >= 0)
28229 + insn_size = sched_ib.filled;
28230 + else
28231 + insn_size = 0;
28232
28233 - fprintf (dump,
28234 - "%s: 999: %d / %d / %d ; {total}\n",
28235 - prefix, total_todo, total_done, total_nothing);
28236 - }
28237 + sched_ib.filled -= insn_size;
28238
28239 - free (nothings);
28240 - nothings = NULL;
28241 - free (dones);
28242 - dones = NULL;
28243 - free (todos);
28244 - todos = NULL;
28245 + return can_issue_more;
28246 +}
28247
28248 - sbitmap_free (present);
28249 - present = NULL;
28250 +/* Return how many instructions should scheduler lookahead to choose the
28251 + best one. */
28252 +static int
28253 +m68k_sched_first_cycle_multipass_dfa_lookahead (void)
28254 +{
28255 + return m68k_sched_issue_rate () - 1;
28256 }
28257
28258 /* Implementation of targetm.sched.md_init_global () hook.
28259 @@ -5350,40 +6010,69 @@ m68k_sched_md_init_global (FILE *sched_d
28260 }
28261 }
28262
28263 - if (reload_completed && sched_verbose >= 8)
28264 - /* Dump statistics. */
28265 - {
28266 - m68k_sched_dump (sched_dump_split_class, "m68k_sched_split",
28267 - sched_dump);
28268 +#ifdef ENABLE_CHECKING
28269 + /* Check that all instructions have DFA reservations and
28270 + that all instructions can be issued from a clean state. */
28271 + {
28272 + rtx insn;
28273 + state_t state;
28274
28275 - sched_dump_dfa_guess_unit_code = get_cpu_unit_code ("cf_v2_guess");
28276 - sched_dump_dfa_state = alloca (state_size ());
28277 + state = alloca (state_size ());
28278
28279 - m68k_sched_dump (sched_dump_dfa_class, "m68k_sched_dfa",
28280 - sched_dump);
28281 + for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn))
28282 + {
28283 + if (INSN_P (insn) && recog_memoized (insn) >= 0)
28284 + {
28285 + gcc_assert (insn_has_dfa_reservation_p (insn));
28286
28287 - sched_dump_dfa_state = NULL;
28288 - sched_dump_dfa_guess_unit_code = 0;
28289 - }
28290 + state_reset (state);
28291 + if (state_transition (state, insn) >= 0)
28292 + gcc_unreachable ();
28293 + }
28294 + }
28295 + }
28296 +#endif
28297
28298 /* Setup target cpu. */
28299 +
28300 + /* ColdFire V4 has a set of features to keep its instruction buffer full
28301 + (e.g., a separate memory bus for instructions) and, hence, we do not model
28302 + buffer for this CPU. */
28303 + sched_ib.enabled_p = (m68k_sched_cpu != CPU_CFV4);
28304 +
28305 switch (m68k_sched_cpu)
28306 {
28307 - case CPU_CF_V2:
28308 - sched_ib_size = 6;
28309 - sched_mem_unit_code = get_cpu_unit_code ("cf_v2_mem");
28310 + case CPU_CFV4:
28311 + sched_ib.filled = 0;
28312 +
28313 + /* FALLTHRU */
28314 +
28315 + case CPU_CFV1:
28316 + case CPU_CFV2:
28317 + max_insn_size = 3;
28318 + sched_ib.records.n_insns = 0;
28319 + sched_ib.records.adjust = NULL;
28320 + break;
28321 +
28322 + case CPU_CFV3:
28323 + max_insn_size = 3;
28324 + sched_ib.records.n_insns = 8;
28325 + sched_ib.records.adjust = xmalloc (sched_ib.records.n_insns
28326 + * sizeof (*sched_ib.records.adjust));
28327 break;
28328
28329 default:
28330 gcc_unreachable ();
28331 }
28332
28333 + sched_mem_unit_code = get_cpu_unit_code ("cf_mem1");
28334 +
28335 sched_adjust_cost_state = xmalloc (state_size ());
28336 state_reset (sched_adjust_cost_state);
28337
28338 start_sequence ();
28339 emit_insn (gen_ib ());
28340 - sched_ib_insn = get_insns ();
28341 + sched_ib.insn = get_insns ();
28342 end_sequence ();
28343 }
28344
28345 @@ -5392,13 +6081,17 @@ static void
28346 m68k_sched_md_finish_global (FILE *dump ATTRIBUTE_UNUSED,
28347 int verbose ATTRIBUTE_UNUSED)
28348 {
28349 - sched_ib_insn = NULL;
28350 + sched_ib.insn = NULL;
28351
28352 free (sched_adjust_cost_state);
28353 sched_adjust_cost_state = NULL;
28354
28355 sched_mem_unit_code = 0;
28356 - sched_ib_size = 0;
28357 +
28358 + free (sched_ib.records.adjust);
28359 + sched_ib.records.adjust = NULL;
28360 + sched_ib.records.n_insns = 0;
28361 + max_insn_size = 0;
28362
28363 free (sched_branch_type);
28364 sched_branch_type = NULL;
28365 @@ -5412,9 +6105,34 @@ m68k_sched_md_init (FILE *sched_dump ATT
28366 int sched_verbose ATTRIBUTE_UNUSED,
28367 int n_insns ATTRIBUTE_UNUSED)
28368 {
28369 - /* haifa-sched.c: schedule_block () calls advance_cycle () just before
28370 - the first cycle. Workaround that. */
28371 - sched_ib_filled = -2;
28372 + switch (m68k_sched_cpu)
28373 + {
28374 + case CPU_CFV1:
28375 + case CPU_CFV2:
28376 + sched_ib.size = 6;
28377 + break;
28378 +
28379 + case CPU_CFV3:
28380 + sched_ib.size = sched_ib.records.n_insns * max_insn_size;
28381 +
28382 + memset (sched_ib.records.adjust, 0,
28383 + sched_ib.records.n_insns * sizeof (*sched_ib.records.adjust));
28384 + sched_ib.records.adjust_index = 0;
28385 + break;
28386 +
28387 + case CPU_CFV4:
28388 + gcc_assert (!sched_ib.enabled_p);
28389 + sched_ib.size = 0;
28390 + break;
28391 +
28392 + default:
28393 + gcc_unreachable ();
28394 + }
28395 +
28396 + if (sched_ib.enabled_p)
28397 + /* haifa-sched.c: schedule_block () calls advance_cycle () just before
28398 + the first cycle. Workaround that. */
28399 + sched_ib.filled = -2;
28400 }
28401
28402 /* Implementation of targetm.sched.dfa_pre_advance_cycle () hook.
28403 @@ -5423,12 +6141,15 @@ m68k_sched_md_init (FILE *sched_dump ATT
28404 static void
28405 m68k_sched_dfa_pre_advance_cycle (void)
28406 {
28407 + if (!sched_ib.enabled_p)
28408 + return;
28409 +
28410 if (!cpu_unit_reservation_p (curr_state, sched_mem_unit_code))
28411 {
28412 - sched_ib_filled += 2;
28413 + sched_ib.filled += 2;
28414
28415 - if (sched_ib_filled > sched_ib_size)
28416 - sched_ib_filled = sched_ib_size;
28417 + if (sched_ib.filled > sched_ib.size)
28418 + sched_ib.filled = sched_ib.size;
28419 }
28420 }
28421
28422 @@ -5441,13 +6162,180 @@ static void
28423 m68k_sched_dfa_post_advance_cycle (void)
28424 {
28425 int i;
28426 - int n;
28427 +
28428 + if (!sched_ib.enabled_p)
28429 + return;
28430
28431 /* Setup number of prefetched instruction words in the instruction
28432 buffer. */
28433 - for (i = sched_ib_filled, n = sched_ib_size; i < n; ++i)
28434 + i = max_insn_size - sched_ib.filled;
28435 +
28436 + while (--i >= 0)
28437 {
28438 - if (state_transition (curr_state, sched_ib_insn) >= 0)
28439 + if (state_transition (curr_state, sched_ib.insn) >= 0)
28440 gcc_unreachable ();
28441 }
28442 }
28443 +
28444 +/* Return X or Y (depending on OPX_P) operand of INSN,
28445 + if it is an integer register, or NULL overwise. */
28446 +static rtx
28447 +sched_get_reg_operand (rtx insn, bool opx_p)
28448 +{
28449 + rtx op = NULL;
28450 +
28451 + if (opx_p)
28452 + {
28453 + if (get_attr_opx_type (insn) == OPX_TYPE_RN)
28454 + {
28455 + op = sched_get_operand (insn, true);
28456 + gcc_assert (op != NULL);
28457 +
28458 + if (!reload_completed && !REG_P (op))
28459 + return NULL;
28460 + }
28461 + }
28462 + else
28463 + {
28464 + if (get_attr_opy_type (insn) == OPY_TYPE_RN)
28465 + {
28466 + op = sched_get_operand (insn, false);
28467 + gcc_assert (op != NULL);
28468 +
28469 + if (!reload_completed && !REG_P (op))
28470 + return NULL;
28471 + }
28472 + }
28473 +
28474 + return op;
28475 +}
28476 +
28477 +/* Return true, if X or Y (depending on OPX_P) operand of INSN
28478 + is a MEM. */
28479 +static bool
28480 +sched_mem_operand_p (rtx insn, bool opx_p)
28481 +{
28482 + switch (sched_get_opxy_mem_type (insn, opx_p))
28483 + {
28484 + case OP_TYPE_MEM1:
28485 + case OP_TYPE_MEM6:
28486 + return true;
28487 +
28488 + default:
28489 + return false;
28490 + }
28491 +}
28492 +
28493 +/* Return X or Y (depending on OPX_P) operand of INSN,
28494 + if it is a MEM, or NULL overwise. */
28495 +static rtx
28496 +sched_get_mem_operand (rtx insn, bool must_read_p, bool must_write_p)
28497 +{
28498 + bool opx_p;
28499 + bool opy_p;
28500 +
28501 + opx_p = false;
28502 + opy_p = false;
28503 +
28504 + if (must_read_p)
28505 + {
28506 + opx_p = true;
28507 + opy_p = true;
28508 + }
28509 +
28510 + if (must_write_p)
28511 + {
28512 + opx_p = true;
28513 + opy_p = false;
28514 + }
28515 +
28516 + if (opy_p && sched_mem_operand_p (insn, false))
28517 + return sched_get_operand (insn, false);
28518 +
28519 + if (opx_p && sched_mem_operand_p (insn, true))
28520 + return sched_get_operand (insn, true);
28521 +
28522 + gcc_unreachable ();
28523 + return NULL;
28524 +}
28525 +
28526 +/* Return non-zero if PRO modifies register used as part of
28527 + address in CON. */
28528 +int
28529 +m68k_sched_address_bypass_p (rtx pro, rtx con)
28530 +{
28531 + rtx pro_x;
28532 + rtx con_mem_read;
28533 +
28534 + pro_x = sched_get_reg_operand (pro, true);
28535 + if (pro_x == NULL)
28536 + return 0;
28537 +
28538 + con_mem_read = sched_get_mem_operand (con, true, false);
28539 + gcc_assert (con_mem_read != NULL);
28540 +
28541 + if (reg_mentioned_p (pro_x, con_mem_read))
28542 + return 1;
28543 +
28544 + return 0;
28545 +}
28546 +
28547 +/* Helper function for m68k_sched_indexed_address_bypass_p.
28548 + if PRO modifies register used as index in CON,
28549 + return scale of indexed memory access in CON. Return zero overwise. */
28550 +static int
28551 +sched_get_indexed_address_scale (rtx pro, rtx con)
28552 +{
28553 + rtx reg;
28554 + rtx mem;
28555 + struct m68k_address address;
28556 +
28557 + reg = sched_get_reg_operand (pro, true);
28558 + if (reg == NULL)
28559 + return 0;
28560 +
28561 + mem = sched_get_mem_operand (con, true, false);
28562 + gcc_assert (mem != NULL && MEM_P (mem));
28563 +
28564 + if (!m68k_decompose_address (GET_MODE (mem), XEXP (mem, 0), reload_completed,
28565 + &address))
28566 + gcc_unreachable ();
28567 +
28568 + if (REGNO (reg) == REGNO (address.index))
28569 + {
28570 + gcc_assert (address.scale != 0);
28571 + return address.scale;
28572 + }
28573 +
28574 + return 0;
28575 +}
28576 +
28577 +/* Return non-zero if PRO modifies register used
28578 + as index with scale 2 or 4 in CON. */
28579 +int
28580 +m68k_sched_indexed_address_bypass_p (rtx pro, rtx con)
28581 +{
28582 + gcc_assert (sched_cfv4_bypass_data.pro == NULL
28583 + && sched_cfv4_bypass_data.con == NULL
28584 + && sched_cfv4_bypass_data.scale == 0);
28585 +
28586 + switch (sched_get_indexed_address_scale (pro, con))
28587 + {
28588 + case 1:
28589 + /* We can't have a variable latency bypass, so
28590 + remember to adjust the insn cost in adjust_cost hook. */
28591 + sched_cfv4_bypass_data.pro = pro;
28592 + sched_cfv4_bypass_data.con = con;
28593 + sched_cfv4_bypass_data.scale = 1;
28594 + return 0;
28595 +
28596 + case 2:
28597 + case 4:
28598 + return 1;
28599 +
28600 + default:
28601 + return 0;
28602 + }
28603 +}
28604 +
28605 +#include "gt-m68k.h"
28606 --- a/gcc/config/m68k/m68k.h
28607 +++ b/gcc/config/m68k/m68k.h
28608 @@ -232,6 +232,7 @@ along with GCC; see the file COPYING3.
28609 #define FL_ISA_C (1 << 16)
28610 #define FL_FIDOA (1 << 17)
28611 #define FL_MMU 0 /* Used by multilib machinery. */
28612 +#define FL_UCLINUX 0 /* Used by multilib machinery. */
28613
28614 #define TARGET_68010 ((m68k_cpu_flags & FL_ISA_68010) != 0)
28615 #define TARGET_68020 ((m68k_cpu_flags & FL_ISA_68020) != 0)
28616 @@ -266,6 +267,11 @@ along with GCC; see the file COPYING3.
28617 #define TUNE_CPU32 (m68k_tune == ucpu32)
28618 #define TUNE_CFV1 (m68k_tune == ucfv1)
28619 #define TUNE_CFV2 (m68k_tune == ucfv2)
28620 +#define TUNE_CFV3 (m68k_tune == ucfv3)
28621 +#define TUNE_CFV4 (m68k_tune == ucfv4 || m68k_tune == ucfv4e)
28622 +
28623 +#define TUNE_MAC ((m68k_tune_flags & FL_CF_MAC) != 0)
28624 +#define TUNE_EMAC ((m68k_tune_flags & FL_CF_EMAC) != 0)
28625
28626 #define OVERRIDE_OPTIONS override_options()
28627
28628 @@ -496,7 +502,8 @@ enum reg_class {
28629
28630 extern enum reg_class regno_reg_class[];
28631 #define REGNO_REG_CLASS(REGNO) (regno_reg_class[(REGNO)])
28632 -#define INDEX_REG_CLASS GENERAL_REGS
28633 +#define MODE_INDEX_REG_CLASS(MODE) \
28634 + (MODE_OK_FOR_INDEX_P (MODE) ? GENERAL_REGS : NO_REGS)
28635 #define BASE_REG_CLASS ADDR_REGS
28636
28637 #define PREFERRED_RELOAD_CLASS(X,CLASS) \
28638 @@ -665,6 +672,10 @@ __transfer_from_trampoline () \
28639 #define HAVE_POST_INCREMENT 1
28640 #define HAVE_PRE_DECREMENT 1
28641
28642 +/* Return true if addresses of mode MODE can have an index register. */
28643 +#define MODE_OK_FOR_INDEX_P(MODE) \
28644 + (!TARGET_COLDFIRE_FPU || GET_MODE_CLASS (MODE) != MODE_FLOAT)
28645 +
28646 /* Macros to check register numbers against specific register classes. */
28647
28648 /* True for data registers, D0 through D7. */
28649 @@ -679,9 +690,10 @@ __transfer_from_trampoline () \
28650 /* True for floating point registers, FP0 through FP7. */
28651 #define FP_REGNO_P(REGNO) IN_RANGE (REGNO, 16, 23)
28652
28653 -#define REGNO_OK_FOR_INDEX_P(REGNO) \
28654 - (INT_REGNO_P (REGNO) \
28655 - || INT_REGNO_P (reg_renumber[REGNO]))
28656 +#define REGNO_MODE_OK_FOR_INDEX_P(REGNO, MODE) \
28657 + (MODE_OK_FOR_INDEX_P (MODE) \
28658 + && (INT_REGNO_P (REGNO) \
28659 + || INT_REGNO_P (reg_renumber[REGNO])))
28660
28661 #define REGNO_OK_FOR_BASE_P(REGNO) \
28662 (ADDRESS_REGNO_P (REGNO) \
28663 @@ -741,13 +753,14 @@ __transfer_from_trampoline () \
28664
28665 #define LEGITIMATE_PIC_OPERAND_P(X) \
28666 (!symbolic_operand (X, VOIDmode) \
28667 - || (TARGET_PCREL && REG_STRICT_P))
28668 + || (TARGET_PCREL && REG_STRICT_P) \
28669 + || m68k_tls_mentioned_p (X))
28670
28671 #define REG_OK_FOR_BASE_P(X) \
28672 m68k_legitimate_base_reg_p (X, REG_STRICT_P)
28673
28674 -#define REG_OK_FOR_INDEX_P(X) \
28675 - m68k_legitimate_index_reg_p (X, REG_STRICT_P)
28676 +#define REG_MODE_OK_FOR_INDEX_P(X, MODE) \
28677 + m68k_legitimate_index_reg_p (MODE, X, REG_STRICT_P)
28678
28679 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
28680 do \
28681 @@ -760,52 +773,19 @@ __transfer_from_trampoline () \
28682 /* This address is OK as it stands. */
28683 #define PIC_CASE_VECTOR_ADDRESS(index) index
28684 \f
28685 -/* For the 68000, we handle X+REG by loading X into a register R and
28686 - using R+REG. R will go in an address reg and indexing will be used.
28687 - However, if REG is a broken-out memory address or multiplication,
28688 - nothing needs to be done because REG can certainly go in an address reg. */
28689 -#define COPY_ONCE(Y) if (!copied) { Y = copy_rtx (Y); copied = ch = 1; }
28690 -#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
28691 -{ register int ch = (X) != (OLDX); \
28692 - if (GET_CODE (X) == PLUS) \
28693 - { int copied = 0; \
28694 - if (GET_CODE (XEXP (X, 0)) == MULT) \
28695 - { COPY_ONCE (X); XEXP (X, 0) = force_operand (XEXP (X, 0), 0);} \
28696 - if (GET_CODE (XEXP (X, 1)) == MULT) \
28697 - { COPY_ONCE (X); XEXP (X, 1) = force_operand (XEXP (X, 1), 0);} \
28698 - if (ch && GET_CODE (XEXP (X, 1)) == REG \
28699 - && GET_CODE (XEXP (X, 0)) == REG) \
28700 - { if (TARGET_COLDFIRE_FPU \
28701 - && GET_MODE_CLASS (MODE) == MODE_FLOAT) \
28702 - { COPY_ONCE (X); X = force_operand (X, 0);} \
28703 - goto WIN; } \
28704 - if (ch) { GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN); } \
28705 - if (GET_CODE (XEXP (X, 0)) == REG \
28706 - || (GET_CODE (XEXP (X, 0)) == SIGN_EXTEND \
28707 - && GET_CODE (XEXP (XEXP (X, 0), 0)) == REG \
28708 - && GET_MODE (XEXP (XEXP (X, 0), 0)) == HImode)) \
28709 - { register rtx temp = gen_reg_rtx (Pmode); \
28710 - register rtx val = force_operand (XEXP (X, 1), 0); \
28711 - emit_move_insn (temp, val); \
28712 - COPY_ONCE (X); \
28713 - XEXP (X, 1) = temp; \
28714 - if (TARGET_COLDFIRE_FPU && GET_MODE_CLASS (MODE) == MODE_FLOAT \
28715 - && GET_CODE (XEXP (X, 0)) == REG) \
28716 - X = force_operand (X, 0); \
28717 - goto WIN; } \
28718 - else if (GET_CODE (XEXP (X, 1)) == REG \
28719 - || (GET_CODE (XEXP (X, 1)) == SIGN_EXTEND \
28720 - && GET_CODE (XEXP (XEXP (X, 1), 0)) == REG \
28721 - && GET_MODE (XEXP (XEXP (X, 1), 0)) == HImode)) \
28722 - { register rtx temp = gen_reg_rtx (Pmode); \
28723 - register rtx val = force_operand (XEXP (X, 0), 0); \
28724 - emit_move_insn (temp, val); \
28725 - COPY_ONCE (X); \
28726 - XEXP (X, 0) = temp; \
28727 - if (TARGET_COLDFIRE_FPU && GET_MODE_CLASS (MODE) == MODE_FLOAT \
28728 - && GET_CODE (XEXP (X, 1)) == REG) \
28729 - X = force_operand (X, 0); \
28730 - goto WIN; }}}
28731 +#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
28732 +do { \
28733 + rtx __x; \
28734 + \
28735 + __x = m68k_legitimize_address (X, OLDX, MODE); \
28736 + if (__x != NULL_RTX) \
28737 + { \
28738 + X = __x; \
28739 + \
28740 + if (memory_address_p (MODE, X)) \
28741 + goto WIN; \
28742 + } \
28743 +} while (0)
28744
28745 /* On the 68000, only predecrement and postincrement address depend thus
28746 (the amount of decrement or increment being the length of the operand).
28747 @@ -845,6 +825,14 @@ __transfer_from_trampoline () \
28748 some or all of the saved cc's so they won't be used. */
28749 #define NOTICE_UPDATE_CC(EXP,INSN) notice_update_cc (EXP, INSN)
28750
28751 +/* The shift instructions always clear the overflow bit. */
28752 +#define CC_OVERFLOW_UNUSABLE 01000
28753 +
28754 +/* The shift instructions use the carry bit in a way not compatible with
28755 + conditional branches. conditions.h uses CC_NO_OVERFLOW for this purpose.
28756 + Rename it to something more understandable. */
28757 +#define CC_NO_CARRY CC_NO_OVERFLOW
28758 +
28759 #define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV) \
28760 do { if (cc_prev_status.flags & CC_IN_68881) \
28761 return FLOAT; \
28762 @@ -1077,6 +1065,12 @@ do { if (cc_prev_status.flags & CC_IN_68
28763
28764 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
28765
28766 +#define OUTPUT_ADDR_CONST_EXTRA(FILE, X, FAIL) \
28767 +do { \
28768 + if (! m68k_output_addr_const_extra (FILE, (X))) \
28769 + goto FAIL; \
28770 +} while (0);
28771 +
28772 /* Values used in the MICROARCH argument to M68K_DEVICE. */
28773 enum uarch_type
28774 {
28775 @@ -1129,6 +1123,7 @@ extern enum target_device m68k_cpu;
28776 extern enum uarch_type m68k_tune;
28777 extern enum fpu_type m68k_fpu;
28778 extern unsigned int m68k_cpu_flags;
28779 +extern unsigned int m68k_tune_flags;
28780 extern const char *m68k_symbolic_call;
28781 extern const char *m68k_symbolic_jump;
28782
28783 @@ -1148,4 +1143,7 @@ extern M68K_CONST_METHOD m68k_const_meth
28784
28785 extern void m68k_emit_move_double (rtx [2]);
28786
28787 +extern int m68k_sched_address_bypass_p (rtx, rtx);
28788 +extern int m68k_sched_indexed_address_bypass_p (rtx, rtx);
28789 +
28790 #define CPU_UNITS_QUERY 1
28791 --- a/gcc/config/m68k/m68k.md
28792 +++ b/gcc/config/m68k/m68k.md
28793 @@ -115,6 +115,9 @@
28794 (UNSPEC_COS 2)
28795 (UNSPEC_GOT 3)
28796 (UNSPEC_IB 4)
28797 + (UNSPEC_TIE 5)
28798 + (UNSPEC_RELOC16 6)
28799 + (UNSPEC_RELOC32 7)
28800 ])
28801
28802 ;; UNSPEC_VOLATILE usage:
28803 @@ -144,197 +147,104 @@
28804 ;; ::::::::::::::::::::
28805
28806 ;; Processor type.
28807 -(define_attr "cpu" "cf_v2, unknown" (const (symbol_ref "m68k_sched_cpu")))
28808 +(define_attr "cpu" "cfv1, cfv2, cfv3, cfv4, unknown"
28809 + (const (symbol_ref "m68k_sched_cpu")))
28810
28811 -;; Instruction type.
28812 -;; Basically, an asm pattern.
28813 -(define_attr "type"
28814 - "add_l, addq_l, asr_l, bcc, bclr, bra, bset, bsr,
28815 - clr_b, clr_w, clr_l, cmp_l,
28816 - ext_w, extb_l, ext_l,
28817 - fadd, fcmp, fdiv, ff1, fintrz, fmove, fmul, fsqrt, fsub, ftst, jmp, jsr,
28818 - ib,
28819 - lea, lsr_l,
28820 - move_b, move_w, move_l, moveq_l, mov3q_l, mvs_b, mvs_w, mvz_b, mvz_w,
28821 - muls_w, muls_l, mulu_w, mulu_l,
28822 - neg_l, nop, not_l,
28823 - pea, rts,
28824 - scc, sub_l, subq_l,
28825 - trap, tst_b, tst_l, tst_w,
28826 - unlk, unknown"
28827 - (const_string "unknown"))
28828 +;; MAC type.
28829 +(define_attr "mac" "no, cf_mac, cf_emac"
28830 + (const (symbol_ref "m68k_sched_mac")))
28831
28832 ;; Instruction type for use in scheduling description.
28833 ;; _l and _w suffixes indicate size of the operands of instruction.
28834 ;; alu - usual arithmetic or logic instruction.
28835 -;; alu_reg1 - arithmetic or logic instruction with one operand that is
28836 -;; a register.
28837 -;; alu_regx - arithmetic or logic instruction which has a register for its
28838 -;; X operand.
28839 ;; aluq - arithmetic or logic instruction which has a quick immediate (the one
28840 ;; that is encoded in the instruction word) for its Y operand.
28841 -;; <all other values> - corresponding asm instructions.
28842 -(define_attr "type1"
28843 - "alu_l, alu_reg1, alu_regx, aluq_l, bcc, bra, bsr, clr, cmp_l, jmp, jsr, lea,
28844 - mov3q_l, move, move_l, moveq_l, mul_l, mul_w, pea, rts, tst, tst_l, unlk,
28845 +;; alux - Arithmetic instruction that uses carry bit (e.g., addx and subx).
28846 +;; bcc - conditional branch.
28847 +;; bitr - bit operation that only updates flags.
28848 +;; bitrw - bit operation that updates flags and output operand.
28849 +;; bra, bsr, clr, cmp, div, ext - corresponding instruction.
28850 +;; falu, fbcc, fcmp, fdiv, fmove, fmul, fneg, fsqrt, ftst - corresponding
28851 +;; instruction.
28852 +;; ib - fake instruction to subscribe slots in ColdFire V1,V2,V3 instruction
28853 +;; buffer.
28854 +;; ignore - fake instruction.
28855 +;; jmp, jsr, lea, link, mov3q, move, moveq, mul - corresponding instruction.
28856 +;; mvsz - mvs or mvz instruction.
28857 +;; neg, nop, pea, rts, scc - corresponding instruction.
28858 +;; shift - arithmetic or logical shift instruction.
28859 +;; trap, tst, unlk - corresponding instruction.
28860 +(define_attr "type"
28861 + "alu_l,aluq_l,alux_l,bcc,bitr,bitrw,bra,bsr,clr,clr_l,cmp,cmp_l,
28862 + div_w,div_l,ext,
28863 + falu,fbcc,fcmp,fdiv,fmove,fmul,fneg,fsqrt,ftst,
28864 + ib,ignore,
28865 + jmp,jsr,lea,link,mov3q_l,move,move_l,moveq_l,mul_w,mul_l,mvsz,neg_l,nop,
28866 + pea,rts,scc,shift,
28867 + trap,tst,tst_l,unlk,
28868 unknown"
28869 - (cond [(eq_attr "type" "add_l,sub_l") (const_string "alu_l")
28870 - (eq_attr "type" "ext_w,extb_l,ext_l,neg_l,not_l")
28871 - (const_string "alu_reg1")
28872 - (eq_attr "type" "asr_l,lsr_l") (const_string "alu_regx")
28873 - (eq_attr "type" "addq_l,subq_l") (const_string "aluq_l")
28874 - (eq_attr "type" "bcc") (const_string "bcc")
28875 - (eq_attr "type" "bra") (const_string "bra")
28876 - (eq_attr "type" "bsr") (const_string "bsr")
28877 - (eq_attr "type" "clr_b,clr_l,clr_w") (const_string "clr")
28878 - (eq_attr "type" "cmp_l") (const_string "cmp_l")
28879 - (eq_attr "type" "jmp") (const_string "jmp")
28880 - (eq_attr "type" "jsr") (const_string "jsr")
28881 - (eq_attr "type" "lea") (const_string "lea")
28882 - (eq_attr "type" "mov3q_l") (const_string "mov3q_l")
28883 - (eq_attr "type" "move_b,move_w") (const_string "move")
28884 - (eq_attr "type" "move_l") (const_string "move_l")
28885 - (eq_attr "type" "moveq_l") (const_string "moveq_l")
28886 - (eq_attr "type" "muls_l,mulu_l") (const_string "mul_l")
28887 - (eq_attr "type" "muls_w,mulu_w") (const_string "mul_w")
28888 - (eq_attr "type" "pea") (const_string "pea")
28889 - (eq_attr "type" "rts") (const_string "rts")
28890 - (eq_attr "type" "tst_b,tst_w") (const_string "tst")
28891 - (eq_attr "type" "tst_l") (const_string "tst_l")
28892 - (eq_attr "type" "unlk") (const_string "unlk")]
28893 - (const_string "unknown")))
28894 + (const_string "unknown"))
28895
28896 ;; Index of the X or Y operand in recog_data.operand[].
28897 ;; Should be used only within opx_type and opy_type.
28898 (define_attr "opx" "" (const_int 0))
28899 (define_attr "opy" "" (const_int 1))
28900
28901 -;; Type of the X operand.
28902 -;; See m68k.c: enum attr_op_type.
28903 -(define_attr "opx_type"
28904 - "none, reg, mem1, mem234, mem5, mem6, mem7, imm_q, imm_w, imm_l"
28905 - (cond [(eq_attr "type1" "rts,unlk") (const_string "none")
28906 - (eq_attr "type1" "alu_reg1,alu_regx,lea,moveq_l,mul_l,mul_w")
28907 - (const_string "reg")
28908 - (eq_attr "type1" "pea") (const_string "mem1")
28909 - (eq_attr "type1" "bcc") (const_string "imm_q")
28910 - (eq_attr "type1" "bra,bsr") (const_string "imm_w")
28911 - (eq_attr "type1" "jmp,jsr")
28912 - (symbol_ref "m68k_sched_attr_opx_type (insn, 1)")]
28913 - (symbol_ref "m68k_sched_attr_opx_type (insn, 0)")))
28914 -
28915 ;; Type of the Y operand.
28916 ;; See m68k.c: enum attr_op_type.
28917 (define_attr "opy_type"
28918 - "none, reg, mem1, mem234, mem5, mem6, mem7, imm_q, imm_w, imm_l"
28919 - (cond [(eq_attr "type1" "alu_reg1,bcc,bra,bsr,clr,jmp,jsr,rts,tst,tst_l,
28920 - unlk") (const_string "none")
28921 - (eq_attr "type1" "mov3q_l,moveq_l,aluq_l") (const_string "imm_q")
28922 - (eq_attr "type1" "lea,pea")
28923 + "none,Rn,FPn,mem1,mem234,mem5,mem6,mem7,imm_q,imm_w,imm_l"
28924 + (cond [(eq_attr "type" "ext,fbcc,ftst,neg_l,bcc,bra,bsr,clr,clr_l,ib,ignore,
28925 + jmp,jsr,nop,rts,scc,trap,tst,tst_l,
28926 + unlk,unknown") (const_string "none")
28927 + (eq_attr "type" "lea,pea")
28928 (symbol_ref "m68k_sched_attr_opy_type (insn, 1)")]
28929 (symbol_ref "m68k_sched_attr_opy_type (insn, 0)")))
28930
28931 -;; Instruction size in words.
28932 -(define_attr "size" ""
28933 - (cond [(eq_attr "type1" "alu_reg1,moveq_l,rts,unlk") (const_int 1)]
28934 - (symbol_ref "m68k_sched_attr_size (insn)")))
28935 +;; Type of the X operand.
28936 +;; See m68k.c: enum attr_op_type.
28937 +(define_attr "opx_type"
28938 + "none,Rn,FPn,mem1,mem234,mem5,mem6,mem7,imm_q,imm_w,imm_l"
28939 + (cond [(eq_attr "type" "ib,ignore,nop,rts,trap,unlk,
28940 + unknown") (const_string "none")
28941 + (eq_attr "type" "pea") (const_string "mem1")
28942 + (eq_attr "type" "jmp,jsr")
28943 + (symbol_ref "m68k_sched_attr_opx_type (insn, 1)")]
28944 + (symbol_ref "m68k_sched_attr_opx_type (insn, 0)")))
28945
28946 ;; Access to the X operand: none, read, write, read/write, unknown.
28947 ;; Access to the Y operand is either none (if opy_type is none)
28948 ;; or read otherwise.
28949 -(define_attr "opx_access" "none, r, w, rw, unknown"
28950 - (cond [(eq_attr "type1" "rts,unlk") (const_string "none")
28951 - (eq_attr "type1" "bcc,bra,bsr,cmp_l,jmp,jsr,tst,tst_l")
28952 - (const_string "r")
28953 - (eq_attr "type1" "clr,lea,mov3q_l,move,move_l,moveq_l,pea")
28954 - (const_string "w")
28955 - (eq_attr "type1" "alu_l,alu_reg1,alu_regx,aluq_l")
28956 - (const_string "rw")]
28957 - (const_string "unknown")))
28958 -
28959 -;; Memory relation of operands:
28960 -;; r - register or immediate operand
28961 -;; m - non-indexed memory location
28962 -;; i - indexed memory location
28963 -
28964 -(define_attr "opx_mem" "r, m, i, unknown"
28965 - (cond [(eq_attr "opx_type" "none,reg,imm_q,imm_w,imm_l") (const_string "r")
28966 - (eq_attr "opx_type" "mem1,mem234,mem5,mem7") (const_string "m")
28967 - (eq_attr "opx_type" "mem6") (const_string "i")]
28968 - (const_string "unknown")))
28969 -
28970 -(define_attr "opy_mem" "r, m, i, unknown"
28971 - (cond [(eq_attr "opy_type" "none,reg,imm_q,imm_w,imm_l") (const_string "r")
28972 - (eq_attr "opy_type" "mem1,mem234,mem5,mem7") (const_string "m")
28973 - (eq_attr "opy_type" "mem6") (const_string "i")]
28974 - (const_string "unknown")))
28975 +(define_attr "opx_access" "none, r, w, rw"
28976 + (cond [(eq_attr "type" "ib,ignore,nop,rts,trap,unlk,
28977 + unknown") (const_string "none")
28978 + (eq_attr "type" "bcc,bra,bsr,bitr,cmp,cmp_l,fbcc,fcmp,ftst,
28979 + jmp,jsr,tst,tst_l") (const_string "r")
28980 + (eq_attr "type" "clr,clr_l,fneg,fmove,lea,
28981 + mov3q_l,move,move_l,moveq_l,mvsz,
28982 + pea,scc") (const_string "w")
28983 + (eq_attr "type" "alu_l,aluq_l,alux_l,bitrw,div_w,div_l,ext,
28984 + falu,fdiv,fmul,fsqrt,link,mul_w,mul_l,
28985 + neg_l,shift") (const_string "rw")]
28986 + ;; Should never be used.
28987 + (symbol_ref "(gcc_unreachable (), OPX_ACCESS_NONE)")))
28988
28989 ;; Memory accesses of the insn.
28990 ;; 00 - no memory references
28991 ;; 10 - memory is read
28992 -;; i10 - indexed memory is read
28993 +;; i0 - indexed memory is read
28994 ;; 01 - memory is written
28995 -;; 0i1 - indexed memory is written
28996 +;; 0i - indexed memory is written
28997 ;; 11 - memory is read, memory is written
28998 -;; i11 - indexed memory is read, memory is written
28999 -;; 1i1 - memory is read, indexed memory is written
29000 -;;
29001 -;; unknown - should now occur on normal insn.
29002 -;; ??? This attribute is implemented in C to spare genattrtab from
29003 -;; ??? optimizing it.
29004 -(define_attr "op_mem" "00, 10, i0, 01, 0i, 11, i1, 1i, unknown"
29005 -; (cond [(and (eq_attr "opy_mem" "r") (eq_attr "opx_mem" "r"))
29006 -; (const_string "00")
29007 -;
29008 -; (and (eq_attr "opy_mem" "r") (eq_attr "opx_mem" "m"))
29009 -; (cond [(eq_attr "opx_access" "r") (const_string "10")
29010 -; (eq_attr "opx_access" "w") (const_string "01")
29011 -; (eq_attr "opx_access" "rw") (const_string "11")]
29012 -; (const_string "unknown"))
29013 -;
29014 -; (and (eq_attr "opy_mem" "r") (eq_attr "opx_mem" "i"))
29015 -; (cond [(eq_attr "opx_access" "r") (const_string "i0")
29016 -; (eq_attr "opx_access" "w") (const_string "0i")
29017 -; (eq_attr "opx_access" "rw") (const_string "i1")]
29018 -; (const_string "unknown"))
29019 -;
29020 -; (and (eq_attr "opy_mem" "m") (eq_attr "opx_mem" "r"))
29021 -; (const_string "10")
29022 -;
29023 -; (and (eq_attr "opy_mem" "m") (eq_attr "opx_mem" "m"))
29024 -; (cond [(eq_attr "opx_access" "w") (const_string "11")]
29025 -; (const_string "unknown"))
29026 -;
29027 -; (and (eq_attr "opy_mem" "m") (eq_attr "opx_mem" "i"))
29028 -; (cond [(eq_attr "opx_access" "w") (const_string "1i")]
29029 -; (const_string "unknown"))
29030 -;
29031 -; (and (eq_attr "opy_mem" "i") (eq_attr "opx_mem" "r"))
29032 -; (const_string "i0")
29033 -;
29034 -; (and (eq_attr "opy_mem" "i") (eq_attr "opx_mem" "m"))
29035 -; (cond [(eq_attr "opx_access" "w") (const_string "i1")]
29036 -; (const_string "unknown"))]
29037 -; (const_string "unknown"))
29038 +;; i1 - indexed memory is read, memory is written
29039 +;; 1i - memory is read, indexed memory is written
29040 +(define_attr "op_mem" "00, 10, i0, 01, 0i, 11, i1, 1i"
29041 (symbol_ref "m68k_sched_attr_op_mem (insn)"))
29042
29043 -;; Attribute to support partial automata description.
29044 -;; This attribute has value 'yes' for instructions that are not
29045 -;; fully handled yet.
29046 -(define_attr "guess" "yes, no"
29047 - (cond [(ior (eq (symbol_ref "reload_completed") (const_int 0))
29048 - (eq_attr "type1" "unknown"))
29049 - (const_string "yes")]
29050 - (const_string "no")))
29051 -
29052 -;; Attribute to support statistics gathering.
29053 -;; Todo means that insn lacks something to get pipeline description.
29054 -;; Done means that insn was transformed to suit pipeline description.
29055 -;; Nothing means that insn was originally good enough for scheduling.
29056 -(define_attr "split" "todo, done, nothing"
29057 - (if_then_else (eq_attr "type" "unknown")
29058 - (const_string "todo")
29059 - (const_string "nothing")))
29060 +;; Instruction size in words.
29061 +(define_attr "size" "1,2,3"
29062 + (symbol_ref "m68k_sched_attr_size (insn)"))
29063 +
29064 \f
29065 ;; Mode macros for floating point operations.
29066 ;; Valid floating point modes
29067 @@ -364,8 +274,7 @@
29068 m68k_emit_move_double (operands);
29069 DONE;
29070 }
29071 - [(set_attr "type" "fmove,*")
29072 - (set_attr "split" "done,*")])
29073 + [(set_attr "type" "fmove,*")])
29074
29075 (define_insn_and_split "pushdi"
29076 [(set (match_operand:DI 0 "push_operand" "=m")
29077 @@ -445,7 +354,7 @@
29078 "@
29079 tst%.l %0
29080 cmp%.w #0,%0"
29081 - [(set_attr "type" "tst_l,*")])
29082 + [(set_attr "type" "tst_l,cmp")])
29083
29084 ;; This can't use an address register, because comparisons
29085 ;; with address registers as second operand always test the whole word.
29086 @@ -460,7 +369,7 @@
29087 (match_operand:HI 0 "nonimmediate_operand" "dm"))]
29088 ""
29089 "tst%.w %0"
29090 - [(set_attr "type" "tst_w")])
29091 + [(set_attr "type" "tst")])
29092
29093 (define_expand "tstqi"
29094 [(set (cc0)
29095 @@ -473,7 +382,7 @@
29096 (match_operand:QI 0 "nonimmediate_operand" "dm"))]
29097 ""
29098 "tst%.b %0"
29099 - [(set_attr "type" "tst_b")])
29100 + [(set_attr "type" "tst")])
29101
29102 (define_expand "tst<mode>"
29103 [(set (cc0)
29104 @@ -492,11 +401,12 @@
29105 if (FP_REG_P (operands[0]))
29106 return "ftst%.x %0";
29107 return "ftst%.<FP:prec> %0";
29108 -})
29109 +}
29110 + [(set_attr "type" "ftst")])
29111
29112 (define_insn "tst<mode>_cf"
29113 [(set (cc0)
29114 - (match_operand:FP 0 "general_operand" "f<FP:dreg><Q>U"))]
29115 + (match_operand:FP 0 "general_operand" "f<FP:dreg>m"))]
29116 "TARGET_COLDFIRE_FPU"
29117 {
29118 cc_status.flags = CC_IN_68881;
29119 @@ -514,15 +424,15 @@
29120 [(set (cc0)
29121 (compare (match_operand:DI 0 "nonimmediate_operand" "")
29122 (match_operand:DI 1 "general_operand" "")))
29123 - (clobber (match_dup 2))])]
29124 + (clobber (match_scratch:DI 2 ""))])]
29125 ""
29126 - "m68k_last_compare_had_fp_operands = 0; operands[2] = gen_reg_rtx (DImode);")
29127 + "m68k_last_compare_had_fp_operands = 0;")
29128
29129 (define_insn ""
29130 [(set (cc0)
29131 (compare (match_operand:DI 1 "nonimmediate_operand" "0,d")
29132 (match_operand:DI 2 "general_operand" "d,0")))
29133 - (clobber (match_operand:DI 0 "register_operand" "=d,d"))]
29134 + (clobber (match_scratch:DI 0 "=d,d"))]
29135 ""
29136 {
29137 if (rtx_equal_p (operands[0], operands[1]))
29138 @@ -600,7 +510,7 @@
29139 if ((REG_P (operands[1]) && !ADDRESS_REG_P (operands[1]))
29140 || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM))
29141 {
29142 - cc_status.flags |= CC_REVERSED;
29143 + cc_status.flags |= CC_REVERSED; /*|*/
29144 return "cmp%.w %d0,%d1";
29145 }
29146 return "cmp%.w %d1,%d0";
29147 @@ -652,8 +562,8 @@
29148
29149 (define_insn "*cmp<mode>_cf"
29150 [(set (cc0)
29151 - (compare (match_operand:FP 0 "fp_src_operand" "f,f,<FP:dreg><Q>U")
29152 - (match_operand:FP 1 "fp_src_operand" "f,<FP:dreg><Q>U,f")))]
29153 + (compare (match_operand:FP 0 "fp_src_operand" "f,f,<FP:dreg>m")
29154 + (match_operand:FP 1 "fp_src_operand" "f,<FP:dreg>m,f")))]
29155 "TARGET_COLDFIRE_FPU
29156 && (register_operand (operands[0], <MODE>mode)
29157 || register_operand (operands[1], <MODE>mode))"
29158 @@ -792,8 +702,7 @@
29159 clr%.l %0
29160 mov3q%.l %1,%-
29161 pea %a1"
29162 - [(set_attr "type" "clr_l,mov3q_l,pea")
29163 - (set_attr "split" "done")])
29164 + [(set_attr "type" "clr_l,mov3q_l,pea")])
29165
29166 ;This is never used.
29167 ;(define_insn "swapsi"
29168 @@ -813,9 +722,8 @@
29169 moveq #0,%0
29170 sub%.l %0,%0
29171 clr%.l %0"
29172 - [(set_attr "type" "moveq_l,sub_l,clr_l")
29173 - (set_attr "opy_type" "imm_q,reg,*")
29174 - (set_attr "split" "done")])
29175 + [(set_attr "type" "moveq_l,alu_l,clr_l")
29176 + (set_attr "opy" "*,0,*")])
29177
29178 ;; Special case of fullword move when source is zero for 68040_60.
29179 ;; On the '040, 'subl an,an' takes 2 clocks while lea takes only 1
29180 @@ -834,9 +742,7 @@
29181 return "";
29182 }
29183 }
29184 - [(set_attr "type" "lea,clr_l")
29185 - (set_attr "opy_type" "imm_w,*")
29186 - (set_attr "split" "done")])
29187 + [(set_attr "type" "lea,clr_l")])
29188
29189 ;; Special case of fullword move when source is zero.
29190 (define_insn "*movsi_const0"
29191 @@ -846,9 +752,8 @@
29192 "@
29193 sub%.l %0,%0
29194 clr%.l %0"
29195 - [(set_attr "type" "sub_l,clr_l")
29196 - (set_attr "opy_type" "reg,*")
29197 - (set_attr "split" "done")])
29198 + [(set_attr "type" "alu_l,clr_l")
29199 + (set_attr "opy" "0,*")])
29200
29201 ;; General case of fullword move.
29202 ;;
29203 @@ -866,7 +771,41 @@
29204 {
29205 rtx tmp, base, offset;
29206
29207 - if (flag_pic && !TARGET_PCREL && symbolic_operand (operands[1], SImode))
29208 + /* Recognize the case where operand[1] is a reference to thread-local
29209 + data and load its address to a register. */
29210 + if (!TARGET_PCREL && m68k_tls_referenced_p (operands[1]))
29211 + {
29212 + rtx tmp = operands[1];
29213 + rtx addend = NULL;
29214 +
29215 + if (GET_CODE (tmp) == CONST && GET_CODE (XEXP (tmp, 0)) == PLUS)
29216 + {
29217 + addend = XEXP (XEXP (tmp, 0), 1);
29218 + tmp = XEXP (XEXP (tmp, 0), 0);
29219 + }
29220 +
29221 + gcc_assert (GET_CODE (tmp) == SYMBOL_REF);
29222 + gcc_assert (SYMBOL_REF_TLS_MODEL (tmp) != 0);
29223 +
29224 + tmp = m68k_legitimize_tls_address (tmp);
29225 +
29226 + if (addend)
29227 + {
29228 + if (!REG_P (tmp))
29229 + {
29230 + rtx reg;
29231 +
29232 + reg = gen_reg_rtx (Pmode);
29233 + emit_move_insn (reg, tmp);
29234 + tmp = reg;
29235 + }
29236 +
29237 + tmp = gen_rtx_PLUS (SImode, tmp, addend);
29238 + }
29239 +
29240 + operands[1] = tmp;
29241 + }
29242 + else if (flag_pic && !TARGET_PCREL && symbolic_operand (operands[1], SImode))
29243 {
29244 /* The source is an address which requires PIC relocation.
29245 Call legitimize_pic_address with the source, mode, and a relocation
29246 @@ -973,11 +912,7 @@
29247 return "";
29248 }
29249 }
29250 - [(set_attr "type" "mov3q_l, moveq_l,*, mvz_w, mvs_w, move_l, move_w, pea, lea, move_l, move_l, move_l")
29251 - (set (attr "split")
29252 - (if_then_else (eq_attr "alternative" "2")
29253 - (const_string "*")
29254 - (const_string "done")))])
29255 + [(set_attr "type" "mov3q_l,moveq_l,*,mvsz,mvsz,move_l,move,pea,lea,move_l,move_l,move_l")])
29256
29257 ;; Special case of fullword move, where we need to get a non-GOT PIC
29258 ;; reference into an address register.
29259 @@ -1066,8 +1001,7 @@
29260 clr%.b %0
29261 move%.b %1,%0
29262 move%.b %1,%0"
29263 - [(set_attr "type" "clr_b,clr_b,move_b,move_b")
29264 - (set_attr "split" "done")])
29265 + [(set_attr "type" "clr,clr,move,move")])
29266
29267 (define_expand "pushqi1"
29268 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -2)))
29269 @@ -1162,10 +1096,8 @@
29270 ;; SFmode MEMs are restricted to modes 2-4 if TARGET_COLDFIRE_FPU.
29271 ;; The move instructions can handle all combinations.
29272 (define_insn "movsf_cf_hard"
29273 - [(set (match_operand:SF 0 "nonimmediate_operand" "=r<Q>U, f, f,mr,f,r<Q>,f
29274 -,m")
29275 - (match_operand:SF 1 "general_operand" " f, r<Q>U,f,rm,F,F, m
29276 -,f"))]
29277 + [(set (match_operand:SF 0 "nonimmediate_operand" "=rm,f, f,rm,f,r<Q>,f,m")
29278 + (match_operand:SF 1 "general_operand" " f, rm,f,rm,F,F, m,f"))]
29279 "TARGET_COLDFIRE_FPU"
29280 {
29281 if (which_alternative == 4 || which_alternative == 5) {
29282 @@ -1307,8 +1239,8 @@
29283 })
29284
29285 (define_insn "movdf_cf_hard"
29286 - [(set (match_operand:DF 0 "nonimmediate_operand" "=f, <Q>U,r,f,r,r,m,f")
29287 - (match_operand:DF 1 "general_operand" " f<Q>U,f, f,r,r,m,r,E"))]
29288 + [(set (match_operand:DF 0 "nonimmediate_operand" "=f, m,r,f,r,r,m,f")
29289 + (match_operand:DF 1 "general_operand" " fm,f,f,r,r,m,r,E"))]
29290 "TARGET_COLDFIRE_FPU"
29291 {
29292 rtx xoperands[3];
29293 @@ -1688,7 +1620,7 @@
29294 (zero_extend:SI (match_operand:HI 1 "nonimmediate_src_operand" "rmS")))]
29295 "ISA_HAS_MVS_MVZ"
29296 "mvz%.w %1,%0"
29297 - [(set_attr "type" "mvz_w")])
29298 + [(set_attr "type" "mvsz")])
29299
29300 (define_insn "zero_extendhisi2"
29301 [(set (match_operand:SI 0 "register_operand" "=d")
29302 @@ -1713,7 +1645,7 @@
29303 (zero_extend:SI (match_operand:QI 1 "nonimmediate_src_operand" "dmS")))]
29304 "ISA_HAS_MVS_MVZ"
29305 "mvz%.b %1,%0"
29306 - [(set_attr "type" "mvz_b")])
29307 + [(set_attr "type" "mvsz")])
29308
29309 (define_insn "zero_extendqisi2"
29310 [(set (match_operand:SI 0 "register_operand" "=d")
29311 @@ -1794,28 +1726,73 @@
29312 return "move%.w %1,%2\;ext%.l %2\;smi %0\;ext%.w %0\;ext%.l %0";
29313 })
29314
29315 -(define_insn "extendsidi2"
29316 - [(set (match_operand:DI 0 "register_operand" "=d")
29317 - (sign_extend:DI (match_operand:SI 1 "nonimmediate_src_operand" "rm")))]
29318 - ""
29319 +(define_expand "extendsidi2"
29320 + [(parallel
29321 + [(set (match_operand:DI 0 "nonimmediate_operand")
29322 + (sign_extend:DI (match_operand:SI 1 "nonimmediate_src_operand")))
29323 + (clobber (match_scratch:SI 2 ""))
29324 + (clobber (match_scratch:SI 3 ""))])])
29325 +
29326 +(define_insn "*extendsidi2_m68k"
29327 + [(set (match_operand:DI 0 "nonimmediate_operand" "=d,<,o")
29328 + (sign_extend:DI
29329 + (match_operand:SI 1 "nonimmediate_src_operand" "rm,rm,rm")))
29330 + (clobber (match_scratch:SI 2 "=X,d,d"))
29331 + (clobber (match_scratch:SI 3 "=X,X,X"))]
29332 + "!TARGET_COLDFIRE"
29333 {
29334 CC_STATUS_INIT;
29335 +
29336 + if (which_alternative == 0)
29337 + /* Handle alternative 0. */
29338 + {
29339 + if (TARGET_68020 || TARGET_COLDFIRE)
29340 + return "move%.l %1,%R0\;smi %0\;extb%.l %0";
29341 + else
29342 + return "move%.l %1,%R0\;smi %0\;ext%.w %0\;ext%.l %0";
29343 + }
29344 +
29345 + /* Handle alternatives 1 and 2. We don't need to adjust address by 4
29346 + in alternative 1 because autodecrement will do that for us. */
29347 + operands[3] = adjust_address (operands[0], SImode,
29348 + which_alternative == 1 ? 0 : 4);
29349 + operands[0] = adjust_address (operands[0], SImode, 0);
29350 +
29351 if (TARGET_68020 || TARGET_COLDFIRE)
29352 - return "move%.l %1,%R0\;smi %0\;extb%.l %0";
29353 + return "move%.l %1,%3\;smi %2\;extb%.l %2\;move%.l %2,%0";
29354 else
29355 - return "move%.l %1,%R0\;smi %0\;ext%.w %0\;ext%.l %0";
29356 + return "move%.l %1,%3\;smi %2\;ext%.w %2\;ext%.l %2\;move%.l %2,%0";
29357 })
29358
29359 -(define_insn "*extendsidi2_mem"
29360 - [(set (match_operand:DI 0 "memory_operand" "=o,<")
29361 - (sign_extend:DI (match_operand:SI 1 "nonimmediate_src_operand" "rm,rm")))
29362 - (clobber (match_scratch:SI 2 "=d,d"))]
29363 - ""
29364 +;; This is a copy of extendsidi2_m68k except for that we can't
29365 +;; fully handle the last alternative on ColdFire.
29366 +;; FIXME: when 'enabled' attribute is available (in GCC 4.4) merge the
29367 +;; two define_insns.
29368 +(define_insn "*extendsidi2_cf"
29369 + [(set (match_operand:DI 0 "nonimmediate_operand" "=d,<,o")
29370 + (sign_extend:DI
29371 + (match_operand:SI 1 "nonimmediate_src_operand" "rm,rm,r<Q>")))
29372 + (clobber (match_scratch:SI 2 "=X,d,d"))
29373 + (clobber (match_scratch:SI 3 "=X,X,X"))]
29374 + "TARGET_COLDFIRE"
29375 {
29376 CC_STATUS_INIT;
29377 +
29378 + if (which_alternative == 0)
29379 + /* Handle alternative 0. */
29380 + {
29381 + if (TARGET_68020 || TARGET_COLDFIRE)
29382 + return "move%.l %1,%R0\;smi %0\;extb%.l %0";
29383 + else
29384 + return "move%.l %1,%R0\;smi %0\;ext%.w %0\;ext%.l %0";
29385 + }
29386 +
29387 + /* Handle alternatives 1 and 2. We don't need to adjust address by 4
29388 + in alternative 1 because autodecrement will do that for us. */
29389 operands[3] = adjust_address (operands[0], SImode,
29390 - which_alternative == 0 ? 4 : 0);
29391 + which_alternative == 1 ? 0 : 4);
29392 operands[0] = adjust_address (operands[0], SImode, 0);
29393 +
29394 if (TARGET_68020 || TARGET_COLDFIRE)
29395 return "move%.l %1,%3\;smi %2\;extb%.l %2\;move%.l %2,%0";
29396 else
29397 @@ -1866,7 +1843,7 @@
29398 (match_operand:HI 1 "nonimmediate_src_operand" "rmS")))]
29399 "ISA_HAS_MVS_MVZ"
29400 "mvs%.w %1,%0"
29401 - [(set_attr "type" "mvs_w")])
29402 + [(set_attr "type" "mvsz")])
29403
29404 (define_insn "*68k_extendhisi2"
29405 [(set (match_operand:SI 0 "nonimmediate_operand" "=*d,a")
29406 @@ -1876,14 +1853,14 @@
29407 "@
29408 ext%.l %0
29409 move%.w %1,%0"
29410 - [(set_attr "type" "ext_l,move_w")])
29411 + [(set_attr "type" "ext,move")])
29412
29413 (define_insn "extendqihi2"
29414 [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
29415 (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0")))]
29416 ""
29417 "ext%.w %0"
29418 - [(set_attr "type" "ext_w")])
29419 + [(set_attr "type" "ext")])
29420
29421 (define_expand "extendqisi2"
29422 [(set (match_operand:SI 0 "nonimmediate_operand" "")
29423 @@ -1896,14 +1873,14 @@
29424 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "rms")))]
29425 "ISA_HAS_MVS_MVZ"
29426 "mvs%.b %1,%0"
29427 - [(set_attr "type" "mvs_b")])
29428 + [(set_attr "type" "mvsz")])
29429
29430 (define_insn "*68k_extendqisi2"
29431 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
29432 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "0")))]
29433 "TARGET_68020 || (TARGET_COLDFIRE && !ISA_HAS_MVS_MVZ)"
29434 "extb%.l %0"
29435 - [(set_attr "type" "extb_l")])
29436 + [(set_attr "type" "ext")])
29437 \f
29438 ;; Conversions between float and double.
29439
29440 @@ -1946,7 +1923,7 @@
29441 (define_insn "extendsfdf2_cf"
29442 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f")
29443 (float_extend:DF
29444 - (match_operand:SF 1 "general_operand" "f,<Q>U")))]
29445 + (match_operand:SF 1 "general_operand" "f,m")))]
29446 "TARGET_COLDFIRE_FPU"
29447 {
29448 if (FP_REG_P (operands[0]) && FP_REG_P (operands[1]))
29449 @@ -1986,9 +1963,9 @@
29450 })
29451
29452 (define_insn "truncdfsf2_cf"
29453 - [(set (match_operand:SF 0 "nonimmediate_operand" "=f,d<Q>U")
29454 + [(set (match_operand:SF 0 "nonimmediate_operand" "=f,dm")
29455 (float_truncate:SF
29456 - (match_operand:DF 1 "general_operand" "<Q>U,f")))]
29457 + (match_operand:DF 1 "general_operand" "m,f")))]
29458 "TARGET_COLDFIRE_FPU"
29459 "@
29460 fsmove%.d %1,%0
29461 @@ -2021,7 +1998,8 @@
29462 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29463 (float:FP (match_operand:SI 1 "general_operand" "dmi")))]
29464 "TARGET_68881"
29465 - "f<FP:round>move%.l %1,%0")
29466 + "f<FP:round>move%.l %1,%0"
29467 + [(set_attr "type" "fmove")])
29468
29469 (define_insn "floatsi<mode>2_cf"
29470 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29471 @@ -2128,18 +2106,19 @@
29472 if (FP_REG_P (operands[1]))
29473 return "fintrz%.x %f1,%0";
29474 return "fintrz%.<FP:prec> %f1,%0";
29475 -})
29476 +}
29477 + [(set_attr "type" "falu")])
29478
29479 (define_insn "ftrunc<mode>2_cf"
29480 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29481 - (fix:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U")))]
29482 + (fix:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))]
29483 "TARGET_COLDFIRE_FPU"
29484 {
29485 if (FP_REG_P (operands[1]))
29486 return "fintrz%.d %f1,%0";
29487 return "fintrz%.<FP:prec> %f1,%0";
29488 }
29489 - [(set_attr "type" "fintrz")])
29490 + [(set_attr "type" "falu")])
29491
29492 ;; Convert a float whose value is an integer
29493 ;; to an actual integer. Second stage of converting float to integer type.
29494 @@ -2153,7 +2132,8 @@
29495 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
29496 (fix:QI (match_operand:FP 1 "general_operand" "f")))]
29497 "TARGET_68881"
29498 - "fmove%.b %1,%0")
29499 + "fmove%.b %1,%0"
29500 + [(set_attr "type" "fmove")])
29501
29502 (define_insn "fix<mode>qi2_cf"
29503 [(set (match_operand:QI 0 "nonimmediate_operand" "=d<Q>U")
29504 @@ -2172,7 +2152,8 @@
29505 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
29506 (fix:HI (match_operand:FP 1 "general_operand" "f")))]
29507 "TARGET_68881"
29508 - "fmove%.w %1,%0")
29509 + "fmove%.w %1,%0"
29510 + [(set_attr "type" "fmove")])
29511
29512 (define_insn "fix<mode>hi2_cf"
29513 [(set (match_operand:HI 0 "nonimmediate_operand" "=d<Q>U")
29514 @@ -2191,7 +2172,8 @@
29515 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
29516 (fix:SI (match_operand:FP 1 "general_operand" "f")))]
29517 "TARGET_68881"
29518 - "fmove%.l %1,%0")
29519 + "fmove%.l %1,%0"
29520 + [(set_attr "type" "fmove")])
29521
29522 (define_insn "fix<mode>si2_cf"
29523 [(set (match_operand:SI 0 "nonimmediate_operand" "=d<Q>U")
29524 @@ -2297,7 +2279,7 @@
29525 operands[1] = adjust_address (operands[1], SImode, 4);
29526 return "add%.l %1,%0";
29527 }
29528 - [(set_attr "type" "add_l")])
29529 + [(set_attr "type" "alu_l")])
29530
29531 (define_insn "adddi3"
29532 [(set (match_operand:DI 0 "nonimmediate_operand" "=o<>,d,d,d")
29533 @@ -2376,12 +2358,44 @@
29534 }
29535 })
29536
29537 -(define_insn "addsi_lshrsi_31"
29538 +(define_expand "addsi_lshrsi_31"
29539 + [(set (match_operand:SI 0 "nonimmediate_operand")
29540 + (plus:SI (lshiftrt:SI (match_operand:SI 1 "general_operand")
29541 + (const_int 31))
29542 + (match_dup 1)))])
29543 +
29544 +(define_insn "*addsi_lshrsi_31_m68k"
29545 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
29546 - (plus:SI (lshiftrt:SI (match_operand:SI 1 "general_operand" "rm")
29547 - (const_int 31))
29548 - (match_dup 1)))]
29549 - ""
29550 + (plus:SI (lshiftrt:SI (match_operand:SI 1 "general_operand" "rm")
29551 + (const_int 31))
29552 + (match_dup 1)))]
29553 + "!TARGET_COLDFIRE"
29554 +{
29555 + operands[2] = operands[0];
29556 + operands[3] = gen_label_rtx();
29557 + if (GET_CODE (operands[0]) == MEM)
29558 + {
29559 + if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
29560 + operands[0] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0));
29561 + else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
29562 + operands[2] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0));
29563 + }
29564 + output_asm_insn ("move%.l %1,%0", operands);
29565 + output_asm_insn ("jpl %l3", operands);
29566 + output_asm_insn ("addq%.l #1,%2", operands);
29567 + (*targetm.asm_out.internal_label) (asm_out_file, "L",
29568 + CODE_LABEL_NUMBER (operands[3]));
29569 + return "";
29570 +})
29571 +
29572 +;; FIXME: When 'enabled' attribute is available (in GCC 4.4) merge
29573 +;; this with previous pattern.
29574 +(define_insn "*addsi_lshrsi_31_cf"
29575 + [(set (match_operand:SI 0 "nonimmediate_operand" "=dm,d<Q>")
29576 + (plus:SI (lshiftrt:SI (match_operand:SI 1 "general_operand" "r<Q>,rm")
29577 + (const_int 31))
29578 + (match_dup 1)))]
29579 + "TARGET_COLDFIRE"
29580 {
29581 operands[2] = operands[0];
29582 operands[3] = gen_label_rtx();
29583 @@ -2421,9 +2435,9 @@
29584 "* return output_addsi3 (operands);")
29585
29586 (define_insn_and_split "*addsi3_5200"
29587 - [(set (match_operand:SI 0 "nonimmediate_operand" "=mr,mr,m,r, ?a,?a,?a,?a")
29588 - (plus:SI (match_operand:SI 1 "general_operand" "%0, 0, 0,0, a, a, r, a")
29589 - (match_operand:SI 2 "general_src_operand" " I, L, d,mrKi,Cj,r, a, J")))]
29590 + [(set (match_operand:SI 0 "nonimmediate_operand" "=mr,mr,a, m,r, ?a, ?a,?a,?a")
29591 + (plus:SI (match_operand:SI 1 "general_operand" "%0, 0, 0, 0,0, a, a, r, a")
29592 + (match_operand:SI 2 "general_src_operand" " I, L, JCu,d,mrKi,Cj, r, a, JCu")))]
29593 "TARGET_COLDFIRE"
29594 {
29595 switch (which_alternative)
29596 @@ -2435,21 +2449,22 @@
29597 operands[2] = GEN_INT (- INTVAL (operands[2]));
29598 return "subq%.l %2,%0";
29599
29600 - case 2:
29601 case 3:
29602 + case 4:
29603 return "add%.l %2,%0";
29604
29605 - case 4:
29606 + case 5:
29607 /* move%.l %2,%0\n\tadd%.l %1,%0 */
29608 return "#";
29609
29610 - case 5:
29611 + case 6:
29612 return MOTOROLA ? "lea (%1,%2.l),%0" : "lea %1@(0,%2:l),%0";
29613
29614 - case 6:
29615 + case 7:
29616 return MOTOROLA ? "lea (%2,%1.l),%0" : "lea %2@(0,%1:l),%0";
29617
29618 - case 7:
29619 + case 2:
29620 + case 8:
29621 return MOTOROLA ? "lea (%c2,%1),%0" : "lea %1@(%c2),%0";
29622
29623 default:
29624 @@ -2457,17 +2472,16 @@
29625 return "";
29626 }
29627 }
29628 - "&& reload_completed && (extract_constrain_insn_cached (insn), which_alternative == 4) && !operands_match_p (operands[0], operands[1])"
29629 + "&& reload_completed && (extract_constrain_insn_cached (insn), which_alternative == 5) && !operands_match_p (operands[0], operands[1])"
29630 [(set (match_dup 0)
29631 (match_dup 2))
29632 (set (match_dup 0)
29633 (plus:SI (match_dup 0)
29634 (match_dup 1)))]
29635 ""
29636 - [(set_attr "type" "addq_l,subq_l,add_l,add_l,*,lea,lea,lea")
29637 - (set_attr "opy" "2,2,2,2,*,*,*,*")
29638 - (set_attr "opy_type" "*,*,*,*,*,mem6,mem6,mem5")
29639 - (set_attr "split" "done,done,done,done,*,done,done,done")])
29640 + [(set_attr "type" "aluq_l,aluq_l,lea, alu_l,alu_l,*,lea, lea, lea")
29641 + (set_attr "opy" "2, 2, *, 2, 2, *,*, *, *")
29642 + (set_attr "opy_type" "*, *, mem5,*, *, *,mem6,mem6,mem5")])
29643
29644 (define_insn ""
29645 [(set (match_operand:SI 0 "nonimmediate_operand" "=a")
29646 @@ -2711,21 +2725,27 @@
29647 (plus:FP (float:FP (match_operand:SI 2 "general_operand" "dmi"))
29648 (match_operand:FP 1 "general_operand" "0")))]
29649 "TARGET_68881"
29650 - "f<FP:round>add%.l %2,%0")
29651 + "f<FP:round>add%.l %2,%0"
29652 + [(set_attr "type" "falu")
29653 + (set_attr "opy" "2")])
29654
29655 (define_insn "add<mode>3_floathi_68881"
29656 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29657 (plus:FP (float:FP (match_operand:HI 2 "general_operand" "dmn"))
29658 (match_operand:FP 1 "general_operand" "0")))]
29659 "TARGET_68881"
29660 - "f<FP:round>add%.w %2,%0")
29661 + "f<FP:round>add%.w %2,%0"
29662 + [(set_attr "type" "falu")
29663 + (set_attr "opy" "2")])
29664
29665 (define_insn "add<mode>3_floatqi_68881"
29666 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29667 (plus:FP (float:FP (match_operand:QI 2 "general_operand" "dmn"))
29668 (match_operand:FP 1 "general_operand" "0")))]
29669 "TARGET_68881"
29670 - "f<FP:round>add%.b %2,%0")
29671 + "f<FP:round>add%.b %2,%0"
29672 + [(set_attr "type" "falu")
29673 + (set_attr "opy" "2")])
29674
29675 (define_insn "add<mode>3_68881"
29676 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29677 @@ -2736,19 +2756,22 @@
29678 if (FP_REG_P (operands[2]))
29679 return "f<FP:round>add%.x %2,%0";
29680 return "f<FP:round>add%.<FP:prec> %f2,%0";
29681 -})
29682 +}
29683 + [(set_attr "type" "falu")
29684 + (set_attr "opy" "2")])
29685
29686 (define_insn "add<mode>3_cf"
29687 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29688 (plus:FP (match_operand:FP 1 "general_operand" "%0")
29689 - (match_operand:FP 2 "general_operand" "f<FP:dreg><Q>U")))]
29690 + (match_operand:FP 2 "general_operand" "f<FP:dreg>m")))]
29691 "TARGET_COLDFIRE_FPU"
29692 {
29693 if (FP_REG_P (operands[2]))
29694 return "f<FP:prec>add%.d %2,%0";
29695 return "f<FP:prec>add%.<FP:prec> %2,%0";
29696 }
29697 - [(set_attr "type" "fadd")])
29698 + [(set_attr "type" "falu")
29699 + (set_attr "opy" "2")])
29700 \f
29701 ;; subtract instructions
29702
29703 @@ -2783,7 +2806,7 @@
29704 operands[1] = adjust_address (operands[1], SImode, 4);
29705 return "sub%.l %1,%0";
29706 }
29707 - [(set_attr "type" "sub_l")])
29708 + [(set_attr "type" "alu_l")])
29709
29710 (define_insn "subdi3"
29711 [(set (match_operand:DI 0 "nonimmediate_operand" "=o<>,d,d,d")
29712 @@ -2874,7 +2897,7 @@
29713 sub%.l %2,%0
29714 sub%.l %2,%0
29715 sub%.l %2,%0"
29716 - [(set_attr "type" "subq_l,sub_l,sub_l,sub_l")
29717 + [(set_attr "type" "aluq_l,alu_l,alu_l,alu_l")
29718 (set_attr "opy" "2")])
29719
29720 (define_insn ""
29721 @@ -2925,21 +2948,27 @@
29722 (minus:FP (match_operand:FP 1 "general_operand" "0")
29723 (float:FP (match_operand:SI 2 "general_operand" "dmi"))))]
29724 "TARGET_68881"
29725 - "f<FP:round>sub%.l %2,%0")
29726 + "f<FP:round>sub%.l %2,%0"
29727 + [(set_attr "type" "falu")
29728 + (set_attr "opy" "2")])
29729
29730 (define_insn "sub<mode>3_floathi_68881"
29731 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29732 (minus:FP (match_operand:FP 1 "general_operand" "0")
29733 (float:FP (match_operand:HI 2 "general_operand" "dmn"))))]
29734 "TARGET_68881"
29735 - "f<FP:round>sub%.w %2,%0")
29736 + "f<FP:round>sub%.w %2,%0"
29737 + [(set_attr "type" "falu")
29738 + (set_attr "opy" "2")])
29739
29740 (define_insn "sub<mode>3_floatqi_68881"
29741 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29742 (minus:FP (match_operand:FP 1 "general_operand" "0")
29743 (float:FP (match_operand:QI 2 "general_operand" "dmn"))))]
29744 "TARGET_68881"
29745 - "f<FP:round>sub%.b %2,%0")
29746 + "f<FP:round>sub%.b %2,%0"
29747 + [(set_attr "type" "falu")
29748 + (set_attr "opy" "2")])
29749
29750 (define_insn "sub<mode>3_68881"
29751 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29752 @@ -2950,19 +2979,22 @@
29753 if (FP_REG_P (operands[2]))
29754 return "f<FP:round>sub%.x %2,%0";
29755 return "f<FP:round>sub%.<FP:prec> %f2,%0";
29756 -})
29757 +}
29758 + [(set_attr "type" "falu")
29759 + (set_attr "opy" "2")])
29760
29761 (define_insn "sub<mode>3_cf"
29762 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29763 (minus:FP (match_operand:FP 1 "general_operand" "0")
29764 - (match_operand:FP 2 "general_operand" "f<FP:dreg><Q>U")))]
29765 + (match_operand:FP 2 "general_operand" "f<FP:dreg>m")))]
29766 "TARGET_COLDFIRE_FPU"
29767 {
29768 if (FP_REG_P (operands[2]))
29769 return "f<FP:prec>sub%.d %2,%0";
29770 return "f<FP:prec>sub%.<FP:prec> %2,%0";
29771 }
29772 - [(set_attr "type" "fsub")])
29773 + [(set_attr "type" "falu")
29774 + (set_attr "opy" "2")])
29775 \f
29776 ;; multiply instructions
29777
29778 @@ -2974,7 +3006,7 @@
29779 {
29780 return MOTOROLA ? "muls%.w %2,%0" : "muls %2,%0";
29781 }
29782 - [(set_attr "type" "muls_w")
29783 + [(set_attr "type" "mul_w")
29784 (set_attr "opy" "2")])
29785
29786 (define_insn "mulhisi3"
29787 @@ -2987,7 +3019,7 @@
29788 {
29789 return MOTOROLA ? "muls%.w %2,%0" : "muls %2,%0";
29790 }
29791 - [(set_attr "type" "muls_w")
29792 + [(set_attr "type" "mul_w")
29793 (set_attr "opy" "2")])
29794
29795 (define_insn "*mulhisisi3_s"
29796 @@ -2999,7 +3031,7 @@
29797 {
29798 return MOTOROLA ? "muls%.w %2,%0" : "muls %2,%0";
29799 }
29800 - [(set_attr "type" "muls_w")
29801 + [(set_attr "type" "mul_w")
29802 (set_attr "opy" "2")])
29803
29804 (define_expand "mulsi3"
29805 @@ -3016,7 +3048,7 @@
29806
29807 "TARGET_68020"
29808 "muls%.l %2,%0"
29809 - [(set_attr "type" "muls_l")
29810 + [(set_attr "type" "mul_l")
29811 (set_attr "opy" "2")])
29812
29813 (define_insn "*mulsi3_cf"
29814 @@ -3025,7 +3057,7 @@
29815 (match_operand:SI 2 "general_operand" "d<Q>")))]
29816 "TARGET_COLDFIRE"
29817 "muls%.l %2,%0"
29818 - [(set_attr "type" "muls_l")
29819 + [(set_attr "type" "mul_l")
29820 (set_attr "opy" "2")])
29821
29822 (define_insn "umulhisi3"
29823 @@ -3038,7 +3070,7 @@
29824 {
29825 return MOTOROLA ? "mulu%.w %2,%0" : "mulu %2,%0";
29826 }
29827 - [(set_attr "type" "mulu_w")
29828 + [(set_attr "type" "mul_w")
29829 (set_attr "opy" "2")])
29830
29831 (define_insn "*mulhisisi3_z"
29832 @@ -3050,7 +3082,7 @@
29833 {
29834 return MOTOROLA ? "mulu%.w %2,%0" : "mulu %2,%0";
29835 }
29836 - [(set_attr "type" "mulu_w")
29837 + [(set_attr "type" "mul_w")
29838 (set_attr "opy" "2")])
29839
29840 ;; We need a separate DEFINE_EXPAND for u?mulsidi3 to be able to use the
29841 @@ -3235,7 +3267,9 @@
29842 return TARGET_68040
29843 ? "f<FP:round>mul%.l %2,%0"
29844 : "f<FP:round_mul>mul%.l %2,%0";
29845 -})
29846 +}
29847 + [(set_attr "type" "fmul")
29848 + (set_attr "opy" "2")])
29849
29850 (define_insn "mul<mode>3_floathi_68881"
29851 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29852 @@ -3246,7 +3280,9 @@
29853 return TARGET_68040
29854 ? "f<FP:round>mul%.w %2,%0"
29855 : "f<FP:round_mul>mul%.w %2,%0";
29856 -})
29857 +}
29858 + [(set_attr "type" "fmul")
29859 + (set_attr "opy" "2")])
29860
29861 (define_insn "mul<mode>3_floatqi_68881"
29862 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29863 @@ -3257,7 +3293,9 @@
29864 return TARGET_68040
29865 ? "f<FP:round>mul%.b %2,%0"
29866 : "f<FP:round_mul>mul%.b %2,%0";
29867 -})
29868 +}
29869 + [(set_attr "type" "fmul")
29870 + (set_attr "opy" "2")])
29871
29872 (define_insn "muldf_68881"
29873 [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
29874 @@ -3304,14 +3342,15 @@
29875 (define_insn "fmul<mode>3_cf"
29876 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29877 (mult:FP (match_operand:FP 1 "general_operand" "%0")
29878 - (match_operand:FP 2 "general_operand" "f<Q>U<FP:dreg>")))]
29879 + (match_operand:FP 2 "general_operand" "fm<FP:dreg>")))]
29880 "TARGET_COLDFIRE_FPU"
29881 {
29882 if (FP_REG_P (operands[2]))
29883 return "f<FP:prec>mul%.d %2,%0";
29884 return "f<FP:prec>mul%.<FP:prec> %2,%0";
29885 }
29886 - [(set_attr "type" "fmul")])
29887 + [(set_attr "type" "fmul")
29888 + (set_attr "opy" "2")])
29889 \f
29890 ;; divide instructions
29891
29892 @@ -3373,14 +3412,15 @@
29893 (define_insn "div<mode>3_cf"
29894 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29895 (div:FP (match_operand:FP 1 "general_operand" "0")
29896 - (match_operand:FP 2 "general_operand" "f<Q>U<FP:dreg>")))]
29897 + (match_operand:FP 2 "general_operand" "fm<FP:dreg>")))]
29898 "TARGET_COLDFIRE_FPU"
29899 {
29900 if (FP_REG_P (operands[2]))
29901 return "f<FP:prec>div%.d %2,%0";
29902 return "f<FP:prec>div%.<FP:prec> %2,%0";
29903 }
29904 - [(set_attr "type" "fdiv")])
29905 + [(set_attr "type" "fdiv")
29906 + (set_attr "opy" "2")])
29907 \f
29908 ;; Remainder instructions.
29909
29910 @@ -3408,7 +3448,9 @@
29911 return "rems%.l %2,%3:%0";
29912 else
29913 return "rems%.l %2,%3:%0\;divs%.l %2,%0";
29914 -})
29915 +}
29916 + [(set_attr "type" "div_l")
29917 + (set_attr "opy" "2")])
29918
29919 (define_insn ""
29920 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
29921 @@ -3448,7 +3490,9 @@
29922 return "remu%.l %2,%3:%0";
29923 else
29924 return "remu%.l %2,%3:%0\;divu%.l %2,%0";
29925 -})
29926 +}
29927 + [(set_attr "type" "div_l")
29928 + (set_attr "opy" "2")])
29929
29930 (define_insn ""
29931 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
29932 @@ -4216,7 +4260,7 @@
29933
29934 (define_insn "neg<mode>2_cf"
29935 [(set (match_operand:FP 0 "nonimmediate_operand" "=f,d")
29936 - (neg:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U,0")))]
29937 + (neg:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m,0")))]
29938 "TARGET_COLDFIRE_FPU"
29939 {
29940 if (DATA_REG_P (operands[0]))
29941 @@ -4250,13 +4294,14 @@
29942
29943 (define_insn "sqrt<mode>2_cf"
29944 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
29945 - (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U")))]
29946 + (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))]
29947 "TARGET_COLDFIRE_FPU"
29948 {
29949 if (FP_REG_P (operands[1]))
29950 return "f<FP:prec>sqrt%.d %1,%0";
29951 return "f<FP:prec>sqrt%.<FP:prec> %1,%0";
29952 -})
29953 +}
29954 + [(set_attr "type" "fsqrt")])
29955 ;; Absolute value instructions
29956 ;; If using software floating point, just zero the sign bit.
29957
29958 @@ -4368,7 +4413,7 @@
29959
29960 (define_insn "abs<mode>2_cf"
29961 [(set (match_operand:FP 0 "nonimmediate_operand" "=f,d")
29962 - (abs:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U,0")))]
29963 + (abs:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m,0")))]
29964 "TARGET_COLDFIRE_FPU"
29965 {
29966 if (DATA_REG_P (operands[0]))
29967 @@ -4379,7 +4424,8 @@
29968 if (FP_REG_P (operands[1]))
29969 return "f<FP:prec>abs%.d %1,%0";
29970 return "f<FP:prec>abs%.<FP:prec> %1,%0";
29971 -})
29972 +}
29973 + [(set_attr "type" "bitrw,fneg")])
29974 \f
29975 ;; bit indexing instructions
29976
29977 @@ -4389,7 +4435,7 @@
29978 (clz:SI (match_operand:SI 1 "register_operand" "0")))]
29979 "ISA_HAS_FF1"
29980 "ff1 %0"
29981 - [(set_attr "type" "ff1")])
29982 + [(set_attr "type" "ext")])
29983 \f
29984 ;; one complement instructions
29985
29986 @@ -4433,7 +4479,7 @@
29987 (not:SI (match_operand:SI 1 "general_operand" "0")))]
29988 "TARGET_COLDFIRE"
29989 "not%.l %0"
29990 - [(set_attr "type" "not_l")])
29991 + [(set_attr "type" "neg_l")])
29992
29993 (define_insn "one_cmplhi2"
29994 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
29995 @@ -4785,7 +4831,7 @@
29996 operands[1] = adjust_address (operands[1], HImode, 2);
29997 return "move%.w %1,%0";
29998 }
29999 - [(set_attr "type" "move_w")])
30000 + [(set_attr "type" "move")])
30001
30002 (define_insn "subregsi1ashrdi_const32"
30003 [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
30004 @@ -4965,7 +5011,7 @@
30005 (match_operand:SI 2 "general_operand" "dI")))]
30006 ""
30007 "asr%.l %2,%0"
30008 - [(set_attr "type" "asr_l")
30009 + [(set_attr "type" "shift")
30010 (set_attr "opy" "2")])
30011
30012 (define_insn "ashrhi3"
30013 @@ -5261,7 +5307,7 @@
30014 (match_operand:SI 2 "general_operand" "dI")))]
30015 ""
30016 "lsr%.l %2,%0"
30017 - [(set_attr "type" "lsr_l")
30018 + [(set_attr "type" "shift")
30019 (set_attr "opy" "2")])
30020
30021 (define_insn "lshrhi3"
30022 @@ -5420,7 +5466,7 @@
30023 CC_STATUS_INIT;
30024 return "bset %1,%0";
30025 }
30026 - [(set_attr "type" "bset")])
30027 + [(set_attr "type" "bitrw")])
30028
30029 ;; set bit, bit number is (sign/zero)_extended from HImode/QImode
30030 (define_insn "*bsetmemqi_ext"
30031 @@ -5434,7 +5480,7 @@
30032 CC_STATUS_INIT;
30033 return "bset %1,%0";
30034 }
30035 - [(set_attr "type" "bset")])
30036 + [(set_attr "type" "bitrw")])
30037
30038 ;; clear bit, bit number is int
30039 (define_insn "bclrmemqi"
30040 @@ -5448,7 +5494,7 @@
30041 CC_STATUS_INIT;
30042 return "bclr %1,%0";
30043 }
30044 - [(set_attr "type" "bclr")])
30045 + [(set_attr "type" "bitrw")])
30046
30047 ;; clear bit, bit number is (sign/zero)_extended from HImode/QImode
30048 (define_insn "*bclrmemqi_ext"
30049 @@ -5463,7 +5509,7 @@
30050 CC_STATUS_INIT;
30051 return "bclr %1,%0";
30052 }
30053 - [(set_attr "type" "bclr")])
30054 + [(set_attr "type" "bitrw")])
30055
30056 ;; Special cases of bit-field insns which we should
30057 ;; recognize in preference to the general case.
30058 @@ -6413,8 +6459,7 @@
30059 {
30060 OUTPUT_JUMP ("jeq %l0", "fjeq %l0", "jeq %l0");
30061 }
30062 - [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))
30063 - (set_attr "split" "done")])
30064 + [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
30065
30066 (define_insn "bne"
30067 [(set (pc)
30068 @@ -6426,8 +6471,7 @@
30069 {
30070 OUTPUT_JUMP ("jne %l0", "fjne %l0", "jne %l0");
30071 }
30072 - [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))
30073 - (set_attr "split" "done")])
30074 + [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
30075
30076 (define_insn "bgt"
30077 [(set (pc)
30078 @@ -6437,10 +6481,15 @@
30079 (pc)))]
30080 ""
30081 {
30082 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30083 + {
30084 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30085 + return 0;
30086 + }
30087 +
30088 OUTPUT_JUMP ("jgt %l0", "fjgt %l0", 0);
30089 }
30090 - [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))
30091 - (set_attr "split" "done")])
30092 + [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
30093
30094 (define_insn "bgtu"
30095 [(set (pc)
30096 @@ -6449,7 +6498,15 @@
30097 (label_ref (match_operand 0 "" ""))
30098 (pc)))]
30099 ""
30100 - "jhi %l0"
30101 +{
30102 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30103 + {
30104 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30105 + return 0;
30106 + }
30107 +
30108 + return "jhi %l0";
30109 +}
30110 [(set_attr "type" "bcc")])
30111
30112 (define_insn "blt"
30113 @@ -6460,10 +6517,15 @@
30114 (pc)))]
30115 ""
30116 {
30117 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30118 + {
30119 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30120 + return 0;
30121 + }
30122 +
30123 OUTPUT_JUMP ("jlt %l0", "fjlt %l0", "jmi %l0");
30124 }
30125 - [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))
30126 - (set_attr "split" "done")])
30127 + [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
30128
30129 (define_insn "bltu"
30130 [(set (pc)
30131 @@ -6472,7 +6534,15 @@
30132 (label_ref (match_operand 0 "" ""))
30133 (pc)))]
30134 ""
30135 - "jcs %l0"
30136 +{
30137 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30138 + {
30139 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30140 + return 0;
30141 + }
30142 +
30143 + return "jcs %l0";
30144 +}
30145 [(set_attr "type" "bcc")])
30146
30147 (define_insn "bge"
30148 @@ -6483,6 +6553,12 @@
30149 (pc)))]
30150 ""
30151 {
30152 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30153 + {
30154 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30155 + return 0;
30156 + }
30157 +
30158 OUTPUT_JUMP ("jge %l0", "fjge %l0", "jpl %l0");
30159 })
30160
30161 @@ -6493,7 +6569,15 @@
30162 (label_ref (match_operand 0 "" ""))
30163 (pc)))]
30164 ""
30165 - "jcc %l0"
30166 +{
30167 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30168 + {
30169 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30170 + return 0;
30171 + }
30172 +
30173 + return "jcc %l0";
30174 +}
30175 [(set_attr "type" "bcc")])
30176
30177 (define_insn "ble"
30178 @@ -6504,6 +6588,12 @@
30179 (pc)))]
30180 ""
30181 {
30182 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30183 + {
30184 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30185 + return 0;
30186 + }
30187 +
30188 OUTPUT_JUMP ("jle %l0", "fjle %l0", 0);
30189 }
30190 [(set_attr "type" "bcc")])
30191 @@ -6515,7 +6605,15 @@
30192 (label_ref (match_operand 0 "" ""))
30193 (pc)))]
30194 ""
30195 - "jls %l0"
30196 +{
30197 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30198 + {
30199 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30200 + return 0;
30201 + }
30202 +
30203 + return "jls %l0";
30204 +}
30205 [(set_attr "type" "bcc")])
30206
30207 (define_insn "bordered"
30208 @@ -6527,7 +6625,8 @@
30209 {
30210 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30211 return "fjor %l0";
30212 -})
30213 +}
30214 + [(set_attr "type" "fbcc")])
30215
30216 (define_insn "bunordered"
30217 [(set (pc)
30218 @@ -6538,7 +6637,8 @@
30219 {
30220 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30221 return "fjun %l0";
30222 -})
30223 +}
30224 + [(set_attr "type" "fbcc")])
30225
30226 (define_insn "buneq"
30227 [(set (pc)
30228 @@ -6549,7 +6649,8 @@
30229 {
30230 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30231 return "fjueq %l0";
30232 -})
30233 +}
30234 + [(set_attr "type" "fbcc")])
30235
30236 (define_insn "bunge"
30237 [(set (pc)
30238 @@ -6560,7 +6661,8 @@
30239 {
30240 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30241 return "fjuge %l0";
30242 -})
30243 +}
30244 + [(set_attr "type" "fbcc")])
30245
30246 (define_insn "bungt"
30247 [(set (pc)
30248 @@ -6571,7 +6673,8 @@
30249 {
30250 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30251 return "fjugt %l0";
30252 -})
30253 +}
30254 + [(set_attr "type" "fbcc")])
30255
30256 (define_insn "bunle"
30257 [(set (pc)
30258 @@ -6582,7 +6685,8 @@
30259 {
30260 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30261 return "fjule %l0";
30262 -})
30263 +}
30264 + [(set_attr "type" "fbcc")])
30265
30266 (define_insn "bunlt"
30267 [(set (pc)
30268 @@ -6593,7 +6697,8 @@
30269 {
30270 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30271 return "fjult %l0";
30272 -})
30273 +}
30274 + [(set_attr "type" "fbcc")])
30275
30276 (define_insn "bltgt"
30277 [(set (pc)
30278 @@ -6604,7 +6709,8 @@
30279 {
30280 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30281 return "fjogl %l0";
30282 -})
30283 +}
30284 + [(set_attr "type" "fbcc")])
30285 \f
30286 ;; Negated conditional jump instructions.
30287
30288 @@ -6640,6 +6746,12 @@
30289 (label_ref (match_operand 0 "" ""))))]
30290 ""
30291 {
30292 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30293 + {
30294 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30295 + return 0;
30296 + }
30297 +
30298 OUTPUT_JUMP ("jle %l0", "fjngt %l0", 0);
30299 }
30300 [(set_attr "type" "bcc")])
30301 @@ -6651,7 +6763,15 @@
30302 (pc)
30303 (label_ref (match_operand 0 "" ""))))]
30304 ""
30305 - "jls %l0"
30306 +{
30307 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30308 + {
30309 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30310 + return 0;
30311 + }
30312 +
30313 + return "jls %l0";
30314 +}
30315 [(set_attr "type" "bcc")])
30316
30317 (define_insn "*blt_rev"
30318 @@ -6662,6 +6782,12 @@
30319 (label_ref (match_operand 0 "" ""))))]
30320 ""
30321 {
30322 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30323 + {
30324 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30325 + return 0;
30326 + }
30327 +
30328 OUTPUT_JUMP ("jge %l0", "fjnlt %l0", "jpl %l0");
30329 }
30330 [(set_attr "type" "bcc")])
30331 @@ -6673,7 +6799,15 @@
30332 (pc)
30333 (label_ref (match_operand 0 "" ""))))]
30334 ""
30335 - "jcc %l0"
30336 +{
30337 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30338 + {
30339 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30340 + return 0;
30341 + }
30342 +
30343 + return "jcc %l0";
30344 +}
30345 [(set_attr "type" "bcc")])
30346
30347 (define_insn "*bge_rev"
30348 @@ -6684,6 +6818,12 @@
30349 (label_ref (match_operand 0 "" ""))))]
30350 ""
30351 {
30352 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30353 + {
30354 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30355 + return 0;
30356 + }
30357 +
30358 OUTPUT_JUMP ("jlt %l0", "fjnge %l0", "jmi %l0");
30359 }
30360 [(set_attr "type" "bcc")])
30361 @@ -6695,7 +6835,15 @@
30362 (pc)
30363 (label_ref (match_operand 0 "" ""))))]
30364 ""
30365 - "jcs %l0"
30366 +{
30367 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30368 + {
30369 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30370 + return 0;
30371 + }
30372 +
30373 + return "jcs %l0";
30374 +}
30375 [(set_attr "type" "bcc")])
30376
30377 (define_insn "*ble_rev"
30378 @@ -6706,6 +6854,12 @@
30379 (label_ref (match_operand 0 "" ""))))]
30380 ""
30381 {
30382 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30383 + {
30384 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30385 + return 0;
30386 + }
30387 +
30388 OUTPUT_JUMP ("jgt %l0", "fjnle %l0", 0);
30389 }
30390 [(set_attr "type" "bcc")])
30391 @@ -6717,7 +6871,15 @@
30392 (pc)
30393 (label_ref (match_operand 0 "" ""))))]
30394 ""
30395 - "jhi %l0"
30396 +{
30397 + if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0)
30398 + {
30399 + cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;
30400 + return 0;
30401 + }
30402 +
30403 + return "jhi %l0";
30404 +}
30405 [(set_attr "type" "bcc")])
30406
30407 (define_insn "*bordered_rev"
30408 @@ -6729,7 +6891,8 @@
30409 {
30410 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30411 return "fjun %l0";
30412 -})
30413 +}
30414 + [(set_attr "type" "fbcc")])
30415
30416 (define_insn "*bunordered_rev"
30417 [(set (pc)
30418 @@ -6740,7 +6903,8 @@
30419 {
30420 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30421 return "fjor %l0";
30422 -})
30423 +}
30424 + [(set_attr "type" "fbcc")])
30425
30426 (define_insn "*buneq_rev"
30427 [(set (pc)
30428 @@ -6751,7 +6915,8 @@
30429 {
30430 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30431 return "fjogl %l0";
30432 -})
30433 +}
30434 + [(set_attr "type" "fbcc")])
30435
30436 (define_insn "*bunge_rev"
30437 [(set (pc)
30438 @@ -6762,7 +6927,8 @@
30439 {
30440 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30441 return "fjolt %l0";
30442 -})
30443 +}
30444 + [(set_attr "type" "fbcc")])
30445
30446 (define_insn "*bungt_rev"
30447 [(set (pc)
30448 @@ -6773,7 +6939,8 @@
30449 {
30450 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30451 return "fjole %l0";
30452 -})
30453 +}
30454 + [(set_attr "type" "fbcc")])
30455
30456 (define_insn "*bunle_rev"
30457 [(set (pc)
30458 @@ -6784,7 +6951,8 @@
30459 {
30460 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30461 return "fjogt %l0";
30462 -})
30463 +}
30464 + [(set_attr "type" "fbcc")])
30465
30466 (define_insn "*bunlt_rev"
30467 [(set (pc)
30468 @@ -6795,7 +6963,8 @@
30469 {
30470 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30471 return "fjoge %l0";
30472 -})
30473 +}
30474 + [(set_attr "type" "fbcc")])
30475
30476 (define_insn "*bltgt_rev"
30477 [(set (pc)
30478 @@ -6806,7 +6975,8 @@
30479 {
30480 gcc_assert (cc_prev_status.flags & CC_IN_68881);
30481 return "fjueq %l0";
30482 -})
30483 +}
30484 + [(set_attr "type" "fbcc")])
30485 \f
30486 ;; Unconditional and other jump instructions
30487 (define_insn "jump"
30488 @@ -6835,7 +7005,7 @@
30489 {
30490 return MOTOROLA ? "jmp (%0)" : "jmp %0@";
30491 }
30492 - [(set_attr "type" "bra")])
30493 + [(set_attr "type" "jmp")])
30494
30495 ;; Jump to variable address from dispatch table of relative addresses.
30496 (define_insn ""
30497 @@ -7013,7 +7183,8 @@
30498 "!SIBLING_CALL_P (insn)"
30499 {
30500 return output_call (operands[0]);
30501 -})
30502 +}
30503 + [(set_attr "type" "jsr")])
30504
30505 ;; Call subroutine, returning value in operand 0
30506 ;; (which must be a hard register).
30507 @@ -7035,7 +7206,6 @@
30508 "!SIBLING_CALL_P (insn)"
30509 "jsr %a1"
30510 [(set_attr "type" "jsr")
30511 - (set_attr "split" "done")
30512 (set_attr "opx" "1")])
30513
30514 (define_insn "*symbolic_call_value_jsr"
30515 @@ -7049,7 +7219,6 @@
30516 return m68k_symbolic_call;
30517 }
30518 [(set_attr "type" "jsr")
30519 - (set_attr "split" "done")
30520 (set_attr "opx" "1")])
30521
30522 (define_insn "*symbolic_call_value_bsr"
30523 @@ -7065,7 +7234,6 @@
30524 return m68k_symbolic_call;
30525 }
30526 [(set_attr "type" "bsr")
30527 - (set_attr "split" "done")
30528 (set_attr "opx" "1")])
30529
30530 ;; Call subroutine returning any type.
30531 @@ -7231,7 +7399,8 @@
30532 return "link.w %0,%1";
30533 else
30534 return "link.l %0,%1";
30535 -})
30536 +}
30537 + [(set_attr "type" "link")])
30538
30539 (define_expand "unlink"
30540 [(parallel
30541 @@ -7721,6 +7890,17 @@
30542 }
30543 })
30544
30545 +;; These are to prevent the scheduler from moving stores to the frame
30546 +;; before the stack adjustment.
30547 +(define_insn "stack_tie"
30548 + [(set (mem:BLK (scratch))
30549 + (unspec:BLK [(match_operand:SI 0 "register_operand" "r")
30550 + (match_operand:SI 1 "register_operand" "r")]
30551 + UNSPEC_TIE))]
30552 + ""
30553 + ""
30554 + [(set_attr "type" "ignore")])
30555 +
30556 ;; Instruction that subscribes one word in ColdFire instruction buffer.
30557 ;; This instruction is used within scheduler only and should not appear
30558 ;; in the instruction stream.
30559 --- a/gcc/config/m68k/m68k.opt
30560 +++ b/gcc/config/m68k/m68k.opt
30561 @@ -178,3 +178,11 @@ Do not use unaligned memory references
30562 mtune=
30563 Target RejectNegative Joined
30564 Tune for the specified target CPU or architecture
30565 +
30566 +mxgot
30567 +Target Report Mask(XGOT)
30568 +Support more than 8192 GOT entries on ColdFire
30569 +
30570 +mxtls
30571 +Target Report Mask(XTLS)
30572 +Support TLS segment larger than 64K
30573 --- a/gcc/config/m68k/predicates.md
30574 +++ b/gcc/config/m68k/predicates.md
30575 @@ -130,7 +130,9 @@
30576 (match_code "sign_extend,zero_extend"))
30577
30578 ;; Returns true if OP is either a symbol reference or a sum of a
30579 -;; symbol reference and a constant.
30580 +;; symbol reference and a constant. This predicate is for "raw"
30581 +;; symbol references not yet processed by legitimize*_address,
30582 +;; hence we do not handle UNSPEC_{XGOT, TLS, XTLS} here.
30583
30584 (define_predicate "symbolic_operand"
30585 (match_code "symbol_ref,label_ref,const")
30586 --- a/gcc/config/m68k/t-cf
30587 +++ b/gcc/config/m68k/t-cf
30588 @@ -2,3 +2,6 @@
30589
30590 M68K_MLIB_CPU += && (CPU ~ "^mcf")
30591 M68K_ARCH := cf
30592 +# Do not stamp the multilibs with a MAC type, as we never use those
30593 +# instructions in compiler-generated code.
30594 +MULTILIB_EXTRA_OPTS += Wa,-mno-mac
30595 --- /dev/null
30596 +++ b/gcc/config/m68k/t-linux
30597 @@ -0,0 +1,11 @@
30598 +EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
30599 +
30600 +# Only include multilibs for CPUs with an MMU.
30601 +M68K_MLIB_CPU += && match(FLAGS, "FL_MMU")
30602 +
30603 +# This rule uses MULTILIB_MATCHES to generate a definition of
30604 +# SYSROOT_SUFFIX_SPEC.
30605 +sysroot-suffix.h: $(srcdir)/config/m68k/print-sysroot-suffix.sh
30606 + $(SHELL) $(srcdir)/config/m68k/print-sysroot-suffix.sh \
30607 + "$(SYSTEM_HEADER_DIR)/../.." "$(MULTILIB_MATCHES)" \
30608 + "$(MULTILIB_OPTIONS)" > $@
30609 --- a/gcc/config/m68k/t-uclinux
30610 +++ b/gcc/config/m68k/t-uclinux
30611 @@ -1,8 +1,8 @@
30612 # crti and crtn are provided by uClibc.
30613 EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o
30614
30615 -# Only include multilibs for the 68020 and for CPUs without an MMU.
30616 -M68K_MLIB_CPU += && (MLIB == "68020" || !match(FLAGS, "FL_MMU"))
30617 +# Include multilibs for CPUs without an MMU or with FL_UCLINUX
30618 +M68K_MLIB_CPU += && (!match(FLAGS, "FL_MMU") || match(FLAGS, "FL_UCLINUX"))
30619
30620 # Add multilibs for execute-in-place and shared-library code.
30621 M68K_MLIB_OPTIONS += msep-data/mid-shared-library
30622 --- a/gcc/config/mips/74k.md
30623 +++ b/gcc/config/mips/74k.md
30624 @@ -118,8 +118,7 @@
30625 ;; stores
30626 (define_insn_reservation "r74k_int_store" 1
30627 (and (eq_attr "cpu" "74kc,74kf2_1,74kf1_1,74kf3_2")
30628 - (and (eq_attr "type" "store")
30629 - (eq_attr "mode" "!unknown")))
30630 + (eq_attr "type" "store"))
30631 "r74k_agen")
30632
30633
30634 @@ -145,33 +144,123 @@
30635 ;; load->load base: 4 cycles
30636 ;; load->store base: 4 cycles
30637 (define_bypass 4 "r74k_int_load" "r74k_int_load")
30638 -(define_bypass 4 "r74k_int_load" "r74k_int_store" "!store_data_bypass_p")
30639 +(define_bypass 4 "r74k_int_load" "r74k_int_store" "!mips_store_data_bypass_p")
30640
30641 ;; logical/move/slt/signext->next use : 1 cycles (Default)
30642 ;; logical/move/slt/signext->load base: 2 cycles
30643 ;; logical/move/slt/signext->store base: 2 cycles
30644 (define_bypass 2 "r74k_int_logical" "r74k_int_load")
30645 -(define_bypass 2 "r74k_int_logical" "r74k_int_store" "!store_data_bypass_p")
30646 +(define_bypass 2 "r74k_int_logical" "r74k_int_store"
30647 + "!mips_store_data_bypass_p")
30648
30649 ;; arith->next use : 2 cycles (Default)
30650 ;; arith->load base: 3 cycles
30651 ;; arith->store base: 3 cycles
30652 (define_bypass 3 "r74k_int_arith" "r74k_int_load")
30653 -(define_bypass 3 "r74k_int_arith" "r74k_int_store" "!store_data_bypass_p")
30654 +(define_bypass 3 "r74k_int_arith" "r74k_int_store" "!mips_store_data_bypass_p")
30655
30656 ;; cmove->next use : 4 cycles (Default)
30657 ;; cmove->load base: 5 cycles
30658 ;; cmove->store base: 5 cycles
30659 (define_bypass 5 "r74k_int_cmove" "r74k_int_load")
30660 -(define_bypass 5 "r74k_int_cmove" "r74k_int_store" "!store_data_bypass_p")
30661 +(define_bypass 5 "r74k_int_cmove" "r74k_int_store"
30662 + "!mips_store_data_bypass_p")
30663
30664 ;; mult/madd/msub->int_mfhilo : 4 cycles (default)
30665 ;; mult->madd/msub : 1 cycles
30666 ;; madd/msub->madd/msub : 1 cycles
30667 -(define_bypass 1 "r74k_int_mult,r74k_int_mul3" "r74k_int_madd"
30668 - "mips_linked_madd_p")
30669 -(define_bypass 1 "r74k_int_madd" "r74k_int_madd"
30670 - "mips_linked_madd_p")
30671 +(define_bypass 1 "r74k_int_mult" "r74k_int_madd")
30672 +(define_bypass 1 "r74k_int_madd" "r74k_int_madd")
30673 +
30674 +(define_bypass 1 "r74k_int_mul3" "r74k_int_madd"
30675 + "mips_mult_madd_chain_bypass_p")
30676 +
30677 +
30678 +;; --------------------------------------------------------------
30679 +;; DSP instructins
30680 +;; --------------------------------------------------------------
30681 +
30682 +;; Non-saturating insn have the same latency as normal ALU operations,
30683 +(define_insn_reservation "r74k_dsp_alu" 2
30684 + (and (eq_attr "cpu" "74kc,74kf2_1,74kf1_1,74kf3_2")
30685 + (eq_attr "type" "dspalu"))
30686 + "r74k_alu")
30687 +
30688 +;; Saturating insn takes an extra cycle.
30689 +(define_insn_reservation "r74k_dsp_alu_sat" 3
30690 + (and (eq_attr "cpu" "74kc,74kf2_1,74kf1_1,74kf3_2")
30691 + (eq_attr "type" "dspalusat"))
30692 + "r74k_alu")
30693 +
30694 +;; dpaq_s, dpau, dpsq_s, dpsu, maq_s, mulsaq
30695 +;; - delivers result to hi/lo in 6 cycle (bypass at M4)
30696 +(define_insn_reservation "r74k_dsp_mac" 6
30697 + (and (eq_attr "cpu" "74kc,74kf2_1,74kf1_1,74kf3_2")
30698 + (eq_attr "type" "dspmac"))
30699 + "r74k_alu+r74k_mul")
30700 +
30701 +;; dpaq_sa, dpsq_sa, maq_sa
30702 +;; - delivers result to hi/lo in 7 cycle (bypass at WB)
30703 +(define_insn_reservation "r74k_dsp_mac_sat" 7
30704 + (and (eq_attr "cpu" "74kc,74kf2_1,74kf1_1,74kf3_2")
30705 + (eq_attr "type" "dspmacsat"))
30706 + "r74k_alu+r74k_mul")
30707 +
30708 +;; extp, extpdp, extpdpv, extpv, extr, extrv
30709 +;; - same latency as "mul"
30710 +(define_insn_reservation "r74k_dsp_acc_ext" 7
30711 + (and (eq_attr "cpu" "74kc,74kf2_1,74kf1_1,74kf3_2")
30712 + (eq_attr "type" "accext"))
30713 + "r74k_alu+r74k_mul")
30714 +
30715 +;; mthlip, shilo, shilov
30716 +;; - same latency as "mul"
30717 +(define_insn_reservation "r74k_dsp_acc_mod" 7
30718 + (and (eq_attr "cpu" "74kc,74kf2_1,74kf1_1,74kf3_2")
30719 + (eq_attr "type" "accmod"))
30720 + "r74k_alu+r74k_mul")
30721 +
30722 +;; dspalu ->load/store base
30723 +;; dspalusat->load/store base
30724 +;; - we should never see these in real life.
30725 +
30726 +;; dsp_mac->dsp_mac : 1 cycles (repeat rate of 1)
30727 +;; dsp_mac->dsp_mac_sat : 1 cycles (repeat rate of 1)
30728 +(define_bypass 1 "r74k_dsp_mac" "r74k_dsp_mac")
30729 +(define_bypass 1 "r74k_dsp_mac" "r74k_dsp_mac_sat")
30730 +
30731 +;; dsp_mac_sat->dsp_mac_sat : 2 cycles (repeat rate of 2)
30732 +;; dsp_mac_sat->dsp_mac : 2 cycles (repeat rate of 2)
30733 +(define_bypass 2 "r74k_dsp_mac_sat" "r74k_dsp_mac_sat")
30734 +(define_bypass 2 "r74k_dsp_mac_sat" "r74k_dsp_mac")
30735 +
30736 +(define_bypass 1 "r74k_int_mult" "r74k_dsp_mac")
30737 +(define_bypass 1 "r74k_int_mult" "r74k_dsp_mac_sat")
30738 +
30739 +;; Before reload, all multiplier is registered as imul3 (which has a long
30740 +;; latency). We temporary jig the latency such that the macc groups
30741 +;; are scheduled closely together during the first scheduler pass.
30742 +(define_bypass 1 "r74k_int_mul3" "r74k_dsp_mac"
30743 + "mips_mult_madd_chain_bypass_p")
30744 +(define_bypass 1 "r74k_int_mul3" "r74k_dsp_mac_sat"
30745 + "mips_mult_madd_chain_bypass_p")
30746 +
30747 +;; Assuming the following is true (bypass at M4)
30748 +;; AP AF AM MB M1 M2 M3 M4 WB GR GC
30749 +;; AP AF AM MB M1 M2 M3 M4 WB GR GC
30750 +;; dsp_mac->dsp_acc_ext : 4 cycles
30751 +;; dsp_mac->dsp_acc_mod : 4 cycles
30752 +(define_bypass 4 "r74k_dsp_mac" "r74k_dsp_acc_ext")
30753 +(define_bypass 4 "r74k_dsp_mac" "r74k_dsp_acc_mod")
30754 +
30755 +;; Assuming the following is true (bypass at WB)
30756 +;; AP AF AM MB M1 M2 M3 M4 WB GR GC
30757 +;; AP AF AM MB M1 M2 M3 M4 WB GR GC
30758 +;; dsp_mac_sat->dsp_acc_ext : 5 cycles
30759 +;; dsp_mac_sat->dsp_acc_mod : 5 cycles
30760 +(define_bypass 5 "r74k_dsp_mac_sat" "r74k_dsp_acc_ext")
30761 +(define_bypass 5 "r74k_dsp_mac_sat" "r74k_dsp_acc_mod")
30762 +
30763
30764 ;; --------------------------------------------------------------
30765 ;; Floating Point Instructions
30766 --- /dev/null
30767 +++ b/gcc/config/mips/crtfastmath.c
30768 @@ -0,0 +1,62 @@
30769 +/*
30770 + * Copyright (C) 2008 Free Software Foundation, Inc.
30771 + *
30772 + * This file is free software; you can redistribute it and/or modify it
30773 + * under the terms of the GNU General Public License as published by the
30774 + * Free Software Foundation; either version 3, or (at your option) any
30775 + * later version.
30776 + *
30777 + * In addition to the permissions in the GNU General Public License, the
30778 + * Free Software Foundation gives you unlimited permission to link the
30779 + * compiled version of this file with other programs, and to distribute
30780 + * those programs without any restriction coming from the use of this
30781 + * file. (The General Public License restrictions do apply in other
30782 + * respects; for example, they cover modification of the file, and
30783 + * distribution when not linked into another program.)
30784 + *
30785 + * This file is distributed in the hope that it will be useful, but
30786 + * WITHOUT ANY WARRANTY; without even the implied warranty of
30787 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30788 + * General Public License for more details.
30789 + *
30790 + * You should have received a copy of the GNU General Public License
30791 + * along with GCC; see the file COPYING3. If not see
30792 + * <http://www.gnu.org/licenses/>.
30793 + *
30794 + * As a special exception, if you link this library with files
30795 + * compiled with GCC to produce an executable, this does not cause
30796 + * the resulting executable to be covered by the GNU General Public License.
30797 + * This exception does not however invalidate any other reasons why
30798 + * the executable file might be covered by the GNU General Public License.
30799 + */
30800 +
30801 +#ifdef __mips_hard_float
30802 +
30803 +/* flush denormalized numbers to zero */
30804 +#define _FPU_FLUSH_TZ 0x1000000
30805 +
30806 +/* rounding control */
30807 +#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */
30808 +#define _FPU_RC_ZERO 0x1
30809 +#define _FPU_RC_UP 0x2
30810 +#define _FPU_RC_DOWN 0x3
30811 +
30812 +/* enable interrupts for IEEE exceptions */
30813 +#define _FPU_IEEE 0x00000F80
30814 +
30815 +/* Macros for accessing the hardware control word. */
30816 +#define _FPU_GETCW(cw) __asm__ ("cfc1 %0,$31" : "=r" (cw))
30817 +#define _FPU_SETCW(cw) __asm__ ("ctc1 %0,$31" : : "r" (cw))
30818 +
30819 +static void __attribute__((constructor))
30820 +set_fast_math (void)
30821 +{
30822 + unsigned int fcr;
30823 +
30824 + /* fastmath: flush to zero, round to nearest, ieee exceptions disabled */
30825 + fcr = _FPU_FLUSH_TZ | _FPU_RC_NEAREST;
30826 +
30827 + _FPU_SETCW(fcr);
30828 +}
30829 +
30830 +#endif /* __mips_hard_float */
30831 --- /dev/null
30832 +++ b/gcc/config/mips/cs-sgxx-linux.h
30833 @@ -0,0 +1,40 @@
30834 +/* MIPS SourceryG++ GNU/Linux Configuration.
30835 + Copyright (C) 2008
30836 + Free Software Foundation, Inc.
30837 +
30838 +This file is part of GCC.
30839 +
30840 +GCC is free software; you can redistribute it and/or modify
30841 +it under the terms of the GNU General Public License as published by
30842 +the Free Software Foundation; either version 3, or (at your option)
30843 +any later version.
30844 +
30845 +GCC is distributed in the hope that it will be useful,
30846 +but WITHOUT ANY WARRANTY; without even the implied warranty of
30847 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30848 +GNU General Public License for more details.
30849 +
30850 +You should have received a copy of the GNU General Public License
30851 +along with GCC; see the file COPYING3. If not see
30852 +<http://www.gnu.org/licenses/>. */
30853 +
30854 +/* We do not need to provide an explicit big-endian multilib. */
30855 +#undef MULTILIB_DEFAULTS
30856 +#define MULTILIB_DEFAULTS \
30857 + { "EB" }
30858 +
30859 +/* The various C libraries each have their own subdirectory. */
30860 +#undef SYSROOT_SUFFIX_SPEC
30861 +#define SYSROOT_SUFFIX_SPEC \
30862 +"%{muclibc:/uclibc}\
30863 +%{mips2|mips3|mips4|march=mips2|march=mips3|march=mips4|march=r6000|\
30864 +march=r4000|march=vr4100|march=vr4111|march=vr4120|march=vr4130|\
30865 +march=vr4300|march=r4400|march=r4600|march=orion|march=r4650|march=r8000|\
30866 +march=vr5000|march=vr5400|march=vr5500|march=rm7000|\
30867 +march=rm9000:/mips2;\
30868 +mips32|march=mips32|march=4kc|march=4km|march=4kp|march=4ks:/mips32}\
30869 +%{msoft-float:/soft-float}%{mel|EL:/el}"
30870 +
30871 +#undef SYSROOT_HEADERS_SUFFIX_SPEC
30872 +#define SYSROOT_HEADERS_SUFFIX_SPEC \
30873 + "%{muclibc:/uclibc}"
30874 --- /dev/null
30875 +++ b/gcc/config/mips/cs-sgxxlite-linux.h
30876 @@ -0,0 +1,33 @@
30877 +/* MIPS SourceryG++ GNU/Linux Configuration.
30878 + Copyright (C) 2008
30879 + Free Software Foundation, Inc.
30880 +
30881 +This file is part of GCC.
30882 +
30883 +GCC is free software; you can redistribute it and/or modify
30884 +it under the terms of the GNU General Public License as published by
30885 +the Free Software Foundation; either version 3, or (at your option)
30886 +any later version.
30887 +
30888 +GCC is distributed in the hope that it will be useful,
30889 +but WITHOUT ANY WARRANTY; without even the implied warranty of
30890 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30891 +GNU General Public License for more details.
30892 +
30893 +You should have received a copy of the GNU General Public License
30894 +along with GCC; see the file COPYING3. If not see
30895 +<http://www.gnu.org/licenses/>. */
30896 +
30897 +/* We do not need to provide an explicit big-endian multilib. */
30898 +#undef MULTILIB_DEFAULTS
30899 +#define MULTILIB_DEFAULTS \
30900 + { "EB" }
30901 +
30902 +/* The various C libraries each have their own subdirectory. */
30903 +#undef SYSROOT_SUFFIX_SPEC
30904 +#define SYSROOT_SUFFIX_SPEC \
30905 +"%{muclibc:/uclibc}%{msoft-float:/soft-float}%{mel|EL:/el}"
30906 +
30907 +#undef SYSROOT_HEADERS_SUFFIX_SPEC
30908 +#define SYSROOT_HEADERS_SUFFIX_SPEC \
30909 + "%{muclibc:/uclibc}"
30910 --- a/gcc/config/mips/elfoabi.h
30911 +++ b/gcc/config/mips/elfoabi.h
30912 @@ -19,7 +19,7 @@ You should have received a copy of the G
30913 along with GCC; see the file COPYING3. If not see
30914 <http://www.gnu.org/licenses/>. */
30915
30916 -#define DRIVER_SELF_SPECS \
30917 +#define SUBTARGET_SELF_SPECS \
30918 /* Make sure a -mips option is present. This helps us to pick \
30919 the right multilib, and also makes the later specs easier \
30920 to write. */ \
30921 --- a/gcc/config/mips/iris6.h
30922 +++ b/gcc/config/mips/iris6.h
30923 @@ -29,7 +29,7 @@ along with GCC; see the file COPYING3.
30924
30925 /* Force the default ABI onto the command line in order to make the specs
30926 easier to write. Default to the mips2 ISA for the O32 ABI. */
30927 -#define DRIVER_SELF_SPECS \
30928 +#define SUBTARGET_SELF_SPECS \
30929 "%{!mabi=*: -mabi=n32}", \
30930 "%{mabi=32: %{!mips*: %{!march*: -mips2}}}"
30931
30932 --- a/gcc/config/mips/linux.h
30933 +++ b/gcc/config/mips/linux.h
30934 @@ -37,10 +37,6 @@ along with GCC; see the file COPYING3.
30935 #undef MD_EXEC_PREFIX
30936 #undef MD_STARTFILE_PREFIX
30937
30938 -/* If we don't set MASK_ABICALLS, we can't default to PIC. */
30939 -#undef TARGET_DEFAULT
30940 -#define TARGET_DEFAULT MASK_ABICALLS
30941 -
30942 #define TARGET_OS_CPP_BUILTINS() \
30943 do { \
30944 LINUX_TARGET_OS_CPP_BUILTINS(); \
30945 @@ -79,7 +75,8 @@ along with GCC; see the file COPYING3.
30946 %{static:-static}}}"
30947
30948 #undef SUBTARGET_ASM_SPEC
30949 -#define SUBTARGET_ASM_SPEC "%{mabi=64: -64} %{!mno-abicalls:-KPIC}"
30950 +#define SUBTARGET_ASM_SPEC \
30951 + "%{mabi=64: -64} %{mabicalls:%{fpic|fPIC|fpie|fPIE:-KPIC;:-mnon-pic-abicalls}}"
30952
30953 /* The MIPS assembler has different syntax for .set. We set it to
30954 .dummy to trap any errors. */
30955 @@ -145,7 +142,15 @@ along with GCC; see the file COPYING3.
30956 /* Default to -mno-shared for non-PIC. */
30957 #define NO_SHARED_SPECS \
30958 "%{mshared|mno-shared|fpic|fPIC|fpie|fPIE:;:-mno-shared}"
30959 -#define DRIVER_SELF_SPECS NO_SHARED_SPECS
30960 +#undef SUBTARGET_SELF_SPECS
30961 +#define SUBTARGET_SELF_SPECS NO_SHARED_SPECS
30962 #else
30963 #define NO_SHARED_SPECS
30964 #endif
30965 +
30966 +/* Similar to standard Linux, but adding -ffast-math support. */
30967 +#undef ENDFILE_SPEC
30968 +#define ENDFILE_SPEC \
30969 + "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
30970 + %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
30971 +
30972 --- a/gcc/config/mips/linux64.h
30973 +++ b/gcc/config/mips/linux64.h
30974 @@ -20,15 +20,15 @@ along with GCC; see the file COPYING3.
30975
30976 /* Force the default endianness and ABI flags onto the command line
30977 in order to make the other specs easier to write. */
30978 -#undef DRIVER_SELF_SPECS
30979 -#define DRIVER_SELF_SPECS \
30980 +#undef SUBTARGET_SELF_SPECS
30981 +#define SUBTARGET_SELF_SPECS \
30982 NO_SHARED_SPECS \
30983 " %{!EB:%{!EL:%(endian_spec)}}" \
30984 " %{!mabi=*: -mabi=n32}"
30985
30986 #undef SUBTARGET_ASM_SPEC
30987 #define SUBTARGET_ASM_SPEC "\
30988 -%{!fno-PIC:%{!fno-pic:-KPIC}} \
30989 +%{mabicalls:%{fpic|fPIC|fpie|fPIE:-KPIC;:-mnon-pic-abicalls}} \
30990 %{fno-PIC:-non_shared} %{fno-pic:-non_shared}"
30991
30992 #undef LIB_SPEC
30993 @@ -72,3 +72,9 @@ NO_SHARED_SPECS \
30994 ieee_quad_format is the default, but let's put this here to make
30995 sure nobody thinks we just forgot to set it to something else. */
30996 #define MIPS_TFMODE_FORMAT mips_quad_format
30997 +
30998 +/* Similar to standard Linux, but adding -ffast-math support. */
30999 +#undef ENDFILE_SPEC
31000 +#define ENDFILE_SPEC \
31001 + "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
31002 + %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
31003 --- a/gcc/config/mips/mips-dsp.md
31004 +++ b/gcc/config/mips/mips-dsp.md
31005 @@ -42,9 +42,9 @@
31006 (match_operand:DSPV 2 "register_operand" "d")))
31007 (set (reg:CCDSP CCDSP_OU_REGNUM)
31008 (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_ADDQ))])]
31009 - ""
31010 + "ISA_HAS_DSP"
31011 "add<DSPV:dspfmt1>.<DSPV:dspfmt2>\t%0,%1,%2"
31012 - [(set_attr "type" "arith")
31013 + [(set_attr "type" "dspalu")
31014 (set_attr "mode" "SI")])
31015
31016 (define_insn "mips_add<DSP:dspfmt1>_s_<DSP:dspfmt2>"
31017 @@ -55,9 +55,9 @@
31018 UNSPEC_ADDQ_S))
31019 (set (reg:CCDSP CCDSP_OU_REGNUM)
31020 (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_ADDQ_S))])]
31021 - ""
31022 + "ISA_HAS_DSP"
31023 "add<DSP:dspfmt1>_s.<DSP:dspfmt2>\t%0,%1,%2"
31024 - [(set_attr "type" "arith")
31025 + [(set_attr "type" "dspalusat")
31026 (set_attr "mode" "SI")])
31027
31028 ;; SUBQ*
31029 @@ -70,7 +70,7 @@
31030 (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_SUBQ))])]
31031 "ISA_HAS_DSP"
31032 "sub<DSPV:dspfmt1>.<DSPV:dspfmt2>\t%0,%1,%2"
31033 - [(set_attr "type" "arith")
31034 + [(set_attr "type" "dspalu")
31035 (set_attr "mode" "SI")])
31036
31037 (define_insn "mips_sub<DSP:dspfmt1>_s_<DSP:dspfmt2>"
31038 @@ -83,7 +83,7 @@
31039 (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_SUBQ_S))])]
31040 "ISA_HAS_DSP"
31041 "sub<DSP:dspfmt1>_s.<DSP:dspfmt2>\t%0,%1,%2"
31042 - [(set_attr "type" "arith")
31043 + [(set_attr "type" "dspalusat")
31044 (set_attr "mode" "SI")])
31045
31046 ;; ADDSC
31047 @@ -97,7 +97,7 @@
31048 (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_ADDSC))])]
31049 "ISA_HAS_DSP"
31050 "addsc\t%0,%1,%2"
31051 - [(set_attr "type" "arith")
31052 + [(set_attr "type" "dspalu")
31053 (set_attr "mode" "SI")])
31054
31055 ;; ADDWC
31056 @@ -112,7 +112,7 @@
31057 (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_ADDWC))])]
31058 "ISA_HAS_DSP"
31059 "addwc\t%0,%1,%2"
31060 - [(set_attr "type" "arith")
31061 + [(set_attr "type" "dspalu")
31062 (set_attr "mode" "SI")])
31063
31064 ;; MODSUB
31065 @@ -123,7 +123,7 @@
31066 UNSPEC_MODSUB))]
31067 "ISA_HAS_DSP"
31068 "modsub\t%0,%1,%2"
31069 - [(set_attr "type" "arith")
31070 + [(set_attr "type" "dspalu")
31071 (set_attr "mode" "SI")])
31072
31073 ;; RADDU*
31074 @@ -133,7 +133,7 @@
31075 UNSPEC_RADDU_W_QB))]
31076 "ISA_HAS_DSP"
31077 "raddu.w.qb\t%0,%1"
31078 - [(set_attr "type" "arith")
31079 + [(set_attr "type" "dspalu")
31080 (set_attr "mode" "SI")])
31081
31082 ;; ABSQ*
31083 @@ -146,7 +146,7 @@
31084 (unspec:CCDSP [(match_dup 1)] UNSPEC_ABSQ_S))])]
31085 "ISA_HAS_DSP"
31086 "absq_s.<DSPQ:dspfmt2>\t%0,%1"
31087 - [(set_attr "type" "arith")
31088 + [(set_attr "type" "dspalusat")
31089 (set_attr "mode" "SI")])
31090
31091 ;; PRECRQ*
31092 @@ -157,7 +157,7 @@
31093 UNSPEC_PRECRQ_QB_PH))]
31094 "ISA_HAS_DSP"
31095 "precrq.qb.ph\t%0,%1,%2"
31096 - [(set_attr "type" "arith")
31097 + [(set_attr "type" "dspalu")
31098 (set_attr "mode" "SI")])
31099
31100 (define_insn "mips_precrq_ph_w"
31101 @@ -167,7 +167,7 @@
31102 UNSPEC_PRECRQ_PH_W))]
31103 "ISA_HAS_DSP"
31104 "precrq.ph.w\t%0,%1,%2"
31105 - [(set_attr "type" "arith")
31106 + [(set_attr "type" "dspalu")
31107 (set_attr "mode" "SI")])
31108
31109 (define_insn "mips_precrq_rs_ph_w"
31110 @@ -181,7 +181,7 @@
31111 UNSPEC_PRECRQ_RS_PH_W))])]
31112 "ISA_HAS_DSP"
31113 "precrq_rs.ph.w\t%0,%1,%2"
31114 - [(set_attr "type" "arith")
31115 + [(set_attr "type" "dspalu")
31116 (set_attr "mode" "SI")])
31117
31118 ;; PRECRQU*
31119 @@ -196,7 +196,7 @@
31120 UNSPEC_PRECRQU_S_QB_PH))])]
31121 "ISA_HAS_DSP"
31122 "precrqu_s.qb.ph\t%0,%1,%2"
31123 - [(set_attr "type" "arith")
31124 + [(set_attr "type" "dspalusat")
31125 (set_attr "mode" "SI")])
31126
31127 ;; PRECEQ*
31128 @@ -206,7 +206,7 @@
31129 UNSPEC_PRECEQ_W_PHL))]
31130 "ISA_HAS_DSP"
31131 "preceq.w.phl\t%0,%1"
31132 - [(set_attr "type" "arith")
31133 + [(set_attr "type" "dspalu")
31134 (set_attr "mode" "SI")])
31135
31136 (define_insn "mips_preceq_w_phr"
31137 @@ -215,7 +215,7 @@
31138 UNSPEC_PRECEQ_W_PHR))]
31139 "ISA_HAS_DSP"
31140 "preceq.w.phr\t%0,%1"
31141 - [(set_attr "type" "arith")
31142 + [(set_attr "type" "dspalu")
31143 (set_attr "mode" "SI")])
31144
31145 ;; PRECEQU*
31146 @@ -225,7 +225,7 @@
31147 UNSPEC_PRECEQU_PH_QBL))]
31148 "ISA_HAS_DSP"
31149 "precequ.ph.qbl\t%0,%1"
31150 - [(set_attr "type" "arith")
31151 + [(set_attr "type" "dspalu")
31152 (set_attr "mode" "SI")])
31153
31154 (define_insn "mips_precequ_ph_qbr"
31155 @@ -234,7 +234,7 @@
31156 UNSPEC_PRECEQU_PH_QBR))]
31157 "ISA_HAS_DSP"
31158 "precequ.ph.qbr\t%0,%1"
31159 - [(set_attr "type" "arith")
31160 + [(set_attr "type" "dspalu")
31161 (set_attr "mode" "SI")])
31162
31163 (define_insn "mips_precequ_ph_qbla"
31164 @@ -243,7 +243,7 @@
31165 UNSPEC_PRECEQU_PH_QBLA))]
31166 "ISA_HAS_DSP"
31167 "precequ.ph.qbla\t%0,%1"
31168 - [(set_attr "type" "arith")
31169 + [(set_attr "type" "dspalu")
31170 (set_attr "mode" "SI")])
31171
31172 (define_insn "mips_precequ_ph_qbra"
31173 @@ -252,7 +252,7 @@
31174 UNSPEC_PRECEQU_PH_QBRA))]
31175 "ISA_HAS_DSP"
31176 "precequ.ph.qbra\t%0,%1"
31177 - [(set_attr "type" "arith")
31178 + [(set_attr "type" "dspalu")
31179 (set_attr "mode" "SI")])
31180
31181 ;; PRECEU*
31182 @@ -262,7 +262,7 @@
31183 UNSPEC_PRECEU_PH_QBL))]
31184 "ISA_HAS_DSP"
31185 "preceu.ph.qbl\t%0,%1"
31186 - [(set_attr "type" "arith")
31187 + [(set_attr "type" "dspalu")
31188 (set_attr "mode" "SI")])
31189
31190 (define_insn "mips_preceu_ph_qbr"
31191 @@ -271,7 +271,7 @@
31192 UNSPEC_PRECEU_PH_QBR))]
31193 "ISA_HAS_DSP"
31194 "preceu.ph.qbr\t%0,%1"
31195 - [(set_attr "type" "arith")
31196 + [(set_attr "type" "dspalu")
31197 (set_attr "mode" "SI")])
31198
31199 (define_insn "mips_preceu_ph_qbla"
31200 @@ -280,7 +280,7 @@
31201 UNSPEC_PRECEU_PH_QBLA))]
31202 "ISA_HAS_DSP"
31203 "preceu.ph.qbla\t%0,%1"
31204 - [(set_attr "type" "arith")
31205 + [(set_attr "type" "dspalu")
31206 (set_attr "mode" "SI")])
31207
31208 (define_insn "mips_preceu_ph_qbra"
31209 @@ -289,7 +289,7 @@
31210 UNSPEC_PRECEU_PH_QBRA))]
31211 "ISA_HAS_DSP"
31212 "preceu.ph.qbra\t%0,%1"
31213 - [(set_attr "type" "arith")
31214 + [(set_attr "type" "dspalu")
31215 (set_attr "mode" "SI")])
31216
31217 ;; Table 2-2. MIPS DSP ASE Instructions: Shift
31218 @@ -313,7 +313,7 @@
31219 }
31220 return "shllv.<DSPV:dspfmt2>\t%0,%1,%2";
31221 }
31222 - [(set_attr "type" "shift")
31223 + [(set_attr "type" "dspalu")
31224 (set_attr "mode" "SI")])
31225
31226 (define_insn "mips_shll_s_<DSPQ:dspfmt2>"
31227 @@ -335,7 +335,7 @@
31228 }
31229 return "shllv_s.<DSPQ:dspfmt2>\t%0,%1,%2";
31230 }
31231 - [(set_attr "type" "shift")
31232 + [(set_attr "type" "dspalusat")
31233 (set_attr "mode" "SI")])
31234
31235 ;; SHRL*
31236 @@ -354,7 +354,7 @@
31237 }
31238 return "shrlv.qb\t%0,%1,%2";
31239 }
31240 - [(set_attr "type" "shift")
31241 + [(set_attr "type" "dspalu")
31242 (set_attr "mode" "SI")])
31243
31244 ;; SHRA*
31245 @@ -373,7 +373,7 @@
31246 }
31247 return "shrav.ph\t%0,%1,%2";
31248 }
31249 - [(set_attr "type" "shift")
31250 + [(set_attr "type" "dspalu")
31251 (set_attr "mode" "SI")])
31252
31253 (define_insn "mips_shra_r_<DSPQ:dspfmt2>"
31254 @@ -392,7 +392,7 @@
31255 }
31256 return "shrav_r.<DSPQ:dspfmt2>\t%0,%1,%2";
31257 }
31258 - [(set_attr "type" "shift")
31259 + [(set_attr "type" "dspalu")
31260 (set_attr "mode" "SI")])
31261
31262 ;; Table 2-3. MIPS DSP ASE Instructions: Multiply
31263 @@ -478,7 +478,7 @@
31264 UNSPEC_DPAU_H_QBL))]
31265 "ISA_HAS_DSP && !TARGET_64BIT"
31266 "dpau.h.qbl\t%q0,%2,%3"
31267 - [(set_attr "type" "imadd")
31268 + [(set_attr "type" "dspmac")
31269 (set_attr "mode" "SI")])
31270
31271 (define_insn "mips_dpau_h_qbr"
31272 @@ -489,7 +489,7 @@
31273 UNSPEC_DPAU_H_QBR))]
31274 "ISA_HAS_DSP && !TARGET_64BIT"
31275 "dpau.h.qbr\t%q0,%2,%3"
31276 - [(set_attr "type" "imadd")
31277 + [(set_attr "type" "dspmac")
31278 (set_attr "mode" "SI")])
31279
31280 ;; DPSU*
31281 @@ -501,7 +501,7 @@
31282 UNSPEC_DPSU_H_QBL))]
31283 "ISA_HAS_DSP && !TARGET_64BIT"
31284 "dpsu.h.qbl\t%q0,%2,%3"
31285 - [(set_attr "type" "imadd")
31286 + [(set_attr "type" "dspmac")
31287 (set_attr "mode" "SI")])
31288
31289 (define_insn "mips_dpsu_h_qbr"
31290 @@ -512,7 +512,7 @@
31291 UNSPEC_DPSU_H_QBR))]
31292 "ISA_HAS_DSP && !TARGET_64BIT"
31293 "dpsu.h.qbr\t%q0,%2,%3"
31294 - [(set_attr "type" "imadd")
31295 + [(set_attr "type" "dspmac")
31296 (set_attr "mode" "SI")])
31297
31298 ;; DPAQ*
31299 @@ -528,7 +528,7 @@
31300 UNSPEC_DPAQ_S_W_PH))])]
31301 "ISA_HAS_DSP && !TARGET_64BIT"
31302 "dpaq_s.w.ph\t%q0,%2,%3"
31303 - [(set_attr "type" "imadd")
31304 + [(set_attr "type" "dspmac")
31305 (set_attr "mode" "SI")])
31306
31307 ;; DPSQ*
31308 @@ -544,7 +544,7 @@
31309 UNSPEC_DPSQ_S_W_PH))])]
31310 "ISA_HAS_DSP && !TARGET_64BIT"
31311 "dpsq_s.w.ph\t%q0,%2,%3"
31312 - [(set_attr "type" "imadd")
31313 + [(set_attr "type" "dspmac")
31314 (set_attr "mode" "SI")])
31315
31316 ;; MULSAQ*
31317 @@ -560,7 +560,7 @@
31318 UNSPEC_MULSAQ_S_W_PH))])]
31319 "ISA_HAS_DSP && !TARGET_64BIT"
31320 "mulsaq_s.w.ph\t%q0,%2,%3"
31321 - [(set_attr "type" "imadd")
31322 + [(set_attr "type" "dspmac")
31323 (set_attr "mode" "SI")])
31324
31325 ;; DPAQ*
31326 @@ -576,7 +576,7 @@
31327 UNSPEC_DPAQ_SA_L_W))])]
31328 "ISA_HAS_DSP && !TARGET_64BIT"
31329 "dpaq_sa.l.w\t%q0,%2,%3"
31330 - [(set_attr "type" "imadd")
31331 + [(set_attr "type" "dspmacsat")
31332 (set_attr "mode" "SI")])
31333
31334 ;; DPSQ*
31335 @@ -592,7 +592,7 @@
31336 UNSPEC_DPSQ_SA_L_W))])]
31337 "ISA_HAS_DSP && !TARGET_64BIT"
31338 "dpsq_sa.l.w\t%q0,%2,%3"
31339 - [(set_attr "type" "imadd")
31340 + [(set_attr "type" "dspmacsat")
31341 (set_attr "mode" "SI")])
31342
31343 ;; MAQ*
31344 @@ -608,7 +608,7 @@
31345 UNSPEC_MAQ_S_W_PHL))])]
31346 "ISA_HAS_DSP && !TARGET_64BIT"
31347 "maq_s.w.phl\t%q0,%2,%3"
31348 - [(set_attr "type" "imadd")
31349 + [(set_attr "type" "dspmac")
31350 (set_attr "mode" "SI")])
31351
31352 (define_insn "mips_maq_s_w_phr"
31353 @@ -623,7 +623,7 @@
31354 UNSPEC_MAQ_S_W_PHR))])]
31355 "ISA_HAS_DSP && !TARGET_64BIT"
31356 "maq_s.w.phr\t%q0,%2,%3"
31357 - [(set_attr "type" "imadd")
31358 + [(set_attr "type" "dspmac")
31359 (set_attr "mode" "SI")])
31360
31361 ;; MAQ_SA*
31362 @@ -639,7 +639,7 @@
31363 UNSPEC_MAQ_SA_W_PHL))])]
31364 "ISA_HAS_DSP && !TARGET_64BIT"
31365 "maq_sa.w.phl\t%q0,%2,%3"
31366 - [(set_attr "type" "imadd")
31367 + [(set_attr "type" "dspmacsat")
31368 (set_attr "mode" "SI")])
31369
31370 (define_insn "mips_maq_sa_w_phr"
31371 @@ -654,7 +654,7 @@
31372 UNSPEC_MAQ_SA_W_PHR))])]
31373 "ISA_HAS_DSP && !TARGET_64BIT"
31374 "maq_sa.w.phr\t%q0,%2,%3"
31375 - [(set_attr "type" "imadd")
31376 + [(set_attr "type" "dspmacsat")
31377 (set_attr "mode" "SI")])
31378
31379 ;; Table 2-4. MIPS DSP ASE Instructions: General Bit/Manipulation
31380 @@ -665,7 +665,7 @@
31381 UNSPEC_BITREV))]
31382 "ISA_HAS_DSP"
31383 "bitrev\t%0,%1"
31384 - [(set_attr "type" "arith")
31385 + [(set_attr "type" "dspalu")
31386 (set_attr "mode" "SI")])
31387
31388 ;; INSV
31389 @@ -678,7 +678,7 @@
31390 UNSPEC_INSV))]
31391 "ISA_HAS_DSP"
31392 "insv\t%0,%2"
31393 - [(set_attr "type" "arith")
31394 + [(set_attr "type" "dspalu")
31395 (set_attr "mode" "SI")])
31396
31397 ;; REPL*
31398 @@ -696,7 +696,7 @@
31399 }
31400 return "replv.qb\t%0,%1";
31401 }
31402 - [(set_attr "type" "arith")
31403 + [(set_attr "type" "dspalu")
31404 (set_attr "mode" "SI")])
31405
31406 (define_insn "mips_repl_ph"
31407 @@ -707,7 +707,7 @@
31408 "@
31409 repl.ph\t%0,%1
31410 replv.ph\t%0,%1"
31411 - [(set_attr "type" "arith")
31412 + [(set_attr "type" "dspalu")
31413 (set_attr "mode" "SI")])
31414
31415 ;; Table 2-5. MIPS DSP ASE Instructions: Compare-Pick
31416 @@ -720,7 +720,7 @@
31417 UNSPEC_CMP_EQ))]
31418 "ISA_HAS_DSP"
31419 "cmp<DSPV:dspfmt1_1>.eq.<DSPV:dspfmt2>\t%0,%1"
31420 - [(set_attr "type" "arith")
31421 + [(set_attr "type" "dspalu")
31422 (set_attr "mode" "SI")])
31423
31424 (define_insn "mips_cmp<DSPV:dspfmt1_1>_lt_<DSPV:dspfmt2>"
31425 @@ -731,7 +731,7 @@
31426 UNSPEC_CMP_LT))]
31427 "ISA_HAS_DSP"
31428 "cmp<DSPV:dspfmt1_1>.lt.<DSPV:dspfmt2>\t%0,%1"
31429 - [(set_attr "type" "arith")
31430 + [(set_attr "type" "dspalu")
31431 (set_attr "mode" "SI")])
31432
31433 (define_insn "mips_cmp<DSPV:dspfmt1_1>_le_<DSPV:dspfmt2>"
31434 @@ -742,7 +742,7 @@
31435 UNSPEC_CMP_LE))]
31436 "ISA_HAS_DSP"
31437 "cmp<DSPV:dspfmt1_1>.le.<DSPV:dspfmt2>\t%0,%1"
31438 - [(set_attr "type" "arith")
31439 + [(set_attr "type" "dspalu")
31440 (set_attr "mode" "SI")])
31441
31442 (define_insn "mips_cmpgu_eq_qb"
31443 @@ -752,7 +752,7 @@
31444 UNSPEC_CMPGU_EQ_QB))]
31445 "ISA_HAS_DSP"
31446 "cmpgu.eq.qb\t%0,%1,%2"
31447 - [(set_attr "type" "arith")
31448 + [(set_attr "type" "dspalu")
31449 (set_attr "mode" "SI")])
31450
31451 (define_insn "mips_cmpgu_lt_qb"
31452 @@ -762,7 +762,7 @@
31453 UNSPEC_CMPGU_LT_QB))]
31454 "ISA_HAS_DSP"
31455 "cmpgu.lt.qb\t%0,%1,%2"
31456 - [(set_attr "type" "arith")
31457 + [(set_attr "type" "dspalu")
31458 (set_attr "mode" "SI")])
31459
31460 (define_insn "mips_cmpgu_le_qb"
31461 @@ -772,7 +772,7 @@
31462 UNSPEC_CMPGU_LE_QB))]
31463 "ISA_HAS_DSP"
31464 "cmpgu.le.qb\t%0,%1,%2"
31465 - [(set_attr "type" "arith")
31466 + [(set_attr "type" "dspalu")
31467 (set_attr "mode" "SI")])
31468
31469 ;; PICK*
31470 @@ -784,7 +784,7 @@
31471 UNSPEC_PICK))]
31472 "ISA_HAS_DSP"
31473 "pick.<DSPV:dspfmt2>\t%0,%1,%2"
31474 - [(set_attr "type" "arith")
31475 + [(set_attr "type" "dspalu")
31476 (set_attr "mode" "SI")])
31477
31478 ;; PACKRL*
31479 @@ -795,7 +795,7 @@
31480 UNSPEC_PACKRL_PH))]
31481 "ISA_HAS_DSP"
31482 "packrl.ph\t%0,%1,%2"
31483 - [(set_attr "type" "arith")
31484 + [(set_attr "type" "dspalu")
31485 (set_attr "mode" "SI")])
31486
31487 ;; Table 2-6. MIPS DSP ASE Instructions: Accumulator and DSPControl Access
31488 @@ -818,7 +818,7 @@
31489 }
31490 return "extrv.w\t%0,%q1,%2";
31491 }
31492 - [(set_attr "type" "mfhilo")
31493 + [(set_attr "type" "accext")
31494 (set_attr "mode" "SI")])
31495
31496 (define_insn "mips_extr_r_w"
31497 @@ -839,7 +839,7 @@
31498 }
31499 return "extrv_r.w\t%0,%q1,%2";
31500 }
31501 - [(set_attr "type" "mfhilo")
31502 + [(set_attr "type" "accext")
31503 (set_attr "mode" "SI")])
31504
31505 (define_insn "mips_extr_rs_w"
31506 @@ -860,7 +860,7 @@
31507 }
31508 return "extrv_rs.w\t%0,%q1,%2";
31509 }
31510 - [(set_attr "type" "mfhilo")
31511 + [(set_attr "type" "accext")
31512 (set_attr "mode" "SI")])
31513
31514 ;; EXTR*_S.H
31515 @@ -882,7 +882,7 @@
31516 }
31517 return "extrv_s.h\t%0,%q1,%2";
31518 }
31519 - [(set_attr "type" "mfhilo")
31520 + [(set_attr "type" "accext")
31521 (set_attr "mode" "SI")])
31522
31523 ;; EXTP*
31524 @@ -905,7 +905,7 @@
31525 }
31526 return "extpv\t%0,%q1,%2";
31527 }
31528 - [(set_attr "type" "mfhilo")
31529 + [(set_attr "type" "accext")
31530 (set_attr "mode" "SI")])
31531
31532 (define_insn "mips_extpdp"
31533 @@ -930,7 +930,7 @@
31534 }
31535 return "extpdpv\t%0,%q1,%2";
31536 }
31537 - [(set_attr "type" "mfhilo")
31538 + [(set_attr "type" "accext")
31539 (set_attr "mode" "SI")])
31540
31541 ;; SHILO*
31542 @@ -949,7 +949,7 @@
31543 }
31544 return "shilov\t%q0,%2";
31545 }
31546 - [(set_attr "type" "mfhilo")
31547 + [(set_attr "type" "accmod")
31548 (set_attr "mode" "SI")])
31549
31550 ;; MTHLIP*
31551 @@ -965,7 +965,7 @@
31552 (reg:CCDSP CCDSP_PO_REGNUM)] UNSPEC_MTHLIP))])]
31553 "ISA_HAS_DSP && !TARGET_64BIT"
31554 "mthlip\t%2,%q0"
31555 - [(set_attr "type" "mfhilo")
31556 + [(set_attr "type" "accmod")
31557 (set_attr "mode" "SI")])
31558
31559 ;; WRDSP
31560 @@ -987,7 +987,7 @@
31561 (unspec:CCDSP [(match_dup 0) (match_dup 1)] UNSPEC_WRDSP))])]
31562 "ISA_HAS_DSP"
31563 "wrdsp\t%0,%1"
31564 - [(set_attr "type" "arith")
31565 + [(set_attr "type" "dspalu")
31566 (set_attr "mode" "SI")])
31567
31568 ;; RDDSP
31569 @@ -1003,7 +1003,7 @@
31570 UNSPEC_RDDSP))]
31571 "ISA_HAS_DSP"
31572 "rddsp\t%0,%1"
31573 - [(set_attr "type" "arith")
31574 + [(set_attr "type" "dspalu")
31575 (set_attr "mode" "SI")])
31576
31577 ;; Table 2-7. MIPS DSP ASE Instructions: Indexed-Load
31578 --- a/gcc/config/mips/mips-dspr2.md
31579 +++ b/gcc/config/mips/mips-dspr2.md
31580 @@ -9,7 +9,7 @@
31581 (unspec:CCDSP [(match_dup 1)] UNSPEC_ABSQ_S_QB))])]
31582 "ISA_HAS_DSPR2"
31583 "absq_s.qb\t%0,%z1"
31584 - [(set_attr "type" "arith")
31585 + [(set_attr "type" "dspalusat")
31586 (set_attr "mode" "SI")])
31587
31588 (define_insn "mips_addu_ph"
31589 @@ -21,7 +21,7 @@
31590 (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_ADDU_PH))])]
31591 "ISA_HAS_DSPR2"
31592 "addu.ph\t%0,%z1,%z2"
31593 - [(set_attr "type" "arith")
31594 + [(set_attr "type" "dspalu")
31595 (set_attr "mode" "SI")])
31596
31597 (define_insn "mips_addu_s_ph"
31598 @@ -34,7 +34,7 @@
31599 (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_ADDU_S_PH))])]
31600 "ISA_HAS_DSPR2"
31601 "addu_s.ph\t%0,%z1,%z2"
31602 - [(set_attr "type" "arith")
31603 + [(set_attr "type" "dspalusat")
31604 (set_attr "mode" "SI")])
31605
31606 (define_insn "mips_adduh_qb"
31607 @@ -44,7 +44,7 @@
31608 UNSPEC_ADDUH_QB))]
31609 "ISA_HAS_DSPR2"
31610 "adduh.qb\t%0,%z1,%z2"
31611 - [(set_attr "type" "arith")
31612 + [(set_attr "type" "dspalu")
31613 (set_attr "mode" "SI")])
31614
31615 (define_insn "mips_adduh_r_qb"
31616 @@ -54,7 +54,7 @@
31617 UNSPEC_ADDUH_R_QB))]
31618 "ISA_HAS_DSPR2"
31619 "adduh_r.qb\t%0,%z1,%z2"
31620 - [(set_attr "type" "arith")
31621 + [(set_attr "type" "dspalusat")
31622 (set_attr "mode" "SI")])
31623
31624 (define_insn "mips_append"
31625 @@ -69,7 +69,7 @@
31626 operands[2] = GEN_INT (INTVAL (operands[2]) & 31);
31627 return "append\t%0,%z2,%3";
31628 }
31629 - [(set_attr "type" "arith")
31630 + [(set_attr "type" "dspalu")
31631 (set_attr "mode" "SI")])
31632
31633 (define_insn "mips_balign"
31634 @@ -84,7 +84,7 @@
31635 operands[2] = GEN_INT (INTVAL (operands[2]) & 3);
31636 return "balign\t%0,%z2,%3";
31637 }
31638 - [(set_attr "type" "arith")
31639 + [(set_attr "type" "dspalu")
31640 (set_attr "mode" "SI")])
31641
31642 (define_insn "mips_cmpgdu_eq_qb"
31643 @@ -99,7 +99,7 @@
31644 UNSPEC_CMPGDU_EQ_QB))])]
31645 "ISA_HAS_DSPR2"
31646 "cmpgdu.eq.qb\t%0,%z1,%z2"
31647 - [(set_attr "type" "arith")
31648 + [(set_attr "type" "dspalu")
31649 (set_attr "mode" "SI")])
31650
31651 (define_insn "mips_cmpgdu_lt_qb"
31652 @@ -114,7 +114,7 @@
31653 UNSPEC_CMPGDU_LT_QB))])]
31654 "ISA_HAS_DSPR2"
31655 "cmpgdu.lt.qb\t%0,%z1,%z2"
31656 - [(set_attr "type" "arith")
31657 + [(set_attr "type" "dspalu")
31658 (set_attr "mode" "SI")])
31659
31660 (define_insn "mips_cmpgdu_le_qb"
31661 @@ -129,7 +129,7 @@
31662 UNSPEC_CMPGDU_LE_QB))])]
31663 "ISA_HAS_DSPR2"
31664 "cmpgdu.le.qb\t%0,%z1,%z2"
31665 - [(set_attr "type" "arith")
31666 + [(set_attr "type" "dspalu")
31667 (set_attr "mode" "SI")])
31668
31669 (define_insn "mips_dpa_w_ph"
31670 @@ -140,7 +140,7 @@
31671 UNSPEC_DPA_W_PH))]
31672 "ISA_HAS_DSPR2 && !TARGET_64BIT"
31673 "dpa.w.ph\t%q0,%z2,%z3"
31674 - [(set_attr "type" "imadd")
31675 + [(set_attr "type" "dspmac")
31676 (set_attr "mode" "SI")])
31677
31678 (define_insn "mips_dps_w_ph"
31679 @@ -151,7 +151,7 @@
31680 UNSPEC_DPS_W_PH))]
31681 "ISA_HAS_DSPR2 && !TARGET_64BIT"
31682 "dps.w.ph\t%q0,%z2,%z3"
31683 - [(set_attr "type" "imadd")
31684 + [(set_attr "type" "dspmac")
31685 (set_attr "mode" "SI")])
31686
31687 (define_expand "mips_madd<u>"
31688 @@ -247,7 +247,7 @@
31689 UNSPEC_MULSA_W_PH))]
31690 "ISA_HAS_DSPR2 && !TARGET_64BIT"
31691 "mulsa.w.ph\t%q0,%z2,%z3"
31692 - [(set_attr "type" "imadd")
31693 + [(set_attr "type" "dspmac")
31694 (set_attr "mode" "SI")])
31695
31696 (define_insn "mips_mult"
31697 @@ -277,7 +277,7 @@
31698 UNSPEC_PRECR_QB_PH))]
31699 "ISA_HAS_DSPR2"
31700 "precr.qb.ph\t%0,%z1,%z2"
31701 - [(set_attr "type" "arith")
31702 + [(set_attr "type" "dspalu")
31703 (set_attr "mode" "SI")])
31704
31705 (define_insn "mips_precr_sra_ph_w"
31706 @@ -292,7 +292,7 @@
31707 operands[2] = GEN_INT (INTVAL (operands[2]) & 31);
31708 return "precr_sra.ph.w\t%0,%z2,%3";
31709 }
31710 - [(set_attr "type" "arith")
31711 + [(set_attr "type" "dspalu")
31712 (set_attr "mode" "SI")])
31713
31714 (define_insn "mips_precr_sra_r_ph_w"
31715 @@ -307,7 +307,7 @@
31716 operands[2] = GEN_INT (INTVAL (operands[2]) & 31);
31717 return "precr_sra_r.ph.w\t%0,%z2,%3";
31718 }
31719 - [(set_attr "type" "arith")
31720 + [(set_attr "type" "dspalu")
31721 (set_attr "mode" "SI")])
31722
31723 (define_insn "mips_prepend"
31724 @@ -322,7 +322,7 @@
31725 operands[2] = GEN_INT (INTVAL (operands[2]) & 31);
31726 return "prepend\t%0,%z2,%3";
31727 }
31728 - [(set_attr "type" "arith")
31729 + [(set_attr "type" "dspalu")
31730 (set_attr "mode" "SI")])
31731
31732 (define_insn "mips_shra_qb"
31733 @@ -340,7 +340,7 @@
31734 }
31735 return "shrav.qb\t%0,%z1,%2";
31736 }
31737 - [(set_attr "type" "shift")
31738 + [(set_attr "type" "dspalu")
31739 (set_attr "mode" "SI")])
31740
31741
31742 @@ -359,7 +359,7 @@
31743 }
31744 return "shrav_r.qb\t%0,%z1,%2";
31745 }
31746 - [(set_attr "type" "shift")
31747 + [(set_attr "type" "dspalu")
31748 (set_attr "mode" "SI")])
31749
31750 (define_insn "mips_shrl_ph"
31751 @@ -377,7 +377,7 @@
31752 }
31753 return "shrlv.ph\t%0,%z1,%2";
31754 }
31755 - [(set_attr "type" "shift")
31756 + [(set_attr "type" "dspalu")
31757 (set_attr "mode" "SI")])
31758
31759 (define_insn "mips_subu_ph"
31760 @@ -390,7 +390,7 @@
31761 (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_SUBU_PH))])]
31762 "ISA_HAS_DSPR2"
31763 "subu.ph\t%0,%z1,%z2"
31764 - [(set_attr "type" "arith")
31765 + [(set_attr "type" "dspalu")
31766 (set_attr "mode" "SI")])
31767
31768 (define_insn "mips_subu_s_ph"
31769 @@ -403,7 +403,7 @@
31770 (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_SUBU_S_PH))])]
31771 "ISA_HAS_DSPR2"
31772 "subu_s.ph\t%0,%z1,%z2"
31773 - [(set_attr "type" "arith")
31774 + [(set_attr "type" "dspalusat")
31775 (set_attr "mode" "SI")])
31776
31777 (define_insn "mips_subuh_qb"
31778 @@ -413,7 +413,7 @@
31779 UNSPEC_SUBUH_QB))]
31780 "ISA_HAS_DSPR2"
31781 "subuh.qb\t%0,%z1,%z2"
31782 - [(set_attr "type" "arith")
31783 + [(set_attr "type" "dspalu")
31784 (set_attr "mode" "SI")])
31785
31786 (define_insn "mips_subuh_r_qb"
31787 @@ -423,7 +423,7 @@
31788 UNSPEC_SUBUH_R_QB))]
31789 "ISA_HAS_DSPR2"
31790 "subuh_r.qb\t%0,%z1,%z2"
31791 - [(set_attr "type" "arith")
31792 + [(set_attr "type" "dspalu")
31793 (set_attr "mode" "SI")])
31794
31795 (define_insn "mips_addqh_ph"
31796 @@ -433,7 +433,7 @@
31797 UNSPEC_ADDQH_PH))]
31798 "ISA_HAS_DSPR2"
31799 "addqh.ph\t%0,%z1,%z2"
31800 - [(set_attr "type" "arith")
31801 + [(set_attr "type" "dspalu")
31802 (set_attr "mode" "SI")])
31803
31804 (define_insn "mips_addqh_r_ph"
31805 @@ -443,7 +443,7 @@
31806 UNSPEC_ADDQH_R_PH))]
31807 "ISA_HAS_DSPR2"
31808 "addqh_r.ph\t%0,%z1,%z2"
31809 - [(set_attr "type" "arith")
31810 + [(set_attr "type" "dspalu")
31811 (set_attr "mode" "SI")])
31812
31813 (define_insn "mips_addqh_w"
31814 @@ -453,7 +453,7 @@
31815 UNSPEC_ADDQH_W))]
31816 "ISA_HAS_DSPR2"
31817 "addqh.w\t%0,%z1,%z2"
31818 - [(set_attr "type" "arith")
31819 + [(set_attr "type" "dspalu")
31820 (set_attr "mode" "SI")])
31821
31822 (define_insn "mips_addqh_r_w"
31823 @@ -463,7 +463,7 @@
31824 UNSPEC_ADDQH_R_W))]
31825 "ISA_HAS_DSPR2"
31826 "addqh_r.w\t%0,%z1,%z2"
31827 - [(set_attr "type" "arith")
31828 + [(set_attr "type" "dspalu")
31829 (set_attr "mode" "SI")])
31830
31831 (define_insn "mips_subqh_ph"
31832 @@ -473,7 +473,7 @@
31833 UNSPEC_SUBQH_PH))]
31834 "ISA_HAS_DSPR2"
31835 "subqh.ph\t%0,%z1,%z2"
31836 - [(set_attr "type" "arith")
31837 + [(set_attr "type" "dspalu")
31838 (set_attr "mode" "SI")])
31839
31840 (define_insn "mips_subqh_r_ph"
31841 @@ -483,7 +483,7 @@
31842 UNSPEC_SUBQH_R_PH))]
31843 "ISA_HAS_DSPR2"
31844 "subqh_r.ph\t%0,%z1,%z2"
31845 - [(set_attr "type" "arith")
31846 + [(set_attr "type" "dspalu")
31847 (set_attr "mode" "SI")])
31848
31849 (define_insn "mips_subqh_w"
31850 @@ -493,7 +493,7 @@
31851 UNSPEC_SUBQH_W))]
31852 "ISA_HAS_DSPR2"
31853 "subqh.w\t%0,%z1,%z2"
31854 - [(set_attr "type" "arith")
31855 + [(set_attr "type" "dspalu")
31856 (set_attr "mode" "SI")])
31857
31858 (define_insn "mips_subqh_r_w"
31859 @@ -503,7 +503,7 @@
31860 UNSPEC_SUBQH_R_W))]
31861 "ISA_HAS_DSPR2"
31862 "subqh_r.w\t%0,%z1,%z2"
31863 - [(set_attr "type" "arith")
31864 + [(set_attr "type" "dspalu")
31865 (set_attr "mode" "SI")])
31866
31867 (define_insn "mips_dpax_w_ph"
31868 @@ -514,7 +514,7 @@
31869 UNSPEC_DPAX_W_PH))]
31870 "ISA_HAS_DSPR2 && !TARGET_64BIT"
31871 "dpax.w.ph\t%q0,%z2,%z3"
31872 - [(set_attr "type" "imadd")
31873 + [(set_attr "type" "dspmac")
31874 (set_attr "mode" "SI")])
31875
31876 (define_insn "mips_dpsx_w_ph"
31877 @@ -525,7 +525,7 @@
31878 UNSPEC_DPSX_W_PH))]
31879 "ISA_HAS_DSPR2 && !TARGET_64BIT"
31880 "dpsx.w.ph\t%q0,%z2,%z3"
31881 - [(set_attr "type" "imadd")
31882 + [(set_attr "type" "dspmac")
31883 (set_attr "mode" "SI")])
31884
31885 (define_insn "mips_dpaqx_s_w_ph"
31886 @@ -540,7 +540,7 @@
31887 UNSPEC_DPAQX_S_W_PH))])]
31888 "ISA_HAS_DSPR2 && !TARGET_64BIT"
31889 "dpaqx_s.w.ph\t%q0,%z2,%z3"
31890 - [(set_attr "type" "imadd")
31891 + [(set_attr "type" "dspmac")
31892 (set_attr "mode" "SI")])
31893
31894 (define_insn "mips_dpaqx_sa_w_ph"
31895 @@ -555,7 +555,7 @@
31896 UNSPEC_DPAQX_SA_W_PH))])]
31897 "ISA_HAS_DSPR2 && !TARGET_64BIT"
31898 "dpaqx_sa.w.ph\t%q0,%z2,%z3"
31899 - [(set_attr "type" "imadd")
31900 + [(set_attr "type" "dspmacsat")
31901 (set_attr "mode" "SI")])
31902
31903 (define_insn "mips_dpsqx_s_w_ph"
31904 @@ -570,7 +570,7 @@
31905 UNSPEC_DPSQX_S_W_PH))])]
31906 "ISA_HAS_DSPR2 && !TARGET_64BIT"
31907 "dpsqx_s.w.ph\t%q0,%z2,%z3"
31908 - [(set_attr "type" "imadd")
31909 + [(set_attr "type" "dspmac")
31910 (set_attr "mode" "SI")])
31911
31912 (define_insn "mips_dpsqx_sa_w_ph"
31913 @@ -585,5 +585,43 @@
31914 UNSPEC_DPSQX_SA_W_PH))])]
31915 "ISA_HAS_DSPR2 && !TARGET_64BIT"
31916 "dpsqx_sa.w.ph\t%q0,%z2,%z3"
31917 - [(set_attr "type" "imadd")
31918 + [(set_attr "type" "dspmacsat")
31919 + (set_attr "mode" "SI")])
31920 +
31921 +;; Convert mtlo $ac[1-3],$0 => mult $ac[1-3],$0,$0
31922 +;; mthi $ac[1-3],$0
31923 +(define_peephole2
31924 + [(set (match_operand:SI 0 "register_operand" "")
31925 + (const_int 0))
31926 + (set (match_operand:SI 1 "register_operand" "")
31927 + (const_int 0))]
31928 + "ISA_HAS_DSPR2
31929 + && !TARGET_MIPS16
31930 + && !TARGET_64BIT
31931 + && (((true_regnum (operands[0]) == AC1LO_REGNUM
31932 + && true_regnum (operands[1]) == AC1HI_REGNUM)
31933 + || (true_regnum (operands[0]) == AC1HI_REGNUM
31934 + && true_regnum (operands[1]) == AC1LO_REGNUM))
31935 + || ((true_regnum (operands[0]) == AC2LO_REGNUM
31936 + && true_regnum (operands[1]) == AC2HI_REGNUM)
31937 + || (true_regnum (operands[0]) == AC2HI_REGNUM
31938 + && true_regnum (operands[1]) == AC2LO_REGNUM))
31939 + || ((true_regnum (operands[0]) == AC3LO_REGNUM
31940 + && true_regnum (operands[1]) == AC3HI_REGNUM)
31941 + || (true_regnum (operands[0]) == AC3HI_REGNUM
31942 + && true_regnum (operands[1]) == AC3LO_REGNUM)))"
31943 + [(parallel [(set (match_dup 0) (const_int 0))
31944 + (set (match_dup 1) (const_int 0))])]
31945 +)
31946 +
31947 +(define_insn "*mips_acc_init"
31948 + [(parallel [(set (match_operand:SI 0 "register_operand" "=a")
31949 + (const_int 0))
31950 + (set (match_operand:SI 1 "register_operand" "=a")
31951 + (const_int 0))])]
31952 + "ISA_HAS_DSPR2
31953 + && !TARGET_MIPS16
31954 + && !TARGET_64BIT"
31955 + "mult\t%q0,$0,$0\t\t# Clear ACC HI/LO"
31956 + [(set_attr "type" "imul")
31957 (set_attr "mode" "SI")])
31958 --- a/gcc/config/mips/mips-protos.h
31959 +++ b/gcc/config/mips/mips-protos.h
31960 @@ -177,6 +177,8 @@ extern rtx mips_emit_move (rtx, rtx);
31961 extern bool mips_split_symbol (rtx, rtx, enum machine_mode, rtx *);
31962 extern rtx mips_unspec_address (rtx, enum mips_symbol_type);
31963 extern bool mips_legitimize_address (rtx *, enum machine_mode);
31964 +extern int mask_low_and_shift_len (enum machine_mode, unsigned HOST_WIDE_INT,
31965 + unsigned HOST_WIDE_INT);
31966 extern void mips_move_integer (rtx, rtx, unsigned HOST_WIDE_INT);
31967 extern bool mips_legitimize_move (enum machine_mode, rtx, rtx);
31968
31969 @@ -239,6 +241,8 @@ extern void mips_print_operand_address (
31970 extern void mips_output_external (FILE *, tree, const char *);
31971 extern void mips_output_filename (FILE *, const char *);
31972 extern void mips_output_ascii (FILE *, const char *, size_t);
31973 +extern void octeon_output_shared_variable (FILE *, tree, const char *,
31974 + unsigned HOST_WIDE_INT, int);
31975 extern void mips_output_aligned_decl_common (FILE *, tree, const char *,
31976 unsigned HOST_WIDE_INT,
31977 unsigned int);
31978 @@ -283,14 +287,18 @@ extern unsigned int mips_hard_regno_nreg
31979 extern bool mips_linked_madd_p (rtx, rtx);
31980 extern bool mips_store_data_bypass_p (rtx, rtx);
31981 extern rtx mips_prefetch_cookie (rtx, rtx);
31982 +extern int mips_mult_madd_chain_bypass_p (rtx, rtx);
31983 +extern int mips_dspalu_bypass_p (rtx, rtx);
31984
31985 extern void irix_asm_output_align (FILE *, unsigned);
31986 extern const char *current_section_name (void);
31987 extern unsigned int current_section_flags (void);
31988 extern bool mips_use_ins_ext_p (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
31989 +extern void mips_adjust_register_ext_operands (rtx *);
31990
31991 extern const char *mips16e_output_save_restore (rtx, HOST_WIDE_INT);
31992 extern bool mips16e_save_restore_pattern_p (rtx, HOST_WIDE_INT,
31993 struct mips16e_save_restore_info *);
31994 +extern void mips_expand_vector_init (rtx, rtx);
31995
31996 #endif /* ! GCC_MIPS_PROTOS_H */
31997 --- a/gcc/config/mips/mips.c
31998 +++ b/gcc/config/mips/mips.c
31999 @@ -232,6 +232,8 @@ static const char *const mips_fp_conditi
32000 MIPS_FP_CONDITIONS (STRINGIFY)
32001 };
32002
32003 +static rtx mips_gnu_local_gp (void);
32004 +
32005 /* Information about a function's frame layout. */
32006 struct mips_frame_info GTY(()) {
32007 /* The size of the frame in bytes. */
32008 @@ -455,6 +457,10 @@ static int mips_base_align_functions; /*
32009 /* The -mcode-readable setting. */
32010 enum mips_code_readable_setting mips_code_readable = CODE_READABLE_YES;
32011
32012 +/* If size of stack frame exceeds this value, compiler will emit
32013 + warning message. */
32014 +static HOST_WIDE_INT mips_warn_framesize = -1;
32015 +
32016 /* Index [M][R] is true if register R is allowed to hold a value of mode M. */
32017 bool mips_hard_regno_mode_ok[(int) MAX_MACHINE_MODE][FIRST_PSEUDO_REGISTER];
32018
32019 @@ -497,7 +503,7 @@ const enum reg_class mips_regno_to_class
32020 MD0_REG, MD1_REG, NO_REGS, ST_REGS,
32021 ST_REGS, ST_REGS, ST_REGS, ST_REGS,
32022 ST_REGS, ST_REGS, ST_REGS, NO_REGS,
32023 - NO_REGS, ALL_REGS, ALL_REGS, NO_REGS,
32024 + NO_REGS, FRAME_REGS, FRAME_REGS, NO_REGS,
32025 COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS,
32026 COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS,
32027 COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS,
32028 @@ -527,9 +533,16 @@ const enum reg_class mips_regno_to_class
32029 ALL_REGS, ALL_REGS, ALL_REGS, ALL_REGS
32030 };
32031
32032 +#ifdef CVMX_SHARED_BSS_FLAGS
32033 +static tree octeon_handle_cvmx_shared_attribute (tree *, tree, tree, int, bool *);
32034 +#endif
32035 +
32036 /* The value of TARGET_ATTRIBUTE_TABLE. */
32037 const struct attribute_spec mips_attribute_table[] = {
32038 /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
32039 +#ifdef CVMX_SHARED_BSS_FLAGS
32040 + { "cvmx_shared", 0, 0, true, false, false, octeon_handle_cvmx_shared_attribute },
32041 +#endif
32042 { "long_call", 0, 0, false, true, true, NULL },
32043 { "far", 0, 0, false, true, true, NULL },
32044 { "near", 0, 0, false, true, true, NULL },
32045 @@ -642,6 +655,9 @@ static const struct mips_cpu_info mips_c
32046 { "sb1", PROCESSOR_SB1, 64, PTF_AVOID_BRANCHLIKELY },
32047 { "sb1a", PROCESSOR_SB1A, 64, PTF_AVOID_BRANCHLIKELY },
32048 { "sr71000", PROCESSOR_SR71000, 64, PTF_AVOID_BRANCHLIKELY },
32049 + { "xlr", PROCESSOR_XLR, 64, 0 },
32050 + { "octeon", PROCESSOR_OCTEON, 64, 0 },
32051 + { "ice9", PROCESSOR_5KF, 64 }, /* May diverge from 5kf in future. */
32052 };
32053
32054 /* Default costs. If these are used for a processor we should look
32055 @@ -1006,6 +1022,26 @@ static const struct mips_rtx_cost_data m
32056 { /* SR71000 */
32057 DEFAULT_COSTS
32058 },
32059 + { /* OCTEON */
32060 + SOFT_FP_COSTS,
32061 + /* Increase the latency values (5, 72) by 10% because MULT and
32062 + DIV are no fully pipelined. */
32063 + COSTS_N_INSNS (6), /* int_mult_si */
32064 + COSTS_N_INSNS (6), /* int_mult_di */
32065 + COSTS_N_INSNS (80), /* int_div_si */
32066 + COSTS_N_INSNS (80), /* int_div_di */
32067 + 1, /* branch_cost */
32068 + 4 /* memory_latency */
32069 + },
32070 + { /* XLR */
32071 + SOFT_FP_COSTS,
32072 + COSTS_N_INSNS (8), /* int_mult_si */
32073 + COSTS_N_INSNS (8), /* int_mult_di */
32074 + COSTS_N_INSNS (72), /* int_div_si */
32075 + COSTS_N_INSNS (72), /* int_div_di */
32076 + 1, /* branch_cost */
32077 + 4 /* memory_latency */
32078 + }
32079 };
32080 \f
32081 /* This hash table keeps track of implicit "mips16" and "nomips16" attributes
32082 @@ -1213,7 +1249,29 @@ mips_split_plus (rtx x, rtx *base_ptr, H
32083 static unsigned int mips_build_integer (struct mips_integer_op *,
32084 unsigned HOST_WIDE_INT);
32085
32086 -/* A subroutine of mips_build_integer, with the same interface.
32087 +/* See whether:
32088 +
32089 + (and:MODE (ashift:MODE X SHIFT) MASK)
32090 +
32091 + would have the effect of masking the low N bits of X and then shifting
32092 + the result left SHIFT bits. Return N if so, otherwise return -1. */
32093 +
32094 +int
32095 +mask_low_and_shift_len (enum machine_mode mode,
32096 + unsigned HOST_WIDE_INT shift,
32097 + unsigned HOST_WIDE_INT mask)
32098 +{
32099 + if (shift >= GET_MODE_BITSIZE (mode))
32100 + return -1;
32101 +
32102 + /* Undo the CONST_INT sign-extension canonicalisation. */
32103 + mask &= GET_MODE_MASK (mode);
32104 +
32105 + /* We don't care about the low SHIFT bits of MASK. */
32106 + return exact_log2 ((mask >> shift) + 1);
32107 +}
32108 +
32109 +/* Subroutine of mips_build_integer (with the same interface).
32110 Assume that the final action in the sequence should be a left shift. */
32111
32112 static unsigned int
32113 @@ -1390,7 +1448,7 @@ mips_classify_symbol (const_rtx x, enum
32114 if (TARGET_MIPS16_SHORT_JUMP_TABLES)
32115 return SYMBOL_PC_RELATIVE;
32116
32117 - if (TARGET_ABICALLS && !TARGET_ABSOLUTE_ABICALLS)
32118 + if (TARGET_ABICALLS && !TARGET_ABSOLUTE_ABICALLS && flag_pic)
32119 return SYMBOL_GOT_PAGE_OFST;
32120
32121 return SYMBOL_ABSOLUTE;
32122 @@ -1413,14 +1471,16 @@ mips_classify_symbol (const_rtx x, enum
32123 return SYMBOL_GP_RELATIVE;
32124 }
32125
32126 - /* Do not use small-data accesses for weak symbols; they may end up
32127 - being zero. */
32128 - if (TARGET_GPOPT && SYMBOL_REF_SMALL_P (x) && !SYMBOL_REF_WEAK (x))
32129 + /* Use a small-data access if appropriate; but do not use small-data
32130 + accesses for weak symbols; they may end up being zero. */
32131 + if (TARGET_GPOPT
32132 + && SYMBOL_REF_SMALL_P (x)
32133 + && !SYMBOL_REF_WEAK (x))
32134 return SYMBOL_GP_RELATIVE;
32135
32136 - /* Don't use GOT accesses for locally-binding symbols when -mno-shared
32137 - is in effect. */
32138 - if (TARGET_ABICALLS
32139 + /* Don't use GOT accesses when compiling for the non-PIC ABI,
32140 + or for locally-binding symbols when -mno-shared is in effect. */
32141 + if (TARGET_ABICALLS && flag_pic
32142 && !(TARGET_ABSOLUTE_ABICALLS && mips_symbol_binds_local_p (x)))
32143 {
32144 /* There are three cases to consider:
32145 @@ -1800,6 +1860,24 @@ mips_valid_base_register_p (rtx x, enum
32146 && mips_regno_mode_ok_for_base_p (REGNO (x), mode, strict_p));
32147 }
32148
32149 +/* Return true if, for every base register BASE_REG, (plus BASE_REG X)
32150 + can address a value of mode MODE. */
32151 +
32152 +static bool
32153 +mips_valid_offset_p (rtx x, enum machine_mode mode)
32154 +{
32155 + /* Check that X is a signed 16-bit number. */
32156 + if (!const_arith_operand (x, Pmode))
32157 + return false;
32158 +
32159 + /* We may need to split multiword moves, so make sure that every word
32160 + is accessible. */
32161 + if (GET_MODE_SIZE (mode) > UNITS_PER_WORD
32162 + && !SMALL_OPERAND (INTVAL (x) + GET_MODE_SIZE (mode) - UNITS_PER_WORD))
32163 + return false;
32164 +
32165 + return true;
32166 +}
32167 /* Return true if X is a valid address for machine mode MODE. If it is,
32168 fill in INFO appropriately. STRICT_P is true if REG_OK_STRICT is in
32169 effect. */
32170 @@ -2175,7 +2253,9 @@ gen_load_const_gp (rtx reg)
32171
32172 /* Return a pseudo register that contains the value of $gp throughout
32173 the current function. Such registers are needed by MIPS16 functions,
32174 - for which $gp itself is not a valid base register or addition operand. */
32175 + for which $gp itself is not a valid base register or addition operand.
32176 + Also hold the GP in a non-PIC abicalls function which refers to TLS
32177 + data - such functions do not require $28 or even a hard register. */
32178
32179 static rtx
32180 mips16_gp_pseudo_reg (void)
32181 @@ -2191,7 +2271,11 @@ mips16_gp_pseudo_reg (void)
32182 {
32183 rtx insn, scan, after;
32184
32185 - insn = gen_load_const_gp (cfun->machine->mips16_gp_pseudo_rtx);
32186 + if (TARGET_NONPIC_ABICALLS)
32187 + insn = gen_loadgp_nonpic (cfun->machine->mips16_gp_pseudo_rtx,
32188 + mips_gnu_local_gp ());
32189 + else
32190 + insn = gen_load_const_gp (cfun->machine->mips16_gp_pseudo_rtx);
32191
32192 push_topmost_sequence ();
32193 /* We need to emit the initialization after the FUNCTION_BEG
32194 @@ -2333,6 +2417,19 @@ mips_add_offset (rtx temp, rtx reg, HOST
32195 return plus_constant (reg, offset);
32196 }
32197 \f
32198 +/* Return the RTX to use for explicit GOT accesses. Uses a pseudo if
32199 + possible. */
32200 +
32201 +static rtx
32202 +mips_got_base (void)
32203 +{
32204 + gcc_assert (can_create_pseudo_p ());
32205 + if (TARGET_NONPIC_ABICALLS)
32206 + return mips16_gp_pseudo_reg ();
32207 + else
32208 + return pic_offset_table_rtx;
32209 +}
32210 +
32211 /* The __tls_get_attr symbol. */
32212 static GTY(()) rtx mips_tls_symbol;
32213
32214 @@ -2356,7 +2453,7 @@ mips_call_tls_get_addr (rtx sym, enum mi
32215 start_sequence ();
32216
32217 emit_insn (gen_rtx_SET (Pmode, a0,
32218 - gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, loc)));
32219 + gen_rtx_LO_SUM (Pmode, mips_got_base (), loc)));
32220 insn = mips_expand_call (v0, mips_tls_symbol, const0_rtx, const0_rtx, false);
32221 CONST_OR_PURE_CALL_P (insn) = 1;
32222 use_reg (&CALL_INSN_FUNCTION_USAGE (insn), a0);
32223 @@ -2435,9 +2532,9 @@ mips_legitimize_tls_address (rtx loc)
32224 tmp1 = gen_reg_rtx (Pmode);
32225 tmp2 = mips_unspec_address (loc, SYMBOL_GOTTPREL);
32226 if (Pmode == DImode)
32227 - emit_insn (gen_load_gotdi (tmp1, pic_offset_table_rtx, tmp2));
32228 + emit_insn (gen_load_gotdi (tmp1, mips_got_base (), tmp2));
32229 else
32230 - emit_insn (gen_load_gotsi (tmp1, pic_offset_table_rtx, tmp2));
32231 + emit_insn (gen_load_gotsi (tmp1, mips_got_base (), tmp2));
32232 dest = gen_reg_rtx (Pmode);
32233 emit_insn (gen_add3_insn (dest, tmp1, tp));
32234 break;
32235 @@ -2464,7 +2561,7 @@ bool
32236 mips_legitimize_address (rtx *xloc, enum machine_mode mode)
32237 {
32238 rtx base;
32239 - HOST_WIDE_INT offset;
32240 + HOST_WIDE_INT intval, high, offset;
32241
32242 if (mips_tls_symbol_p (*xloc))
32243 {
32244 @@ -2485,6 +2582,32 @@ mips_legitimize_address (rtx *xloc, enum
32245 *xloc = mips_add_offset (NULL, base, offset);
32246 return true;
32247 }
32248 +
32249 + /* Handle references to constant addresses by loading the high part
32250 + into a register and using an offset for the low part. */
32251 + if (GET_CODE (base) == CONST_INT)
32252 + {
32253 + intval = INTVAL (base);
32254 + high = trunc_int_for_mode (CONST_HIGH_PART (intval), Pmode);
32255 + offset = CONST_LOW_PART (intval);
32256 + /* Ignore cases in which a positive address would be accessed by a
32257 + negative offset from a negative address. The required wraparound
32258 + does not occur for 32-bit addresses on 64-bit targets, and it is
32259 + very unlikely that such an access would occur in real code anyway.
32260 +
32261 + If the low offset is not legitimate for MODE, prefer to load
32262 + the constant normally, instead of using mips_force_address on
32263 + the legitimized address. The latter option would cause us to
32264 + use (D)ADDIU unconditionally, but LUI/ORI is more efficient
32265 + than LUI/ADDIU on some targets. */
32266 + if ((intval < 0 || high > 0)
32267 + && mips_valid_offset_p (GEN_INT (offset), mode))
32268 + {
32269 + base = mips_force_temporary (NULL, GEN_INT (high));
32270 + *xloc = plus_constant (base, offset);
32271 + return true;
32272 + }
32273 + }
32274 return false;
32275 }
32276
32277 @@ -3360,6 +3483,27 @@ mips_rtx_costs (rtx x, int code, int out
32278 return false;
32279
32280 case ZERO_EXTEND:
32281 + /* Check for BADDU patterns; see mips.md. */
32282 + if (ISA_HAS_BADDU)
32283 + {
32284 + rtx op0 = XEXP (x, 0);
32285 + if ((GET_CODE (op0) == TRUNCATE || GET_CODE (op0) == SUBREG)
32286 + && GET_MODE (op0) == QImode
32287 + && GET_CODE (XEXP (op0, 0)) == PLUS)
32288 + {
32289 + rtx op1 = XEXP (XEXP (op0, 0), 0);
32290 + rtx op2 = XEXP (XEXP (op0, 0), 1);
32291 + if (GET_CODE (op1) == SUBREG
32292 + && GET_CODE (XEXP (op1, 0)) == TRUNCATE)
32293 + op1 = XEXP (XEXP (op1, 0), 0);
32294 + if (GET_CODE (op2) == SUBREG
32295 + && GET_CODE (XEXP (op2, 0)) == TRUNCATE)
32296 + op2 = XEXP (XEXP (op2, 0), 0);
32297 + *total =
32298 + COSTS_N_INSNS (1) + rtx_cost (op1, 0) + rtx_cost (op2, 0);
32299 + return true;
32300 + }
32301 + }
32302 *total = mips_zero_extend_cost (mode, XEXP (x, 0));
32303 return false;
32304
32305 @@ -3869,6 +4013,30 @@ mips_emit_compare (enum rtx_code *code,
32306 }
32307 }
32308 \f
32309 +/* If it is possible and profitable to use SEQ or SNE to compare a
32310 + register with OP, return the instruction's second source operand,
32311 + otherwise return null. MODE is the mode of OP. */
32312 +
32313 +static rtx
32314 +mips_get_seq_sne_operand (enum machine_mode mode, rtx op)
32315 +{
32316 + if (!ISA_HAS_SEQ_SNE)
32317 + return NULL;
32318 +
32319 + if (reg_imm10_operand (op, mode))
32320 + return op;
32321 +
32322 + /* If OP is in the range of either ADDIU or XORI, we could either
32323 + use those instructions and boolify the result, or move OP into a
32324 + register and use SEQ or SNE. Prefer the former, because it is
32325 + better than the latter when a 0/1 result is not needed. */
32326 + if (uns_arith_operand (op, mode)
32327 + || arith_operand (op, mode))
32328 + return NULL;
32329 +
32330 + return force_reg (mode, op);
32331 +}
32332 +
32333 /* Try comparing cmp_operands[0] and cmp_operands[1] using rtl code CODE.
32334 Store the result in TARGET and return true if successful.
32335
32336 @@ -3883,8 +4051,15 @@ mips_expand_scc (enum rtx_code code, rtx
32337 target = gen_lowpart (GET_MODE (cmp_operands[0]), target);
32338 if (code == EQ || code == NE)
32339 {
32340 - rtx zie = mips_zero_if_equal (cmp_operands[0], cmp_operands[1]);
32341 - mips_emit_binary (code, target, zie, const0_rtx);
32342 + rtx scc_operand = mips_get_seq_sne_operand (GET_MODE (cmp_operands[0]),
32343 + cmp_operands[1]);
32344 + if (scc_operand)
32345 + mips_emit_binary (code, target, cmp_operands[0], scc_operand);
32346 + else
32347 + {
32348 + rtx zie = mips_zero_if_equal (cmp_operands[0], cmp_operands[1]);
32349 + mips_emit_binary (code, target, zie, const0_rtx);
32350 + }
32351 }
32352 else
32353 mips_emit_int_order_test (code, 0, target,
32354 @@ -5954,6 +6129,15 @@ mips_expand_ext_as_unaligned_load (rtx d
32355 if (!mips_get_unaligned_mem (&src, width, bitpos, &left, &right))
32356 return false;
32357
32358 + if (ISA_HAS_UL_US)
32359 + {
32360 + if (GET_MODE (dest) == DImode)
32361 + emit_insn (gen_mov_uld (dest, src, left));
32362 + else
32363 + emit_insn (gen_mov_ulw (dest, src, left));
32364 + return true;
32365 + }
32366 +
32367 temp = gen_reg_rtx (GET_MODE (dest));
32368 if (GET_MODE (dest) == DImode)
32369 {
32370 @@ -5988,6 +6172,16 @@ mips_expand_ins_as_unaligned_store (rtx
32371
32372 mode = mode_for_size (width, MODE_INT, 0);
32373 src = gen_lowpart (mode, src);
32374 +
32375 + if (ISA_HAS_UL_US)
32376 + {
32377 + if (GET_MODE (src) == DImode)
32378 + emit_insn (gen_mov_usd (dest, src, left));
32379 + else
32380 + emit_insn (gen_mov_usw (dest, src, left));
32381 + return true;
32382 + }
32383 +
32384 if (mode == DImode)
32385 {
32386 emit_insn (gen_mov_sdl (dest, src, left));
32387 @@ -6398,6 +6592,27 @@ mips_print_float_branch_condition (FILE
32388 }
32389 }
32390
32391 +/* Likewise bit branches. */
32392 +
32393 +static void
32394 +mips_print_bit_branch_condition (FILE *file, enum rtx_code code, int letter)
32395 +{
32396 + switch (code)
32397 + {
32398 + case EQ:
32399 + fputs ("bit0", file);
32400 + break;
32401 +
32402 + case NE:
32403 + fputs ("bit1", file);
32404 + break;
32405 +
32406 + default:
32407 + output_operand_lossage ("'%%%c' is not a valid operand prefix", letter);
32408 + break;
32409 + }
32410 +}
32411 +
32412 /* Implement the PRINT_OPERAND macro. The MIPS-specific operand codes are:
32413
32414 'X' Print CONST_INT OP in hexadecimal format.
32415 @@ -6419,8 +6634,11 @@ mips_print_float_branch_condition (FILE
32416 'D' Print the second part of a double-word register or memory operand.
32417 'L' Print the low-order register in a double-word register operand.
32418 'M' Print high-order register in a double-word register operand.
32419 - 'z' Print $0 if OP is zero, otherwise print OP normally. */
32420 -
32421 + 'z' Print $0 if OP is zero, otherwise print OP normally.
32422 + 'E' substract 1 from the const_int value.
32423 + 'G' print part of opcode for a branch-bit condition.
32424 + 'H' print part of opcode for a branch-bit condition, inverted. */
32425 +
32426 void
32427 mips_print_operand (FILE *file, rtx op, int letter)
32428 {
32429 @@ -6518,6 +6736,23 @@ mips_print_operand (FILE *file, rtx op,
32430 output_operand_lossage ("invalid use of '%%%c'", letter);
32431 break;
32432
32433 + case 'E':
32434 + {
32435 + if (code != CONST_INT)
32436 + output_operand_lossage ("'%%E' misused");
32437 + fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (op) - 1);
32438 + }
32439 + break;
32440 +
32441 + case 'G':
32442 + mips_print_bit_branch_condition (file, code, letter);
32443 + break;
32444 +
32445 + case 'H':
32446 + mips_print_bit_branch_condition (file, reverse_condition (code),
32447 + letter);
32448 + break;
32449 +
32450 default:
32451 switch (code)
32452 {
32453 @@ -6627,7 +6862,7 @@ mips_select_rtx_section (enum machine_mo
32454 static section *
32455 mips_function_rodata_section (tree decl)
32456 {
32457 - if (!TARGET_ABICALLS || TARGET_GPWORD)
32458 + if (!TARGET_ABICALLS || !flag_pic || TARGET_GPWORD)
32459 return default_function_rodata_section (decl);
32460
32461 if (decl && DECL_SECTION_NAME (decl))
32462 @@ -6667,6 +6902,12 @@ mips_in_small_data_p (const_tree decl)
32463 if (TARGET_ABICALLS || TARGET_VXWORKS_RTP)
32464 return false;
32465
32466 +#ifdef CVMX_SHARED_BSS_FLAGS
32467 + if (TARGET_OCTEON && TREE_CODE (decl) == VAR_DECL
32468 + && lookup_attribute ("cvmx_shared", DECL_ATTRIBUTES (decl)))
32469 + return false;
32470 +#endif
32471 +
32472 if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl) != 0)
32473 {
32474 const char *name;
32475 @@ -6845,6 +7086,26 @@ mips_output_filename (FILE *stream, cons
32476 }
32477 }
32478
32479 +/* Initialize vector TARGET to VALS. */
32480 +
32481 +void
32482 +mips_expand_vector_init (rtx target, rtx vals)
32483 +{
32484 + enum machine_mode mode = GET_MODE (target);
32485 + enum machine_mode inner = GET_MODE_INNER (mode);
32486 + unsigned int i, n_elts = GET_MODE_NUNITS (mode);
32487 + rtx mem;
32488 +
32489 + gcc_assert (VECTOR_MODE_P (mode));
32490 +
32491 + mem = assign_stack_temp (mode, GET_MODE_SIZE (mode), 0);
32492 + for (i = 0; i < n_elts; i++)
32493 + emit_move_insn (adjust_address_nv (mem, inner, i * GET_MODE_SIZE (inner)),
32494 + XVECEXP (vals, 0, i));
32495 +
32496 + emit_move_insn (target, mem);
32497 +}
32498 +
32499 /* Implement TARGET_ASM_OUTPUT_DWARF_DTPREL. */
32500
32501 static void ATTRIBUTE_UNUSED
32502 @@ -6893,6 +7154,37 @@ mips_dwarf_register_span (rtx reg)
32503 return NULL_RTX;
32504 }
32505
32506 +/* DSP ALU can bypass data with no delays for the following pairs. */
32507 +enum insn_code dspalu_bypass_table[][2] =
32508 +{
32509 + {CODE_FOR_mips_addsc, CODE_FOR_mips_addwc},
32510 + {CODE_FOR_mips_cmpu_eq_qb, CODE_FOR_mips_pick_qb},
32511 + {CODE_FOR_mips_cmpu_lt_qb, CODE_FOR_mips_pick_qb},
32512 + {CODE_FOR_mips_cmpu_le_qb, CODE_FOR_mips_pick_qb},
32513 + {CODE_FOR_mips_cmp_eq_ph, CODE_FOR_mips_pick_ph},
32514 + {CODE_FOR_mips_cmp_lt_ph, CODE_FOR_mips_pick_ph},
32515 + {CODE_FOR_mips_cmp_le_ph, CODE_FOR_mips_pick_ph},
32516 + {CODE_FOR_mips_wrdsp, CODE_FOR_mips_insv}
32517 +};
32518 +
32519 +int
32520 +mips_dspalu_bypass_p (rtx out_insn, rtx in_insn)
32521 +{
32522 + int i;
32523 + int num_bypass = (sizeof (dspalu_bypass_table)
32524 + / (2 * sizeof (enum insn_code)));
32525 + enum insn_code out_icode = INSN_CODE (out_insn);
32526 + enum insn_code in_icode = INSN_CODE (in_insn);
32527 +
32528 + for (i = 0; i < num_bypass; i++)
32529 + {
32530 + if (out_icode == dspalu_bypass_table[i][0]
32531 + && in_icode == dspalu_bypass_table[i][1])
32532 + return true;
32533 + }
32534 +
32535 + return false;
32536 +}
32537 /* Implement ASM_OUTPUT_ASCII. */
32538
32539 void
32540 @@ -7117,16 +7409,26 @@ mips_file_start (void)
32541 "\t.previous\n", TARGET_LONG64 ? 64 : 32);
32542
32543 #ifdef HAVE_AS_GNU_ATTRIBUTE
32544 +#ifdef TARGET_MIPS_SDEMTK
32545 + fprintf (asm_out_file, "\t.gnu_attribute 4, %d\n",
32546 + (!TARGET_NO_FLOAT
32547 + ? (TARGET_HARD_FLOAT
32548 + ? (TARGET_DOUBLE_FLOAT
32549 + ? ((!TARGET_64BIT && TARGET_FLOAT64) ? 4 : 1) : 2) : 3) : 0));
32550 +#else
32551 fprintf (asm_out_file, "\t.gnu_attribute 4, %d\n",
32552 (TARGET_HARD_FLOAT_ABI
32553 ? (TARGET_DOUBLE_FLOAT
32554 ? ((!TARGET_64BIT && TARGET_FLOAT64) ? 4 : 1) : 2) : 3));
32555 #endif
32556 +#endif
32557 }
32558
32559 /* If TARGET_ABICALLS, tell GAS to generate -KPIC code. */
32560 if (TARGET_ABICALLS)
32561 fprintf (asm_out_file, "\t.abicalls\n");
32562 + if (TARGET_ABICALLS && !flag_pic)
32563 + fprintf (asm_out_file, "\t.option\tpic0\n");
32564
32565 if (flag_verbose_asm)
32566 fprintf (asm_out_file, "\n%s -G value = %d, Arch = %s, ISA = %d\n",
32567 @@ -7617,6 +7919,7 @@ mips16e_output_save_restore (rtx pattern
32568 return buffer;
32569 }
32570 \f
32571 +
32572 /* Return true if the current function has an insn that implicitly
32573 refers to $gp. */
32574
32575 @@ -7631,6 +7934,7 @@ mips_function_has_gp_insn (void)
32576 push_topmost_sequence ();
32577 for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
32578 if (USEFUL_INSN_P (insn)
32579 +
32580 && (get_attr_got (insn) != GOT_UNSET
32581 || mips_small_data_pattern_p (PATTERN (insn))))
32582 {
32583 @@ -7720,7 +8024,7 @@ mips_save_reg_p (unsigned int regno)
32584 {
32585 /* We only need to save $gp if TARGET_CALL_SAVED_GP and only then
32586 if we have not chosen a call-clobbered substitute. */
32587 - if (regno == GLOBAL_POINTER_REGNUM)
32588 + if (regno == GLOBAL_POINTER_REGNUM && fixed_regs[regno])
32589 return TARGET_CALL_SAVED_GP && cfun->machine->global_pointer == regno;
32590
32591 /* Check call-saved registers. */
32592 @@ -7944,7 +8248,7 @@ mips_current_loadgp_style (void)
32593 if (TARGET_RTP_PIC)
32594 return LOADGP_RTP;
32595
32596 - if (TARGET_ABSOLUTE_ABICALLS)
32597 + if (TARGET_ABSOLUTE_ABICALLS || !flag_pic)
32598 return LOADGP_ABSOLUTE;
32599
32600 return TARGET_NEWABI ? LOADGP_NEWABI : LOADGP_OLDABI;
32601 @@ -8059,9 +8363,10 @@ mips_restore_gp (void)
32602 {
32603 rtx base, address;
32604
32605 - gcc_assert (TARGET_ABICALLS && TARGET_OLDABI);
32606 + gcc_assert (TARGET_ABICALLS && TARGET_OLDABI && flag_pic);
32607
32608 base = frame_pointer_needed ? hard_frame_pointer_rtx : stack_pointer_rtx;
32609 +
32610 address = mips_add_offset (pic_offset_table_rtx, base,
32611 current_function_outgoing_args_size);
32612 mips_emit_move (pic_offset_table_rtx, gen_frame_mem (Pmode, address));
32613 @@ -8312,7 +8617,18 @@ mips_save_reg (rtx reg, rtx mem)
32614
32615 /* The __gnu_local_gp symbol. */
32616
32617 -static GTY(()) rtx mips_gnu_local_gp;
32618 +static GTY(()) rtx mips_gnu_local_gp_rtx;
32619 +
32620 +static rtx
32621 +mips_gnu_local_gp (void)
32622 +{
32623 + if (mips_gnu_local_gp_rtx == NULL)
32624 + {
32625 + mips_gnu_local_gp_rtx = gen_rtx_SYMBOL_REF (Pmode, "__gnu_local_gp");
32626 + SYMBOL_REF_FLAGS (mips_gnu_local_gp_rtx) |= SYMBOL_FLAG_LOCAL;
32627 + }
32628 + return mips_gnu_local_gp_rtx;
32629 +}
32630
32631 /* If we're generating n32 or n64 abicalls, emit instructions
32632 to set up the global pointer. */
32633 @@ -8326,14 +8642,9 @@ mips_emit_loadgp (void)
32634 switch (mips_current_loadgp_style ())
32635 {
32636 case LOADGP_ABSOLUTE:
32637 - if (mips_gnu_local_gp == NULL)
32638 - {
32639 - mips_gnu_local_gp = gen_rtx_SYMBOL_REF (Pmode, "__gnu_local_gp");
32640 - SYMBOL_REF_FLAGS (mips_gnu_local_gp) |= SYMBOL_FLAG_LOCAL;
32641 - }
32642 emit_insn (Pmode == SImode
32643 - ? gen_loadgp_absolute_si (pic_reg, mips_gnu_local_gp)
32644 - : gen_loadgp_absolute_di (pic_reg, mips_gnu_local_gp));
32645 + ? gen_loadgp_absolute_si (pic_reg, mips_gnu_local_gp ())
32646 + : gen_loadgp_absolute_di (pic_reg, mips_gnu_local_gp ()));
32647 break;
32648
32649 case LOADGP_NEWABI:
32650 @@ -8490,7 +8801,7 @@ mips_expand_prologue (void)
32651 mips_emit_loadgp ();
32652
32653 /* Initialize the $gp save slot. */
32654 - if (frame->cprestore_size > 0)
32655 + if (frame->cprestore_size > 0 && flag_pic )
32656 emit_insn (gen_cprestore (GEN_INT (current_function_outgoing_args_size)));
32657
32658 /* If we are profiling, make sure no instructions are scheduled before
32659 @@ -8549,6 +8860,11 @@ mips_expand_epilogue (bool sibcall_p)
32660 step1 = frame->total_size;
32661 step2 = 0;
32662
32663 + if (mips_warn_framesize >= 0
32664 + && step1 > mips_warn_framesize)
32665 + warning (0, "frame size of %qs is " HOST_WIDE_INT_PRINT_DEC " bytes",
32666 + current_function_name (), step1);
32667 +
32668 /* Work out which register holds the frame address. */
32669 if (!frame_pointer_needed)
32670 base = stack_pointer_rtx;
32671 @@ -9456,10 +9772,15 @@ mips_output_division (const char *divisi
32672 s = "bnez\t%2,1f\n\tbreak\t7\n1:";
32673 }
32674 else if (GENERATE_DIVIDE_TRAPS)
32675 - {
32676 - output_asm_insn (s, operands);
32677 - s = "teq\t%2,%.,7";
32678 - }
32679 + {
32680 + if (TUNE_74K)
32681 + output_asm_insn ("teq\t%2,%.,7", operands);
32682 + else
32683 + {
32684 + output_asm_insn (s, operands);
32685 + s = "teq\t%2,%.,7";
32686 + }
32687 + }
32688 else
32689 {
32690 output_asm_insn ("%(bne\t%2,%.,1f", operands);
32691 @@ -9552,6 +9873,7 @@ mips_issue_rate (void)
32692 case PROCESSOR_R5500:
32693 case PROCESSOR_R7000:
32694 case PROCESSOR_R9000:
32695 + case PROCESSOR_OCTEON:
32696 return 2;
32697
32698 case PROCESSOR_SB1:
32699 @@ -9577,6 +9899,11 @@ mips_multipass_dfa_lookahead (void)
32700 if (TUNE_SB1)
32701 return 4;
32702
32703 + /* Because of the two pipelines we have at most two alternative
32704 + schedules on Octeon. */
32705 + if (mips_tune == PROCESSOR_OCTEON)
32706 + return 2;
32707 +
32708 return 0;
32709 }
32710 \f
32711 @@ -9613,7 +9940,17 @@ mips_maybe_swap_ready (rtx *ready, int p
32712 ready[pos2] = temp;
32713 }
32714 }
32715 -\f
32716 +
32717 +int
32718 +mips_mult_madd_chain_bypass_p (rtx out_insn ATTRIBUTE_UNUSED,
32719 + rtx in_insn ATTRIBUTE_UNUSED)
32720 +{
32721 + if (reload_completed)
32722 + return false;
32723 + else
32724 + return true;
32725 +}
32726 +
32727 /* Used by TUNE_MACC_CHAINS to record the last scheduled instruction
32728 that may clobber hi or lo. */
32729 static rtx mips_macc_chains_last_hilo;
32730 @@ -11908,6 +12245,28 @@ mips_parse_cpu (const char *cpu_string)
32731 return NULL;
32732 }
32733
32734 +/* Prepare the extv/extzv operands in OPERANDS for a register extraction.
32735 + The problem here is that the extv interface always provides word_mode
32736 + register operands, even if the values were originally SImode.
32737 + We nevertheless want to use SImode operations for naturally-SImode
32738 + operands because SUBREGs are harder to optimize. */
32739 +
32740 +void
32741 +mips_adjust_register_ext_operands (rtx *operands)
32742 +{
32743 + if (GET_CODE (operands[0]) == SUBREG
32744 + && GET_MODE (operands[0]) == DImode
32745 + && GET_CODE (operands[1]) == SUBREG
32746 + && GET_MODE (operands[1]) == DImode
32747 + && GET_MODE (SUBREG_REG (operands[0])) == SImode
32748 + && GET_MODE (SUBREG_REG (operands[1])) == SImode
32749 + && INTVAL (operands[2]) + INTVAL (operands[3]) <= 32)
32750 + {
32751 + operands[0] = SUBREG_REG (operands[0]);
32752 + operands[1] = SUBREG_REG (operands[1]);
32753 + }
32754 +}
32755 +
32756 /* Set up globals to generate code for the ISA or processor
32757 described by INFO. */
32758
32759 @@ -11979,6 +12338,9 @@ mips_handle_option (size_t code, const c
32760 return false;
32761 return true;
32762
32763 + case OPT_mwarn_framesize_:
32764 + return sscanf (arg, HOST_WIDE_INT_PRINT_DEC, &mips_warn_framesize) == 1;
32765 +
32766 default:
32767 return true;
32768 }
32769 @@ -11995,10 +12357,6 @@ mips_override_options (void)
32770 SUBTARGET_OVERRIDE_OPTIONS;
32771 #endif
32772
32773 - /* Set the small data limit. */
32774 - mips_small_data_threshold = (g_switch_set
32775 - ? g_switch_value
32776 - : MIPS_DEFAULT_GVALUE);
32777
32778 /* The following code determines the architecture and register size.
32779 Similar code was added to GAS 2.14 (see tc-mips.c:md_after_parse_args()).
32780 @@ -12088,6 +12446,10 @@ mips_override_options (void)
32781
32782 /* End of code shared with GAS. */
32783
32784 + /* The non-PIC ABI may only be used in conjunction with the o32 ABI. */
32785 + if (TARGET_ABICALLS && !flag_pic && mips_abi != ABI_32)
32786 + sorry ("non-PIC abicalls may only be used with the o32 ABI");
32787 +
32788 /* If no -mlong* option was given, infer it from the other options. */
32789 if ((target_flags_explicit & MASK_LONG64) == 0)
32790 {
32791 @@ -12136,23 +12498,21 @@ mips_override_options (void)
32792 target_flags &= ~MASK_ABICALLS;
32793 }
32794
32795 - /* MIPS16 cannot generate PIC yet. */
32796 + /* MIPS16 cannot generate PIC or abicalls yet. */
32797 if (TARGET_MIPS16 && (flag_pic || TARGET_ABICALLS))
32798 {
32799 - sorry ("MIPS16 PIC");
32800 + sorry ("MIPS16 PIC or abicalls are not yet implemented");
32801 target_flags &= ~MASK_ABICALLS;
32802 flag_pic = flag_pie = flag_shlib = 0;
32803 }
32804
32805 - if (TARGET_ABICALLS)
32806 - /* We need to set flag_pic for executables as well as DSOs
32807 - because we may reference symbols that are not defined in
32808 - the final executable. (MIPS does not use things like
32809 - copy relocs, for example.)
32810 -
32811 - Also, there is a body of code that uses __PIC__ to distinguish
32812 - between -mabicalls and -mno-abicalls code. */
32813 - flag_pic = 1;
32814 + /* For SDE, switch on ABICALLS mode if -fpic or -fpie were used, and the
32815 + user hasn't explicitly disabled these modes. */
32816 + if (TARGET_MIPS_SDE
32817 + && (flag_pic || flag_pie) && !TARGET_ABICALLS
32818 + && !((target_flags_explicit & MASK_ABICALLS))
32819 + && mips_abi != ABI_EABI)
32820 + target_flags |= MASK_ABICALLS;
32821
32822 /* -mvr4130-align is a "speed over size" optimization: it usually produces
32823 faster code, but at the expense of more nops. Enable it at -O3 and
32824 @@ -12167,6 +12527,11 @@ mips_override_options (void)
32825
32826 /* If we have a nonzero small-data limit, check that the -mgpopt
32827 setting is consistent with the other target flags. */
32828 +
32829 + /* Set the small data limit. */
32830 + mips_small_data_threshold = (g_switch_set
32831 + ? g_switch_value
32832 + : MIPS_DEFAULT_GVALUE);
32833 if (mips_small_data_threshold > 0)
32834 {
32835 if (!TARGET_GPOPT)
32836 @@ -12262,6 +12627,10 @@ mips_override_options (void)
32837 /* Function to allocate machine-dependent function status. */
32838 init_machine_status = &mips_init_machine_status;
32839
32840 + /* __thread_support is not supported by uClibc. */
32841 + if (building_for_uclibc)
32842 + targetm.have_tls = 0;
32843 +
32844 /* Default to working around R4000 errata only if the processor
32845 was selected explicitly. */
32846 if ((target_flags_explicit & MASK_FIX_R4000) == 0
32847 @@ -12314,18 +12683,24 @@ mips_swap_registers (unsigned int i)
32848 #undef SWAP_STRING
32849 #undef SWAP_INT
32850 }
32851 -
32852 -/* Implement CONDITIONAL_REGISTER_USAGE. */
32853 -
32854 void
32855 mips_conditional_register_usage (void)
32856 {
32857 +
32858 + /* These DSP control register fields are global. */
32859 + if (ISA_HAS_DSP)
32860 + {
32861 + global_regs[CCDSP_PO_REGNUM] = 1;
32862 + global_regs[CCDSP_SC_REGNUM] = 1;
32863 + }
32864 if (!ISA_HAS_DSP)
32865 {
32866 int regno;
32867
32868 for (regno = DSP_ACC_REG_FIRST; regno <= DSP_ACC_REG_LAST; regno++)
32869 fixed_regs[regno] = call_used_regs[regno] = 1;
32870 + for (regno = DSP_CTRL_REG_FIRST; regno <= DSP_CTRL_REG_LAST; regno++)
32871 + fixed_regs[regno] = call_used_regs[regno] = 1;
32872 }
32873 if (!TARGET_HARD_FLOAT)
32874 {
32875 @@ -12387,6 +12762,24 @@ mips_conditional_register_usage (void)
32876 for (regno = DSP_ACC_REG_FIRST; regno <= DSP_ACC_REG_LAST; regno += 2)
32877 mips_swap_registers (regno);
32878 }
32879 + /* In non-PIC abicalls, $gp is completely ordinary; we can use a pseudo
32880 + for TLS GOT entries. */
32881 + if (TARGET_NONPIC_ABICALLS)
32882 + {
32883 + call_used_regs[GLOBAL_POINTER_REGNUM] = TARGET_OLDABI;
32884 + call_really_used_regs[GLOBAL_POINTER_REGNUM] = TARGET_OLDABI;
32885 + fixed_regs[GLOBAL_POINTER_REGNUM] = 0;
32886 + }
32887 + /* $f30 is reserved for errata workarounds in ICE9A. */
32888 + if (TARGET_FIX_ICE9A)
32889 + {
32890 + const int f30 = FP_REG_FIRST + 30;
32891 + const int f31 = FP_REG_FIRST + 31;
32892 +
32893 + fixed_regs[f30] = call_really_used_regs[f30] = call_used_regs[f30] = 1;
32894 + if (MAX_FPRS_PER_FMT == 2)
32895 + fixed_regs[f31] = call_really_used_regs[f31] = call_used_regs[f31] = 1;
32896 + }
32897 }
32898
32899 /* When generating MIPS16 code, we want to allocate $24 (T_REG) before
32900 @@ -12411,6 +12804,153 @@ mips_order_regs_for_local_alloc (void)
32901 }
32902 }
32903 \f
32904 +#ifdef CVMX_SHARED_BSS_FLAGS
32905 +/* Handle a "cvmx_shared" attribute; arguments as in
32906 + struct attribute_spec.handler. */
32907 +
32908 +static tree
32909 +octeon_handle_cvmx_shared_attribute (tree *node, tree name,
32910 + tree args ATTRIBUTE_UNUSED,
32911 + int flags ATTRIBUTE_UNUSED,
32912 + bool *no_add_attrs)
32913 +{
32914 + if (TREE_CODE (*node) != VAR_DECL)
32915 + {
32916 + warning (OPT_Wattributes, "%qs attribute only applies to variables",
32917 + IDENTIFIER_POINTER (name));
32918 + *no_add_attrs = true;
32919 + }
32920 +
32921 + return NULL_TREE;
32922 +}
32923 +\f
32924 +/* Switch to the appropriate section for output of DECL.
32925 + DECL is either a `VAR_DECL' node or a constant of some sort.
32926 + RELOC indicates whether forming the initial value of DECL requires
32927 + link-time relocations. */
32928 +
32929 +static section *
32930 +octeon_select_section (tree decl, int reloc, unsigned HOST_WIDE_INT align)
32931 +{
32932 + if (decl && TREE_CODE (decl) == VAR_DECL
32933 + && lookup_attribute ("cvmx_shared", DECL_ATTRIBUTES (decl)))
32934 + {
32935 + const char *sname = NULL;
32936 + unsigned int flags = SECTION_WRITE;
32937 +
32938 + switch (categorize_decl_for_section (decl, reloc))
32939 + {
32940 + case SECCAT_DATA:
32941 + case SECCAT_SDATA:
32942 + case SECCAT_RODATA:
32943 + case SECCAT_SRODATA:
32944 + case SECCAT_RODATA_MERGE_STR:
32945 + case SECCAT_RODATA_MERGE_STR_INIT:
32946 + case SECCAT_RODATA_MERGE_CONST:
32947 + case SECCAT_DATA_REL:
32948 + case SECCAT_DATA_REL_LOCAL:
32949 + case SECCAT_DATA_REL_RO:
32950 + case SECCAT_DATA_REL_RO_LOCAL:
32951 + sname = ".cvmx_shared";
32952 + break;
32953 + case SECCAT_BSS:
32954 + case SECCAT_SBSS:
32955 + sname = ".cvmx_shared_bss";
32956 + flags |= SECTION_BSS;
32957 + break;
32958 + case SECCAT_TEXT:
32959 + case SECCAT_TDATA:
32960 + case SECCAT_TBSS:
32961 + break;
32962 + }
32963 + if (sname)
32964 + {
32965 + return get_section (sname, flags, decl);
32966 + }
32967 + }
32968 + return default_elf_select_section (decl, reloc, align);
32969 +}
32970 +\f
32971 +/* Build up a unique section name, expressed as a
32972 + STRING_CST node, and assign it to DECL_SECTION_NAME (decl).
32973 + RELOC indicates whether the initial value of EXP requires
32974 + link-time relocations. */
32975 +
32976 +static void
32977 +octeon_unique_section (tree decl, int reloc)
32978 +{
32979 + if (decl && TREE_CODE (decl) == VAR_DECL
32980 + && lookup_attribute ("cvmx_shared", DECL_ATTRIBUTES (decl)))
32981 + {
32982 + const char *sname = NULL;
32983 +
32984 + if (! DECL_ONE_ONLY (decl))
32985 + {
32986 + section *sect;
32987 + sect = octeon_select_section (decl, reloc, DECL_ALIGN (decl));
32988 + DECL_SECTION_NAME (decl) = build_string (strlen (sect->named.name),
32989 + sect->named.name);
32990 + return;
32991 + }
32992 +
32993 + switch (categorize_decl_for_section (decl, reloc))
32994 + {
32995 + case SECCAT_BSS:
32996 + case SECCAT_SBSS:
32997 + sname = ".cvmx_shared_bss.linkonce.";
32998 + break;
32999 + case SECCAT_SDATA:
33000 + case SECCAT_DATA:
33001 + case SECCAT_DATA_REL:
33002 + case SECCAT_DATA_REL_LOCAL:
33003 + case SECCAT_DATA_REL_RO:
33004 + case SECCAT_DATA_REL_RO_LOCAL:
33005 + case SECCAT_RODATA:
33006 + case SECCAT_SRODATA:
33007 + case SECCAT_RODATA_MERGE_STR:
33008 + case SECCAT_RODATA_MERGE_STR_INIT:
33009 + case SECCAT_RODATA_MERGE_CONST:
33010 + sname = ".cvmx_shared.linkonce.";
33011 + break;
33012 + case SECCAT_TEXT:
33013 + case SECCAT_TDATA:
33014 + case SECCAT_TBSS:
33015 + break;
33016 + }
33017 + if (sname)
33018 + {
33019 + const char *name;
33020 + size_t plen, nlen;
33021 + char *string;
33022 + plen = strlen (sname);
33023 +
33024 + name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
33025 + name = targetm.strip_name_encoding (name);
33026 + nlen = strlen (name);
33027 +
33028 + string = alloca (plen + nlen + 1);
33029 + memcpy (string, sname, plen);
33030 + memcpy (string + plen, name, nlen + 1);
33031 + DECL_SECTION_NAME (decl) = build_string (nlen + plen, string);
33032 + return;
33033 + }
33034 + }
33035 + default_unique_section (decl, reloc);
33036 +}
33037 +\f
33038 +/* Emit an uninitialized cvmx_shared variable. */
33039 +void
33040 +octeon_output_shared_variable (FILE *stream, tree decl, const char *name,
33041 + unsigned HOST_WIDE_INT size, int align)
33042 +{
33043 + switch_to_section (get_section (".cvmx_shared_bss", CVMX_SHARED_BSS_FLAGS,
33044 + NULL_TREE));
33045 + ASM_OUTPUT_ALIGN (stream, floor_log2 (align / BITS_PER_UNIT));
33046 + ASM_DECLARE_OBJECT_NAME (stream, name, decl);
33047 + ASM_OUTPUT_SKIP (stream, size != 0 ? size : 1);
33048 +}
33049 +#endif
33050 +\f
33051 /* Initialize the GCC target structure. */
33052 #undef TARGET_ASM_ALIGNED_HI_OP
33053 #define TARGET_ASM_ALIGNED_HI_OP "\t.half\t"
33054 @@ -12571,6 +13111,7 @@ mips_order_regs_for_local_alloc (void)
33055 #undef TARGET_DWARF_REGISTER_SPAN
33056 #define TARGET_DWARF_REGISTER_SPAN mips_dwarf_register_span
33057
33058 +
33059 struct gcc_target targetm = TARGET_INITIALIZER;
33060 \f
33061 #include "gt-mips.h"
33062 --- a/gcc/config/mips/mips.h
33063 +++ b/gcc/config/mips/mips.h
33064 @@ -67,6 +67,8 @@ enum processor_type {
33065 PROCESSOR_SB1,
33066 PROCESSOR_SB1A,
33067 PROCESSOR_SR71000,
33068 + PROCESSOR_XLR,
33069 + PROCESSOR_OCTEON,
33070 PROCESSOR_MAX
33071 };
33072
33073 @@ -179,15 +181,19 @@ enum mips_code_readable_setting {
33074 #define TARGET_SIBCALLS \
33075 (!TARGET_MIPS16 && (!TARGET_USE_GOT || TARGET_EXPLICIT_RELOCS))
33076
33077 -/* True if we need to use a global offset table to access some symbols. */
33078 -#define TARGET_USE_GOT (TARGET_ABICALLS || TARGET_RTP_PIC)
33079 +/* True if we need to use a global offset table to access some symbols.
33080 + Small data and TLS are not counted. */
33081 +#define TARGET_USE_GOT ((TARGET_ABICALLS && flag_pic) || TARGET_RTP_PIC)
33082
33083 /* True if TARGET_USE_GOT and if $gp is a call-clobbered register. */
33084 -#define TARGET_CALL_CLOBBERED_GP (TARGET_ABICALLS && TARGET_OLDABI)
33085 +#define TARGET_CALL_CLOBBERED_GP (TARGET_ABICALLS && flag_pic && TARGET_OLDABI)
33086
33087 /* True if TARGET_USE_GOT and if $gp is a call-saved register. */
33088 #define TARGET_CALL_SAVED_GP (TARGET_USE_GOT && !TARGET_CALL_CLOBBERED_GP)
33089
33090 +/* True if using abicalls, but not ourselves PIC. */
33091 +#define TARGET_NONPIC_ABICALLS (TARGET_ABICALLS && !flag_pic)
33092 +
33093 /* True if indirect calls must use register class PIC_FN_ADDR_REG.
33094 This is true for both the PIC and non-PIC VxWorks RTP modes. */
33095 #define TARGET_USE_PIC_FN_ADDR_REG (TARGET_ABICALLS || TARGET_VXWORKS_RTP)
33096 @@ -197,7 +203,8 @@ enum mips_code_readable_setting {
33097 Although GAS does understand .gpdword, the SGI linker mishandles
33098 the relocations GAS generates (R_MIPS_GPREL32 followed by R_MIPS_64).
33099 We therefore disable GP-relative switch tables for n64 on IRIX targets. */
33100 -#define TARGET_GPWORD (TARGET_ABICALLS && !(mips_abi == ABI_64 && TARGET_IRIX))
33101 +#define TARGET_GPWORD (TARGET_ABICALLS && flag_pic \
33102 + && !(mips_abi == ABI_64 && TARGET_IRIX))
33103
33104 /* Generate mips16 code */
33105 #define TARGET_MIPS16 ((target_flags & MASK_MIPS16) != 0)
33106 @@ -237,6 +244,8 @@ enum mips_code_readable_setting {
33107 #define TARGET_SB1 (mips_arch == PROCESSOR_SB1 \
33108 || mips_arch == PROCESSOR_SB1A)
33109 #define TARGET_SR71K (mips_arch == PROCESSOR_SR71000)
33110 +#define TARGET_OCTEON (mips_arch == PROCESSOR_OCTEON)
33111 +#define TARGET_XLR (mips_arch == PROCESSOR_XLR)
33112
33113 /* Scheduling target defines. */
33114 #define TUNE_MIPS3000 (mips_tune == PROCESSOR_R3000)
33115 @@ -311,6 +320,9 @@ enum mips_code_readable_setting {
33116 #define TARGET_IRIX 0
33117 #define TARGET_IRIX6 0
33118
33119 +/* SDE specific stuff. */
33120 +#define TARGET_MIPS_SDE 0
33121 +
33122 /* Define preprocessor macros for the -march and -mtune options.
33123 PREFIX is either _MIPS_ARCH or _MIPS_TUNE, INFO is the selected
33124 processor. If INFO's canonical name is "foo", define PREFIX to
33125 @@ -435,7 +447,10 @@ enum mips_code_readable_setting {
33126 else if (ISA_MIPS64) \
33127 { \
33128 builtin_define ("__mips=64"); \
33129 - builtin_define ("__mips_isa_rev=1"); \
33130 + if (TARGET_OCTEON) \
33131 + builtin_define ("__mips_isa_rev=2"); \
33132 + else \
33133 + builtin_define ("__mips_isa_rev=1"); \
33134 builtin_define ("_MIPS_ISA=_MIPS_ISA_MIPS64"); \
33135 } \
33136 \
33137 @@ -520,6 +535,9 @@ enum mips_code_readable_setting {
33138 \
33139 if (mips_abi == ABI_EABI) \
33140 builtin_define ("__mips_eabi"); \
33141 + \
33142 + if (TARGET_FIX_ICE9A) \
33143 + builtin_define ("_MIPS_FIX_ICE9A"); \
33144 } \
33145 while (0)
33146
33147 @@ -651,7 +669,8 @@ enum mips_code_readable_setting {
33148 %{march=mips32|march=4kc|march=4km|march=4kp|march=4ksc:-mips32} \
33149 %{march=mips32r2|march=m4k|march=4ke*|march=4ksd|march=24k* \
33150 |march=34k*|march=74k*: -mips32r2} \
33151 - %{march=mips64|march=5k*|march=20k*|march=sb1*|march=sr71000: -mips64} \
33152 + %{march=mips64|march=5k*|march=20k*|march=sb1*|march=sr71000 \
33153 + |march=octeon|march=xlr: -mips64} \
33154 %{!march=*: -" MULTILIB_ISA_DEFAULT "}}"
33155
33156 /* A spec that infers a -mhard-float or -msoft-float setting from an
33157 @@ -664,6 +683,11 @@ enum mips_code_readable_setting {
33158 |march=34kc|march=74kc|march=5kc: -msoft-float; \
33159 march=*: -mhard-float}"
33160
33161 +/* A spec that infers the -mdsp setting from an -march argument. */
33162 +
33163 +#define MIPS_ARCH_DSP_SPEC \
33164 + "%{!mno-dsp:%{march=24ke*|march=34k*|march=74k*: -mdsp}}"
33165 +
33166 /* A spec condition that matches 32-bit options. It only works if
33167 MIPS_ISA_LEVEL_SPEC has been applied. */
33168
33169 @@ -672,19 +696,27 @@ enum mips_code_readable_setting {
33170
33171 /* Support for a compile-time default CPU, et cetera. The rules are:
33172 --with-arch is ignored if -march is specified or a -mips is specified
33173 - (other than -mips16).
33174 - --with-tune is ignored if -mtune is specified.
33175 + (other than -mips16); likewise --with-arch32 and --with-arch64.
33176 + --with-tune is ignored if -mtune is specified; likewise
33177 + --with-tune32 and --with-tune64.
33178 --with-abi is ignored if -mabi is specified.
33179 --with-float is ignored if -mhard-float or -msoft-float are
33180 specified.
33181 --with-divide is ignored if -mdivide-traps or -mdivide-breaks are
33182 - specified. */
33183 + specified.
33184 + --with-fix-ice9a is ignored if -mfix-ice9a or -mno-fix-ice9a are
33185 + specified. */
33186 #define OPTION_DEFAULT_SPECS \
33187 {"arch", "%{" MIPS_ARCH_OPTION_SPEC ":;: -march=%(VALUE)}" }, \
33188 + {"arch32", "%{!mabi=*|mabi=32:%{" MIPS_ARCH_OPTION_SPEC ":;: -march=%(VALUE)}}" }, \
33189 + {"arch64", "%{mabi=n32|mabi=64:%{" MIPS_ARCH_OPTION_SPEC ":;: -march=%(VALUE)}}" }, \
33190 {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
33191 + {"tune32", "%{!mabi=*|mabi=32:%{!mtune=*:-mtune=%(VALUE)}}" }, \
33192 + {"tune64", "%{mabi=n32|mabi=64:%{!mtune=*:-mtune=%(VALUE)}}" }, \
33193 {"abi", "%{!mabi=*:-mabi=%(VALUE)}" }, \
33194 {"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" }, \
33195 {"divide", "%{!mdivide-traps:%{!mdivide-breaks:-mdivide-%(VALUE)}}" }, \
33196 + {"fix-ice9a", "%{!mfix-ice9a:%{!mno-fix-ice9a:-mfix-ice9a}}" }, \
33197 {"llsc", "%{!mllsc:%{!mno-llsc:-m%(VALUE)}}" }
33198
33199
33200 @@ -783,6 +815,9 @@ enum mips_code_readable_setting {
33201 || ISA_MIPS64) \
33202 && !TARGET_MIPS16)
33203
33204 +/* ISA has Octeon specific pop instruction */
33205 +#define ISA_HAS_POPCOUNT (TARGET_OCTEON && !TARGET_MIPS16)
33206 +
33207 /* ISA has three operand multiply instructions that put
33208 the high part in an accumulator: mulhi or mulhiu. */
33209 #define ISA_HAS_MULHI ((TARGET_MIPS5400 \
33210 @@ -823,6 +858,7 @@ enum mips_code_readable_setting {
33211 || TARGET_MIPS5400 \
33212 || TARGET_MIPS5500 \
33213 || TARGET_SR71K \
33214 + || TARGET_OCTEON \
33215 || TARGET_SMARTMIPS) \
33216 && !TARGET_MIPS16)
33217
33218 @@ -848,13 +884,33 @@ enum mips_code_readable_setting {
33219 #define ISA_HAS_TRUNC_W (!ISA_MIPS1)
33220
33221 /* ISA includes the MIPS32r2 seb and seh instructions. */
33222 -#define ISA_HAS_SEB_SEH (ISA_MIPS32R2 \
33223 +#define ISA_HAS_SEB_SEH ((ISA_MIPS32R2 || TARGET_OCTEON) \
33224 && !TARGET_MIPS16)
33225
33226 /* ISA includes the MIPS32/64 rev 2 ext and ins instructions. */
33227 -#define ISA_HAS_EXT_INS (ISA_MIPS32R2 \
33228 +#define ISA_HAS_EXT_INS ((ISA_MIPS32R2 || TARGET_OCTEON) \
33229 && !TARGET_MIPS16)
33230
33231 +/* ISA includes the exts instructions. */
33232 +#define ISA_HAS_EXTS (TARGET_OCTEON && !TARGET_MIPS16)
33233 +
33234 +/* ISA includes the bbit* instructions. */
33235 +#define ISA_HAS_BBIT (TARGET_OCTEON && !TARGET_MIPS16)
33236 +
33237 +/* ISA includes the seq and sne instructions. */
33238 +#define ISA_HAS_SEQ_SNE (TARGET_OCTEON && !TARGET_MIPS16)
33239 +
33240 +/* ISA includes the baddu instruction. */
33241 +#define ISA_HAS_BADDU (TARGET_OCTEON && !TARGET_MIPS16)
33242 +
33243 +/* ISA has single-instruction unalinged load/store support. */
33244 +#define ISA_HAS_UL_US (TARGET_OCTEON \
33245 + && TARGET_OCTEON_UNALIGNED \
33246 + && !TARGET_MIPS16)
33247 +
33248 +/* ISA includes the cins instruction. */
33249 +#define ISA_HAS_CINS (TARGET_OCTEON && !TARGET_MIPS16)
33250 +
33251 /* ISA has instructions for accessing top part of 64-bit fp regs. */
33252 #define ISA_HAS_MXHC1 (TARGET_FLOAT64 && ISA_MIPS32R2)
33253
33254 @@ -935,6 +991,49 @@ enum mips_code_readable_setting {
33255 #endif
33256
33257 \f
33258 +/* Some targets (most of those with dynamic linking, e.g. Irix,
33259 + GNU/Linux, BSD) default to -mabicalls. They mostly default to PIC
33260 + also. Force the appropriate -mabicalls setting into the command
33261 + line for the benefit of the -fno-pic spec just below. */
33262 +#ifdef TARGET_ABICALLS_DEFAULT
33263 +#define ABICALLS_SPEC "%{!mno-abicalls:%{!mabicalls:-mabicalls}}"
33264 +#else
33265 +#define ABICALLS_SPEC "%{!mno-abicalls:%{!mabicalls:-mno-abicalls}}"
33266 +#endif
33267 +
33268 +/* Make -mabicalls imply PIC unless the target supports non-PIC
33269 + abicalls. Targets which do not support non-PIC abicalls must set
33270 + flag_pic for executables as well as DSOs
33271 + because we may reference symbols that are not defined in
33272 + the final executable - these targets do not have copy relocs.
33273 +
33274 + All 64-bit targets are assumed to not support PIC abicalls.
33275 + CSL NOTE: It would be nice to remove this restriction before
33276 + contributing upstream; 64-bit support should be a small project.
33277 +
33278 + Also, there is a body of code that uses __PIC__ to distinguish
33279 + between -mabicalls and -mno-abicalls code. For targets with
33280 + non-PIC abicalls support any such code will have to be corrected.
33281 + All you need to do if !__PIC__ is use $t9 for indirect calls
33282 + and be careful about assuming $gp is set up in inline asm. */
33283 +#ifdef TARGET_ABICALLS_NONPIC
33284 +#define ABICALLS_SELF_SPECS ABICALLS_SPEC, \
33285 + "%{mabicalls:%{!fno-pic:%{mabi=o64|mabi=64|mabi=n32:-fpic}}}"
33286 +#else
33287 +#define ABICALLS_SELF_SPECS ABICALLS_SPEC, \
33288 + "%{mabicalls:%{!fno-pic:-fpic}}"
33289 +#endif
33290 +
33291 +/* Any additional self specs defined by the subtarget. */
33292 +#ifndef SUBTARGET_SELF_SPECS
33293 +#define SUBTARGET_SELF_SPECS ""
33294 +#endif
33295 +
33296 +#define DRIVER_SELF_SPECS \
33297 + SUBTARGET_SELF_SPECS, \
33298 + ABICALLS_SELF_SPECS
33299 +\f
33300 +
33301 #ifndef MIPS_ABI_DEFAULT
33302 #define MIPS_ABI_DEFAULT ABI_32
33303 #endif
33304 @@ -1003,7 +1102,7 @@ enum mips_code_readable_setting {
33305 %{mdspr2} %{mno-dspr2} \
33306 %{msmartmips} %{mno-smartmips} \
33307 %{mmt} %{mno-mt} \
33308 -%{mfix-vr4120} %{mfix-vr4130} \
33309 +%{mfix-vr4120} %{mfix-vr4130} %{mfix-ice9a} %{mno-fix-ice9a} \
33310 %(subtarget_asm_optimizing_spec) \
33311 %(subtarget_asm_debugging_spec) \
33312 %{mabi=*} %{!mabi*: %(asm_abi_default_spec)} \
33313 @@ -1012,6 +1111,7 @@ enum mips_code_readable_setting {
33314 %{mshared} %{mno-shared} \
33315 %{msym32} %{mno-sym32} \
33316 %{mtune=*} %{v} \
33317 +%{mocteon-useun} %{mno-octeon-useun} \
33318 %(subtarget_asm_spec)"
33319
33320 /* Extra switches sometimes passed to the linker. */
33321 @@ -1515,9 +1615,24 @@ enum mips_code_readable_setting {
33322 #define DSP_ACC_REG_LAST 181
33323 #define DSP_ACC_REG_NUM (DSP_ACC_REG_LAST - DSP_ACC_REG_FIRST + 1)
33324
33325 +#define DSP_CTRL_REG_FIRST 182
33326 +#define DSP_CTRL_REG_LAST 187
33327 +
33328 #define AT_REGNUM (GP_REG_FIRST + 1)
33329 #define HI_REGNUM (TARGET_BIG_ENDIAN ? MD_REG_FIRST : MD_REG_FIRST + 1)
33330 #define LO_REGNUM (TARGET_BIG_ENDIAN ? MD_REG_FIRST + 1 : MD_REG_FIRST)
33331 +#define AC1HI_REGNUM (TARGET_BIG_ENDIAN \
33332 + ? DSP_ACC_REG_FIRST : DSP_ACC_REG_FIRST + 1)
33333 +#define AC1LO_REGNUM (TARGET_BIG_ENDIAN \
33334 + ? DSP_ACC_REG_FIRST + 1 : DSP_ACC_REG_FIRST)
33335 +#define AC2HI_REGNUM (TARGET_BIG_ENDIAN \
33336 + ? DSP_ACC_REG_FIRST + 2 : DSP_ACC_REG_FIRST + 3)
33337 +#define AC2LO_REGNUM (TARGET_BIG_ENDIAN \
33338 + ? DSP_ACC_REG_FIRST + 3 : DSP_ACC_REG_FIRST + 2)
33339 +#define AC3HI_REGNUM (TARGET_BIG_ENDIAN \
33340 + ? DSP_ACC_REG_FIRST + 4 : DSP_ACC_REG_FIRST + 5)
33341 +#define AC3LO_REGNUM (TARGET_BIG_ENDIAN \
33342 + ? DSP_ACC_REG_FIRST + 5 : DSP_ACC_REG_FIRST + 4)
33343
33344 /* FPSW_REGNUM is the single condition code used if !ISA_HAS_8CC.
33345 If ISA_HAS_8CC, it should not be used, and an arbitrary ST_REG
33346 @@ -1673,6 +1788,7 @@ enum reg_class
33347 ST_REGS, /* status registers (fp status) */
33348 DSP_ACC_REGS, /* DSP accumulator registers */
33349 ACC_REGS, /* Hi/Lo and DSP accumulator registers */
33350 + FRAME_REGS, /* $arg and $frame */
33351 ALL_REGS, /* all registers */
33352 LIM_REG_CLASSES /* max value + 1 */
33353 };
33354 @@ -1715,6 +1831,7 @@ enum reg_class
33355 "ST_REGS", \
33356 "DSP_ACC_REGS", \
33357 "ACC_REGS", \
33358 + "FRAME_REGS", \
33359 "ALL_REGS" \
33360 }
33361
33362 @@ -1758,7 +1875,8 @@ enum reg_class
33363 { 0x00000000, 0x00000000, 0x000007f8, 0x00000000, 0x00000000, 0x00000000 }, /* status registers */ \
33364 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003f0000 }, /* dsp accumulator registers */ \
33365 { 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x003f0000 }, /* hi/lo and dsp accumulator registers */ \
33366 - { 0xffffffff, 0xffffffff, 0xffff07ff, 0xffffffff, 0xffffffff, 0x0fffffff } /* all registers */ \
33367 + { 0x00000000, 0x00000000, 0x00006000, 0x00000000, 0x00000000, 0x00000000 }, /* frame registers */ \
33368 + { 0xffffffff, 0xffffffff, 0xffff67ff, 0xffffffff, 0xffffffff, 0x0fffffff } /* all registers */ \
33369 }
33370
33371
33372 @@ -2446,7 +2564,7 @@ typedef struct mips_args {
33373 ? "%*" INSN "\t%" #OPNO "%/" \
33374 : REG_P (OPERANDS[OPNO]) \
33375 ? "%*" INSN "r\t%" #OPNO "%/" \
33376 - : TARGET_ABICALLS \
33377 + : TARGET_ABICALLS && flag_pic \
33378 ? (".option\tpic0\n\t" \
33379 "%*" INSN "\t%" #OPNO "%/\n\t" \
33380 ".option\tpic2") \
33381 --- a/gcc/config/mips/mips.md
33382 +++ b/gcc/config/mips/mips.md
33383 @@ -60,7 +60,10 @@
33384 (UNSPEC_MEMORY_BARRIER 41)
33385 (UNSPEC_SET_GOT_VERSION 42)
33386 (UNSPEC_UPDATE_GOT_VERSION 43)
33387 -
33388 +
33389 + (UNSPEC_UNALIGNED_LOAD 50)
33390 + (UNSPEC_UNALIGNED_STORE 51)
33391 +
33392 (UNSPEC_ADDRESS_FIRST 100)
33393
33394 (TLS_GET_TP_REGNUM 3)
33395 @@ -269,6 +272,7 @@
33396 ;; slt set less than instructions
33397 ;; signext sign extend instructions
33398 ;; clz the clz and clo instructions
33399 +;; pop pop and dpop
33400 ;; trap trap if instructions
33401 ;; imul integer multiply 2 operands
33402 ;; imul3 integer multiply 3 operands
33403 @@ -291,11 +295,17 @@
33404 ;; frsqrt floating point reciprocal square root
33405 ;; frsqrt1 floating point reciprocal square root step1
33406 ;; frsqrt2 floating point reciprocal square root step2
33407 +;; dspmac DSP MAC instructions not saturating the accumulator
33408 +;; dspmacsat DSP MAC instructions that saturate the accumulator
33409 +;; accext DSP accumulator extract instructions
33410 +;; accmod DSP accumulator modify instructions
33411 +;; dspalu DSP ALU instructions not saturating the result
33412 +;; dspalusat DSP ALU instructions that saturate the result
33413 ;; multi multiword sequence (or user asm statements)
33414 ;; nop no operation
33415 ;; ghost an instruction that produces no real code
33416 (define_attr "type"
33417 - "unknown,branch,jump,call,load,fpload,fpidxload,store,fpstore,fpidxstore,prefetch,prefetchx,condmove,mfc,mtc,mthilo,mfhilo,const,arith,logical,shift,slt,signext,clz,trap,imul,imul3,imadd,idiv,move,fmove,fadd,fmul,fmadd,fdiv,frdiv,frdiv1,frdiv2,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,frsqrt1,frsqrt2,multi,nop,ghost"
33418 + "unknown,branch,jump,call,load,fpload,fpidxload,store,fpstore,fpidxstore,prefetch,prefetchx,condmove,mfc,mtc,mthilo,mfhilo,const,arith,logical,shift,slt,signext,clz,pop,trap,imul,imul3,imadd,idiv,move,fmove,fadd,fmul,fmadd,fdiv,frdiv,frdiv1,frdiv2,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,frsqrt1,frsqrt2,dspmac,dspmacsat,accext,accmod,dspalu,dspalusat,multi,nop,ghost"
33419 (cond [(eq_attr "jal" "!unset") (const_string "call")
33420 (eq_attr "got" "load") (const_string "load")]
33421 (const_string "unknown")))
33422 @@ -412,7 +422,7 @@
33423 ;; Attribute describing the processor. This attribute must match exactly
33424 ;; with the processor_type enumeration in mips.h.
33425 (define_attr "cpu"
33426 - "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"
33427 + "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,xlr,octeon"
33428 (const (symbol_ref "mips_tune")))
33429
33430 ;; The type of hardware hazard associated with this instruction.
33431 @@ -461,6 +471,16 @@
33432 (const_string "yes")
33433 (const_string "no"))))
33434
33435 +;; Attributes defining whether a branch has a branch-likely variant.
33436 +(define_attr "branch_without_likely" "no,yes" (const_string "no"))
33437 +
33438 +(define_attr "branch_with_likely" "no,yes"
33439 + (if_then_else
33440 + (and (eq_attr "type" "branch")
33441 + (eq_attr "branch_without_likely" "no"))
33442 + (const_string "yes")
33443 + (const_string "no")))
33444 +
33445 ;; True if an instruction might assign to hi or lo when reloaded.
33446 ;; This is used by the TUNE_MACC_CHAINS code.
33447 (define_attr "may_clobber_hilo" "no,yes"
33448 @@ -513,6 +533,30 @@
33449 (V2SF "!TARGET_64BIT && TARGET_PAIRED_SINGLE_FLOAT")
33450 (TF "TARGET_64BIT && TARGET_FLOAT64")])
33451
33452 +;; The attributes for the ICE9A fix.
33453 +(define_mode_attr ice9a_stallnops [(SF "") (V2SF "")
33454 + (DF "movn.d\t$f30, $f28, $0\;movn.d\t$f30, $f28, $0\;movn.d\t$f30, $f28, $0\;movn.d\t$f30, $f28, $0\;movn.d\t$f30, $f28, $0\;")])
33455 +(define_mode_attr ice9a_round [(SF "") (V2SF "")
33456 + (DF "\;movn.d\t$f30, %0, $0")])
33457 +
33458 +
33459 +
33460 +;; stall workaround = 5 insns, => length = 4 * (1+5) = 24
33461 +(define_mode_attr ice9a_length_stall [(SF "4") (V2SF "4")
33462 + (DF "24")])
33463 +
33464 +;; round workaround = 1 insn, => length = 4 * (1+1) = 8
33465 +(define_mode_attr ice9a_length_round [(SF "4") (V2SF "4")
33466 + (DF "8")])
33467 +
33468 +;; both workarounds = 5+1 insn, => length = 4 * (1+5+1) = 28
33469 +(define_mode_attr ice9a_length_both [(SF "4") (V2SF "4")
33470 + (DF "28")])
33471 +
33472 +
33473 +
33474 +
33475 +
33476 ;; In GPR templates, a string like "<d>subu" will expand to "subu" in the
33477 ;; 32-bit version and "dsubu" in the 64-bit version.
33478 (define_mode_attr d [(SI "") (DI "d")
33479 @@ -525,9 +569,12 @@
33480 ;; instruction.
33481 (define_mode_attr size [(QI "b") (HI "h")])
33482
33483 -;; This attributes gives the mode mask of a SHORT.
33484 +;; This attribute gives the mode mask of a SHORT.
33485 (define_mode_attr mask [(QI "0x00ff") (HI "0xffff")])
33486
33487 +;; This attribute gives the number of the topmost bit of a SUBDI.
33488 +(define_mode_attr topbit [(QI "7") (HI "15") (SI "31")])
33489 +
33490 ;; Mode attributes for GPR loads and stores.
33491 (define_mode_attr load [(SI "lw") (DI "ld")])
33492 (define_mode_attr store [(SI "sw") (DI "sd")])
33493 @@ -599,14 +646,23 @@
33494 ;; to use the same template.
33495 (define_code_iterator any_extend [sign_extend zero_extend])
33496
33497 +;; This code iterator allows both sorts of extraction to be treated alike.
33498 +(define_code_iterator any_extract [sign_extract zero_extract])
33499 +
33500 ;; This code iterator allows the three shift instructions to be generated
33501 ;; from the same template.
33502 (define_code_iterator any_shift [ashift ashiftrt lshiftrt])
33503
33504 +;; This code iterator allows both of the right shift codes to be treated alike.
33505 +(define_code_iterator any_shiftrt [ashiftrt lshiftrt])
33506 +
33507 ;; This code iterator allows all native floating-point comparisons to be
33508 ;; generated from the same template.
33509 (define_code_iterator fcond [unordered uneq unlt unle eq lt le])
33510
33511 +;; This code iterator allows both equality operators to be treated alike.
33512 +(define_code_iterator equality_op [eq ne])
33513 +
33514 ;; This code iterator is used for comparisons that can be implemented
33515 ;; by swapping the operands.
33516 (define_code_iterator swapped_fcond [ge gt unge ungt])
33517 @@ -663,13 +719,19 @@
33518 ;;
33519 ;; .........................
33520
33521 -(define_delay (and (eq_attr "type" "branch")
33522 +(define_delay (and (eq_attr "branch_with_likely" "yes")
33523 (eq (symbol_ref "TARGET_MIPS16") (const_int 0)))
33524 [(eq_attr "can_delay" "yes")
33525 (nil)
33526 (and (eq_attr "branch_likely" "yes")
33527 (eq_attr "can_delay" "yes"))])
33528
33529 +(define_delay (and (eq_attr "branch_without_likely" "yes")
33530 + (eq (symbol_ref "TARGET_MIPS16") (const_int 0)))
33531 + [(eq_attr "can_delay" "yes")
33532 + (nil)
33533 + (nil)])
33534 +
33535 (define_delay (eq_attr "type" "jump")
33536 [(eq_attr "can_delay" "yes")
33537 (nil)
33538 @@ -720,7 +782,9 @@
33539 (include "7000.md")
33540 (include "9000.md")
33541 (include "sb1.md")
33542 +(include "octeon.md")
33543 (include "sr71k.md")
33544 +(include "xlr.md")
33545 (include "generic.md")
33546 \f
33547 ;;
33548 @@ -985,6 +1049,51 @@
33549 [(set_attr "type" "arith")
33550 (set_attr "mode" "SI")
33551 (set_attr "extended_mips16" "yes")])
33552 +
33553 +;; Combiner patterns for unsigned byte-add.
33554 +
33555 +(define_insn "*baddu_si"
33556 + [(set (match_operand:SI 0 "register_operand" "=d")
33557 + (zero_extend:SI
33558 + (subreg:QI
33559 + (plus:SI (match_operand:SI 1 "register_operand" "d")
33560 + (match_operand:SI 2 "register_operand" "d")) 3)))]
33561 + "ISA_HAS_BADDU && TARGET_BIG_ENDIAN"
33562 + "baddu\\t%0,%1,%2"
33563 + [(set_attr "type" "arith")])
33564 +
33565 +(define_insn "*baddu_disi"
33566 + [(set (match_operand:SI 0 "register_operand" "=d")
33567 + (zero_extend:SI
33568 + (truncate:QI
33569 + (plus:DI (match_operand:DI 1 "register_operand" "d")
33570 + (match_operand:DI 2 "register_operand" "d")))))]
33571 + "TARGET_64BIT && ISA_HAS_BADDU"
33572 + "baddu\\t%0,%1,%2"
33573 + [(set_attr "type" "arith")])
33574 +
33575 +(define_insn "*baddu_didi"
33576 + [(set (match_operand:DI 0 "register_operand" "=d")
33577 + (zero_extend:DI
33578 + (truncate:QI
33579 + (plus:DI
33580 + (subreg:DI
33581 + (truncate:QI (match_operand:DI 1 "register_operand" "d")) 0)
33582 + (subreg:DI
33583 + (truncate:QI (match_operand:DI 2 "register_operand" "d")) 0)))))]
33584 + "TARGET_64BIT && ISA_HAS_BADDU"
33585 + "baddu\\t%0,%1,%2"
33586 + [(set_attr "type" "arith")])
33587 +
33588 +(define_insn "*baddu_didi2"
33589 + [(set (match_operand:DI 0 "register_operand" "=d")
33590 + (zero_extend:DI
33591 + (truncate:QI
33592 + (plus:DI (match_operand:DI 1 "register_operand" "d")
33593 + (match_operand:DI 2 "register_operand" "d")))))]
33594 + "TARGET_64BIT && ISA_HAS_BADDU"
33595 + "baddu\\t%0,%1,%2"
33596 + [(set_attr "type" "arith")])
33597 \f
33598 ;;
33599 ;; ....................
33600 @@ -1041,7 +1150,7 @@
33601 [(set (match_operand:SCALARF 0 "register_operand" "=f")
33602 (mult:SCALARF (match_operand:SCALARF 1 "register_operand" "f")
33603 (match_operand:SCALARF 2 "register_operand" "f")))]
33604 - "!TARGET_4300_MUL_FIX"
33605 + "!TARGET_4300_MUL_FIX && !TARGET_FIX_ICE9A"
33606 "mul.<fmt>\t%0,%1,%2"
33607 [(set_attr "type" "fmul")
33608 (set_attr "mode" "<MODE>")])
33609 @@ -1054,12 +1163,22 @@
33610 [(set (match_operand:SCALARF 0 "register_operand" "=f")
33611 (mult:SCALARF (match_operand:SCALARF 1 "register_operand" "f")
33612 (match_operand:SCALARF 2 "register_operand" "f")))]
33613 - "TARGET_4300_MUL_FIX"
33614 + "TARGET_4300_MUL_FIX && !TARGET_FIX_ICE9A"
33615 "mul.<fmt>\t%0,%1,%2\;nop"
33616 [(set_attr "type" "fmul")
33617 (set_attr "mode" "<MODE>")
33618 (set_attr "length" "8")])
33619
33620 +(define_insn "*mul<mode>3_fix_ice9a"
33621 + [(set (match_operand:SCALARF 0 "register_operand" "=f")
33622 + (mult:SCALARF (match_operand:SCALARF 1 "register_operand" "f")
33623 + (match_operand:SCALARF 2 "register_operand" "f")))]
33624 + "TARGET_FIX_ICE9A && !TARGET_4300_MUL_FIX"
33625 + "<ice9a_stallnops>mul.<fmt>\t%0,%1,%2<ice9a_round>"
33626 + [(set_attr "type" "fmul")
33627 + (set_attr "mode" "<MODE>")
33628 + (set_attr "length" "<ice9a_length_both>")])
33629 +
33630 (define_insn "mulv2sf3"
33631 [(set (match_operand:V2SF 0 "register_operand" "=f")
33632 (mult:V2SF (match_operand:V2SF 1 "register_operand" "f")
33633 @@ -1849,21 +1968,43 @@
33634 (plus:ANYF (mult:ANYF (match_operand:ANYF 1 "register_operand" "f")
33635 (match_operand:ANYF 2 "register_operand" "f"))
33636 (match_operand:ANYF 3 "register_operand" "f")))]
33637 - "ISA_HAS_FP4 && TARGET_FUSED_MADD"
33638 + "ISA_HAS_FP4 && TARGET_FUSED_MADD && !TARGET_FIX_ICE9A"
33639 "madd.<fmt>\t%0,%3,%1,%2"
33640 [(set_attr "type" "fmadd")
33641 (set_attr "mode" "<UNITMODE>")])
33642
33643 +(define_insn "*madd<mode>_ice9a"
33644 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33645 + (plus:ANYF (mult:ANYF (match_operand:ANYF 1 "register_operand" "f")
33646 + (match_operand:ANYF 2 "register_operand" "f"))
33647 + (match_operand:ANYF 3 "register_operand" "f")))]
33648 + "ISA_HAS_FP4 && TARGET_FUSED_MADD && TARGET_FIX_ICE9A"
33649 + "<ice9a_stallnops>madd.<fmt>\t%0,%3,%1,%2<ice9a_round>"
33650 + [(set_attr "type" "fmadd")
33651 + (set_attr "mode" "<UNITMODE>")
33652 + (set_attr "length" "<ice9a_length_both>")])
33653 +
33654 (define_insn "*msub<mode>"
33655 [(set (match_operand:ANYF 0 "register_operand" "=f")
33656 (minus:ANYF (mult:ANYF (match_operand:ANYF 1 "register_operand" "f")
33657 (match_operand:ANYF 2 "register_operand" "f"))
33658 (match_operand:ANYF 3 "register_operand" "f")))]
33659 - "ISA_HAS_FP4 && TARGET_FUSED_MADD"
33660 + "ISA_HAS_FP4 && TARGET_FUSED_MADD && !TARGET_FIX_ICE9A"
33661 "msub.<fmt>\t%0,%3,%1,%2"
33662 [(set_attr "type" "fmadd")
33663 (set_attr "mode" "<UNITMODE>")])
33664
33665 +(define_insn "*msub<mode>_ice9a"
33666 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33667 + (minus:ANYF (mult:ANYF (match_operand:ANYF 1 "register_operand" "f")
33668 + (match_operand:ANYF 2 "register_operand" "f"))
33669 + (match_operand:ANYF 3 "register_operand" "f")))]
33670 + "ISA_HAS_FP4 && TARGET_FUSED_MADD && TARGET_FIX_ICE9A"
33671 + "<ice9a_stallnops>msub.<fmt>\t%0,%3,%1,%2<ice9a_round>"
33672 + [(set_attr "type" "fmadd")
33673 + (set_attr "mode" "<UNITMODE>")
33674 + (set_attr "length" "<ice9a_length_both>")])
33675 +
33676 (define_insn "*nmadd<mode>"
33677 [(set (match_operand:ANYF 0 "register_operand" "=f")
33678 (neg:ANYF (plus:ANYF
33679 @@ -1873,7 +2014,8 @@
33680 "ISA_HAS_NMADD_NMSUB (<MODE>mode)
33681 && TARGET_FUSED_MADD
33682 && HONOR_SIGNED_ZEROS (<MODE>mode)
33683 - && !HONOR_NANS (<MODE>mode)"
33684 + && !HONOR_NANS (<MODE>mode)
33685 + && !TARGET_FIX_ICE9A"
33686 "nmadd.<fmt>\t%0,%3,%1,%2"
33687 [(set_attr "type" "fmadd")
33688 (set_attr "mode" "<UNITMODE>")])
33689 @@ -1887,11 +2029,44 @@
33690 "ISA_HAS_NMADD_NMSUB (<MODE>mode)
33691 && TARGET_FUSED_MADD
33692 && !HONOR_SIGNED_ZEROS (<MODE>mode)
33693 - && !HONOR_NANS (<MODE>mode)"
33694 + && !HONOR_NANS (<MODE>mode)
33695 + && !TARGET_FIX_ICE9A"
33696 "nmadd.<fmt>\t%0,%3,%1,%2"
33697 [(set_attr "type" "fmadd")
33698 (set_attr "mode" "<UNITMODE>")])
33699
33700 +(define_insn "*nmadd<mode>_ice9a"
33701 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33702 + (neg:ANYF (plus:ANYF
33703 + (mult:ANYF (match_operand:ANYF 1 "register_operand" "f")
33704 + (match_operand:ANYF 2 "register_operand" "f"))
33705 + (match_operand:ANYF 3 "register_operand" "f"))))]
33706 + "ISA_HAS_NMADD_NMSUB (<MODE>mode)
33707 + && TARGET_FUSED_MADD
33708 + && HONOR_SIGNED_ZEROS (<MODE>mode)
33709 + && !HONOR_NANS (<MODE>mode)
33710 + && TARGET_FIX_ICE9A"
33711 + "<ice9a_stallnops>nmadd.<fmt>\t%0,%3,%1,%2<ice9a_round>"
33712 + [(set_attr "type" "fmadd")
33713 + (set_attr "length" "<ice9a_length_both>")
33714 + (set_attr "mode" "<UNITMODE>")])
33715 +
33716 +(define_insn "*nmadd<mode>_fastmath_ice9a"
33717 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33718 + (minus:ANYF
33719 + (mult:ANYF (neg:ANYF (match_operand:ANYF 1 "register_operand" "f"))
33720 + (match_operand:ANYF 2 "register_operand" "f"))
33721 + (match_operand:ANYF 3 "register_operand" "f")))]
33722 + "ISA_HAS_NMADD_NMSUB (<MODE>mode)
33723 + && TARGET_FUSED_MADD
33724 + && !HONOR_SIGNED_ZEROS (<MODE>mode)
33725 + && !HONOR_NANS (<MODE>mode)
33726 + && TARGET_FIX_ICE9A"
33727 + "<ice9a_stallnops>nmadd.<fmt>\t%0,%3,%1,%2<ice9a_round>"
33728 + [(set_attr "type" "fmadd")
33729 + (set_attr "length" "<ice9a_length_both>")
33730 + (set_attr "mode" "<UNITMODE>")])
33731 +
33732 (define_insn "*nmsub<mode>"
33733 [(set (match_operand:ANYF 0 "register_operand" "=f")
33734 (neg:ANYF (minus:ANYF
33735 @@ -1901,7 +2076,8 @@
33736 "ISA_HAS_NMADD_NMSUB (<MODE>mode)
33737 && TARGET_FUSED_MADD
33738 && HONOR_SIGNED_ZEROS (<MODE>mode)
33739 - && !HONOR_NANS (<MODE>mode)"
33740 + && !HONOR_NANS (<MODE>mode)
33741 + && !TARGET_FIX_ICE9A"
33742 "nmsub.<fmt>\t%0,%1,%2,%3"
33743 [(set_attr "type" "fmadd")
33744 (set_attr "mode" "<UNITMODE>")])
33745 @@ -1915,10 +2091,43 @@
33746 "ISA_HAS_NMADD_NMSUB (<MODE>mode)
33747 && TARGET_FUSED_MADD
33748 && !HONOR_SIGNED_ZEROS (<MODE>mode)
33749 - && !HONOR_NANS (<MODE>mode)"
33750 + && !HONOR_NANS (<MODE>mode)
33751 + && !TARGET_FIX_ICE9A"
33752 "nmsub.<fmt>\t%0,%1,%2,%3"
33753 [(set_attr "type" "fmadd")
33754 (set_attr "mode" "<UNITMODE>")])
33755 +
33756 +(define_insn "*nmsub<mode>_ice9a"
33757 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33758 + (neg:ANYF (minus:ANYF
33759 + (mult:ANYF (match_operand:ANYF 2 "register_operand" "f")
33760 + (match_operand:ANYF 3 "register_operand" "f"))
33761 + (match_operand:ANYF 1 "register_operand" "f"))))]
33762 + "ISA_HAS_NMADD_NMSUB (<MODE>mode)
33763 + && TARGET_FUSED_MADD
33764 + && HONOR_SIGNED_ZEROS (<MODE>mode)
33765 + && !HONOR_NANS (<MODE>mode)
33766 + && TARGET_FIX_ICE9A"
33767 + "<ice9a_stallnops>nmsub.<fmt>\t%0,%1,%2,%3<ice9a_round>"
33768 + [(set_attr "type" "fmadd")
33769 + (set_attr "length" "<ice9a_length_both>")
33770 + (set_attr "mode" "<UNITMODE>")])
33771 +
33772 +(define_insn "*nmsub<mode>_fastmath_ice9a"
33773 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33774 + (minus:ANYF
33775 + (match_operand:ANYF 1 "register_operand" "f")
33776 + (mult:ANYF (match_operand:ANYF 2 "register_operand" "f")
33777 + (match_operand:ANYF 3 "register_operand" "f"))))]
33778 + "ISA_HAS_NMADD_NMSUB (<MODE>mode)
33779 + && TARGET_FUSED_MADD
33780 + && !HONOR_SIGNED_ZEROS (<MODE>mode)
33781 + && !HONOR_NANS (<MODE>mode)
33782 + && TARGET_FIX_ICE9A"
33783 + "<ice9a_stallnops>nmsub.<fmt>\t%0,%1,%2,%3<ice9a_round>"
33784 + [(set_attr "type" "fmadd")
33785 + (set_attr "length" "<ice9a_length_both>")
33786 + (set_attr "mode" "<UNITMODE>")])
33787 \f
33788 ;;
33789 ;; ....................
33790 @@ -1973,19 +2182,40 @@
33791 [(set (match_operand:ANYF 0 "register_operand" "=f")
33792 (div:ANYF (match_operand:ANYF 1 "const_1_operand" "")
33793 (match_operand:ANYF 2 "register_operand" "f")))]
33794 - "<recip_condition> && flag_unsafe_math_optimizations"
33795 -{
33796 - if (TARGET_FIX_SB1)
33797 - return "recip.<fmt>\t%0,%2\;mov.<fmt>\t%0,%0";
33798 - else
33799 - return "recip.<fmt>\t%0,%2";
33800 -}
33801 + "<recip_condition> &&
33802 + flag_unsafe_math_optimizations &&
33803 + !TARGET_FIX_SB1 &&
33804 + !TARGET_FIX_ICE9A"
33805 + "recip.<fmt>\t%0,%2"
33806 + [(set_attr "type" "frdiv")
33807 + (set_attr "mode" "<UNITMODE>")])
33808 +
33809 +(define_insn "*recip<mode>3_fix_sb1"
33810 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33811 + (div:ANYF (match_operand:ANYF 1 "const_1_operand" "")
33812 + (match_operand:ANYF 2 "register_operand" "f")))]
33813 + "<recip_condition> &&
33814 + flag_unsafe_math_optimizations &&
33815 + TARGET_FIX_SB1 &&
33816 + !TARGET_FIX_ICE9A"
33817 + "recip.<fmt>\t%0,%2\;mov.<fmt>\t%0,%0"
33818 [(set_attr "type" "frdiv")
33819 (set_attr "mode" "<UNITMODE>")
33820 - (set (attr "length")
33821 - (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0))
33822 - (const_int 8)
33823 - (const_int 4)))])
33824 + (set_attr "length" "8")])
33825 +
33826 +(define_insn "*recip<mode>3_fix_ice9a"
33827 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33828 + (div:ANYF (match_operand:ANYF 1 "const_1_operand" "")
33829 + (match_operand:ANYF 2 "register_operand" "f")))]
33830 + "<recip_condition> &&
33831 + flag_unsafe_math_optimizations &&
33832 + !TARGET_FIX_SB1 &&
33833 + TARGET_FIX_ICE9A"
33834 + "<ice9a_stallnops>recip.<fmt>\t%0,%2"
33835 + [(set_attr "type" "frdiv")
33836 + (set_attr "mode" "<UNITMODE>")
33837 + (set_attr "length" "<ice9a_length_stall>")])
33838 +
33839
33840 ;; VR4120 errata MD(A1): signed division instructions do not work correctly
33841 ;; with negative operands. We use special libgcc functions instead.
33842 @@ -2021,60 +2251,117 @@
33843 ;; ....................
33844
33845 ;; These patterns work around the early SB-1 rev2 core "F1" erratum (see
33846 -;; "*div[sd]f3" comment for details).
33847 +;; "*div[sd]f3" comment for details), and ICE9A errata.
33848
33849 -(define_insn "sqrt<mode>2"
33850 +(define_expand "sqrt<mode>2"
33851 [(set (match_operand:ANYF 0 "register_operand" "=f")
33852 (sqrt:ANYF (match_operand:ANYF 1 "register_operand" "f")))]
33853 "<sqrt_condition>"
33854 -{
33855 - if (TARGET_FIX_SB1)
33856 - return "sqrt.<fmt>\t%0,%1\;mov.<fmt>\t%0,%0";
33857 - else
33858 - return "sqrt.<fmt>\t%0,%1";
33859 -}
33860 + "")
33861 +
33862 +(define_insn "*sqrt<mode>2"
33863 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33864 + (sqrt:ANYF (match_operand:ANYF 1 "register_operand" "f")))]
33865 + "<sqrt_condition> &&
33866 + !TARGET_FIX_SB1 &&
33867 + !TARGET_FIX_ICE9A"
33868 + "sqrt.<fmt>\t%0,%1"
33869 + [(set_attr "type" "fsqrt")
33870 + (set_attr "mode" "<UNITMODE>")])
33871 +
33872 +(define_insn "*sqrt<mode>2_fix_sb1"
33873 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33874 + (sqrt:ANYF (match_operand:ANYF 1 "register_operand" "f")))]
33875 + "<sqrt_condition> &&
33876 + TARGET_FIX_SB1 &&
33877 + !TARGET_FIX_ICE9A"
33878 + "sqrt.<fmt>\t%0,%1\;mov.<fmt>\t%0,%0"
33879 [(set_attr "type" "fsqrt")
33880 (set_attr "mode" "<UNITMODE>")
33881 - (set (attr "length")
33882 - (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0))
33883 - (const_int 8)
33884 - (const_int 4)))])
33885 + (set_attr "length" "8")])
33886 +
33887 +(define_insn "*sqrt<mode>2_fix_ice9a"
33888 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33889 + (sqrt:ANYF (match_operand:ANYF 1 "register_operand" "f")))]
33890 + "<sqrt_condition> &&
33891 + !TARGET_FIX_SB1 &&
33892 + TARGET_FIX_ICE9A"
33893 + "sqrt.<fmt>\t%0,%1<ice9a_round>"
33894 + [(set_attr "type" "fsqrt")
33895 + (set_attr "mode" "<UNITMODE>")
33896 + (set_attr "length" "<ice9a_length_round>")])
33897
33898 (define_insn "*rsqrt<mode>a"
33899 [(set (match_operand:ANYF 0 "register_operand" "=f")
33900 (div:ANYF (match_operand:ANYF 1 "const_1_operand" "")
33901 (sqrt:ANYF (match_operand:ANYF 2 "register_operand" "f"))))]
33902 - "<recip_condition> && flag_unsafe_math_optimizations"
33903 -{
33904 - if (TARGET_FIX_SB1)
33905 - return "rsqrt.<fmt>\t%0,%2\;mov.<fmt>\t%0,%0";
33906 - else
33907 - return "rsqrt.<fmt>\t%0,%2";
33908 -}
33909 + "<recip_condition> &&
33910 + flag_unsafe_math_optimizations &&
33911 + !TARGET_FIX_SB1 &&
33912 + !TARGET_FIX_ICE9A"
33913 + "rsqrt.<fmt>\t%0,%2"
33914 + [(set_attr "type" "frsqrt")
33915 + (set_attr "mode" "<UNITMODE>")])
33916 +
33917 +(define_insn "*rsqrt<mode>a_fix_sb1"
33918 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33919 + (div:ANYF (match_operand:ANYF 1 "const_1_operand" "")
33920 + (sqrt:ANYF (match_operand:ANYF 2 "register_operand" "f"))))]
33921 + "<recip_condition> &&
33922 + flag_unsafe_math_optimizations &&
33923 + TARGET_FIX_SB1"
33924 + "rsqrt.<fmt>\t%0,%2\;mov.<fmt>\t%0,%0"
33925 [(set_attr "type" "frsqrt")
33926 (set_attr "mode" "<UNITMODE>")
33927 - (set (attr "length")
33928 - (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0))
33929 - (const_int 8)
33930 - (const_int 4)))])
33931 + (set_attr "length" "8")])
33932 +
33933 +(define_insn "*rsqrt<mode>a_fix_ice9a"
33934 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33935 + (div:ANYF (match_operand:ANYF 1 "const_1_operand" "")
33936 + (sqrt:ANYF (match_operand:ANYF 2 "register_operand" "f"))))]
33937 + "<recip_condition> &&
33938 + flag_unsafe_math_optimizations &&
33939 + TARGET_FIX_ICE9A"
33940 + "<ice9a_stallnops>rsqrt.<fmt>\t%0,%2<ice9a_round>"
33941 + [(set_attr "type" "frsqrt")
33942 + (set_attr "mode" "<UNITMODE>")
33943 + (set_attr "length" "<ice9a_length_both>")])
33944
33945 (define_insn "*rsqrt<mode>b"
33946 [(set (match_operand:ANYF 0 "register_operand" "=f")
33947 (sqrt:ANYF (div:ANYF (match_operand:ANYF 1 "const_1_operand" "")
33948 (match_operand:ANYF 2 "register_operand" "f"))))]
33949 - "<recip_condition> && flag_unsafe_math_optimizations"
33950 -{
33951 - if (TARGET_FIX_SB1)
33952 - return "rsqrt.<fmt>\t%0,%2\;mov.<fmt>\t%0,%0";
33953 - else
33954 - return "rsqrt.<fmt>\t%0,%2";
33955 -}
33956 + "<recip_condition> &&
33957 + flag_unsafe_math_optimizations &&
33958 + !TARGET_FIX_SB1 &&
33959 + !TARGET_FIX_ICE9A"
33960 + "rsqrt.<fmt>\t%0,%2"
33961 + [(set_attr "type" "frsqrt")
33962 + (set_attr "mode" "<UNITMODE>")])
33963 +
33964 +(define_insn "*rsqrt<mode>b_fix_sb1"
33965 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33966 + (sqrt:ANYF (div:ANYF (match_operand:ANYF 1 "const_1_operand" "")
33967 + (match_operand:ANYF 2 "register_operand" "f"))))]
33968 + "<recip_condition> &&
33969 + flag_unsafe_math_optimizations &&
33970 + TARGET_FIX_SB1"
33971 + "rsqrt.<fmt>\t%0,%2\;mov.<fmt>\t%0,%0"
33972 [(set_attr "type" "frsqrt")
33973 (set_attr "mode" "<UNITMODE>")
33974 - (set (attr "length")
33975 - (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0))
33976 - (const_int 8)
33977 - (const_int 4)))])
33978 + (set_attr "length" "8")])
33979 +
33980 +(define_insn "*rsqrt<mode>b_fix_ice9a"
33981 + [(set (match_operand:ANYF 0 "register_operand" "=f")
33982 + (sqrt:ANYF (div:ANYF (match_operand:ANYF 1 "const_1_operand" "")
33983 + (match_operand:ANYF 2 "register_operand" "f"))))]
33984 + "<recip_condition> &&
33985 + flag_unsafe_math_optimizations &&
33986 + TARGET_FIX_ICE9A"
33987 + "<ice9a_stallnops>rsqrt.<fmt>\t%0,%2\;mov.<fmt>\t%0,%0<ice9a_round>"
33988 + [(set_attr "type" "frsqrt")
33989 + (set_attr "mode" "<UNITMODE>")
33990 + (set_attr "length" "<ice9a_length_both>")])
33991 \f
33992 ;;
33993 ;; ....................
33994 @@ -2093,7 +2380,9 @@
33995 (define_insn "abs<mode>2"
33996 [(set (match_operand:ANYF 0 "register_operand" "=f")
33997 (abs:ANYF (match_operand:ANYF 1 "register_operand" "f")))]
33998 - "!HONOR_NANS (<MODE>mode)"
33999 + "!HONOR_NANS (<MODE>mode)
34000 + || (TARGET_MIPS_SDE
34001 + && TARGET_HARD_FLOAT)"
34002 "abs.<fmt>\t%0,%1"
34003 [(set_attr "type" "fabs")
34004 (set_attr "mode" "<UNITMODE>")])
34005 @@ -2115,6 +2404,22 @@
34006 (set_attr "mode" "<MODE>")])
34007 \f
34008 ;;
34009 +;; ...................
34010 +;;
34011 +;; Count number of 1-bits.
34012 +;;
34013 +;; ...................
34014 +;;
34015 +
34016 +(define_insn "popcount<mode>2"
34017 + [(set (match_operand:GPR 0 "register_operand" "=d")
34018 + (popcount:GPR (match_operand:GPR 1 "register_operand" "d")))]
34019 + "ISA_HAS_POPCOUNT"
34020 + "<d>pop\t%0,%1"
34021 + [(set_attr "type" "pop")
34022 + (set_attr "mode" "<MODE>")])
34023 +\f
34024 +;;
34025 ;; ....................
34026 ;;
34027 ;; NEGATION and ONE'S COMPLEMENT
34028 @@ -2347,6 +2652,16 @@
34029 (set_attr "mode" "SI")
34030 (set_attr "extended_mips16" "yes,*")])
34031
34032 +(define_insn "*<code>_trunc_exts<mode>"
34033 + [(set (match_operand:SUBDI 0 "register_operand" "=d")
34034 + (truncate:SUBDI
34035 + (any_shiftrt:DI (match_operand:DI 1 "register_operand" "d")
34036 + (match_operand:DI 2 "const_int_operand" ""))))]
34037 + "TARGET_64BIT && ISA_HAS_EXTS && INTVAL (operands[2]) < 32"
34038 + "exts\t%0,%1,%2,31"
34039 + [(set_attr "type" "shift")
34040 + (set_attr "mode" "SI")])
34041 +
34042 ;; Combiner patterns to optimize shift/truncate combinations.
34043
34044 (define_insn ""
34045 @@ -2447,10 +2762,15 @@
34046
34047 ;; Extension insns.
34048
34049 -(define_insn_and_split "zero_extendsidi2"
34050 +(define_expand "zero_extendsidi2"
34051 + [(set (match_operand:DI 0 "register_operand")
34052 + (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand")))]
34053 + "TARGET_64BIT")
34054 +
34055 +(define_insn_and_split "*zero_extendsidi2"
34056 [(set (match_operand:DI 0 "register_operand" "=d,d")
34057 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,W")))]
34058 - "TARGET_64BIT"
34059 + "TARGET_64BIT && !ISA_HAS_EXT_INS"
34060 "@
34061 #
34062 lwu\t%0,%1"
34063 @@ -2471,7 +2791,7 @@
34064 [(set (match_operand:DI 0 "register_operand" "=d,d")
34065 (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,W")
34066 (const_int 4294967295)))]
34067 - "TARGET_64BIT"
34068 + "TARGET_64BIT && !ISA_HAS_EXT_INS"
34069 {
34070 if (which_alternative == 0)
34071 return "#";
34072 @@ -2489,6 +2809,31 @@
34073 (set_attr "mode" "DI")
34074 (set_attr "length" "8,*")])
34075
34076 +(define_insn "*zero_extendsidi2_dext"
34077 + [(set (match_operand:DI 0 "register_operand" "=d,d")
34078 + (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,W")))]
34079 + "TARGET_64BIT && ISA_HAS_EXT_INS"
34080 + "@
34081 + dext\t%0,%1,0,32
34082 + lwu\t%0,%1"
34083 + [(set_attr "type" "shift,load")
34084 + (set_attr "mode" "DI")])
34085 +
34086 +(define_insn "*clear_upper32_dext"
34087 + [(set (match_operand:DI 0 "register_operand" "=d,d")
34088 + (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o")
34089 + (const_int 4294967295)))]
34090 + "TARGET_64BIT && ISA_HAS_EXT_INS"
34091 +{
34092 + if (which_alternative == 0)
34093 + return "dext\t%0,%1,0,32";
34094 +
34095 + operands[1] = gen_lowpart (SImode, operands[1]);
34096 + return "lwu\t%0,%1";
34097 +}
34098 + [(set_attr "type" "shift,load")
34099 + (set_attr "mode" "DI")])
34100 +
34101 (define_expand "zero_extend<SHORT:mode><GPR:mode>2"
34102 [(set (match_operand:GPR 0 "register_operand")
34103 (zero_extend:GPR (match_operand:SHORT 1 "nonimmediate_operand")))]
34104 @@ -3026,11 +3371,18 @@
34105 ;;
34106 ;; ....................
34107
34108 -;; Bit field extract patterns which use lwl/lwr or ldl/ldr.
34109 +;; Bit field extract patterns which use lwl/lwr or ldl/ldr or
34110 +;; exts/ext/dext.
34111 +
34112 +;; ??? Using nonimmediate_operand for operand 1 will cause mode_for_extraction
34113 +;; to return word_mode rather than QImode for memories. That's probably
34114 +;; harmless given the current middle-end code; the RTL expander will only
34115 +;; pass QImode references in any case, and any attempt to recog() a memory
34116 +;; extraction will fail whatever mode the memory has.
34117
34118 (define_expand "extv"
34119 [(set (match_operand 0 "register_operand")
34120 - (sign_extract (match_operand:QI 1 "memory_operand")
34121 + (sign_extract (match_operand 1 "nonimmediate_operand")
34122 (match_operand 2 "immediate_operand")
34123 (match_operand 3 "immediate_operand")))]
34124 "!TARGET_MIPS16"
34125 @@ -3039,10 +3391,52 @@
34126 INTVAL (operands[2]),
34127 INTVAL (operands[3])))
34128 DONE;
34129 + else if (ISA_HAS_EXTS
34130 + && register_operand (operands[1], VOIDmode)
34131 + && INTVAL (operands[2]) <= 32)
34132 + {
34133 + mips_adjust_register_ext_operands (operands);
34134 + if (GET_MODE (operands[0]) == SImode)
34135 + {
34136 + emit_insn (gen_extvsi (operands[0], operands[1], operands[2],
34137 + operands[3]));
34138 + DONE;
34139 + }
34140 + else if (TARGET_64BIT && GET_MODE (operands[0]) == DImode)
34141 + {
34142 + emit_insn (gen_extvdi (operands[0], operands[1], operands[2],
34143 + operands[3]));
34144 + DONE;
34145 + }
34146 + }
34147 else
34148 FAIL;
34149 })
34150
34151 +(define_insn "extv<mode>"
34152 + [(set (match_operand:GPR 0 "register_operand" "=d")
34153 + (sign_extract:GPR (match_operand:GPR 1 "register_operand" "d")
34154 + (match_operand 2 "const_int_operand" "")
34155 + (match_operand 3 "const_int_operand" "")))]
34156 + "ISA_HAS_EXTS && INTVAL (operands[2]) <= 32"
34157 + "exts\t%0,%1,%3,%E2"
34158 + [(set_attr "type" "shift")
34159 + (set_attr "mode" "<MODE>")])
34160 +
34161 +;; If we are extracting something no bigger than 32 bits, the destination
34162 +;; register will be a properly sign-extended SImode value. Truncation
34163 +;; is therefore a no-op in this case.
34164 +(define_insn "*extv_truncdi<mode>"
34165 + [(set (match_operand:SUBDI 0 "register_operand" "=d")
34166 + (truncate:SUBDI
34167 + (sign_extract:DI (match_operand:DI 1 "register_operand" "d")
34168 + (match_operand 2 "const_int_operand" "")
34169 + (match_operand 3 "const_int_operand" ""))))]
34170 + "TARGET_64BIT && ISA_HAS_EXTS && INTVAL (operands[2]) <= 32"
34171 + "exts\t%0,%1,%3,%E2"
34172 + [(set_attr "type" "shift")
34173 + (set_attr "mode" "<MODE>")])
34174 +
34175 (define_expand "extzv"
34176 [(set (match_operand 0 "register_operand")
34177 (zero_extract (match_operand 1 "nonimmediate_operand")
34178 @@ -3055,8 +3449,17 @@
34179 INTVAL (operands[3])))
34180 DONE;
34181 else if (mips_use_ins_ext_p (operands[1], INTVAL (operands[2]),
34182 - INTVAL (operands[3])))
34183 + INTVAL (operands[3]))
34184 + /* extract_bit_field can invoke us with (subreg:DI (reg:SI))
34185 + as the output and size more than 31 bits. We would
34186 + create incorrect SI values. Instead, just FAIL. */
34187 + && (GET_MODE (operands[0]) != DImode
34188 + || !(GET_CODE (operands[0]) == SUBREG
34189 + && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0])))
34190 + < (GET_MODE_SIZE (GET_MODE (operands[0]))))
34191 + && INTVAL (operands[2]) >= 32)))
34192 {
34193 + mips_adjust_register_ext_operands (operands);
34194 if (GET_MODE (operands[0]) == DImode)
34195 emit_insn (gen_extzvdi (operands[0], operands[1], operands[2],
34196 operands[3]));
34197 @@ -3080,6 +3483,32 @@
34198 [(set_attr "type" "arith")
34199 (set_attr "mode" "<MODE>")])
34200
34201 +;; If we're extracting fewer than 32 bits, the upper 33 bits of the
34202 +;; destination will be zero, and thus truncation will be a no-op.
34203 +(define_insn "*extzv_truncdi<mode>"
34204 + [(set (match_operand:SUBDI 0 "register_operand" "=d")
34205 + (truncate:SUBDI
34206 + (zero_extract:DI (match_operand:DI 1 "register_operand" "d")
34207 + (match_operand 2 "const_int_operand" "")
34208 + (match_operand 3 "const_int_operand" ""))))]
34209 + "TARGET_64BIT && ISA_HAS_EXT_INS && INTVAL (operands[2]) < 32"
34210 + "dext\t%0,%1,%3,%2"
34211 + [(set_attr "type" "shift")
34212 + (set_attr "mode" "<MODE>")])
34213 +
34214 +;; If we're truncating an extraction that is at least big as the truncation
34215 +;; mode, we can simply extract the useful bits and sign-extend the rest.
34216 +;; The result will be a properly sign-extended value.
34217 +(define_insn "*extz_truncdi<mode>_exts"
34218 + [(set (match_operand:SUBDI 0 "register_operand" "=d")
34219 + (truncate:SUBDI
34220 + (zero_extract:DI (match_operand:DI 1 "register_operand" "d")
34221 + (match_operand 2 "const_int_operand" "")
34222 + (match_operand 3 "const_int_operand" ""))))]
34223 + "TARGET_64BIT && ISA_HAS_EXTS && INTVAL (operands[2]) > <topbit>"
34224 + "exts\t%0,%1,%3,<topbit>"
34225 + [(set_attr "type" "shift")
34226 + (set_attr "mode" "<MODE>")])
34227
34228 (define_expand "insv"
34229 [(set (zero_extract (match_operand 0 "nonimmediate_operand")
34230 @@ -3102,9 +3531,9 @@
34231 emit_insn (gen_insvsi (operands[0], operands[1], operands[2],
34232 operands[3]));
34233 DONE;
34234 - }
34235 - else
34236 - FAIL;
34237 + }
34238 + else
34239 + FAIL;
34240 })
34241
34242 (define_insn "insv<mode>"
34243 @@ -3118,6 +3547,62 @@
34244 [(set_attr "type" "arith")
34245 (set_attr "mode" "<MODE>")])
34246
34247 +(define_insn "*insv<mode>di"
34248 + [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+d")
34249 + (match_operand 1 "const_int_operand" "")
34250 + (match_operand 2 "const_int_operand" ""))
34251 + (subreg:DI
34252 + (truncate:SUBDI (match_operand:DI 3 "register_operand" "d")) 0))]
34253 + "TARGET_64BIT && mips_use_ins_ext_p (operands[0], INTVAL (operands[1]),
34254 + INTVAL (operands[2]))"
34255 + "dins\t%0,%3,%2,%1"
34256 + [(set_attr "type" "shift")
34257 + (set_attr "mode" "DI")])
34258 +
34259 +;; Combine does not notice that zero- and sign-extensions have no
34260 +;; effect here.
34261 +;; ??? Should ideally be done in combine instead.
34262 +
34263 +(define_insn "*insv_<code>_<mode>di"
34264 + [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+d")
34265 + (match_operand 1 "const_int_operand" "")
34266 + (match_operand 2 "const_int_operand" ""))
34267 + (any_extend:DI (match_operand:SUBDI 3 "register_operand" "d")))]
34268 + "TARGET_64BIT && ISA_HAS_EXT_INS && INTVAL (operands[1]) <= <topbit> + 1"
34269 + "dins\t%0,%3,%2,%1"
34270 + [(set_attr "type" "shift")
34271 + (set_attr "mode" "DI")])
34272 +
34273 +(define_insn "*insvdi_clear_upper32<mode>"
34274 + [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+d")
34275 + (match_operand 1 "const_int_operand" "")
34276 + (match_operand 2 "const_int_operand" ""))
34277 + (subreg:DI
34278 + (truncate:SUBDI
34279 + (and:DI (match_operand:DI 3 "register_operand" "d")
34280 + (const_int 4294967295))) 0))]
34281 + "TARGET_64BIT && ISA_HAS_EXT_INS && INTVAL (operands[1]) <= 32"
34282 + "dins\t%0,%3,%2,%1"
34283 + [(set_attr "type" "shift")
34284 + (set_attr "mode" "DI")])
34285 +
34286 +;; Combiner pattern for cins.
34287 +
34288 +(define_insn "*cins"
34289 + [(set (match_operand:DI 0 "register_operand" "=d")
34290 + (match_operator:DI 1 "mask_low_and_shift_operator"
34291 + [(ashift:DI
34292 + (match_operand:DI 2 "register_operand" "d")
34293 + (match_operand:DI 3 "const_int_operand" ""))
34294 + (match_operand:DI 4 "const_int_operand" "")]))]
34295 + "TARGET_64BIT && ISA_HAS_CINS"
34296 +{
34297 + operands[4]
34298 + = GEN_INT (mask_low_and_shift_len (DImode, INTVAL (operands[3]),
34299 + INTVAL (operands[4])));
34300 + return "cins\t%0,%2,%3,%E4";
34301 +})
34302 +
34303 ;; Unaligned word moves generated by the bit field patterns.
34304 ;;
34305 ;; As far as the rtl is concerned, both the left-part and right-part
34306 @@ -3135,7 +3620,9 @@
34307 (unspec:GPR [(match_operand:BLK 1 "memory_operand" "m")
34308 (match_operand:QI 2 "memory_operand" "m")]
34309 UNSPEC_LOAD_LEFT))]
34310 - "!TARGET_MIPS16 && mips_mem_fits_mode_p (<MODE>mode, operands[1])"
34311 + "!TARGET_MIPS16
34312 + && !ISA_HAS_UL_US
34313 + && mips_mem_fits_mode_p (<MODE>mode, operands[1])"
34314 "<load>l\t%0,%2"
34315 [(set_attr "type" "load")
34316 (set_attr "mode" "<MODE>")])
34317 @@ -3146,7 +3633,9 @@
34318 (match_operand:QI 2 "memory_operand" "m")
34319 (match_operand:GPR 3 "register_operand" "0")]
34320 UNSPEC_LOAD_RIGHT))]
34321 - "!TARGET_MIPS16 && mips_mem_fits_mode_p (<MODE>mode, operands[1])"
34322 + "!TARGET_MIPS16
34323 + && !ISA_HAS_UL_US
34324 + && mips_mem_fits_mode_p (<MODE>mode, operands[1])"
34325 "<load>r\t%0,%2"
34326 [(set_attr "type" "load")
34327 (set_attr "mode" "<MODE>")])
34328 @@ -3156,7 +3645,9 @@
34329 (unspec:BLK [(match_operand:GPR 1 "reg_or_0_operand" "dJ")
34330 (match_operand:QI 2 "memory_operand" "m")]
34331 UNSPEC_STORE_LEFT))]
34332 - "!TARGET_MIPS16 && mips_mem_fits_mode_p (<MODE>mode, operands[0])"
34333 + "!TARGET_MIPS16
34334 + && !ISA_HAS_UL_US
34335 + && mips_mem_fits_mode_p (<MODE>mode, operands[0])"
34336 "<store>l\t%z1,%2"
34337 [(set_attr "type" "store")
34338 (set_attr "mode" "<MODE>")])
34339 @@ -3172,6 +3663,28 @@
34340 [(set_attr "type" "store")
34341 (set_attr "mode" "<MODE>")])
34342
34343 +;; Unaligned load and store patterns.
34344 +
34345 +(define_insn "mov_u<load>"
34346 + [(set (match_operand:GPR 0 "register_operand" "=d")
34347 + (unspec:GPR [(match_operand:BLK 1 "memory_operand" "m")
34348 + (match_operand:QI 2 "memory_operand" "m")]
34349 + UNSPEC_UNALIGNED_LOAD))]
34350 + "ISA_HAS_UL_US && mips_mem_fits_mode_p (<MODE>mode, operands[1])"
34351 + "u<load>\t%0,%2"
34352 + [(set_attr "type" "load")
34353 + (set_attr "mode" "<MODE>")])
34354 +
34355 +(define_insn "mov_u<store>"
34356 + [(set (match_operand:BLK 0 "memory_operand" "=m")
34357 + (unspec:BLK [(match_operand:GPR 1 "reg_or_0_operand" "dJ")
34358 + (match_operand:QI 2 "memory_operand" "m")]
34359 + UNSPEC_UNALIGNED_STORE))]
34360 + "ISA_HAS_UL_US && mips_mem_fits_mode_p (<MODE>mode, operands[0])"
34361 + "u<store>\t%z1,%2"
34362 + [(set_attr "type" "store")
34363 + (set_attr "mode" "<MODE>")])
34364 +
34365 ;; An instruction to calculate the high part of a 64-bit SYMBOL_ABSOLUTE.
34366 ;; The required value is:
34367 ;;
34368 @@ -3497,6 +4010,26 @@
34369 (const_string "*")
34370 (const_string "*")])])
34371
34372 +;; Truncate to QI in two steps. Combine should probably canonicalize
34373 +;; this to just one truncate:QI.
34374 +
34375 +(define_insn "*truncsi_storeqi"
34376 + [(set (match_operand:QI 0 "memory_operand" "=m")
34377 + (subreg:QI
34378 + (truncate:SI (match_operand:DI 1 "register_operand" "d")) 3))]
34379 + "TARGET_64BIT && !TARGET_MIPS16 && TARGET_BIG_ENDIAN"
34380 + "sb\t%z1,%0"
34381 + [(set_attr "type" "store")
34382 + (set_attr "mode" "QI")])
34383 +
34384 +(define_insn "*truncsi_storehi"
34385 + [(set (match_operand:HI 0 "memory_operand" "=m")
34386 + (subreg:HI
34387 + (truncate:SI (match_operand:DI 1 "register_operand" "d")) 2))]
34388 + "TARGET_64BIT && !TARGET_MIPS16 && TARGET_BIG_ENDIAN"
34389 + "sh\t%z1,%0"
34390 + [(set_attr "type" "store")
34391 + (set_attr "mode" "HI")])
34392
34393 ;; On the mips16, we can split ld $r,N($r) into an add and a load,
34394 ;; when the original load is a 4 byte instruction but the add and the
34395 @@ -4270,6 +4803,22 @@
34396 [(set (match_operand:P 0 "register_operand" "=d")
34397 (const:P (unspec:P [(const_int 0)] UNSPEC_GP)))])
34398
34399 +;; Move the constant value of __gnu_local_gp (operand 1) into
34400 +;; operand 0, for non-PIC abicalls code. All uses of the result
34401 +;; are explicit, so there's no need for unspec_volatile here.
34402 +(define_insn_and_split "loadgp_nonpic"
34403 + [(set (match_operand 0 "register_operand" "=d")
34404 + (const (unspec [(match_operand 1 "" "")] UNSPEC_LOADGP)))]
34405 + "TARGET_ABICALLS && !flag_pic"
34406 + "#"
34407 + ""
34408 + [(const_int 0)]
34409 +{
34410 + mips_emit_move (operands[0], operands[1]);
34411 + DONE;
34412 +}
34413 + [(set_attr "length" "8")])
34414 +
34415 ;; Insn to initialize $gp for n32/n64 abicalls. Operand 0 is the offset
34416 ;; of _gp from the start of this function. Operand 1 is the incoming
34417 ;; function address.
34418 @@ -4820,7 +5369,7 @@
34419 (define_insn_and_split ""
34420 [(set (match_operand:SI 0 "register_operand" "=d")
34421 (lshiftrt:SI (match_operand:SI 1 "memory_operand" "m")
34422 - (match_operand:SI 2 "immediate_operand" "I")))]
34423 + (match_operand:SI 2 "const_int_operand" "")))]
34424 "TARGET_MIPS16"
34425 "#"
34426 ""
34427 @@ -4997,6 +5546,96 @@
34428 [(set_attr "type" "branch")
34429 (set_attr "mode" "none")])
34430
34431 +;; Conditional branch on whether a bit is set or clear.
34432 +
34433 +(define_insn "*branch_bit<mode>"
34434 + [(set (pc)
34435 + (if_then_else
34436 + (match_operator 0 "equality_operator"
34437 + [(zero_extract:GPR
34438 + (match_operand:GPR 2 "register_operand" "d")
34439 + (const_int 1)
34440 + (match_operand 3 "const_int_operand" ""))
34441 + (const_int 0)])
34442 + (label_ref (match_operand 1 "" ""))
34443 + (pc)))]
34444 + "ISA_HAS_BBIT"
34445 +{
34446 + return mips_output_conditional_branch (insn, operands,
34447 + MIPS_BRANCH ("b%G0", "%2,%3,%1"),
34448 + MIPS_BRANCH ("b%H0", "%2,%3,%1"));
34449 +}
34450 + [(set_attr "type" "branch")
34451 + (set_attr "branch_without_likely" "yes")
34452 + (set_attr "mode" "none")])
34453 +
34454 +(define_insn "*branch_bit_truncdi<mode>"
34455 + [(set (pc)
34456 + (if_then_else
34457 + (match_operator 0 "equality_operator"
34458 + [(zero_extract:DI
34459 + (subreg:DI
34460 + (truncate:SUBDI
34461 + (match_operand:DI 2 "register_operand" "d")) 0)
34462 + (const_int 1)
34463 + (match_operand 3 "const_int_operand" ""))
34464 + (const_int 0)])
34465 + (label_ref (match_operand 1 "" ""))
34466 + (pc)))]
34467 + "TARGET_64BIT && ISA_HAS_BBIT"
34468 +{
34469 + return mips_output_conditional_branch (insn, operands,
34470 + MIPS_BRANCH ("b%G0", "%2,%3,%1"),
34471 + MIPS_BRANCH ("b%H0", "%2,%3,%1"));
34472 +}
34473 + [(set_attr "type" "branch")
34474 + (set_attr "branch_without_likely" "yes")
34475 + (set_attr "mode" "none")])
34476 +
34477 +(define_insn "*branch_bit<mode>_inverted"
34478 + [(set (pc)
34479 + (if_then_else
34480 + (match_operator 0 "equality_operator"
34481 + [(zero_extract:GPR
34482 + (match_operand:GPR 2 "register_operand" "d")
34483 + (const_int 1)
34484 + (match_operand 3 "const_int_operand" ""))
34485 + (const_int 0)])
34486 + (pc)
34487 + (label_ref (match_operand 1 "" ""))))]
34488 + "ISA_HAS_BBIT"
34489 +{
34490 + return mips_output_conditional_branch (insn, operands,
34491 + MIPS_BRANCH ("b%H0", "%2,%3,%1"),
34492 + MIPS_BRANCH ("b%G0", "%2,%3,%1"));
34493 +}
34494 + [(set_attr "type" "branch")
34495 + (set_attr "branch_without_likely" "yes")
34496 + (set_attr "mode" "none")])
34497 +
34498 +(define_insn "*branch_bit_truncdi<mode>_inverted"
34499 + [(set (pc)
34500 + (if_then_else
34501 + (match_operator 0 "equality_operator"
34502 + [(zero_extract:DI
34503 + (subreg:DI
34504 + (truncate:SUBDI
34505 + (match_operand:DI 2 "register_operand" "d")) 0)
34506 + (const_int 1)
34507 + (match_operand 3 "const_int_operand" ""))
34508 + (const_int 0)])
34509 + (pc)
34510 + (label_ref (match_operand 1 "" ""))))]
34511 + "TARGET_64BIT && ISA_HAS_BBIT"
34512 +{
34513 + return mips_output_conditional_branch (insn, operands,
34514 + MIPS_BRANCH ("b%H0", "%2,%3,%1"),
34515 + MIPS_BRANCH ("b%G0", "%2,%3,%1"));
34516 +}
34517 + [(set_attr "type" "branch")
34518 + (set_attr "branch_without_likely" "yes")
34519 + (set_attr "mode" "none")])
34520 +
34521 ;; MIPS16 branches
34522
34523 (define_insn "*branch_equality<mode>_mips16"
34524 @@ -5065,11 +5704,42 @@
34525 [(set (match_operand:GPR 0 "register_operand" "=d")
34526 (eq:GPR (match_operand:GPR 1 "register_operand" "d")
34527 (const_int 0)))]
34528 - "!TARGET_MIPS16"
34529 + "!TARGET_MIPS16 && !ISA_HAS_SEQ_SNE"
34530 "sltu\t%0,%1,1"
34531 [(set_attr "type" "slt")
34532 (set_attr "mode" "<MODE>")])
34533
34534 +(define_insn "*seq_si_to_di"
34535 + [(set (match_operand:DI 0 "register_operand" "=d")
34536 + (eq:DI (match_operand:SI 1 "register_operand" "d")
34537 + (const_int 0)))]
34538 + "TARGET_64BIT && !TARGET_MIPS16 && !ISA_HAS_SEQ_SNE"
34539 + "sltu\t%0,%1,1"
34540 + [(set_attr "type" "slt")
34541 + (set_attr "mode" "DI")])
34542 +
34543 +(define_insn "*s<code>_<mode>_s<code>"
34544 + [(set (match_operand:GPR 0 "register_operand" "=d,d")
34545 + (equality_op:GPR (match_operand:GPR 1 "register_operand" "%d,d")
34546 + (match_operand:GPR 2 "reg_imm10_operand" "d,YB")))]
34547 + "ISA_HAS_SEQ_SNE"
34548 + "@
34549 + s<code>\\t%0,%1,%2
34550 + s<code>i\\t%0,%1,%2"
34551 + [(set_attr "type" "arith")
34552 + (set_attr "mode" "<MODE>")])
34553 +
34554 +(define_insn "*s<code>_si_to_di_s<code>"
34555 + [(set (match_operand:DI 0 "register_operand" "=d,d")
34556 + (equality_op:DI (match_operand:SI 1 "register_operand" "%d,d")
34557 + (match_operand:SI 2 "reg_imm10_operand" "d,YB")))]
34558 + "TARGET_64BIT && ISA_HAS_SEQ_SNE"
34559 + "@
34560 + s<code>\\t%0,%1,%2
34561 + s<code>i\\t%0,%1,%2"
34562 + [(set_attr "type" "arith")
34563 + (set_attr "mode" "SI")])
34564 +
34565 (define_insn "*seq_<mode>_mips16"
34566 [(set (match_operand:GPR 0 "register_operand" "=t")
34567 (eq:GPR (match_operand:GPR 1 "register_operand" "d")
34568 @@ -5079,6 +5749,15 @@
34569 [(set_attr "type" "slt")
34570 (set_attr "mode" "<MODE>")])
34571
34572 +(define_insn "*seq_si_to_di_mips16"
34573 + [(set (match_operand:DI 0 "register_operand" "=d")
34574 + (eq:DI (match_operand:SI 1 "register_operand" "d")
34575 + (const_int 0)))]
34576 + "TARGET_64BIT && TARGET_MIPS16"
34577 + "sltu\t%1,1"
34578 + [(set_attr "type" "slt")
34579 + (set_attr "mode" "DI")])
34580 +
34581 ;; "sne" uses sltu instructions in which the first operand is $0.
34582 ;; This isn't possible in mips16 code.
34583
34584 @@ -5093,11 +5772,20 @@
34585 [(set (match_operand:GPR 0 "register_operand" "=d")
34586 (ne:GPR (match_operand:GPR 1 "register_operand" "d")
34587 (const_int 0)))]
34588 - "!TARGET_MIPS16"
34589 + "!TARGET_MIPS16 && !ISA_HAS_SEQ_SNE"
34590 "sltu\t%0,%.,%1"
34591 [(set_attr "type" "slt")
34592 (set_attr "mode" "<MODE>")])
34593
34594 +(define_insn "*sne_si_to_di"
34595 + [(set (match_operand:DI 0 "register_operand" "=d")
34596 + (ne:DI (match_operand:SI 1 "register_operand" "d")
34597 + (const_int 0)))]
34598 + "TARGET_64BIT && !TARGET_MIPS16 && !ISA_HAS_SEQ_SNE"
34599 + "sltu\t%0,%.,%1"
34600 + [(set_attr "type" "slt")
34601 + (set_attr "mode" "DI")])
34602 +
34603 (define_expand "sgt"
34604 [(set (match_operand:SI 0 "register_operand")
34605 (gt:SI (match_dup 1)
34606 @@ -5353,6 +6041,26 @@
34607 return "%*b\t%l0%/";
34608 else
34609 {
34610 + if (final_sequence && (mips_abi == ABI_32 || mips_abi == ABI_O64))
34611 + {
34612 + /* If the delay slot contains a $gp restore, we need to
34613 + do that first, because we need it for the load
34614 + label. Other ABIs do not have caller-save $gp. */
34615 + rtx next = NEXT_INSN (insn);
34616 + if (INSN_P (next) && !INSN_DELETED_P (next))
34617 + {
34618 + rtx pat = PATTERN (next);
34619 + if (GET_CODE (pat) == SET
34620 + && REG_P (SET_DEST (pat))
34621 + && REGNO (SET_DEST (pat)) == PIC_OFFSET_TABLE_REGNUM)
34622 + {
34623 + rtx ops[2];
34624 + ops[0] = SET_DEST (pat);
34625 + ops[1] = SET_SRC (pat);
34626 + output_asm_insn (mips_output_move (ops[0], ops[1]), ops);
34627 + }
34628 + }
34629 + }
34630 output_asm_insn (mips_output_load_label (), operands);
34631 return "%*jr\t%@%/%]";
34632 }
34633 @@ -5371,7 +6079,13 @@
34634 (lt (abs (minus (match_dup 0)
34635 (plus (pc) (const_int 4))))
34636 (const_int 131072)))
34637 - (const_int 4) (const_int 16)))])
34638 + (const_int 4)
34639 + (if_then_else
34640 + ;; for these two ABIs we may need to move a restore of $gp
34641 + (ior (eq (symbol_ref "mips_abi") (symbol_ref "ABI_32"))
34642 + (eq (symbol_ref "mips_abi") (symbol_ref "ABI_O64")))
34643 + (const_int 20)
34644 + (const_int 16))))])
34645
34646 ;; We need a different insn for the mips16, because a mips16 branch
34647 ;; does not have a delay slot.
34648 @@ -5462,11 +6176,12 @@
34649
34650 ;; Restore the gp that we saved above. Despite the earlier comment, it seems
34651 ;; that older code did recalculate the gp from $25. Continue to jump through
34652 -;; $25 for compatibility (we lose nothing by doing so).
34653 +;; $25 for compatibility (we lose nothing by doing so). Similarly restore
34654 +;; $gp if we might be jumping to code which expects that.
34655
34656 (define_expand "builtin_longjmp"
34657 [(use (match_operand 0 "register_operand"))]
34658 - "TARGET_USE_GOT"
34659 + "TARGET_USE_GOT || TARGET_ABICALLS"
34660 {
34661 /* The elements of the buffer are, in order: */
34662 int W = GET_MODE_SIZE (Pmode);
34663 --- a/gcc/config/mips/mips.opt
34664 +++ b/gcc/config/mips/mips.opt
34665 @@ -124,6 +124,10 @@ mfix-vr4130
34666 Target Report Var(TARGET_FIX_VR4130)
34667 Work around VR4130 mflo/mfhi errata
34668
34669 +mfix-ice9a
34670 +Target Report Var(TARGET_FIX_ICE9A)
34671 +Work around SiCortex ICE9A errata
34672 +
34673 mfix4300
34674 Target Report Var(TARGET_4300_MUL_FIX)
34675 Work around an early 4300 hardware bug
34676 @@ -176,6 +180,10 @@ mips16
34677 Target Report RejectNegative Mask(MIPS16)
34678 Generate MIPS16 code
34679
34680 +mips16e
34681 +Target Report RejectNegative Mask(MIPS16) MaskExists
34682 +Deprecated; alias for -mips16
34683 +
34684 mips3d
34685 Target Report RejectNegative Mask(MIPS3D)
34686 Use MIPS-3D instructions
34687 @@ -228,6 +236,10 @@ mno-mips3d
34688 Target Report RejectNegative InverseMask(MIPS3D)
34689 Do not use MIPS-3D instructions
34690
34691 +mocteon-useun
34692 +Target Report Mask(OCTEON_UNALIGNED)
34693 +Use Octeon-specific unaligned loads/stores for 32/64-bit data
34694 +
34695 mpaired-single
34696 Target Report Mask(PAIRED_SINGLE_FLOAT)
34697 Use paired-single floating-point instructions
34698 @@ -260,6 +272,10 @@ mtune=
34699 Target RejectNegative Joined Var(mips_tune_string)
34700 -mtune=PROCESSOR Optimize the output for PROCESSOR
34701
34702 +muclibc
34703 +Target RejectNegative Var(building_for_uclibc)
34704 +Building with -muclibc
34705 +
34706 muninit-const-in-rodata
34707 Target Report Var(TARGET_UNINIT_CONST_IN_RODATA)
34708 Put uninitialized constants in ROM (needs -membedded-data)
34709 @@ -268,6 +284,10 @@ mvr4130-align
34710 Target Report Mask(VR4130_ALIGN)
34711 Perform VR4130-specific alignment optimizations
34712
34713 +mwarn-framesize=
34714 +Target RejectNegative Joined
34715 +Warn if a single function's framesize exceeds the given framesize
34716 +
34717 mxgot
34718 Target Report Var(TARGET_XGOT)
34719 Lift restrictions on GOT size
34720 --- /dev/null
34721 +++ b/gcc/config/mips/montavista-linux.h
34722 @@ -0,0 +1,54 @@
34723 +/* MontaVista GNU/Linux Configuration.
34724 + Copyright (C) 2009
34725 + Free Software Foundation, Inc.
34726 +
34727 +This file is part of GCC.
34728 +
34729 +GCC is free software; you can redistribute it and/or modify
34730 +it under the terms of the GNU General Public License as published by
34731 +the Free Software Foundation; either version 3, or (at your option)
34732 +any later version.
34733 +
34734 +GCC is distributed in the hope that it will be useful,
34735 +but WITHOUT ANY WARRANTY; without even the implied warranty of
34736 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34737 +GNU General Public License for more details.
34738 +
34739 +You should have received a copy of the GNU General Public License
34740 +along with GCC; see the file COPYING3. If not see
34741 +<http://www.gnu.org/licenses/>. */
34742 +
34743 +/* Override linux64.h to default to O32. */
34744 +#undef SUBTARGET_SELF_SPECS
34745 +#define SUBTARGET_SELF_SPECS \
34746 +NO_SHARED_SPECS, \
34747 +"%{!EB:%{!EL:%(endian_spec)}}", \
34748 +"%{!mabi=*: -mabi=32}"
34749 +
34750 +/* We do not need to provide an explicit big-endian multilib. */
34751 +#undef MULTILIB_DEFAULTS
34752 +#define MULTILIB_DEFAULTS \
34753 + { "meb", "mabi=32" }
34754 +
34755 +/* The various C libraries each have their own subdirectory. */
34756 +#undef SYSROOT_SUFFIX_SPEC
34757 +#define SYSROOT_SUFFIX_SPEC \
34758 + "%{mel:%{msoft-float:/mel/soft-float ; \
34759 + :/mel} ; \
34760 + msoft-float:/soft-float}"
34761 +
34762 +/* MULTILIB_OSDIRNAMES provides directory names used in two ways:
34763 + relative to $target/lib/ in the GCC installation, and relative to
34764 + lib/ and usr/lib/ in a sysroot. For the latter, we want names such
34765 + as plain ../lib64, but these cannot be used outside the sysroot
34766 + because different multilibs would be mapped to the same directory.
34767 + Directories are searched both with and without the multilib suffix,
34768 + so it suffices if the directory without the suffix is correct
34769 + within the sysroot while the directory with the suffix doesn't
34770 + exist. We use STARTFILE_PREFIX_SPEC to achieve the desired
34771 + effect. */
34772 +#undef STARTFILE_PREFIX_SPEC
34773 +#define STARTFILE_PREFIX_SPEC \
34774 + "%{mabi=32: /usr/local/lib/ /lib/ /usr/lib/} \
34775 + %{mabi=n32: /usr/local/lib32/ /lib32/ /usr/lib32/} \
34776 + %{mabi=64: /usr/local/lib64/ /lib64/ /usr/lib64/}"
34777 --- /dev/null
34778 +++ b/gcc/config/mips/octeon-elf-unwind.h
34779 @@ -0,0 +1,57 @@
34780 +/* Stack unwinding support through the first exception frame.
34781 + Copyright (C) 2007 Cavium Networks.
34782 +
34783 +This file is part of GCC.
34784 +
34785 +GCC is free software; you can redistribute it and/or modify
34786 +it under the terms of the GNU General Public License as published by
34787 +the Free Software Foundation; either version 2, or (at your option)
34788 +any later version.
34789 +
34790 +GCC is distributed in the hope that it will be useful,
34791 +but WITHOUT ANY WARRANTY; without even the implied warranty of
34792 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34793 +GNU General Public License for more details.
34794 +
34795 +You should have received a copy of the GNU General Public License
34796 +along with GCC; see the file COPYING. If not, write to
34797 +the Free Software Foundation, 51 Franklin Street, Fifth Floor,
34798 +Boston, MA 02110-1301, USA. */
34799 +
34800 +#define MD_FALLBACK_FRAME_STATE_FOR octeon_elf_fallback_frame_state
34801 +
34802 +/* Check whether this is the cvmx_interrupt_stage2 frame. If the
34803 + function call was dispatched via k0 assume we are in
34804 + cvmx_interrupt_stage2. In this case the sp in point to the saved
34805 + register array. */
34806 +
34807 +static _Unwind_Reason_Code
34808 +octeon_elf_fallback_frame_state (struct _Unwind_Context *context,
34809 + _Unwind_FrameState *fs)
34810 +{
34811 + unsigned i;
34812 + unsigned *pc = context->ra;
34813 +
34814 + /* Look for "jalr k0". */
34815 + if (pc[-2] != 0x0340f809)
34816 + return _URC_END_OF_STACK;
34817 +
34818 + for (i = 0; i < 32; i++)
34819 + {
34820 + fs->regs.reg[i].how = REG_SAVED_OFFSET;
34821 + fs->regs.reg[i].loc.offset = 8 * i;
34822 + }
34823 +
34824 + /* Keep the next frame's sp. This way we have a CFA that points
34825 + exactly to the register array. */
34826 + fs->regs.cfa_how = CFA_REG_OFFSET;
34827 + fs->regs.cfa_reg = STACK_POINTER_REGNUM;
34828 + fs->regs.cfa_offset = 0;
34829 +
34830 + /* DEPC is saved as the 35. register. */
34831 + fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].how = REG_SAVED_OFFSET;
34832 + fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].loc.offset = 8 * 35;
34833 + fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN;
34834 +
34835 + return _URC_NO_REASON;
34836 +}
34837 --- /dev/null
34838 +++ b/gcc/config/mips/octeon-elf.h
34839 @@ -0,0 +1,98 @@
34840 +/* Macros for mips*-octeon-elf target.
34841 + Copyright (C) 2004, 2005, 2006 Cavium Networks.
34842 +
34843 +This file is part of GCC.
34844 +
34845 +GCC is free software; you can redistribute it and/or modify
34846 +it under the terms of the GNU General Public License as published by
34847 +the Free Software Foundation; either version 2, or (at your option)
34848 +any later version.
34849 +
34850 +GCC is distributed in the hope that it will be useful,
34851 +but WITHOUT ANY WARRANTY; without even the implied warranty of
34852 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34853 +GNU General Public License for more details.
34854 +
34855 +You should have received a copy of the GNU General Public License
34856 +along with GCC; see the file COPYING. If not, write to
34857 +the Free Software Foundation, 51 Franklin Street, Fifth Floor,
34858 +Boston, MA 02110-1301, USA. */
34859 +
34860 +/* Add MASK_SOFT_FLOAT and MASK_OCTEON_UNALIGNED. */
34861 +
34862 +#undef TARGET_DEFAULT
34863 +#define TARGET_DEFAULT (MASK_SOFT_FLOAT_ABI | MASK_OCTEON_UNALIGNED)
34864 +
34865 +/* Forward -m*octeon-useun. */
34866 +
34867 +#undef SUBTARGET_ASM_SPEC
34868 +#define SUBTARGET_ASM_SPEC "%{mno-octeon-useun} %{!mno-octeon-useun:-mocteon-useun}"
34869 +
34870 +/* Enable backtrace including on machine exceptions by default. */
34871 +
34872 +#undef SUBTARGET_CC1_SPEC
34873 +#define SUBTARGET_CC1_SPEC "%{!fno-asynchronous-unwind-tables:-fasynchronous-unwind-tables}"
34874 +
34875 +/* Without ASM_PREFERRED_EH_DATA_FORMAT, output_call_frame_info emits
34876 + pointer-sized addresses for FDE addresses. For 64-bit targets, it does
34877 + it without properly "switching over" to 64-bit as described in the DWARF3
34878 + spec. GDB can fall back on .eh_frames and misinterpret FDE addresses.
34879 + Instead let's be explicit and use augmentation to describe the encoding if
34880 + pointer size is 64. */
34881 +
34882 +#undef ASM_PREFERRED_EH_DATA_FORMAT
34883 +#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
34884 + ((CODE) == 1 && POINTER_SIZE == 64 \
34885 + ? (ABI_HAS_64BIT_SYMBOLS ? DW_EH_PE_udata8 : DW_EH_PE_udata4) \
34886 + : DW_EH_PE_absptr)
34887 +
34888 +/* Link to libc library. */
34889 +
34890 +#undef LIB_SPEC
34891 +#define LIB_SPEC "-lc"
34892 +
34893 +/* Link to startup file. */
34894 +
34895 +#undef STARTFILE_SPEC
34896 +#define STARTFILE_SPEC "crti%O%s crtbegin%O%s crt0%O%s"
34897 +
34898 +/* Default our test-only n64 configuration to -G0 since that is what
34899 + the kernel uses. */
34900 +
34901 +#undef SUBTARGET_SELF_SPECS
34902 +#define SUBTARGET_SELF_SPECS \
34903 +"%{mabi=64:%{!G*: -G0}}"
34904 +
34905 +/* Pass linker emulation mode for N32. */
34906 +
34907 +#undef LINK_SPEC
34908 +#define LINK_SPEC "\
34909 +%(endian_spec) \
34910 +%{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips32r2} %{mips64} \
34911 +%{mips64r2} %{bestGnum} %{shared} %{non_shared} \
34912 +%{mabi=n32:-melf32e%{!EL:b}%{EL:l}octeonn32} \
34913 +%{mabi=64:-melf64e%{!EL:b}%{EL:l}octeon}"
34914 +
34915 +/* Override because of N32. */
34916 +
34917 +#undef LOCAL_LABEL_PREFIX
34918 +#define LOCAL_LABEL_PREFIX ((mips_abi == ABI_N32) ? "." : "$")
34919 +
34920 +/* Append the core number to the GCOV filename FN. */
34921 +
34922 +#define GCOV_TARGET_SUFFIX_LENGTH 2
34923 +#define ADD_GCOV_TARGET_SUFFIX(FN) \
34924 +do \
34925 + { \
34926 + char *fn = FN; \
34927 + int core; \
34928 + char s[3]; \
34929 + \
34930 + asm ("rdhwr %0, $0" : "=r"(core)); \
34931 + sprintf (s, "%d", core); \
34932 + strcat (fn, s); \
34933 + } \
34934 +while (0)
34935 +
34936 +/* Code to unwind through the exception frame. */
34937 +#define MD_UNWIND_SUPPORT "config/mips/octeon-elf-unwind.h"
34938 --- /dev/null
34939 +++ b/gcc/config/mips/octeon.h
34940 @@ -0,0 +1,68 @@
34941 +/* Macros for mips*-octeon-* target.
34942 + Copyright (C) 2004, 2005, 2006 Cavium Networks.
34943 +
34944 +This file is part of GCC.
34945 +
34946 +GCC is free software; you can redistribute it and/or modify
34947 +it under the terms of the GNU General Public License as published by
34948 +the Free Software Foundation; either version 2, or (at your option)
34949 +any later version.
34950 +
34951 +GCC is distributed in the hope that it will be useful,
34952 +but WITHOUT ANY WARRANTY; without even the implied warranty of
34953 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34954 +GNU General Public License for more details.
34955 +
34956 +You should have received a copy of the GNU General Public License
34957 +along with GCC; see the file COPYING. If not, write to
34958 +the Free Software Foundation, 51 Franklin Street, Fifth Floor,
34959 +Boston, MA 02110-1301, USA. */
34960 +
34961 +#define CVMX_SHARED_BSS_FLAGS (SECTION_WRITE | SECTION_BSS)
34962 +
34963 +#undef TARGET_ASM_SELECT_SECTION
34964 +#define TARGET_ASM_SELECT_SECTION octeon_select_section
34965 +
34966 +#undef TARGET_ASM_UNIQUE_SECTION
34967 +#define TARGET_ASM_UNIQUE_SECTION octeon_unique_section
34968 +
34969 +/* Implement ASM_OUTPUT_ALIGNED_DECL_LOCAL. This differs from the
34970 + generic version only in the use of cvmx_shared attribute. */
34971 +
34972 +#undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
34973 +#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGN) \
34974 + do \
34975 + { \
34976 + if ((DECL) && TREE_CODE ((DECL)) == VAR_DECL \
34977 + && lookup_attribute ("cvmx_shared", DECL_ATTRIBUTES (DECL))) \
34978 + { \
34979 + fprintf ((STREAM), "%s", LOCAL_ASM_OP); \
34980 + assemble_name ((STREAM), (NAME)); \
34981 + fprintf ((STREAM), "\n"); \
34982 + octeon_output_shared_variable ((STREAM), (DECL), (NAME), \
34983 + (SIZE), (ALIGN)); \
34984 + } \
34985 + else \
34986 + ASM_OUTPUT_ALIGNED_LOCAL (STREAM, NAME, SIZE, ALIGN); \
34987 + } \
34988 + while (0)
34989 +
34990 +\f
34991 +/* Implement ASM_OUTPUT_ALIGNED_DECL_COMMON. This differs from the mips
34992 + version only in the use of cvmx_shared attribute. */
34993 +
34994 +#undef ASM_OUTPUT_ALIGNED_DECL_COMMON
34995 +#define ASM_OUTPUT_ALIGNED_DECL_COMMON(STREAM, DECL, NAME, SIZE, ALIGN) \
34996 + { \
34997 + if (TREE_CODE ((DECL)) == VAR_DECL \
34998 + && lookup_attribute ("cvmx_shared", DECL_ATTRIBUTES ((DECL)))) \
34999 + { \
35000 + if (TREE_PUBLIC ((DECL)) && DECL_NAME ((DECL))) \
35001 + targetm.asm_out.globalize_label (asm_out_file, (NAME)); \
35002 + octeon_output_shared_variable ((STREAM), (DECL), (NAME), \
35003 + (SIZE), (ALIGN)); \
35004 + } \
35005 + else \
35006 + mips_output_aligned_decl_common ((STREAM), (DECL), (NAME), (SIZE), \
35007 + (ALIGN)); \
35008 + }
35009 --- /dev/null
35010 +++ b/gcc/config/mips/octeon.md
35011 @@ -0,0 +1,85 @@
35012 +;; Octeon pipeline description.
35013 +;; Copyright (C) 2004, 2005, 2006 Cavium Networks.
35014 +;;
35015 +;; This file is part of GCC.
35016 +
35017 +;; GCC is free software; you can redistribute it and/or modify it
35018 +;; under the terms of the GNU General Public License as published
35019 +;; by the Free Software Foundation; either version 2, or (at your
35020 +;; option) any later version.
35021 +
35022 +;; GCC is distributed in the hope that it will be useful, but WITHOUT
35023 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
35024 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
35025 +;; License for more details.
35026 +
35027 +;; You should have received a copy of the GNU General Public License
35028 +;; along with GCC; see the file COPYING. If not, write to the
35029 +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
35030 +;; MA 02110-1301, USA.
35031 +
35032 +;; The OCTEON is a dual-issue processor that can bundle instructions as:
35033 +;; {arith|imul(3)|idiv|*hilo|condmove|load|store|branch|jump|xfer}
35034 +;; {arith|imul(3)|idiv|*hilo|condmove}
35035 +
35036 +(define_automaton "octeon")
35037 +
35038 +(define_cpu_unit "octeon_pipe0" "octeon")
35039 +(define_cpu_unit "octeon_pipe1" "octeon")
35040 +(define_cpu_unit "octeon_mult" "octeon")
35041 +
35042 +(define_insn_reservation "octeon_arith" 1
35043 + (and (eq_attr "cpu" "octeon")
35044 + (eq_attr "type" "arith,const,shift,slt,nop,logical,signext,move"))
35045 + "octeon_pipe0 | octeon_pipe1")
35046 +
35047 +(define_insn_reservation "octeon_condmove" 2
35048 + (and (eq_attr "cpu" "octeon")
35049 + (eq_attr "type" "condmove"))
35050 + "octeon_pipe0 | octeon_pipe1")
35051 +
35052 +;; ??? Unaligned accesses take longer. We will need to differentiate
35053 +;; between the two.
35054 +
35055 +(define_insn_reservation "octeon_pipe0" 2
35056 + (and (eq_attr "cpu" "octeon")
35057 + (eq_attr "type" "load,store,prefetch,mfc,mtc"))
35058 + "octeon_pipe0")
35059 +
35060 +(define_insn_reservation "octeon_brj" 1
35061 + (and (eq_attr "cpu" "octeon")
35062 + (eq_attr "type" "branch,jump,call,trap"))
35063 + "octeon_pipe0")
35064 +
35065 +(define_insn_reservation "octeon_imul3" 5
35066 + (and (eq_attr "cpu" "octeon")
35067 + (eq_attr "type" "imul3,pop,clz"))
35068 + "(octeon_pipe0 | octeon_pipe1) + octeon_mult")
35069 +
35070 +(define_insn_reservation "octeon_imul" 2
35071 + (and (eq_attr "cpu" "octeon")
35072 + (eq_attr "type" "imul,mthilo"))
35073 + "(octeon_pipe0 | octeon_pipe1) + octeon_mult, octeon_mult")
35074 +
35075 +(define_insn_reservation "octeon_mfhilo" 5
35076 + (and (eq_attr "cpu" "octeon")
35077 + (eq_attr "type" "mfhilo"))
35078 + "(octeon_pipe0 | octeon_pipe1) + octeon_mult")
35079 +
35080 +(define_insn_reservation "octeon_imadd" 4
35081 + (and (eq_attr "cpu" "octeon")
35082 + (eq_attr "type" "imadd"))
35083 + "(octeon_pipe0 | octeon_pipe1) + octeon_mult, (octeon_mult * 3)")
35084 +
35085 +(define_insn_reservation "octeon_idiv" 72
35086 + (and (eq_attr "cpu" "octeon")
35087 + (eq_attr "type" "idiv"))
35088 + "(octeon_pipe0 | octeon_pipe1) + octeon_mult, (octeon_mult * 71)")
35089 +
35090 +;; Assume both pipes are needed for unknown and multiple-instruction
35091 +;; patterns.
35092 +
35093 +(define_insn_reservation "octeon_unknown" 1
35094 + (and (eq_attr "cpu" "octeon")
35095 + (eq_attr "type" "unknown,multi"))
35096 + "octeon_pipe0 + octeon_pipe1")
35097 --- a/gcc/config/mips/predicates.md
35098 +++ b/gcc/config/mips/predicates.md
35099 @@ -105,11 +105,15 @@
35100 /* We can only use direct calls for TARGET_ABSOLUTE_ABICALLS if we
35101 are sure that the target function does not need $25 to be live
35102 on entry. This is true for any locally-defined function because
35103 - any such function will use %hi/%lo accesses to set up $gp. */
35104 + any such function will use %hi/%lo accesses to set up $gp.
35105 + Alternatively, if PLTs and copy relocations are available, the
35106 + static linker will make sure that $25 is valid on entry to the
35107 + target function. */
35108 if (TARGET_ABSOLUTE_ABICALLS
35109 && !(GET_CODE (op) == SYMBOL_REF
35110 && SYMBOL_REF_DECL (op)
35111 - && !DECL_EXTERNAL (SYMBOL_REF_DECL (op))))
35112 + && !DECL_EXTERNAL (SYMBOL_REF_DECL (op)))
35113 + && flag_pic)
35114 return false;
35115
35116 /* If -mlong-calls or if this function has an explicit long_call
35117 @@ -209,6 +213,20 @@
35118 }
35119 })
35120
35121 +(define_predicate "mask_low_and_shift_operator"
35122 + (and (match_code "and")
35123 + (match_test "GET_CODE (XEXP (op, 0)) == ASHIFT
35124 + && GET_CODE (XEXP (op, 1)) == CONST_INT
35125 + && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT"))
35126 +{
35127 + int len;
35128 +
35129 + len = mask_low_and_shift_len (GET_MODE (op),
35130 + INTVAL (XEXP (XEXP (op, 0), 1)),
35131 + INTVAL (XEXP (op, 1)));
35132 + return 0 < len && len <= 32;
35133 +})
35134 +
35135 (define_predicate "consttable_operand"
35136 (match_test "CONSTANT_P (op)"))
35137
35138 --- a/gcc/config/mips/sde.h
35139 +++ b/gcc/config/mips/sde.h
35140 @@ -19,7 +19,11 @@ You should have received a copy of the G
35141 along with GCC; see the file COPYING3. If not see
35142 <http://www.gnu.org/licenses/>. */
35143
35144 -#define DRIVER_SELF_SPECS \
35145 +#undef TARGET_MIPS_SDE
35146 +#define TARGET_MIPS_SDE 1
35147 +
35148 +#undef SUBTARGET_SELF_SPECS
35149 +#define SUBTARGET_SELF_SPECS \
35150 /* Make sure a -mips option is present. This helps us to pick \
35151 the right multilib, and also makes the later specs easier \
35152 to write. */ \
35153 @@ -28,6 +32,9 @@ along with GCC; see the file COPYING3.
35154 /* Infer the default float setting from -march. */ \
35155 MIPS_ARCH_FLOAT_SPEC, \
35156 \
35157 + /* Infer the default dsp setting from -march. */ \
35158 + MIPS_ARCH_DSP_SPEC, \
35159 + \
35160 /* If no ABI option is specified, infer one from the ISA level \
35161 or -mgp setting. */ \
35162 "%{!mabi=*: %{" MIPS_32BIT_OPTION_SPEC ": -mabi=32;: -mabi=n32}}", \
35163 @@ -56,7 +63,6 @@ along with GCC; see the file COPYING3.
35164 #undef SUBTARGET_ASM_SPEC
35165 #define SUBTARGET_ASM_SPEC "\
35166 %{!mips1:--trap} \
35167 -%{fPIC|fpic|fPIE|fpie:%{!mips16*:-KPIC}} \
35168 %{mips16:-no-mips16}"
35169
35170 #undef LINK_SPEC
35171 --- a/gcc/config/mips/sdemtk.h
35172 +++ b/gcc/config/mips/sdemtk.h
35173 @@ -19,6 +19,8 @@ You should have received a copy of the G
35174 along with GCC; see the file COPYING3. If not see
35175 <http://www.gnu.org/licenses/>. */
35176
35177 +#define TARGET_MIPS_SDEMTK 1
35178 +
35179 #define TARGET_OS_CPP_BUILTINS() \
35180 do \
35181 { \
35182 @@ -105,3 +107,13 @@ extern void mips_sync_icache (void *beg,
35183 /* ...nor does the call sequence preserve $31. */
35184 #undef MIPS_SAVE_REG_FOR_PROFILING_P
35185 #define MIPS_SAVE_REG_FOR_PROFILING_P(REGNO) ((REGNO) == GP_REG_FIRST + 31)
35186 +
35187 +/* From mips.h, with mno-float option added. */
35188 +
35189 +#undef MIPS_ARCH_FLOAT_SPEC
35190 +#define MIPS_ARCH_FLOAT_SPEC \
35191 + "%{mhard-float|msoft-float|mno-float|march=mips*:; \
35192 + march=vr41*|march=m4k|march=4k*|march=24kc|march=24kec \
35193 + |march=34kc|march=74kc|march=5kc: -msoft-float; \
35194 + march=*: -mhard-float}"
35195 +
35196 --- /dev/null
35197 +++ b/gcc/config/mips/sicortex.h
35198 @@ -0,0 +1,30 @@
35199 +/* SiCortex GNU/Linux Configuration.
35200 + Copyright (C) 2008
35201 + Free Software Foundation, Inc.
35202 +
35203 +This file is part of GCC.
35204 +
35205 +GCC is free software; you can redistribute it and/or modify
35206 +it under the terms of the GNU General Public License as published by
35207 +the Free Software Foundation; either version 3, or (at your option)
35208 +any later version.
35209 +
35210 +GCC is distributed in the hope that it will be useful,
35211 +but WITHOUT ANY WARRANTY; without even the implied warranty of
35212 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35213 +GNU General Public License for more details.
35214 +
35215 +You should have received a copy of the GNU General Public License
35216 +along with GCC; see the file COPYING3. If not see
35217 +<http://www.gnu.org/licenses/>. */
35218 +
35219 +/* Override linux.h default to add __SICORTEX__ define. */
35220 +#undef TARGET_OS_CPP_BUILTINS
35221 +#define TARGET_OS_CPP_BUILTINS() \
35222 + do { \
35223 + LINUX_TARGET_OS_CPP_BUILTINS(); \
35224 + builtin_define ("__SICORTEX__"); \
35225 + /* The GNU C++ standard library requires this. */ \
35226 + if (c_dialect_cxx ()) \
35227 + builtin_define ("_GNU_SOURCE"); \
35228 + } while (0)
35229 --- /dev/null
35230 +++ b/gcc/config/mips/t-crtfm
35231 @@ -0,0 +1,9 @@
35232 +
35233 +EXTRA_MULTILIB_PARTS += crtfastmath.o
35234 +
35235 +EXTRA_PARTS += crtfastmath.o
35236 +
35237 +$(T)crtfastmath.o: $(srcdir)/config/mips/crtfastmath.c $(GCC_PASSES)
35238 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
35239 + -c -o $(T)crtfastmath.o $(srcdir)/config/mips/crtfastmath.c
35240 +
35241 --- /dev/null
35242 +++ b/gcc/config/mips/t-montavista-elf
35243 @@ -0,0 +1,22 @@
35244 +# MontaVista ELF Configuration.
35245 +# Copyright (C) 2009
35246 +# Free Software Foundation, Inc.
35247 +#
35248 +# This file is part of GCC.
35249 +#
35250 +# GCC is free software; you can redistribute it and/or modify
35251 +# it under the terms of the GNU General Public License as published by
35252 +# the Free Software Foundation; either version 3, or (at your option)
35253 +# any later version.
35254 +#
35255 +# GCC is distributed in the hope that it will be useful,
35256 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
35257 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35258 +# GNU General Public License for more details.
35259 +#
35260 +# You should have received a copy of the GNU General Public License
35261 +# along with GCC; see the file COPYING3. If not see
35262 +# <http://www.gnu.org/licenses/>.
35263 +
35264 +MULTILIB_OPTIONS =
35265 +MULTILIB_DIRNAMES =
35266 --- /dev/null
35267 +++ b/gcc/config/mips/t-montavista-linux
35268 @@ -0,0 +1,43 @@
35269 +# MontaVista GNU/Linux Configuration.
35270 +# Copyright (C) 2009
35271 +# Free Software Foundation, Inc.
35272 +#
35273 +# This file is part of GCC.
35274 +#
35275 +# GCC is free software; you can redistribute it and/or modify
35276 +# it under the terms of the GNU General Public License as published by
35277 +# the Free Software Foundation; either version 3, or (at your option)
35278 +# any later version.
35279 +#
35280 +# GCC is distributed in the hope that it will be useful,
35281 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
35282 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35283 +# GNU General Public License for more details.
35284 +#
35285 +# You should have received a copy of the GNU General Public License
35286 +# along with GCC; see the file COPYING3. If not see
35287 +# <http://www.gnu.org/licenses/>.
35288 +
35289 +# Build big-endian and little-endian support libraries.
35290 +MULTILIB_OPTIONS = mel msoft-float march=octeon mabi=n32/mabi=64
35291 +MULTILIB_DIRNAMES = mel soft-float octeon n32 64
35292 +MULTILIB_EXCEPTIONS = *mel*/*mabi=n32* *mel*/*mabi=64*
35293 +MULTILIB_EXCEPTIONS += *mel*/*march=octeon* march=octeon march=octeon/mabi=n32
35294 +MULTILIB_EXCEPTIONS += march=octeon/mabi=64 msoft-float/march=octeon
35295 +
35296 +# These files must be built for each multilib.
35297 +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
35298 +
35299 +# See comment in montavista-linux.h on STARTFILE_PREFIX_SPEC for how the real
35300 +# directories used in the sysroots are determined. These directories
35301 +# are specified so that (a) they are distinct and (b) removing the
35302 +# components that form part of the sysroot suffix leaves the real
35303 +# directory within the sysroot.
35304 +MULTILIB_OSDIRNAMES = msoft-float/mabi.n32=../lib32/soft-float
35305 +MULTILIB_OSDIRNAMES += msoft-float/mabi.64=../lib64/soft-float
35306 +MULTILIB_OSDIRNAMES += msoft-float/march.octeon/mabi.n32=../lib32/soft-float/octeon
35307 +MULTILIB_OSDIRNAMES += msoft-float/march.octeon/mabi.64=../lib64/soft-float/octeon
35308 +MULTILIB_OSDIRNAMES += mel/msoft-float=!mel/soft-float
35309 +MULTILIB_OSDIRNAMES += msoft-float=!soft-float
35310 +MULTILIB_OSDIRNAMES += mabi.64=../lib64
35311 +MULTILIB_OSDIRNAMES += mabi.n32=../lib32
35312 --- /dev/null
35313 +++ b/gcc/config/mips/t-octeon-elf
35314 @@ -0,0 +1,41 @@
35315 +# Don't let CTOR_LIST end up in sdata section.
35316 +
35317 +CRTSTUFF_T_CFLAGS = -G 0 -fno-asynchronous-unwind-tables
35318 +
35319 +# Assemble startup files.
35320 +
35321 +$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES)
35322 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
35323 + -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm
35324 +
35325 +$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES)
35326 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
35327 + -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm
35328 +
35329 +# N32 uses TFmode for long double.
35330 +
35331 +TPBIT = tp-bit.c
35332 +
35333 +tp-bit.c: $(srcdir)/config/fp-bit.c
35334 + echo '#ifdef __MIPSEL__' > tp-bit.c
35335 + echo '# define FLOAT_BIT_ORDER_MISMATCH' >> tp-bit.c
35336 + echo '#endif' >> tp-bit.c
35337 + echo '#if __LDBL_MANT_DIG__ == 113' >> tp-bit.c
35338 + echo '#define QUIET_NAN_NEGATED' >> tp-bit.c
35339 + echo '# define TFLOAT' >> tp-bit.c
35340 + cat $(srcdir)/config/fp-bit.c >> tp-bit.c
35341 + echo '#endif' >> tp-bit.c
35342 +
35343 +# We must build libgcc2.a with -G 0, in case the user wants to link
35344 +# without the $gp register.
35345 +
35346 +TARGET_LIBGCC2_CFLAGS = -G 0
35347 +
35348 +# Build both ABIs.
35349 +
35350 +MULTILIB_OPTIONS = mabi=n32/mabi=eabi/mabi=64
35351 +MULTILIB_DIRNAMES = n32 eabi n64
35352 +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
35353 +
35354 +LIBGCC = stmp-multilib
35355 +INSTALL_LIBGCC = install-multilib
35356 --- a/gcc/config/mips/t-sde
35357 +++ b/gcc/config/mips/t-sde
35358 @@ -10,9 +10,17 @@ $(T)crtn.o: $(srcdir)/config/mips/crtn.a
35359 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
35360 -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm
35361
35362 -MULTILIB_OPTIONS = EL/EB mips32/mips32r2/mips64 mips16 msoft-float/mfp64 mcode-readable=no
35363 +# We must build libgcc2.a with -G 0, in case the user wants to link
35364 +# without the $gp register. Use -fno-optimize-sibling-calls in case
35365 +# we have a mixed mips16/non-mips16 environment where a plain "jump"
35366 +# instuction won't work across the divide (no jx instruction).
35367 +# Compile libraries with -mcode-xonly, so that they are link-compatible
35368 +# with both -mcode-readable=pcrel and -mcode-readable=yes.
35369 +TARGET_LIBGCC2_CFLAGS = -G 0 -fno-optimize-sibling-calls -mcode-xonly
35370 +
35371 +MULTILIB_OPTIONS = EL/EB mips32/mips32r2/mips64 mips16 msoft-float/mfp64 mno-data-in-code
35372 MULTILIB_DIRNAMES = el eb mips32 mips32r2 mips64 mips16 sof f64 spram
35373 -MULTILIB_MATCHES = EL=mel EB=meb
35374 +MULTILIB_MATCHES = EL=mel EB=meb mips16=mips16e
35375
35376 # The -mfp64 option is only valid in conjunction with -mips32r2.
35377 ifneq ($(filter MIPS_ISA_DEFAULT=33,$(tm_defines)),)
35378 --- /dev/null
35379 +++ b/gcc/config/mips/t-sdelib
35380 @@ -0,0 +1,23 @@
35381 +# Override newlib settings in t-sde and set up for building
35382 +# against SDE header files and libraries.
35383 +
35384 +# Remove stdarg.h and stddef.h from USER_H.
35385 +USER_H = $(srcdir)/ginclude/float.h \
35386 + $(srcdir)/ginclude/iso646.h \
35387 + $(srcdir)/ginclude/stdbool.h \
35388 + $(srcdir)/ginclude/varargs.h \
35389 + $(EXTRA_HEADERS)
35390 +
35391 +# Don't run fixinclude
35392 +STMP_FIXINC = stmp-sdefixinc
35393 +stmp-sdefixinc: gsyslimits.h
35394 + rm -rf include; mkdir include
35395 + chmod a+rx include
35396 + rm -f include/syslimits.h
35397 + cp $(srcdir)/gsyslimits.h include/syslimits.h
35398 + chmod a+r include/syslimits.h
35399 + $(STAMP) stmp-sdefixinc
35400 +
35401 +# Don't build FPBIT and DPBIT; we'll be using the SDE soft-float library.
35402 +FPBIT =
35403 +DPBIT =
35404 --- a/gcc/config/mips/t-sdemtk
35405 +++ b/gcc/config/mips/t-sdemtk
35406 @@ -1,26 +1,7 @@
35407 -# Override newlib settings in t-sde and set up for building
35408 -# against SDE header files and libraries.
35409
35410 -MULTILIB_OPTIONS = EL/EB mips32/mips32r2/mips64 mips16 msoft-float/mno-float/mfp64
35411 -MULTILIB_DIRNAMES = el eb mips32 mips32r2 mips64 mips16 sof nof f64
35412 +MULTILIB_OPTIONS = EL/EB mips32/mips32r2/mips64 mips16 fp64/msoft-float/mno-float
35413 +MULTILIB_DIRNAMES = el eb mips32 mips32r2 mips64 mips16 f64 sof nof
35414 +MULTILIB_MATCHES = EL=mel EB=meb
35415 +MULTILIB_EXCLUSIONS = mfp64/!mips32r2 mips16/mips64 mcode-readable=no/!mips16
35416 +MULTILIB_EXCEPTIONS =
35417
35418 -# Remove stdarg.h and stddef.h from USER_H.
35419 -USER_H = $(srcdir)/ginclude/float.h \
35420 - $(srcdir)/ginclude/iso646.h \
35421 - $(srcdir)/ginclude/stdbool.h \
35422 - $(srcdir)/ginclude/varargs.h \
35423 - $(EXTRA_HEADERS)
35424 -
35425 -# Don't run fixinclude
35426 -STMP_FIXINC = stmp-sdefixinc
35427 -stmp-sdefixinc: gsyslimits.h
35428 - rm -rf include; mkdir include
35429 - chmod a+rx include
35430 - rm -f include/syslimits.h
35431 - cp $(srcdir)/gsyslimits.h include/syslimits.h
35432 - chmod a+r include/syslimits.h
35433 - $(STAMP) stmp-sdefixinc
35434 -
35435 -# Don't build FPBIT and DPBIT; we'll be using the SDE soft-float library.
35436 -FPBIT =
35437 -DPBIT =
35438 --- /dev/null
35439 +++ b/gcc/config/mips/t-sgxx-linux
35440 @@ -0,0 +1,11 @@
35441 +MULTILIB_OPTIONS = muclibc march=mips2/march=mips32 msoft-float EL/EB
35442 +MULTILIB_DIRNAMES = uclibc mips2 mips32 soft-float el eb
35443 +MULTILIB_MATCHES := EL=mel EB=meb \
35444 + march?mips2=mips2 march?mips2=mips3 march?mips2=mips4 \
35445 + $(foreach cpu,mips3 mips4 r6000 r4000 vr4100 vr4111 vr4120 vr4130 vr4300 \
35446 + r4400 r4600 orion r4650 r8000 vr5000 vr5400 vr5500 rm7000 \
35447 + rm9000,march?mips2=march?$(cpu)) \
35448 + march?mips32=mips32 \
35449 + $(foreach cpu,4kc 4km 4kp 4ks,march?mips32=march?$(cpu))
35450 +MULTILIB_EXCEPTIONS = *muclibc*/*march?mips2* *muclibc*/*march?mips32*
35451 +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
35452 --- /dev/null
35453 +++ b/gcc/config/mips/t-sgxx-sde
35454 @@ -0,0 +1,7 @@
35455 +# SourceryG++ overrides for SDE builds
35456 +
35457 +MULTILIB_OPTIONS = EL/EB mips16 mfp64/msoft-float/mno-float mcode-readable=no
35458 +MULTILIB_DIRNAMES = el eb mips16 fp64 sof nof spram
35459 +MULTILIB_MATCHES = EL=mel EB=meb mips16=mips16e
35460 +MULTILIB_EXCLUSIONS = mcode-readable=no/!mips16
35461 +MULTILIB_EXCEPTIONS =
35462 --- /dev/null
35463 +++ b/gcc/config/mips/t-sgxxlite-linux
35464 @@ -0,0 +1,5 @@
35465 +MULTILIB_OPTIONS = muclibc msoft-float EL/EB
35466 +MULTILIB_DIRNAMES = uclibc soft-float el eb
35467 +MULTILIB_MATCHES := EL=mel EB=meb
35468 +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
35469 +
35470 --- /dev/null
35471 +++ b/gcc/config/mips/t-sicortex
35472 @@ -0,0 +1,24 @@
35473 +# SiCortex GNU/Linux Configuration.
35474 +# Copyright (C) 2008
35475 +# Free Software Foundation, Inc.
35476 +#
35477 +# This file is part of GCC.
35478 +#
35479 +# GCC is free software; you can redistribute it and/or modify
35480 +# it under the terms of the GNU General Public License as published by
35481 +# the Free Software Foundation; either version 3, or (at your option)
35482 +# any later version.
35483 +#
35484 +# GCC is distributed in the hope that it will be useful,
35485 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
35486 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35487 +# GNU General Public License for more details.
35488 +#
35489 +# You should have received a copy of the GNU General Public License
35490 +# along with GCC; see the file COPYING3. If not see
35491 +# <http://www.gnu.org/licenses/>.
35492 +
35493 +# No O32 libraries for SiCortex.
35494 +MULTILIB_OPTIONS = mabi=n32/mabi=64
35495 +MULTILIB_DIRNAMES = n32 64
35496 +MULTILIB_OSDIRNAMES = ../lib32 ../lib64
35497 --- /dev/null
35498 +++ b/gcc/config/mips/t-wrs-linux
35499 @@ -0,0 +1,50 @@
35500 +# Wind River GNU/Linux Configuration.
35501 +# Copyright (C) 2006, 2007
35502 +# Free Software Foundation, Inc.
35503 +#
35504 +# This file is part of GCC.
35505 +#
35506 +# GCC is free software; you can redistribute it and/or modify
35507 +# it under the terms of the GNU General Public License as published by
35508 +# the Free Software Foundation; either version 3, or (at your option)
35509 +# any later version.
35510 +#
35511 +# GCC is distributed in the hope that it will be useful,
35512 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
35513 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35514 +# GNU General Public License for more details.
35515 +#
35516 +# You should have received a copy of the GNU General Public License
35517 +# along with GCC; see the file COPYING3. If not see
35518 +# <http://www.gnu.org/licenses/>.
35519 +
35520 +# Build big-endian and little-endian support libraries.
35521 +MULTILIB_OPTIONS = muclibc mel mhard-float march=octeon mabi=n32/mabi=64
35522 +MULTILIB_DIRNAMES = uclibc mel hard-float octeon n32 64
35523 +MULTILIB_EXCEPTIONS = *muclibc*/*mhard-float*
35524 +MULTILIB_EXCEPTIONS += *muclibc*/*mabi=n32*
35525 +MULTILIB_EXCEPTIONS += *muclibc*/*mabi=64*
35526 +MULTILIB_EXCEPTIONS += */march=octeon*
35527 +MULTILIB_EXCEPTIONS += march=octeon march=octeon/mabi=32
35528 +MULTILIB_EXCEPTIONS += mel/mabi=n32 mel/mabi=64
35529 +MULTILIB_EXCEPTIONS += mabi=n32
35530 +# These files must be built for each multilib.
35531 +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
35532 +
35533 +# See comment in wrs-linux.h on STARTFILE_PREFIX_SPEC for how the real
35534 +# directories used in the sysroots are determined. These directories
35535 +# are specified so that (a) they are distinct and (b) removing the
35536 +# components that form part of the sysroot suffix leaves the real
35537 +# directory within the sysroot.
35538 +MULTILIB_OSDIRNAMES = mel/mhard-float/mabi.n32=../lib32/mel/hard-float
35539 +MULTILIB_OSDIRNAMES += mel/mhard-float/mabi.64=../lib64/mel/hard-float
35540 +MULTILIB_OSDIRNAMES += mhard-float/mabi.n32=../lib32/hard-float
35541 +MULTILIB_OSDIRNAMES += mhard-float/mabi.64=../lib64/hard-float
35542 +MULTILIB_OSDIRNAMES += mel/mhard-float=!mel/hard-float
35543 +MULTILIB_OSDIRNAMES += mhard-float=!hard-float
35544 +MULTILIB_OSDIRNAMES += mabi.64=../lib64
35545 +MULTILIB_OSDIRNAMES += march.octeon/mabi.n32=../lib32/octeon
35546 +MULTILIB_OSDIRNAMES += march.octeon/mabi.64=../lib64/octeon
35547 +MULTILIB_OSDIRNAMES += muclibc/mel=!uclibc/mel
35548 +MULTILIB_OSDIRNAMES += muclibc=!uclibc
35549 +
35550 --- a/gcc/config/mips/vr.h
35551 +++ b/gcc/config/mips/vr.h
35552 @@ -26,7 +26,7 @@ along with GCC; see the file COPYING3.
35553 MULTILIB_ABI_DEFAULT, \
35554 DEFAULT_VR_ARCH }
35555
35556 -#define DRIVER_SELF_SPECS \
35557 +#define SUBTARGET_SELF_SPECS \
35558 /* Enforce the default architecture. This is mostly for \
35559 the assembler's benefit. */ \
35560 "%{!march=*:%{!mfix-vr4120:%{!mfix-vr4130:" \
35561 --- /dev/null
35562 +++ b/gcc/config/mips/wrs-linux.h
35563 @@ -0,0 +1,63 @@
35564 +/* Wind River GNU/Linux Configuration.
35565 + Copyright (C) 2006, 2007
35566 + Free Software Foundation, Inc.
35567 +
35568 +This file is part of GCC.
35569 +
35570 +GCC is free software; you can redistribute it and/or modify
35571 +it under the terms of the GNU General Public License as published by
35572 +the Free Software Foundation; either version 3, or (at your option)
35573 +any later version.
35574 +
35575 +GCC is distributed in the hope that it will be useful,
35576 +but WITHOUT ANY WARRANTY; without even the implied warranty of
35577 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35578 +GNU General Public License for more details.
35579 +
35580 +You should have received a copy of the GNU General Public License
35581 +along with GCC; see the file COPYING3. If not see
35582 +<http://www.gnu.org/licenses/>. */
35583 +
35584 +/* Override linux64.h to default to O32. */
35585 +#undef SUBTARGET_SELF_SPECS
35586 +#define SUBTARGET_SELF_SPECS \
35587 +NO_SHARED_SPECS, \
35588 +"%{!EB:%{!EL:%(endian_spec)}}", \
35589 +"%{!mabi=*: -mabi=32}"
35590 +
35591 +/* We do not need to provide an explicit big-endian multilib. */
35592 +#undef MULTILIB_DEFAULTS
35593 +#define MULTILIB_DEFAULTS \
35594 + { "meb", "mabi=32" }
35595 +
35596 +/* The GLIBC headers are in /usr/include, relative to the sysroot; the
35597 + uClibc headers are in /uclibc/usr/include. */
35598 +#undef SYSROOT_HEADERS_SUFFIX_SPEC
35599 +#define SYSROOT_HEADERS_SUFFIX_SPEC \
35600 + "%{muclibc:/uclibc}"
35601 +
35602 +/* The various C libraries each have their own subdirectory. */
35603 +#undef SYSROOT_SUFFIX_SPEC
35604 +#define SYSROOT_SUFFIX_SPEC \
35605 + "%{muclibc:%{mel:/uclibc/mel ; \
35606 + :/uclibc} ; \
35607 + mel:%{mhard-float:/mel/hard-float ; \
35608 + :/mel} ; \
35609 + march=octeon:/octeon ; \
35610 + mhard-float:/hard-float}"
35611 +
35612 +/* MULTILIB_OSDIRNAMES provides directory names used in two ways:
35613 + relative to $target/lib/ in the GCC installation, and relative to
35614 + lib/ and usr/lib/ in a sysroot. For the latter, we want names such
35615 + as plain ../lib64, but these cannot be used outside the sysroot
35616 + because different multilibs would be mapped to the same directory.
35617 + Directories are searched both with and without the multilib suffix,
35618 + so it suffices if the directory without the suffix is correct
35619 + within the sysroot while the directory with the suffix doesn't
35620 + exist. We use STARTFILE_PREFIX_SPEC to achieve the desired
35621 + effect. */
35622 +#undef STARTFILE_PREFIX_SPEC
35623 +#define STARTFILE_PREFIX_SPEC \
35624 + "%{mabi=32: /usr/local/lib/ /lib/ /usr/lib/} \
35625 + %{mabi=n32: /usr/local/lib32/ /lib32/ /usr/lib32/} \
35626 + %{mabi=64: /usr/local/lib64/ /lib64/ /usr/lib64/}"
35627 --- /dev/null
35628 +++ b/gcc/config/mips/xlr.md
35629 @@ -0,0 +1,89 @@
35630 +;; DFA-based pipeline description for the XLR.
35631 +;; Copyright (C) 2008 Free Software Foundation, Inc.
35632 +;;
35633 +;; xlr.md Machine Description for the RMI XLR Microprocessor
35634 +;; This file is part of GCC.
35635 +
35636 +;; GCC is free software; you can redistribute it and/or modify it
35637 +;; under the terms of the GNU General Public License as published
35638 +;; by the Free Software Foundation; either version 3, or (at your
35639 +;; option) any later version.
35640 +
35641 +;; GCC is distributed in the hope that it will be useful, but WITHOUT
35642 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
35643 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
35644 +;; License for more details.
35645 +
35646 +;; You should have received a copy of the GNU General Public License
35647 +;; along with GCC; see the file COPYING3. If not see
35648 +;; <http://www.gnu.org/licenses/>.
35649 +
35650 +(define_automaton "xlr_main,xlr_muldiv")
35651 +
35652 +;; Definitions for xlr_main automaton.
35653 +(define_cpu_unit "xlr_main_pipe" "xlr_main")
35654 +
35655 +(define_insn_reservation "ir_xlr_alu_slt" 2
35656 + (and (eq_attr "cpu" "xlr")
35657 + (eq_attr "type" "slt"))
35658 + "xlr_main_pipe")
35659 +
35660 +;; Integer arithmetic instructions.
35661 +(define_insn_reservation "ir_xlr_alu" 1
35662 + (and (eq_attr "cpu" "xlr")
35663 + (eq_attr "type" "move,arith,shift,clz,logical,signext,const,unknown,multi,nop,trap"))
35664 + "xlr_main_pipe")
35665 +
35666 +;; Integer arithmetic instructions.
35667 +(define_insn_reservation "ir_xlr_condmove" 2
35668 + (and (eq_attr "cpu" "xlr")
35669 + (eq_attr "type" "condmove"))
35670 + "xlr_main_pipe")
35671 +
35672 +;; Load/store instructions.
35673 +(define_insn_reservation "ir_xlr_load" 4
35674 + (and (eq_attr "cpu" "xlr")
35675 + (eq_attr "type" "load"))
35676 + "xlr_main_pipe")
35677 +
35678 +(define_insn_reservation "ir_xlr_store" 1
35679 + (and (eq_attr "cpu" "xlr")
35680 + (eq_attr "type" "store"))
35681 + "xlr_main_pipe")
35682 +
35683 +(define_insn_reservation "ir_xlr_prefetch_x" 1
35684 + (and (eq_attr "cpu" "xlr")
35685 + (eq_attr "type" "prefetch,prefetchx"))
35686 + "xlr_main_pipe")
35687 +
35688 +;; Branch instructions - use branch misprediction latency.
35689 +(define_insn_reservation "ir_xlr_branch" 1
35690 + (and (eq_attr "cpu" "xlr")
35691 + (eq_attr "type" "branch,jump,call"))
35692 + "xlr_main_pipe")
35693 +
35694 +;; Coprocessor move instructions.
35695 +(define_insn_reservation "ir_xlr_xfer" 2
35696 + (and (eq_attr "cpu" "xlr")
35697 + (eq_attr "type" "mtc,mfc"))
35698 + "xlr_main_pipe")
35699 +
35700 +(define_bypass 5 "ir_xlr_xfer" "ir_xlr_xfer")
35701 +
35702 +;; Definitions for the xlr_muldiv automaton.
35703 +(define_cpu_unit "xlr_imuldiv_nopipe" "xlr_muldiv")
35704 +
35705 +(define_insn_reservation "ir_xlr_imul" 8
35706 + (and (eq_attr "cpu" "xlr")
35707 + (eq_attr "type" "imul,imul3,imadd"))
35708 + "xlr_main_pipe,xlr_imuldiv_nopipe*6")
35709 +
35710 +(define_insn_reservation "ir_xlr_div" 68
35711 + (and (eq_attr "cpu" "xlr")
35712 + (eq_attr "type" "idiv"))
35713 + "xlr_main_pipe,xlr_imuldiv_nopipe*67")
35714 +
35715 +(define_insn_reservation "xlr_hilo" 2
35716 + (and (eq_attr "cpu" "xlr")
35717 + (eq_attr "type" "mfhilo,mthilo"))
35718 + "xlr_imuldiv_nopipe")
35719 --- /dev/null
35720 +++ b/gcc/config/print-sysroot-suffix.sh
35721 @@ -0,0 +1,107 @@
35722 +#! /bin/sh
35723 +# Script to generate SYSROOT_SUFFIX equivalent to MULTILIB_OSDIRNAMES
35724 +# Arguments are MULTILIB_OSDIRNAMES, MULTILIB_OPTIONS, MULTILIB_MATCHES
35725 +# and MULTILIB_ALIASES.
35726 +
35727 +set -e
35728 +
35729 +dirnames="$1"
35730 +options="$2"
35731 +matches="$3"
35732 +aliases="$4"
35733 +
35734 +cat > print-sysroot-suffix3.sh <<\EOF
35735 +#! /bin/sh
35736 +# Print all the multilib matches for this option
35737 +result="$1"
35738 +EOF
35739 +for x in $matches; do
35740 + l=`echo $x | sed -e 's/=.*$//' -e 's/?/=/g'`
35741 + r=`echo $x | sed -e 's/^.*=//' -e 's/?/=/g'`
35742 + echo "[ \"\$1\" = \"$l\" ] && result=\"\$result|$r\"" >> print-sysroot-suffix3.sh
35743 +done
35744 +echo 'echo $result' >> print-sysroot-suffix3.sh
35745 +chmod +x print-sysroot-suffix3.sh
35746 +
35747 +cat > print-sysroot-suffix2.sh <<\EOF
35748 +#! /bin/sh
35749 +# Recursive script to enumerate all multilib combinations, match against
35750 +# multilib directories and optut a spec string of the result.
35751 +# Will fold identical trees.
35752 +
35753 +padding="$1"
35754 +optstring="$2"
35755 +shift 2
35756 +n="\" \\
35757 +$padding\""
35758 +if [ $# = 0 ]; then
35759 + case $optstring in
35760 +EOF
35761 +for x in $aliases; do
35762 + l=`echo $x | sed -e 's/=.*$//' -e 's/?/=/g'`
35763 + r=`echo $x | sed -e 's/^.*=//' -e 's/?/=/g'`
35764 + echo "/$r/) optstring=\"/$l/\" ;;" >> print-sysroot-suffix2.sh
35765 +done
35766 +echo " esac" >> print-sysroot-suffix2.sh
35767 +
35768 +pat=
35769 +for x in $dirnames; do
35770 + p=`echo $x | sed -e 's,=!,/$=/,'`
35771 + pat="$pat -e 's=^//$p='"
35772 +done
35773 +echo ' optstring=`echo "/$optstring" | sed '"$pat\`" >> print-sysroot-suffix2.sh
35774 +cat >> print-sysroot-suffix2.sh <<\EOF
35775 + case $optstring in
35776 + //*)
35777 + ;;
35778 + *)
35779 + echo "$optstring"
35780 + ;;
35781 + esac
35782 +else
35783 + thisopt="$1"
35784 + shift
35785 + bit=
35786 + lastcond=
35787 + result=
35788 + for x in `echo "$thisopt" | sed -e 's,/, ,g'`; do
35789 + case $x in
35790 +EOF
35791 +for x in `echo "$options" | sed -e 's,/, ,g'`; do
35792 + match=`./print-sysroot-suffix3.sh "$x"`
35793 + echo "$x) optmatch=\"$match\" ;;" >> print-sysroot-suffix2.sh
35794 +done
35795 +cat >> print-sysroot-suffix2.sh <<\EOF
35796 + esac
35797 + bit=`"$0" "$padding " "$optstring$x/" "$@"`
35798 + if [ -z "$lastopt" ]; then
35799 + lastopt="$optmatch"
35800 + else
35801 + if [ "$lastbit" = "$bit" ]; then
35802 + lastopt="$lastopt|$optmatch"
35803 + else
35804 + result="$result$lastopt:$lastbit;$n"
35805 + lastopt="$optmatch"
35806 + fi
35807 + fi
35808 + lastbit="$bit"
35809 + done
35810 + bit=`"$0" "$padding " "$optstring" "$@"`
35811 + if [ "$bit" = "$lastbit" ]; then
35812 + if [ -z "$result" ]; then
35813 + echo "$bit"
35814 + else
35815 + echo "$n%{$result:$bit}"
35816 + fi
35817 + else
35818 + echo "$n%{$result$lastopt:$lastbit;$n:$bit}"
35819 + fi
35820 +fi
35821 +EOF
35822 +
35823 +chmod +x ./print-sysroot-suffix2.sh
35824 +result=`./print-sysroot-suffix2.sh "" "/" $options`
35825 +echo "#undef SYSROOT_SUFFIX_SPEC"
35826 +echo "#define SYSROOT_SUFFIX_SPEC \"$result\""
35827 +rm print-sysroot-suffix2.sh
35828 +rm print-sysroot-suffix3.sh
35829 --- a/gcc/config/rs6000/aix.h
35830 +++ b/gcc/config/rs6000/aix.h
35831 @@ -202,6 +202,8 @@
35832
35833 /* Define cutoff for using external functions to save floating point. */
35834 #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) == 62 || (FIRST_REG) == 63)
35835 +/* And similarly for general purpose registers. */
35836 +#define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32)
35837
35838 /* __throw will restore its own return address to be the same as the
35839 return address of the function that the throw is being made to.
35840 --- a/gcc/config/rs6000/altivec.md
35841 +++ b/gcc/config/rs6000/altivec.md
35842 @@ -64,7 +64,6 @@
35843 (UNSPEC_VPKUWUS 102)
35844 (UNSPEC_VPKSWUS 103)
35845 (UNSPEC_VRL 104)
35846 - (UNSPEC_VSL 107)
35847 (UNSPEC_VSLV4SI 110)
35848 (UNSPEC_VSLO 111)
35849 (UNSPEC_VSR 118)
35850 @@ -582,7 +581,7 @@
35851 /* Generate [-0.0, -0.0, -0.0, -0.0]. */
35852 neg0 = gen_reg_rtx (V4SImode);
35853 emit_insn (gen_altivec_vspltisw (neg0, constm1_rtx));
35854 - emit_insn (gen_altivec_vslw (neg0, neg0, neg0));
35855 + emit_insn (gen_ashlv4si3 (neg0, neg0, neg0));
35856
35857 /* Use the multiply-add. */
35858 emit_insn (gen_altivec_vmaddfp (operands[0], operands[1], operands[2],
35859 @@ -641,7 +640,7 @@
35860 high_product = gen_reg_rtx (V4SImode);
35861 emit_insn (gen_altivec_vmsumuhm (high_product, one, small_swap, zero));
35862
35863 - emit_insn (gen_altivec_vslw (high_product, high_product, sixteen));
35864 + emit_insn (gen_ashlv4si3 (high_product, high_product, sixteen));
35865
35866 emit_insn (gen_addv4si3 (operands[0], high_product, low_product));
35867
35868 @@ -1227,15 +1226,6 @@
35869 "vrl<VI_char> %0,%1,%2"
35870 [(set_attr "type" "vecsimple")])
35871
35872 -(define_insn "altivec_vsl<VI_char>"
35873 - [(set (match_operand:VI 0 "register_operand" "=v")
35874 - (unspec:VI [(match_operand:VI 1 "register_operand" "v")
35875 - (match_operand:VI 2 "register_operand" "v")]
35876 - UNSPEC_VSL))]
35877 - "TARGET_ALTIVEC"
35878 - "vsl<VI_char> %0,%1,%2"
35879 - [(set_attr "type" "vecsimple")])
35880 -
35881 (define_insn "altivec_vsl"
35882 [(set (match_operand:V4SI 0 "register_operand" "=v")
35883 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
35884 @@ -1254,6 +1244,14 @@
35885 "vslo %0,%1,%2"
35886 [(set_attr "type" "vecperm")])
35887
35888 +(define_insn "ashl<mode>3"
35889 + [(set (match_operand:VI 0 "register_operand" "=v")
35890 + (ashift:VI (match_operand:VI 1 "register_operand" "v")
35891 + (match_operand:VI 2 "register_operand" "v") ))]
35892 + "TARGET_ALTIVEC"
35893 + "vsl<VI_char> %0,%1,%2"
35894 + [(set_attr "type" "vecsimple")])
35895 +
35896 (define_insn "lshr<mode>3"
35897 [(set (match_operand:VI 0 "register_operand" "=v")
35898 (lshiftrt:VI (match_operand:VI 1 "register_operand" "v")
35899 @@ -2045,7 +2043,7 @@
35900 [(set (match_dup 2)
35901 (vec_duplicate:V4SI (const_int -1)))
35902 (set (match_dup 3)
35903 - (unspec:V4SI [(match_dup 2) (match_dup 2)] UNSPEC_VSL))
35904 + (ashift:V4SI (match_dup 2) (match_dup 2)))
35905 (set (match_operand:V4SF 0 "register_operand" "=v")
35906 (and:V4SF (not:V4SF (subreg:V4SF (match_dup 3) 0))
35907 (match_operand:V4SF 1 "register_operand" "v")))]
35908 @@ -2648,7 +2646,7 @@
35909 /* Generate [-0.0, -0.0, -0.0, -0.0]. */
35910 neg0 = gen_reg_rtx (V4SImode);
35911 emit_insn (gen_altivec_vspltisw (neg0, constm1_rtx));
35912 - emit_insn (gen_altivec_vslw (neg0, neg0, neg0));
35913 + emit_insn (gen_ashlv4si3 (neg0, neg0, neg0));
35914
35915 /* XOR */
35916 emit_insn (gen_xorv4sf3 (operands[0],
35917 --- /dev/null
35918 +++ b/gcc/config/rs6000/crtresfpr.asm
35919 @@ -0,0 +1,90 @@
35920 +/*
35921 + * Special support for eabi and SVR4
35922 + *
35923 + * Copyright (C) 1995, 1996, 1998, 2000, 2001, 2008
35924 + * Free Software Foundation, Inc.
35925 + * Written By Michael Meissner
35926 + * 64-bit support written by David Edelsohn
35927 + *
35928 + * This file is free software; you can redistribute it and/or modify it
35929 + * under the terms of the GNU General Public License as published by the
35930 + * Free Software Foundation; either version 2, or (at your option) any
35931 + * later version.
35932 + *
35933 + * In addition to the permissions in the GNU General Public License, the
35934 + * Free Software Foundation gives you unlimited permission to link the
35935 + * compiled version of this file with other programs, and to distribute
35936 + * those programs without any restriction coming from the use of this
35937 + * file. (The General Public License restrictions do apply in other
35938 + * respects; for example, they cover modification of the file, and
35939 + * distribution when not linked into another program.)
35940 + *
35941 + * This file is distributed in the hope that it will be useful, but
35942 + * WITHOUT ANY WARRANTY; without even the implied warranty of
35943 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
35944 + * General Public License for more details.
35945 + *
35946 + * You should have received a copy of the GNU General Public License
35947 + * along with this program; see the file COPYING. If not, write to
35948 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
35949 + * Boston, MA 02110-1301, USA.
35950 + *
35951 + * As a special exception, if you link this library with files
35952 + * compiled with GCC to produce an executable, this does not cause
35953 + * the resulting executable to be covered by the GNU General Public License.
35954 + * This exception does not however invalidate any other reasons why
35955 + * the executable file might be covered by the GNU General Public License.
35956 + */
35957 +
35958 +/* Do any initializations needed for the eabi environment */
35959 +
35960 + .file "crtresfpr.asm"
35961 + .section ".text"
35962 + #include "ppc-asm.h"
35963 +
35964 +/* On PowerPC64 Linux, these functions are provided by the linker. */
35965 +#ifndef __powerpc64__
35966 +
35967 +/* Routines for restoring floating point registers, called by the compiler. */
35968 +/* Called with r11 pointing to the stack header word of the caller of the */
35969 +/* function, just beyond the end of the floating point save area. */
35970 +
35971 +HIDDEN_FUNC(_restfpr_14) lfd 14,-144(11) /* restore fp registers */
35972 +HIDDEN_FUNC(_restfpr_15) lfd 15,-136(11)
35973 +HIDDEN_FUNC(_restfpr_16) lfd 16,-128(11)
35974 +HIDDEN_FUNC(_restfpr_17) lfd 17,-120(11)
35975 +HIDDEN_FUNC(_restfpr_18) lfd 18,-112(11)
35976 +HIDDEN_FUNC(_restfpr_19) lfd 19,-104(11)
35977 +HIDDEN_FUNC(_restfpr_20) lfd 20,-96(11)
35978 +HIDDEN_FUNC(_restfpr_21) lfd 21,-88(11)
35979 +HIDDEN_FUNC(_restfpr_22) lfd 22,-80(11)
35980 +HIDDEN_FUNC(_restfpr_23) lfd 23,-72(11)
35981 +HIDDEN_FUNC(_restfpr_24) lfd 24,-64(11)
35982 +HIDDEN_FUNC(_restfpr_25) lfd 25,-56(11)
35983 +HIDDEN_FUNC(_restfpr_26) lfd 26,-48(11)
35984 +HIDDEN_FUNC(_restfpr_27) lfd 27,-40(11)
35985 +HIDDEN_FUNC(_restfpr_28) lfd 28,-32(11)
35986 +HIDDEN_FUNC(_restfpr_29) lfd 29,-24(11)
35987 +HIDDEN_FUNC(_restfpr_30) lfd 30,-16(11)
35988 +HIDDEN_FUNC(_restfpr_31) lfd 31,-8(11)
35989 + blr
35990 +FUNC_END(_restfpr_31)
35991 +FUNC_END(_restfpr_30)
35992 +FUNC_END(_restfpr_29)
35993 +FUNC_END(_restfpr_28)
35994 +FUNC_END(_restfpr_27)
35995 +FUNC_END(_restfpr_26)
35996 +FUNC_END(_restfpr_25)
35997 +FUNC_END(_restfpr_24)
35998 +FUNC_END(_restfpr_23)
35999 +FUNC_END(_restfpr_22)
36000 +FUNC_END(_restfpr_21)
36001 +FUNC_END(_restfpr_20)
36002 +FUNC_END(_restfpr_19)
36003 +FUNC_END(_restfpr_18)
36004 +FUNC_END(_restfpr_17)
36005 +FUNC_END(_restfpr_16)
36006 +FUNC_END(_restfpr_15)
36007 +FUNC_END(_restfpr_14)
36008 +
36009 +#endif
36010 --- /dev/null
36011 +++ b/gcc/config/rs6000/crtresgpr.asm
36012 @@ -0,0 +1,90 @@
36013 +/*
36014 + * Special support for eabi and SVR4
36015 + *
36016 + * Copyright (C) 1995, 1996, 1998, 2000, 2001, 2008
36017 + * Free Software Foundation, Inc.
36018 + * Written By Michael Meissner
36019 + * 64-bit support written by David Edelsohn
36020 + *
36021 + * This file is free software; you can redistribute it and/or modify it
36022 + * under the terms of the GNU General Public License as published by the
36023 + * Free Software Foundation; either version 2, or (at your option) any
36024 + * later version.
36025 + *
36026 + * In addition to the permissions in the GNU General Public License, the
36027 + * Free Software Foundation gives you unlimited permission to link the
36028 + * compiled version of this file with other programs, and to distribute
36029 + * those programs without any restriction coming from the use of this
36030 + * file. (The General Public License restrictions do apply in other
36031 + * respects; for example, they cover modification of the file, and
36032 + * distribution when not linked into another program.)
36033 + *
36034 + * This file is distributed in the hope that it will be useful, but
36035 + * WITHOUT ANY WARRANTY; without even the implied warranty of
36036 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36037 + * General Public License for more details.
36038 + *
36039 + * You should have received a copy of the GNU General Public License
36040 + * along with this program; see the file COPYING. If not, write to
36041 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
36042 + * Boston, MA 02110-1301, USA.
36043 + *
36044 + * As a special exception, if you link this library with files
36045 + * compiled with GCC to produce an executable, this does not cause
36046 + * the resulting executable to be covered by the GNU General Public License.
36047 + * This exception does not however invalidate any other reasons why
36048 + * the executable file might be covered by the GNU General Public License.
36049 + */
36050 +
36051 +/* Do any initializations needed for the eabi environment */
36052 +
36053 + .file "crtresgpr.asm"
36054 + .section ".text"
36055 + #include "ppc-asm.h"
36056 +
36057 +/* On PowerPC64 Linux, these functions are provided by the linker. */
36058 +#ifndef __powerpc64__
36059 +
36060 +/* Routines for restoring integer registers, called by the compiler. */
36061 +/* Called with r11 pointing to the stack header word of the caller of the */
36062 +/* function, just beyond the end of the integer restore area. */
36063 +
36064 +HIDDEN_FUNC(_restgpr_14) lwz 14,-72(11) /* restore gp registers */
36065 +HIDDEN_FUNC(_restgpr_15) lwz 15,-68(11)
36066 +HIDDEN_FUNC(_restgpr_16) lwz 16,-64(11)
36067 +HIDDEN_FUNC(_restgpr_17) lwz 17,-60(11)
36068 +HIDDEN_FUNC(_restgpr_18) lwz 18,-56(11)
36069 +HIDDEN_FUNC(_restgpr_19) lwz 19,-52(11)
36070 +HIDDEN_FUNC(_restgpr_20) lwz 20,-48(11)
36071 +HIDDEN_FUNC(_restgpr_21) lwz 21,-44(11)
36072 +HIDDEN_FUNC(_restgpr_22) lwz 22,-40(11)
36073 +HIDDEN_FUNC(_restgpr_23) lwz 23,-36(11)
36074 +HIDDEN_FUNC(_restgpr_24) lwz 24,-32(11)
36075 +HIDDEN_FUNC(_restgpr_25) lwz 25,-28(11)
36076 +HIDDEN_FUNC(_restgpr_26) lwz 26,-24(11)
36077 +HIDDEN_FUNC(_restgpr_27) lwz 27,-20(11)
36078 +HIDDEN_FUNC(_restgpr_28) lwz 28,-16(11)
36079 +HIDDEN_FUNC(_restgpr_29) lwz 29,-12(11)
36080 +HIDDEN_FUNC(_restgpr_30) lwz 30,-8(11)
36081 +HIDDEN_FUNC(_restgpr_31) lwz 31,-4(11)
36082 + blr
36083 +FUNC_END(_restgpr_31)
36084 +FUNC_END(_restgpr_30)
36085 +FUNC_END(_restgpr_29)
36086 +FUNC_END(_restgpr_28)
36087 +FUNC_END(_restgpr_27)
36088 +FUNC_END(_restgpr_26)
36089 +FUNC_END(_restgpr_25)
36090 +FUNC_END(_restgpr_24)
36091 +FUNC_END(_restgpr_23)
36092 +FUNC_END(_restgpr_22)
36093 +FUNC_END(_restgpr_21)
36094 +FUNC_END(_restgpr_20)
36095 +FUNC_END(_restgpr_19)
36096 +FUNC_END(_restgpr_18)
36097 +FUNC_END(_restgpr_17)
36098 +FUNC_END(_restgpr_16)
36099 +FUNC_END(_restgpr_15)
36100 +FUNC_END(_restgpr_14)
36101 +
36102 +#endif
36103 --- /dev/null
36104 +++ b/gcc/config/rs6000/crtresxfpr.asm
36105 @@ -0,0 +1,95 @@
36106 +/*
36107 + * Special support for eabi and SVR4
36108 + *
36109 + * Copyright (C) 1995, 1996, 1998, 2000, 2001, 2008
36110 + * Free Software Foundation, Inc.
36111 + * Written By Michael Meissner
36112 + * 64-bit support written by David Edelsohn
36113 + *
36114 + * This file is free software; you can redistribute it and/or modify it
36115 + * under the terms of the GNU General Public License as published by the
36116 + * Free Software Foundation; either version 2, or (at your option) any
36117 + * later version.
36118 + *
36119 + * In addition to the permissions in the GNU General Public License, the
36120 + * Free Software Foundation gives you unlimited permission to link the
36121 + * compiled version of this file with other programs, and to distribute
36122 + * those programs without any restriction coming from the use of this
36123 + * file. (The General Public License restrictions do apply in other
36124 + * respects; for example, they cover modification of the file, and
36125 + * distribution when not linked into another program.)
36126 + *
36127 + * This file is distributed in the hope that it will be useful, but
36128 + * WITHOUT ANY WARRANTY; without even the implied warranty of
36129 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36130 + * General Public License for more details.
36131 + *
36132 + * You should have received a copy of the GNU General Public License
36133 + * along with this program; see the file COPYING. If not, write to
36134 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
36135 + * Boston, MA 02110-1301, USA.
36136 + *
36137 + * As a special exception, if you link this library with files
36138 + * compiled with GCC to produce an executable, this does not cause
36139 + * the resulting executable to be covered by the GNU General Public License.
36140 + * This exception does not however invalidate any other reasons why
36141 + * the executable file might be covered by the GNU General Public License.
36142 + */
36143 +
36144 +/* Do any initializations needed for the eabi environment */
36145 +
36146 + .file "crtresxfpr.asm"
36147 + .section ".text"
36148 + #include "ppc-asm.h"
36149 +
36150 +/* On PowerPC64 Linux, these functions are provided by the linker. */
36151 +#ifndef __powerpc64__
36152 +
36153 +/* Routines for restoring floating point registers, called by the compiler. */
36154 +/* Called with r11 pointing to the stack header word of the caller of the */
36155 +/* function, just beyond the end of the floating point save area. */
36156 +/* In addition to restoring the fp registers, it will return to the caller's */
36157 +/* caller */
36158 +
36159 +HIDDEN_FUNC(_restfpr_14_x) lfd 14,-144(11) /* restore fp registers */
36160 +HIDDEN_FUNC(_restfpr_15_x) lfd 15,-136(11)
36161 +HIDDEN_FUNC(_restfpr_16_x) lfd 16,-128(11)
36162 +HIDDEN_FUNC(_restfpr_17_x) lfd 17,-120(11)
36163 +HIDDEN_FUNC(_restfpr_18_x) lfd 18,-112(11)
36164 +HIDDEN_FUNC(_restfpr_19_x) lfd 19,-104(11)
36165 +HIDDEN_FUNC(_restfpr_20_x) lfd 20,-96(11)
36166 +HIDDEN_FUNC(_restfpr_21_x) lfd 21,-88(11)
36167 +HIDDEN_FUNC(_restfpr_22_x) lfd 22,-80(11)
36168 +HIDDEN_FUNC(_restfpr_23_x) lfd 23,-72(11)
36169 +HIDDEN_FUNC(_restfpr_24_x) lfd 24,-64(11)
36170 +HIDDEN_FUNC(_restfpr_25_x) lfd 25,-56(11)
36171 +HIDDEN_FUNC(_restfpr_26_x) lfd 26,-48(11)
36172 +HIDDEN_FUNC(_restfpr_27_x) lfd 27,-40(11)
36173 +HIDDEN_FUNC(_restfpr_28_x) lfd 28,-32(11)
36174 +HIDDEN_FUNC(_restfpr_29_x) lfd 29,-24(11)
36175 +HIDDEN_FUNC(_restfpr_30_x) lfd 30,-16(11)
36176 +HIDDEN_FUNC(_restfpr_31_x) lwz 0,4(11)
36177 + lfd 31,-8(11)
36178 + mtlr 0
36179 + mr 1,11
36180 + blr
36181 +FUNC_END(_restfpr_31_x)
36182 +FUNC_END(_restfpr_30_x)
36183 +FUNC_END(_restfpr_29_x)
36184 +FUNC_END(_restfpr_28_x)
36185 +FUNC_END(_restfpr_27_x)
36186 +FUNC_END(_restfpr_26_x)
36187 +FUNC_END(_restfpr_25_x)
36188 +FUNC_END(_restfpr_24_x)
36189 +FUNC_END(_restfpr_23_x)
36190 +FUNC_END(_restfpr_22_x)
36191 +FUNC_END(_restfpr_21_x)
36192 +FUNC_END(_restfpr_20_x)
36193 +FUNC_END(_restfpr_19_x)
36194 +FUNC_END(_restfpr_18_x)
36195 +FUNC_END(_restfpr_17_x)
36196 +FUNC_END(_restfpr_16_x)
36197 +FUNC_END(_restfpr_15_x)
36198 +FUNC_END(_restfpr_14_x)
36199 +
36200 +#endif
36201 --- /dev/null
36202 +++ b/gcc/config/rs6000/crtresxgpr.asm
36203 @@ -0,0 +1,93 @@
36204 +/*
36205 + * Special support for eabi and SVR4
36206 + *
36207 + * Copyright (C) 1995, 1996, 1998, 2000, 2001, 2008
36208 + * Free Software Foundation, Inc.
36209 + * Written By Michael Meissner
36210 + * 64-bit support written by David Edelsohn
36211 + *
36212 + * This file is free software; you can redistribute it and/or modify it
36213 + * under the terms of the GNU General Public License as published by the
36214 + * Free Software Foundation; either version 2, or (at your option) any
36215 + * later version.
36216 + *
36217 + * In addition to the permissions in the GNU General Public License, the
36218 + * Free Software Foundation gives you unlimited permission to link the
36219 + * compiled version of this file with other programs, and to distribute
36220 + * those programs without any restriction coming from the use of this
36221 + * file. (The General Public License restrictions do apply in other
36222 + * respects; for example, they cover modification of the file, and
36223 + * distribution when not linked into another program.)
36224 + *
36225 + * This file is distributed in the hope that it will be useful, but
36226 + * WITHOUT ANY WARRANTY; without even the implied warranty of
36227 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36228 + * General Public License for more details.
36229 + *
36230 + * You should have received a copy of the GNU General Public License
36231 + * along with this program; see the file COPYING. If not, write to
36232 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
36233 + * Boston, MA 02110-1301, USA.
36234 + *
36235 + * As a special exception, if you link this library with files
36236 + * compiled with GCC to produce an executable, this does not cause
36237 + * the resulting executable to be covered by the GNU General Public License.
36238 + * This exception does not however invalidate any other reasons why
36239 + * the executable file might be covered by the GNU General Public License.
36240 + */
36241 +
36242 +/* Do any initializations needed for the eabi environment */
36243 +
36244 + .file "crtresxgpr.asm"
36245 + .section ".text"
36246 + #include "ppc-asm.h"
36247 +
36248 +/* On PowerPC64 Linux, these functions are provided by the linker. */
36249 +#ifndef __powerpc64__
36250 +
36251 +/* Routines for restoring integer registers, called by the compiler. */
36252 +/* Called with r11 pointing to the stack header word of the caller of the */
36253 +/* function, just beyond the end of the integer restore area. */
36254 +
36255 +HIDDEN_FUNC(_restgpr_14_x) lwz 14,-72(11) /* restore gp registers */
36256 +HIDDEN_FUNC(_restgpr_15_x) lwz 15,-68(11)
36257 +HIDDEN_FUNC(_restgpr_16_x) lwz 16,-64(11)
36258 +HIDDEN_FUNC(_restgpr_17_x) lwz 17,-60(11)
36259 +HIDDEN_FUNC(_restgpr_18_x) lwz 18,-56(11)
36260 +HIDDEN_FUNC(_restgpr_19_x) lwz 19,-52(11)
36261 +HIDDEN_FUNC(_restgpr_20_x) lwz 20,-48(11)
36262 +HIDDEN_FUNC(_restgpr_21_x) lwz 21,-44(11)
36263 +HIDDEN_FUNC(_restgpr_22_x) lwz 22,-40(11)
36264 +HIDDEN_FUNC(_restgpr_23_x) lwz 23,-36(11)
36265 +HIDDEN_FUNC(_restgpr_24_x) lwz 24,-32(11)
36266 +HIDDEN_FUNC(_restgpr_25_x) lwz 25,-28(11)
36267 +HIDDEN_FUNC(_restgpr_26_x) lwz 26,-24(11)
36268 +HIDDEN_FUNC(_restgpr_27_x) lwz 27,-20(11)
36269 +HIDDEN_FUNC(_restgpr_28_x) lwz 28,-16(11)
36270 +HIDDEN_FUNC(_restgpr_29_x) lwz 29,-12(11)
36271 +HIDDEN_FUNC(_restgpr_30_x) lwz 30,-8(11)
36272 +HIDDEN_FUNC(_restgpr_31_x) lwz 0,4(11)
36273 + lwz 31,-4(11)
36274 + mtlr 0
36275 + mr 1,11
36276 + blr
36277 +FUNC_END(_restgpr_31_x)
36278 +FUNC_END(_restgpr_30_x)
36279 +FUNC_END(_restgpr_29_x)
36280 +FUNC_END(_restgpr_28_x)
36281 +FUNC_END(_restgpr_27_x)
36282 +FUNC_END(_restgpr_26_x)
36283 +FUNC_END(_restgpr_25_x)
36284 +FUNC_END(_restgpr_24_x)
36285 +FUNC_END(_restgpr_23_x)
36286 +FUNC_END(_restgpr_22_x)
36287 +FUNC_END(_restgpr_21_x)
36288 +FUNC_END(_restgpr_20_x)
36289 +FUNC_END(_restgpr_19_x)
36290 +FUNC_END(_restgpr_18_x)
36291 +FUNC_END(_restgpr_17_x)
36292 +FUNC_END(_restgpr_16_x)
36293 +FUNC_END(_restgpr_15_x)
36294 +FUNC_END(_restgpr_14_x)
36295 +
36296 +#endif
36297 --- /dev/null
36298 +++ b/gcc/config/rs6000/crtsavfpr.asm
36299 @@ -0,0 +1,90 @@
36300 +/*
36301 + * Special support for eabi and SVR4
36302 + *
36303 + * Copyright (C) 1995, 1996, 1998, 2000, 2001, 2008
36304 + * Free Software Foundation, Inc.
36305 + * Written By Michael Meissner
36306 + * 64-bit support written by David Edelsohn
36307 + *
36308 + * This file is free software; you can redistribute it and/or modify it
36309 + * under the terms of the GNU General Public License as published by the
36310 + * Free Software Foundation; either version 2, or (at your option) any
36311 + * later version.
36312 + *
36313 + * In addition to the permissions in the GNU General Public License, the
36314 + * Free Software Foundation gives you unlimited permission to link the
36315 + * compiled version of this file with other programs, and to distribute
36316 + * those programs without any restriction coming from the use of this
36317 + * file. (The General Public License restrictions do apply in other
36318 + * respects; for example, they cover modification of the file, and
36319 + * distribution when not linked into another program.)
36320 + *
36321 + * This file is distributed in the hope that it will be useful, but
36322 + * WITHOUT ANY WARRANTY; without even the implied warranty of
36323 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36324 + * General Public License for more details.
36325 + *
36326 + * You should have received a copy of the GNU General Public License
36327 + * along with this program; see the file COPYING. If not, write to
36328 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
36329 + * Boston, MA 02110-1301, USA.
36330 + *
36331 + * As a special exception, if you link this library with files
36332 + * compiled with GCC to produce an executable, this does not cause
36333 + * the resulting executable to be covered by the GNU General Public License.
36334 + * This exception does not however invalidate any other reasons why
36335 + * the executable file might be covered by the GNU General Public License.
36336 + */
36337 +
36338 +/* Do any initializations needed for the eabi environment */
36339 +
36340 + .file "crtsavfpr.asm"
36341 + .section ".text"
36342 + #include "ppc-asm.h"
36343 +
36344 +/* On PowerPC64 Linux, these functions are provided by the linker. */
36345 +#ifndef __powerpc64__
36346 +
36347 +/* Routines for saving floating point registers, called by the compiler. */
36348 +/* Called with r11 pointing to the stack header word of the caller of the */
36349 +/* function, just beyond the end of the floating point save area. */
36350 +
36351 +HIDDEN_FUNC(_savefpr_14) stfd 14,-144(11) /* save fp registers */
36352 +HIDDEN_FUNC(_savefpr_15) stfd 15,-136(11)
36353 +HIDDEN_FUNC(_savefpr_16) stfd 16,-128(11)
36354 +HIDDEN_FUNC(_savefpr_17) stfd 17,-120(11)
36355 +HIDDEN_FUNC(_savefpr_18) stfd 18,-112(11)
36356 +HIDDEN_FUNC(_savefpr_19) stfd 19,-104(11)
36357 +HIDDEN_FUNC(_savefpr_20) stfd 20,-96(11)
36358 +HIDDEN_FUNC(_savefpr_21) stfd 21,-88(11)
36359 +HIDDEN_FUNC(_savefpr_22) stfd 22,-80(11)
36360 +HIDDEN_FUNC(_savefpr_23) stfd 23,-72(11)
36361 +HIDDEN_FUNC(_savefpr_24) stfd 24,-64(11)
36362 +HIDDEN_FUNC(_savefpr_25) stfd 25,-56(11)
36363 +HIDDEN_FUNC(_savefpr_26) stfd 26,-48(11)
36364 +HIDDEN_FUNC(_savefpr_27) stfd 27,-40(11)
36365 +HIDDEN_FUNC(_savefpr_28) stfd 28,-32(11)
36366 +HIDDEN_FUNC(_savefpr_29) stfd 29,-24(11)
36367 +HIDDEN_FUNC(_savefpr_30) stfd 30,-16(11)
36368 +HIDDEN_FUNC(_savefpr_31) stfd 31,-8(11)
36369 + blr
36370 +FUNC_END(_savefpr_31)
36371 +FUNC_END(_savefpr_30)
36372 +FUNC_END(_savefpr_29)
36373 +FUNC_END(_savefpr_28)
36374 +FUNC_END(_savefpr_27)
36375 +FUNC_END(_savefpr_26)
36376 +FUNC_END(_savefpr_25)
36377 +FUNC_END(_savefpr_24)
36378 +FUNC_END(_savefpr_23)
36379 +FUNC_END(_savefpr_22)
36380 +FUNC_END(_savefpr_21)
36381 +FUNC_END(_savefpr_20)
36382 +FUNC_END(_savefpr_19)
36383 +FUNC_END(_savefpr_18)
36384 +FUNC_END(_savefpr_17)
36385 +FUNC_END(_savefpr_16)
36386 +FUNC_END(_savefpr_15)
36387 +FUNC_END(_savefpr_14)
36388 +
36389 +#endif
36390 --- /dev/null
36391 +++ b/gcc/config/rs6000/crtsavgpr.asm
36392 @@ -0,0 +1,90 @@
36393 +/*
36394 + * Special support for eabi and SVR4
36395 + *
36396 + * Copyright (C) 1995, 1996, 1998, 2000, 2001, 2008
36397 + * Free Software Foundation, Inc.
36398 + * Written By Michael Meissner
36399 + * 64-bit support written by David Edelsohn
36400 + *
36401 + * This file is free software; you can redistribute it and/or modify it
36402 + * under the terms of the GNU General Public License as published by the
36403 + * Free Software Foundation; either version 2, or (at your option) any
36404 + * later version.
36405 + *
36406 + * In addition to the permissions in the GNU General Public License, the
36407 + * Free Software Foundation gives you unlimited permission to link the
36408 + * compiled version of this file with other programs, and to distribute
36409 + * those programs without any restriction coming from the use of this
36410 + * file. (The General Public License restrictions do apply in other
36411 + * respects; for example, they cover modification of the file, and
36412 + * distribution when not linked into another program.)
36413 + *
36414 + * This file is distributed in the hope that it will be useful, but
36415 + * WITHOUT ANY WARRANTY; without even the implied warranty of
36416 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36417 + * General Public License for more details.
36418 + *
36419 + * You should have received a copy of the GNU General Public License
36420 + * along with this program; see the file COPYING. If not, write to
36421 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
36422 + * Boston, MA 02110-1301, USA.
36423 + *
36424 + * As a special exception, if you link this library with files
36425 + * compiled with GCC to produce an executable, this does not cause
36426 + * the resulting executable to be covered by the GNU General Public License.
36427 + * This exception does not however invalidate any other reasons why
36428 + * the executable file might be covered by the GNU General Public License.
36429 + */
36430 +
36431 +/* Do any initializations needed for the eabi environment */
36432 +
36433 + .file "crtsavgpr.asm"
36434 + .section ".text"
36435 + #include "ppc-asm.h"
36436 +
36437 +/* On PowerPC64 Linux, these functions are provided by the linker. */
36438 +#ifndef __powerpc64__
36439 +
36440 +/* Routines for saving integer registers, called by the compiler. */
36441 +/* Called with r11 pointing to the stack header word of the caller of the */
36442 +/* function, just beyond the end of the integer save area. */
36443 +
36444 +HIDDEN_FUNC(_savegpr_14) stw 14,-72(11) /* save gp registers */
36445 +HIDDEN_FUNC(_savegpr_15) stw 15,-68(11)
36446 +HIDDEN_FUNC(_savegpr_16) stw 16,-64(11)
36447 +HIDDEN_FUNC(_savegpr_17) stw 17,-60(11)
36448 +HIDDEN_FUNC(_savegpr_18) stw 18,-56(11)
36449 +HIDDEN_FUNC(_savegpr_19) stw 19,-52(11)
36450 +HIDDEN_FUNC(_savegpr_20) stw 20,-48(11)
36451 +HIDDEN_FUNC(_savegpr_21) stw 21,-44(11)
36452 +HIDDEN_FUNC(_savegpr_22) stw 22,-40(11)
36453 +HIDDEN_FUNC(_savegpr_23) stw 23,-36(11)
36454 +HIDDEN_FUNC(_savegpr_24) stw 24,-32(11)
36455 +HIDDEN_FUNC(_savegpr_25) stw 25,-28(11)
36456 +HIDDEN_FUNC(_savegpr_26) stw 26,-24(11)
36457 +HIDDEN_FUNC(_savegpr_27) stw 27,-20(11)
36458 +HIDDEN_FUNC(_savegpr_28) stw 28,-16(11)
36459 +HIDDEN_FUNC(_savegpr_29) stw 29,-12(11)
36460 +HIDDEN_FUNC(_savegpr_30) stw 30,-8(11)
36461 +HIDDEN_FUNC(_savegpr_31) stw 31,-4(11)
36462 + blr
36463 +FUNC_END(_savegpr_31)
36464 +FUNC_END(_savegpr_30)
36465 +FUNC_END(_savegpr_29)
36466 +FUNC_END(_savegpr_28)
36467 +FUNC_END(_savegpr_27)
36468 +FUNC_END(_savegpr_26)
36469 +FUNC_END(_savegpr_25)
36470 +FUNC_END(_savegpr_24)
36471 +FUNC_END(_savegpr_23)
36472 +FUNC_END(_savegpr_22)
36473 +FUNC_END(_savegpr_21)
36474 +FUNC_END(_savegpr_20)
36475 +FUNC_END(_savegpr_19)
36476 +FUNC_END(_savegpr_18)
36477 +FUNC_END(_savegpr_17)
36478 +FUNC_END(_savegpr_16)
36479 +FUNC_END(_savegpr_15)
36480 +FUNC_END(_savegpr_14)
36481 +
36482 +#endif
36483 --- a/gcc/config/rs6000/crtsavres.asm
36484 +++ /dev/null
36485 @@ -1,307 +0,0 @@
36486 -/*
36487 - * Special support for eabi and SVR4
36488 - *
36489 - * Copyright (C) 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
36490 - * Written By Michael Meissner
36491 - * 64-bit support written by David Edelsohn
36492 - *
36493 - * This file is free software; you can redistribute it and/or modify it
36494 - * under the terms of the GNU General Public License as published by the
36495 - * Free Software Foundation; either version 2, or (at your option) any
36496 - * later version.
36497 - *
36498 - * In addition to the permissions in the GNU General Public License, the
36499 - * Free Software Foundation gives you unlimited permission to link the
36500 - * compiled version of this file with other programs, and to distribute
36501 - * those programs without any restriction coming from the use of this
36502 - * file. (The General Public License restrictions do apply in other
36503 - * respects; for example, they cover modification of the file, and
36504 - * distribution when not linked into another program.)
36505 - *
36506 - * This file is distributed in the hope that it will be useful, but
36507 - * WITHOUT ANY WARRANTY; without even the implied warranty of
36508 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36509 - * General Public License for more details.
36510 - *
36511 - * You should have received a copy of the GNU General Public License
36512 - * along with this program; see the file COPYING. If not, write to
36513 - * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
36514 - * Boston, MA 02110-1301, USA.
36515 - *
36516 - * As a special exception, if you link this library with files
36517 - * compiled with GCC to produce an executable, this does not cause
36518 - * the resulting executable to be covered by the GNU General Public License.
36519 - * This exception does not however invalidate any other reasons why
36520 - * the executable file might be covered by the GNU General Public License.
36521 - */
36522 -
36523 -/* Do any initializations needed for the eabi environment */
36524 -
36525 - .file "crtsavres.asm"
36526 - .section ".text"
36527 - #include "ppc-asm.h"
36528 -
36529 -/* On PowerPC64 Linux, these functions are provided by the linker. */
36530 -#ifndef __powerpc64__
36531 -
36532 -/* Routines for saving floating point registers, called by the compiler. */
36533 -/* Called with r11 pointing to the stack header word of the caller of the */
36534 -/* function, just beyond the end of the floating point save area. */
36535 -
36536 -FUNC_START(_savefpr_14) stfd 14,-144(11) /* save fp registers */
36537 -FUNC_START(_savefpr_15) stfd 15,-136(11)
36538 -FUNC_START(_savefpr_16) stfd 16,-128(11)
36539 -FUNC_START(_savefpr_17) stfd 17,-120(11)
36540 -FUNC_START(_savefpr_18) stfd 18,-112(11)
36541 -FUNC_START(_savefpr_19) stfd 19,-104(11)
36542 -FUNC_START(_savefpr_20) stfd 20,-96(11)
36543 -FUNC_START(_savefpr_21) stfd 21,-88(11)
36544 -FUNC_START(_savefpr_22) stfd 22,-80(11)
36545 -FUNC_START(_savefpr_23) stfd 23,-72(11)
36546 -FUNC_START(_savefpr_24) stfd 24,-64(11)
36547 -FUNC_START(_savefpr_25) stfd 25,-56(11)
36548 -FUNC_START(_savefpr_26) stfd 26,-48(11)
36549 -FUNC_START(_savefpr_27) stfd 27,-40(11)
36550 -FUNC_START(_savefpr_28) stfd 28,-32(11)
36551 -FUNC_START(_savefpr_29) stfd 29,-24(11)
36552 -FUNC_START(_savefpr_30) stfd 30,-16(11)
36553 -FUNC_START(_savefpr_31) stfd 31,-8(11)
36554 - blr
36555 -FUNC_END(_savefpr_31)
36556 -FUNC_END(_savefpr_30)
36557 -FUNC_END(_savefpr_29)
36558 -FUNC_END(_savefpr_28)
36559 -FUNC_END(_savefpr_27)
36560 -FUNC_END(_savefpr_26)
36561 -FUNC_END(_savefpr_25)
36562 -FUNC_END(_savefpr_24)
36563 -FUNC_END(_savefpr_23)
36564 -FUNC_END(_savefpr_22)
36565 -FUNC_END(_savefpr_21)
36566 -FUNC_END(_savefpr_20)
36567 -FUNC_END(_savefpr_19)
36568 -FUNC_END(_savefpr_18)
36569 -FUNC_END(_savefpr_17)
36570 -FUNC_END(_savefpr_16)
36571 -FUNC_END(_savefpr_15)
36572 -FUNC_END(_savefpr_14)
36573 -
36574 -/* Routines for saving integer registers, called by the compiler. */
36575 -/* Called with r11 pointing to the stack header word of the caller of the */
36576 -/* function, just beyond the end of the integer save area. */
36577 -
36578 -FUNC_START(_savegpr_14) stw 14,-72(11) /* save gp registers */
36579 -FUNC_START(_savegpr_15) stw 15,-68(11)
36580 -FUNC_START(_savegpr_16) stw 16,-64(11)
36581 -FUNC_START(_savegpr_17) stw 17,-60(11)
36582 -FUNC_START(_savegpr_18) stw 18,-56(11)
36583 -FUNC_START(_savegpr_19) stw 19,-52(11)
36584 -FUNC_START(_savegpr_20) stw 20,-48(11)
36585 -FUNC_START(_savegpr_21) stw 21,-44(11)
36586 -FUNC_START(_savegpr_22) stw 22,-40(11)
36587 -FUNC_START(_savegpr_23) stw 23,-36(11)
36588 -FUNC_START(_savegpr_24) stw 24,-32(11)
36589 -FUNC_START(_savegpr_25) stw 25,-28(11)
36590 -FUNC_START(_savegpr_26) stw 26,-24(11)
36591 -FUNC_START(_savegpr_27) stw 27,-20(11)
36592 -FUNC_START(_savegpr_28) stw 28,-16(11)
36593 -FUNC_START(_savegpr_29) stw 29,-12(11)
36594 -FUNC_START(_savegpr_30) stw 30,-8(11)
36595 -FUNC_START(_savegpr_31) stw 31,-4(11)
36596 - blr
36597 -FUNC_END(_savegpr_31)
36598 -FUNC_END(_savegpr_30)
36599 -FUNC_END(_savegpr_29)
36600 -FUNC_END(_savegpr_28)
36601 -FUNC_END(_savegpr_27)
36602 -FUNC_END(_savegpr_26)
36603 -FUNC_END(_savegpr_25)
36604 -FUNC_END(_savegpr_24)
36605 -FUNC_END(_savegpr_23)
36606 -FUNC_END(_savegpr_22)
36607 -FUNC_END(_savegpr_21)
36608 -FUNC_END(_savegpr_20)
36609 -FUNC_END(_savegpr_19)
36610 -FUNC_END(_savegpr_18)
36611 -FUNC_END(_savegpr_17)
36612 -FUNC_END(_savegpr_16)
36613 -FUNC_END(_savegpr_15)
36614 -FUNC_END(_savegpr_14)
36615 -
36616 -/* Routines for restoring floating point registers, called by the compiler. */
36617 -/* Called with r11 pointing to the stack header word of the caller of the */
36618 -/* function, just beyond the end of the floating point save area. */
36619 -
36620 -FUNC_START(_restfpr_14) lfd 14,-144(11) /* restore fp registers */
36621 -FUNC_START(_restfpr_15) lfd 15,-136(11)
36622 -FUNC_START(_restfpr_16) lfd 16,-128(11)
36623 -FUNC_START(_restfpr_17) lfd 17,-120(11)
36624 -FUNC_START(_restfpr_18) lfd 18,-112(11)
36625 -FUNC_START(_restfpr_19) lfd 19,-104(11)
36626 -FUNC_START(_restfpr_20) lfd 20,-96(11)
36627 -FUNC_START(_restfpr_21) lfd 21,-88(11)
36628 -FUNC_START(_restfpr_22) lfd 22,-80(11)
36629 -FUNC_START(_restfpr_23) lfd 23,-72(11)
36630 -FUNC_START(_restfpr_24) lfd 24,-64(11)
36631 -FUNC_START(_restfpr_25) lfd 25,-56(11)
36632 -FUNC_START(_restfpr_26) lfd 26,-48(11)
36633 -FUNC_START(_restfpr_27) lfd 27,-40(11)
36634 -FUNC_START(_restfpr_28) lfd 28,-32(11)
36635 -FUNC_START(_restfpr_29) lfd 29,-24(11)
36636 -FUNC_START(_restfpr_30) lfd 30,-16(11)
36637 -FUNC_START(_restfpr_31) lfd 31,-8(11)
36638 - blr
36639 -FUNC_END(_restfpr_31)
36640 -FUNC_END(_restfpr_30)
36641 -FUNC_END(_restfpr_29)
36642 -FUNC_END(_restfpr_28)
36643 -FUNC_END(_restfpr_27)
36644 -FUNC_END(_restfpr_26)
36645 -FUNC_END(_restfpr_25)
36646 -FUNC_END(_restfpr_24)
36647 -FUNC_END(_restfpr_23)
36648 -FUNC_END(_restfpr_22)
36649 -FUNC_END(_restfpr_21)
36650 -FUNC_END(_restfpr_20)
36651 -FUNC_END(_restfpr_19)
36652 -FUNC_END(_restfpr_18)
36653 -FUNC_END(_restfpr_17)
36654 -FUNC_END(_restfpr_16)
36655 -FUNC_END(_restfpr_15)
36656 -FUNC_END(_restfpr_14)
36657 -
36658 -/* Routines for restoring integer registers, called by the compiler. */
36659 -/* Called with r11 pointing to the stack header word of the caller of the */
36660 -/* function, just beyond the end of the integer restore area. */
36661 -
36662 -FUNC_START(_restgpr_14) lwz 14,-72(11) /* restore gp registers */
36663 -FUNC_START(_restgpr_15) lwz 15,-68(11)
36664 -FUNC_START(_restgpr_16) lwz 16,-64(11)
36665 -FUNC_START(_restgpr_17) lwz 17,-60(11)
36666 -FUNC_START(_restgpr_18) lwz 18,-56(11)
36667 -FUNC_START(_restgpr_19) lwz 19,-52(11)
36668 -FUNC_START(_restgpr_20) lwz 20,-48(11)
36669 -FUNC_START(_restgpr_21) lwz 21,-44(11)
36670 -FUNC_START(_restgpr_22) lwz 22,-40(11)
36671 -FUNC_START(_restgpr_23) lwz 23,-36(11)
36672 -FUNC_START(_restgpr_24) lwz 24,-32(11)
36673 -FUNC_START(_restgpr_25) lwz 25,-28(11)
36674 -FUNC_START(_restgpr_26) lwz 26,-24(11)
36675 -FUNC_START(_restgpr_27) lwz 27,-20(11)
36676 -FUNC_START(_restgpr_28) lwz 28,-16(11)
36677 -FUNC_START(_restgpr_29) lwz 29,-12(11)
36678 -FUNC_START(_restgpr_30) lwz 30,-8(11)
36679 -FUNC_START(_restgpr_31) lwz 31,-4(11)
36680 - blr
36681 -FUNC_END(_restgpr_31)
36682 -FUNC_END(_restgpr_30)
36683 -FUNC_END(_restgpr_29)
36684 -FUNC_END(_restgpr_28)
36685 -FUNC_END(_restgpr_27)
36686 -FUNC_END(_restgpr_26)
36687 -FUNC_END(_restgpr_25)
36688 -FUNC_END(_restgpr_24)
36689 -FUNC_END(_restgpr_23)
36690 -FUNC_END(_restgpr_22)
36691 -FUNC_END(_restgpr_21)
36692 -FUNC_END(_restgpr_20)
36693 -FUNC_END(_restgpr_19)
36694 -FUNC_END(_restgpr_18)
36695 -FUNC_END(_restgpr_17)
36696 -FUNC_END(_restgpr_16)
36697 -FUNC_END(_restgpr_15)
36698 -FUNC_END(_restgpr_14)
36699 -
36700 -/* Routines for restoring floating point registers, called by the compiler. */
36701 -/* Called with r11 pointing to the stack header word of the caller of the */
36702 -/* function, just beyond the end of the floating point save area. */
36703 -/* In addition to restoring the fp registers, it will return to the caller's */
36704 -/* caller */
36705 -
36706 -FUNC_START(_restfpr_14_x) lfd 14,-144(11) /* restore fp registers */
36707 -FUNC_START(_restfpr_15_x) lfd 15,-136(11)
36708 -FUNC_START(_restfpr_16_x) lfd 16,-128(11)
36709 -FUNC_START(_restfpr_17_x) lfd 17,-120(11)
36710 -FUNC_START(_restfpr_18_x) lfd 18,-112(11)
36711 -FUNC_START(_restfpr_19_x) lfd 19,-104(11)
36712 -FUNC_START(_restfpr_20_x) lfd 20,-96(11)
36713 -FUNC_START(_restfpr_21_x) lfd 21,-88(11)
36714 -FUNC_START(_restfpr_22_x) lfd 22,-80(11)
36715 -FUNC_START(_restfpr_23_x) lfd 23,-72(11)
36716 -FUNC_START(_restfpr_24_x) lfd 24,-64(11)
36717 -FUNC_START(_restfpr_25_x) lfd 25,-56(11)
36718 -FUNC_START(_restfpr_26_x) lfd 26,-48(11)
36719 -FUNC_START(_restfpr_27_x) lfd 27,-40(11)
36720 -FUNC_START(_restfpr_28_x) lfd 28,-32(11)
36721 -FUNC_START(_restfpr_29_x) lfd 29,-24(11)
36722 -FUNC_START(_restfpr_30_x) lfd 30,-16(11)
36723 -FUNC_START(_restfpr_31_x) lwz 0,4(11)
36724 - lfd 31,-8(11)
36725 - mtlr 0
36726 - mr 1,11
36727 - blr
36728 -FUNC_END(_restfpr_31_x)
36729 -FUNC_END(_restfpr_30_x)
36730 -FUNC_END(_restfpr_29_x)
36731 -FUNC_END(_restfpr_28_x)
36732 -FUNC_END(_restfpr_27_x)
36733 -FUNC_END(_restfpr_26_x)
36734 -FUNC_END(_restfpr_25_x)
36735 -FUNC_END(_restfpr_24_x)
36736 -FUNC_END(_restfpr_23_x)
36737 -FUNC_END(_restfpr_22_x)
36738 -FUNC_END(_restfpr_21_x)
36739 -FUNC_END(_restfpr_20_x)
36740 -FUNC_END(_restfpr_19_x)
36741 -FUNC_END(_restfpr_18_x)
36742 -FUNC_END(_restfpr_17_x)
36743 -FUNC_END(_restfpr_16_x)
36744 -FUNC_END(_restfpr_15_x)
36745 -FUNC_END(_restfpr_14_x)
36746 -
36747 -/* Routines for restoring integer registers, called by the compiler. */
36748 -/* Called with r11 pointing to the stack header word of the caller of the */
36749 -/* function, just beyond the end of the integer restore area. */
36750 -
36751 -FUNC_START(_restgpr_14_x) lwz 14,-72(11) /* restore gp registers */
36752 -FUNC_START(_restgpr_15_x) lwz 15,-68(11)
36753 -FUNC_START(_restgpr_16_x) lwz 16,-64(11)
36754 -FUNC_START(_restgpr_17_x) lwz 17,-60(11)
36755 -FUNC_START(_restgpr_18_x) lwz 18,-56(11)
36756 -FUNC_START(_restgpr_19_x) lwz 19,-52(11)
36757 -FUNC_START(_restgpr_20_x) lwz 20,-48(11)
36758 -FUNC_START(_restgpr_21_x) lwz 21,-44(11)
36759 -FUNC_START(_restgpr_22_x) lwz 22,-40(11)
36760 -FUNC_START(_restgpr_23_x) lwz 23,-36(11)
36761 -FUNC_START(_restgpr_24_x) lwz 24,-32(11)
36762 -FUNC_START(_restgpr_25_x) lwz 25,-28(11)
36763 -FUNC_START(_restgpr_26_x) lwz 26,-24(11)
36764 -FUNC_START(_restgpr_27_x) lwz 27,-20(11)
36765 -FUNC_START(_restgpr_28_x) lwz 28,-16(11)
36766 -FUNC_START(_restgpr_29_x) lwz 29,-12(11)
36767 -FUNC_START(_restgpr_30_x) lwz 30,-8(11)
36768 -FUNC_START(_restgpr_31_x) lwz 0,4(11)
36769 - lwz 31,-4(11)
36770 - mtlr 0
36771 - mr 1,11
36772 - blr
36773 -FUNC_END(_restgpr_31_x)
36774 -FUNC_END(_restgpr_30_x)
36775 -FUNC_END(_restgpr_29_x)
36776 -FUNC_END(_restgpr_28_x)
36777 -FUNC_END(_restgpr_27_x)
36778 -FUNC_END(_restgpr_26_x)
36779 -FUNC_END(_restgpr_25_x)
36780 -FUNC_END(_restgpr_24_x)
36781 -FUNC_END(_restgpr_23_x)
36782 -FUNC_END(_restgpr_22_x)
36783 -FUNC_END(_restgpr_21_x)
36784 -FUNC_END(_restgpr_20_x)
36785 -FUNC_END(_restgpr_19_x)
36786 -FUNC_END(_restgpr_18_x)
36787 -FUNC_END(_restgpr_17_x)
36788 -FUNC_END(_restgpr_16_x)
36789 -FUNC_END(_restgpr_15_x)
36790 -FUNC_END(_restgpr_14_x)
36791 -
36792 -#endif
36793 --- a/gcc/config/rs6000/darwin-ldouble.c
36794 +++ b/gcc/config/rs6000/darwin-ldouble.c
36795 @@ -422,15 +422,13 @@ fmsub (double a, double b, double c)
36796 FP_UNPACK_SEMIRAW_Q(U,u);
36797 FP_UNPACK_SEMIRAW_Q(Z,z);
36798 FP_SUB_Q(V,U,Z);
36799 - FP_PACK_SEMIRAW_Q(v,V);
36800 - FP_HANDLE_EXCEPTIONS;
36801
36802 /* Truncate quad to double. */
36803 - FP_INIT_ROUNDMODE;
36804 - FP_UNPACK_SEMIRAW_Q(V,v);
36805 #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
36806 + V_f[3] &= 0x0007ffff;
36807 FP_TRUNC(D,Q,2,4,R,V);
36808 #else
36809 + V_f1 &= 0x0007ffffffffffffL;
36810 FP_TRUNC(D,Q,1,2,R,V);
36811 #endif
36812 FP_PACK_SEMIRAW_D(r,R);
36813 --- a/gcc/config/rs6000/darwin.h
36814 +++ b/gcc/config/rs6000/darwin.h
36815 @@ -191,6 +191,8 @@
36816
36817 #undef FP_SAVE_INLINE
36818 #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)
36819 +#undef GP_SAVE_INLINE
36820 +#define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32)
36821
36822 /* Darwin uses a function call if everything needs to be saved/restored. */
36823 #undef WORLD_SAVE_P
36824 --- a/gcc/config/rs6000/dfp.md
36825 +++ b/gcc/config/rs6000/dfp.md
36826 @@ -155,7 +155,7 @@
36827 (define_expand "negdd2"
36828 [(set (match_operand:DD 0 "gpc_reg_operand" "")
36829 (neg:DD (match_operand:DD 1 "gpc_reg_operand" "")))]
36830 - "TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)"
36831 + "TARGET_HARD_FLOAT && TARGET_FPRS"
36832 "")
36833
36834 (define_insn "*negdd2_fpr"
36835 @@ -168,7 +168,7 @@
36836 (define_expand "absdd2"
36837 [(set (match_operand:DD 0 "gpc_reg_operand" "")
36838 (abs:DD (match_operand:DD 1 "gpc_reg_operand" "")))]
36839 - "TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)"
36840 + "TARGET_HARD_FLOAT && TARGET_FPRS"
36841 "")
36842
36843 (define_insn "*absdd2_fpr"
36844 @@ -376,7 +376,7 @@
36845 (define_insn "*movdd_softfloat32"
36846 [(set (match_operand:DD 0 "nonimmediate_operand" "=r,r,m,r,r,r")
36847 (match_operand:DD 1 "input_operand" "r,m,r,G,H,F"))]
36848 - "! TARGET_POWERPC64 && TARGET_SOFT_FLOAT
36849 + "! TARGET_POWERPC64 && (TARGET_SOFT_FLOAT || !TARGET_FPRS)
36850 && (gpc_reg_operand (operands[0], DDmode)
36851 || gpc_reg_operand (operands[1], DDmode))"
36852 "*
36853 @@ -486,7 +486,7 @@
36854 (define_expand "negtd2"
36855 [(set (match_operand:TD 0 "gpc_reg_operand" "")
36856 (neg:TD (match_operand:TD 1 "gpc_reg_operand" "")))]
36857 - "TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)"
36858 + "TARGET_HARD_FLOAT && TARGET_FPRS"
36859 "")
36860
36861 (define_insn "*negtd2_fpr"
36862 @@ -499,7 +499,7 @@
36863 (define_expand "abstd2"
36864 [(set (match_operand:TD 0 "gpc_reg_operand" "")
36865 (abs:TD (match_operand:TD 1 "gpc_reg_operand" "")))]
36866 - "TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)"
36867 + "TARGET_HARD_FLOAT && TARGET_FPRS"
36868 "")
36869
36870 (define_insn "*abstd2_fpr"
36871 --- /dev/null
36872 +++ b/gcc/config/rs6000/e300c2c3.md
36873 @@ -0,0 +1,189 @@
36874 +;; Pipeline description for Motorola PowerPC e300c3 core.
36875 +;; Copyright (C) 2008 Free Software Foundation, Inc.
36876 +;; Contributed by Edmar Wienskoski (edmar@freescale.com)
36877 +;;
36878 +;; This file is part of GCC.
36879 +;;
36880 +;; GCC is free software; you can redistribute it and/or modify it
36881 +;; under the terms of the GNU General Public License as published
36882 +;; by the Free Software Foundation; either version 3, or (at your
36883 +;; option) any later version.
36884 +;;
36885 +;; GCC is distributed in the hope that it will be useful, but WITHOUT
36886 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
36887 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
36888 +;; License for more details.
36889 +;;
36890 +;; You should have received a copy of the GNU General Public License
36891 +;; along with GCC; see the file COPYING3. If not see
36892 +;; <http://www.gnu.org/licenses/>.
36893 +
36894 +(define_automaton "ppce300c3_most,ppce300c3_long,ppce300c3_retire")
36895 +(define_cpu_unit "ppce300c3_decode_0,ppce300c3_decode_1" "ppce300c3_most")
36896 +
36897 +;; We don't simulate general issue queue (GIC). If we have SU insn
36898 +;; and then SU1 insn, they can not be issued on the same cycle
36899 +;; (although SU1 insn and then SU insn can be issued) because the SU
36900 +;; insn will go to SU1 from GIC0 entry. Fortunately, the first cycle
36901 +;; multipass insn scheduling will find the situation and issue the SU1
36902 +;; insn and then the SU insn.
36903 +(define_cpu_unit "ppce300c3_issue_0,ppce300c3_issue_1" "ppce300c3_most")
36904 +
36905 +;; We could describe completion buffers slots in combination with the
36906 +;; retirement units and the order of completion but the result
36907 +;; automaton would behave in the same way because we can not describe
36908 +;; real latency time with taking in order completion into account.
36909 +;; Actually we could define the real latency time by querying reserved
36910 +;; automaton units but the current scheduler uses latency time before
36911 +;; issuing insns and making any reservations.
36912 +;;
36913 +;; So our description is aimed to achieve a insn schedule in which the
36914 +;; insns would not wait in the completion buffer.
36915 +(define_cpu_unit "ppce300c3_retire_0,ppce300c3_retire_1" "ppce300c3_retire")
36916 +
36917 +;; Branch unit:
36918 +(define_cpu_unit "ppce300c3_bu" "ppce300c3_most")
36919 +
36920 +;; IU:
36921 +(define_cpu_unit "ppce300c3_iu0_stage0,ppce300c3_iu1_stage0" "ppce300c3_most")
36922 +
36923 +;; IU: This used to describe non-pipelined division.
36924 +(define_cpu_unit "ppce300c3_mu_div" "ppce300c3_long")
36925 +
36926 +;; SRU:
36927 +(define_cpu_unit "ppce300c3_sru_stage0" "ppce300c3_most")
36928 +
36929 +;; Here we simplified LSU unit description not describing the stages.
36930 +(define_cpu_unit "ppce300c3_lsu" "ppce300c3_most")
36931 +
36932 +;; FPU:
36933 +(define_cpu_unit "ppce300c3_fpu" "ppce300c3_most")
36934 +
36935 +;; The following units are used to make automata deterministic
36936 +(define_cpu_unit "present_ppce300c3_decode_0" "ppce300c3_most")
36937 +(define_cpu_unit "present_ppce300c3_issue_0" "ppce300c3_most")
36938 +(define_cpu_unit "present_ppce300c3_retire_0" "ppce300c3_retire")
36939 +(define_cpu_unit "present_ppce300c3_iu0_stage0" "ppce300c3_most")
36940 +
36941 +;; The following sets to make automata deterministic when option ndfa is used.
36942 +(presence_set "present_ppce300c3_decode_0" "ppce300c3_decode_0")
36943 +(presence_set "present_ppce300c3_issue_0" "ppce300c3_issue_0")
36944 +(presence_set "present_ppce300c3_retire_0" "ppce300c3_retire_0")
36945 +(presence_set "present_ppce300c3_iu0_stage0" "ppce300c3_iu0_stage0")
36946 +
36947 +;; Some useful abbreviations.
36948 +(define_reservation "ppce300c3_decode"
36949 + "ppce300c3_decode_0|ppce300c3_decode_1+present_ppce300c3_decode_0")
36950 +(define_reservation "ppce300c3_issue"
36951 + "ppce300c3_issue_0|ppce300c3_issue_1+present_ppce300c3_issue_0")
36952 +(define_reservation "ppce300c3_retire"
36953 + "ppce300c3_retire_0|ppce300c3_retire_1+present_ppce300c3_retire_0")
36954 +(define_reservation "ppce300c3_iu_stage0"
36955 + "ppce300c3_iu0_stage0|ppce300c3_iu1_stage0+present_ppce300c3_iu0_stage0")
36956 +
36957 +;; Compares can be executed either one of the IU or SRU
36958 +(define_insn_reservation "ppce300c3_cmp" 1
36959 + (and (eq_attr "type" "cmp,compare,delayed_compare,fast_compare")
36960 + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
36961 + "ppce300c3_decode,ppce300c3_issue+(ppce300c3_iu_stage0|ppce300c3_sru_stage0) \
36962 + +ppce300c3_retire")
36963 +
36964 +;; Other one cycle IU insns
36965 +(define_insn_reservation "ppce300c3_iu" 1
36966 + (and (eq_attr "type" "integer,insert_word")
36967 + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
36968 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_iu_stage0+ppce300c3_retire")
36969 +
36970 +;; Branch. Actually this latency time is not used by the scheduler.
36971 +(define_insn_reservation "ppce300c3_branch" 1
36972 + (and (eq_attr "type" "jmpreg,branch")
36973 + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
36974 + "ppce300c3_decode,ppce300c3_bu,ppce300c3_retire")
36975 +
36976 +;; Multiply is non-pipelined but can be executed in any IU
36977 +(define_insn_reservation "ppce300c3_multiply" 2
36978 + (and (eq_attr "type" "imul,imul2,imul3,imul_compare")
36979 + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
36980 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_iu_stage0, \
36981 + ppce300c3_iu_stage0+ppce300c3_retire")
36982 +
36983 +;; Divide. We use the average latency time here. We omit reserving a
36984 +;; retire unit because of the result automata will be huge.
36985 +(define_insn_reservation "ppce300c3_divide" 20
36986 + (and (eq_attr "type" "idiv")
36987 + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
36988 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_iu_stage0+ppce300c3_mu_div,\
36989 + ppce300c3_mu_div*19")
36990 +
36991 +;; CR logical
36992 +(define_insn_reservation "ppce300c3_cr_logical" 1
36993 + (and (eq_attr "type" "cr_logical,delayed_cr")
36994 + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
36995 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire")
36996 +
36997 +;; Mfcr
36998 +(define_insn_reservation "ppce300c3_mfcr" 1
36999 + (and (eq_attr "type" "mfcr")
37000 + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
37001 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire")
37002 +
37003 +;; Mtcrf
37004 +(define_insn_reservation "ppce300c3_mtcrf" 1
37005 + (and (eq_attr "type" "mtcr")
37006 + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
37007 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire")
37008 +
37009 +;; Mtjmpr
37010 +(define_insn_reservation "ppce300c3_mtjmpr" 1
37011 + (and (eq_attr "type" "mtjmpr,mfjmpr")
37012 + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
37013 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_sru_stage0+ppce300c3_retire")
37014 +
37015 +;; Float point instructions
37016 +(define_insn_reservation "ppce300c3_fpcompare" 3
37017 + (and (eq_attr "type" "fpcompare")
37018 + (eq_attr "cpu" "ppce300c3"))
37019 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,nothing,ppce300c3_retire")
37020 +
37021 +(define_insn_reservation "ppce300c3_fp" 3
37022 + (and (eq_attr "type" "fp")
37023 + (eq_attr "cpu" "ppce300c3"))
37024 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,nothing,ppce300c3_retire")
37025 +
37026 +(define_insn_reservation "ppce300c3_dmul" 4
37027 + (and (eq_attr "type" "dmul")
37028 + (eq_attr "cpu" "ppce300c3"))
37029 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,ppce300c3_fpu,nothing,ppce300c3_retire")
37030 +
37031 +; Divides are not pipelined
37032 +(define_insn_reservation "ppce300c3_sdiv" 18
37033 + (and (eq_attr "type" "sdiv")
37034 + (eq_attr "cpu" "ppce300c3"))
37035 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,ppce300c3_fpu*17")
37036 +
37037 +(define_insn_reservation "ppce300c3_ddiv" 33
37038 + (and (eq_attr "type" "ddiv")
37039 + (eq_attr "cpu" "ppce300c3"))
37040 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_fpu,ppce300c3_fpu*32")
37041 +
37042 +;; Loads
37043 +(define_insn_reservation "ppce300c3_load" 2
37044 + (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u")
37045 + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
37046 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire")
37047 +
37048 +(define_insn_reservation "ppce300c3_fpload" 2
37049 + (and (eq_attr "type" "fpload,fpload_ux,fpload_u")
37050 + (eq_attr "cpu" "ppce300c3"))
37051 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire")
37052 +
37053 +;; Stores.
37054 +(define_insn_reservation "ppce300c3_store" 2
37055 + (and (eq_attr "type" "store,store_ux,store_u")
37056 + (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
37057 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire")
37058 +
37059 +(define_insn_reservation "ppce300c3_fpstore" 2
37060 + (and (eq_attr "type" "fpstore,fpstore_ux,fpstore_u")
37061 + (eq_attr "cpu" "ppce300c3"))
37062 + "ppce300c3_decode,ppce300c3_issue+ppce300c3_lsu,ppce300c3_retire")
37063 --- a/gcc/config/rs6000/e500.h
37064 +++ b/gcc/config/rs6000/e500.h
37065 @@ -19,7 +19,6 @@
37066 #undef TARGET_SPE_ABI
37067 #undef TARGET_SPE
37068 #undef TARGET_E500
37069 -#undef TARGET_ISEL
37070 #undef TARGET_FPRS
37071 #undef TARGET_E500_SINGLE
37072 #undef TARGET_E500_DOUBLE
37073 @@ -28,13 +27,12 @@
37074 #define TARGET_SPE_ABI rs6000_spe_abi
37075 #define TARGET_SPE rs6000_spe
37076 #define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540)
37077 -#define TARGET_ISEL rs6000_isel
37078 #define TARGET_FPRS (rs6000_float_gprs == 0)
37079 #define TARGET_E500_SINGLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 1)
37080 #define TARGET_E500_DOUBLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 2)
37081 #define CHECK_E500_OPTIONS \
37082 do { \
37083 - if (TARGET_E500 || TARGET_SPE || TARGET_SPE_ABI || TARGET_ISEL \
37084 + if (TARGET_E500 || TARGET_SPE || TARGET_SPE_ABI \
37085 || TARGET_E500_SINGLE || TARGET_E500_DOUBLE) \
37086 { \
37087 if (TARGET_ALTIVEC) \
37088 --- /dev/null
37089 +++ b/gcc/config/rs6000/e500crtres32gpr.asm
37090 @@ -0,0 +1,84 @@
37091 +/*
37092 + * Special support for e500 eabi and SVR4
37093 + *
37094 + * Copyright (C) 2008 Free Software Foundation, Inc.
37095 + * Written by Nathan Froyd
37096 + *
37097 + * This file is free software; you can redistribute it and/or modify it
37098 + * under the terms of the GNU General Public License as published by the
37099 + * Free Software Foundation; either version 2, or (at your option) any
37100 + * later version.
37101 + *
37102 + * In addition to the permissions in the GNU General Public License, the
37103 + * Free Software Foundation gives you unlimited permission to link the
37104 + * compiled version of this file with other programs, and to distribute
37105 + * those programs without any restriction coming from the use of this
37106 + * file. (The General Public License restrictions do apply in other
37107 + * respects; for example, they cover modification of the file, and
37108 + * distribution when not linked into another program.)
37109 + *
37110 + * This file is distributed in the hope that it will be useful, but
37111 + * WITHOUT ANY WARRANTY; without even the implied warranty of
37112 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37113 + * General Public License for more details.
37114 + *
37115 + * You should have received a copy of the GNU General Public License
37116 + * along with this program; see the file COPYING. If not, write to
37117 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
37118 + * Boston, MA 02110-1301, USA.
37119 + *
37120 + * As a special exception, if you link this library with files
37121 + * compiled with GCC to produce an executable, this does not cause
37122 + * the resulting executable to be covered by the GNU General Public License.
37123 + * This exception does not however invalidate any other reasons why
37124 + * the executable file might be covered by the GNU General Public License.
37125 + */
37126 +
37127 + .file "e500crtres32gpr.asm"
37128 + .section ".text"
37129 + #include "ppc-asm.h"
37130 +
37131 +#ifdef __SPE__
37132 +
37133 +/* Routines for restoring 32-bit integer registers, called by the compiler. */
37134 +/* "Bare" versions that simply return to their caller. */
37135 +
37136 +HIDDEN_FUNC(_rest32gpr_14) lwz 14,-72(11)
37137 +HIDDEN_FUNC(_rest32gpr_15) lwz 15,-68(11)
37138 +HIDDEN_FUNC(_rest32gpr_16) lwz 16,-64(11)
37139 +HIDDEN_FUNC(_rest32gpr_17) lwz 17,-60(11)
37140 +HIDDEN_FUNC(_rest32gpr_18) lwz 18,-56(11)
37141 +HIDDEN_FUNC(_rest32gpr_19) lwz 19,-52(11)
37142 +HIDDEN_FUNC(_rest32gpr_20) lwz 20,-48(11)
37143 +HIDDEN_FUNC(_rest32gpr_21) lwz 21,-44(11)
37144 +HIDDEN_FUNC(_rest32gpr_22) lwz 22,-40(11)
37145 +HIDDEN_FUNC(_rest32gpr_23) lwz 23,-36(11)
37146 +HIDDEN_FUNC(_rest32gpr_24) lwz 24,-32(11)
37147 +HIDDEN_FUNC(_rest32gpr_25) lwz 25,-28(11)
37148 +HIDDEN_FUNC(_rest32gpr_26) lwz 26,-24(11)
37149 +HIDDEN_FUNC(_rest32gpr_27) lwz 27,-20(11)
37150 +HIDDEN_FUNC(_rest32gpr_28) lwz 28,-16(11)
37151 +HIDDEN_FUNC(_rest32gpr_29) lwz 29,-12(11)
37152 +HIDDEN_FUNC(_rest32gpr_30) lwz 30,-8(11)
37153 +HIDDEN_FUNC(_rest32gpr_31) lwz 31,-4(11)
37154 + blr
37155 +FUNC_END(_rest32gpr_31)
37156 +FUNC_END(_rest32gpr_30)
37157 +FUNC_END(_rest32gpr_29)
37158 +FUNC_END(_rest32gpr_28)
37159 +FUNC_END(_rest32gpr_27)
37160 +FUNC_END(_rest32gpr_26)
37161 +FUNC_END(_rest32gpr_25)
37162 +FUNC_END(_rest32gpr_24)
37163 +FUNC_END(_rest32gpr_23)
37164 +FUNC_END(_rest32gpr_22)
37165 +FUNC_END(_rest32gpr_21)
37166 +FUNC_END(_rest32gpr_20)
37167 +FUNC_END(_rest32gpr_19)
37168 +FUNC_END(_rest32gpr_18)
37169 +FUNC_END(_rest32gpr_17)
37170 +FUNC_END(_rest32gpr_16)
37171 +FUNC_END(_rest32gpr_15)
37172 +FUNC_END(_rest32gpr_14)
37173 +
37174 +#endif
37175 --- /dev/null
37176 +++ b/gcc/config/rs6000/e500crtres64gpr.asm
37177 @@ -0,0 +1,84 @@
37178 +/*
37179 + * Special support for e500 eabi and SVR4
37180 + *
37181 + * Copyright (C) 2008 Free Software Foundation, Inc.
37182 + * Written by Nathan Froyd
37183 + *
37184 + * This file is free software; you can redistribute it and/or modify it
37185 + * under the terms of the GNU General Public License as published by the
37186 + * Free Software Foundation; either version 2, or (at your option) any
37187 + * later version.
37188 + *
37189 + * In addition to the permissions in the GNU General Public License, the
37190 + * Free Software Foundation gives you unlimited permission to link the
37191 + * compiled version of this file with other programs, and to distribute
37192 + * those programs without any restriction coming from the use of this
37193 + * file. (The General Public License restrictions do apply in other
37194 + * respects; for example, they cover modification of the file, and
37195 + * distribution when not linked into another program.)
37196 + *
37197 + * This file is distributed in the hope that it will be useful, but
37198 + * WITHOUT ANY WARRANTY; without even the implied warranty of
37199 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37200 + * General Public License for more details.
37201 + *
37202 + * You should have received a copy of the GNU General Public License
37203 + * along with this program; see the file COPYING. If not, write to
37204 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
37205 + * Boston, MA 02110-1301, USA.
37206 + *
37207 + * As a special exception, if you link this library with files
37208 + * compiled with GCC to produce an executable, this does not cause
37209 + * the resulting executable to be covered by the GNU General Public License.
37210 + * This exception does not however invalidate any other reasons why
37211 + * the executable file might be covered by the GNU General Public License.
37212 + */
37213 +
37214 + .file "e500crtres64gpr.asm"
37215 + .section ".text"
37216 + #include "ppc-asm.h"
37217 +
37218 +#ifdef __SPE__
37219 +
37220 +/* Routines for restoring 64-bit integer registers, called by the compiler. */
37221 +/* "Bare" versions that return to their caller. */
37222 +
37223 +HIDDEN_FUNC(_rest64gpr_14) evldd 14,0(11)
37224 +HIDDEN_FUNC(_rest64gpr_15) evldd 15,8(11)
37225 +HIDDEN_FUNC(_rest64gpr_16) evldd 16,16(11)
37226 +HIDDEN_FUNC(_rest64gpr_17) evldd 17,24(11)
37227 +HIDDEN_FUNC(_rest64gpr_18) evldd 18,32(11)
37228 +HIDDEN_FUNC(_rest64gpr_19) evldd 19,40(11)
37229 +HIDDEN_FUNC(_rest64gpr_20) evldd 20,48(11)
37230 +HIDDEN_FUNC(_rest64gpr_21) evldd 21,56(11)
37231 +HIDDEN_FUNC(_rest64gpr_22) evldd 22,64(11)
37232 +HIDDEN_FUNC(_rest64gpr_23) evldd 23,72(11)
37233 +HIDDEN_FUNC(_rest64gpr_24) evldd 24,80(11)
37234 +HIDDEN_FUNC(_rest64gpr_25) evldd 25,88(11)
37235 +HIDDEN_FUNC(_rest64gpr_26) evldd 26,96(11)
37236 +HIDDEN_FUNC(_rest64gpr_27) evldd 27,104(11)
37237 +HIDDEN_FUNC(_rest64gpr_28) evldd 28,112(11)
37238 +HIDDEN_FUNC(_rest64gpr_29) evldd 29,120(11)
37239 +HIDDEN_FUNC(_rest64gpr_30) evldd 30,128(11)
37240 +HIDDEN_FUNC(_rest64gpr_31) evldd 31,136(11)
37241 + blr
37242 +FUNC_END(_rest64gpr_31)
37243 +FUNC_END(_rest64gpr_30)
37244 +FUNC_END(_rest64gpr_29)
37245 +FUNC_END(_rest64gpr_28)
37246 +FUNC_END(_rest64gpr_27)
37247 +FUNC_END(_rest64gpr_26)
37248 +FUNC_END(_rest64gpr_25)
37249 +FUNC_END(_rest64gpr_24)
37250 +FUNC_END(_rest64gpr_23)
37251 +FUNC_END(_rest64gpr_22)
37252 +FUNC_END(_rest64gpr_21)
37253 +FUNC_END(_rest64gpr_20)
37254 +FUNC_END(_rest64gpr_19)
37255 +FUNC_END(_rest64gpr_18)
37256 +FUNC_END(_rest64gpr_17)
37257 +FUNC_END(_rest64gpr_16)
37258 +FUNC_END(_rest64gpr_15)
37259 +FUNC_END(_rest64gpr_14)
37260 +
37261 +#endif
37262 --- /dev/null
37263 +++ b/gcc/config/rs6000/e500crtres64gprctr.asm
37264 @@ -0,0 +1,83 @@
37265 +/*
37266 + * Special support for e500 eabi and SVR4
37267 + *
37268 + * Copyright (C) 2008 Free Software Foundation, Inc.
37269 + * Written by Nathan Froyd
37270 + *
37271 + * This file is free software; you can redistribute it and/or modify it
37272 + * under the terms of the GNU General Public License as published by the
37273 + * Free Software Foundation; either version 2, or (at your option) any
37274 + * later version.
37275 + *
37276 + * In addition to the permissions in the GNU General Public License, the
37277 + * Free Software Foundation gives you unlimited permission to link the
37278 + * compiled version of this file with other programs, and to distribute
37279 + * those programs without any restriction coming from the use of this
37280 + * file. (The General Public License restrictions do apply in other
37281 + * respects; for example, they cover modification of the file, and
37282 + * distribution when not linked into another program.)
37283 + *
37284 + * This file is distributed in the hope that it will be useful, but
37285 + * WITHOUT ANY WARRANTY; without even the implied warranty of
37286 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37287 + * General Public License for more details.
37288 + *
37289 + * You should have received a copy of the GNU General Public License
37290 + * along with this program; see the file COPYING. If not, write to
37291 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
37292 + * Boston, MA 02110-1301, USA.
37293 + *
37294 + * As a special exception, if you link this library with files
37295 + * compiled with GCC to produce an executable, this does not cause
37296 + * the resulting executable to be covered by the GNU General Public License.
37297 + * This exception does not however invalidate any other reasons why
37298 + * the executable file might be covered by the GNU General Public License.
37299 + */
37300 +
37301 + .file "e500crtres64gprctr.asm"
37302 + .section ".text"
37303 + #include "ppc-asm.h"
37304 +
37305 +#ifdef __SPE__
37306 +
37307 +/* Routines for restoring 64-bit integer registers where the number of
37308 + registers to be restored is passed in CTR, called by the compiler. */
37309 +
37310 +HIDDEN_FUNC(_rest64gpr_ctr_14) evldd 14,0(11)
37311 + bdz _rest64_gpr_ctr_done
37312 +HIDDEN_FUNC(_rest64gpr_ctr_15) evldd 15,8(11)
37313 + bdz _rest64_gpr_ctr_done
37314 +HIDDEN_FUNC(_rest64gpr_ctr_16) evldd 16,16(11)
37315 + bdz _rest64_gpr_ctr_done
37316 +HIDDEN_FUNC(_rest64gpr_ctr_17) evldd 17,24(11)
37317 + bdz _rest64_gpr_ctr_done
37318 +HIDDEN_FUNC(_rest64gpr_ctr_18) evldd 18,32(11)
37319 + bdz _rest64_gpr_ctr_done
37320 +HIDDEN_FUNC(_rest64gpr_ctr_19) evldd 19,40(11)
37321 + bdz _rest64_gpr_ctr_done
37322 +HIDDEN_FUNC(_rest64gpr_ctr_20) evldd 20,48(11)
37323 + bdz _rest64_gpr_ctr_done
37324 +HIDDEN_FUNC(_rest64gpr_ctr_21) evldd 21,56(11)
37325 + bdz _rest64_gpr_ctr_done
37326 +HIDDEN_FUNC(_rest64gpr_ctr_22) evldd 22,64(11)
37327 + bdz _rest64_gpr_ctr_done
37328 +HIDDEN_FUNC(_rest64gpr_ctr_23) evldd 23,72(11)
37329 + bdz _rest64_gpr_ctr_done
37330 +HIDDEN_FUNC(_rest64gpr_ctr_24) evldd 24,80(11)
37331 + bdz _rest64_gpr_ctr_done
37332 +HIDDEN_FUNC(_rest64gpr_ctr_25) evldd 25,88(11)
37333 + bdz _rest64_gpr_ctr_done
37334 +HIDDEN_FUNC(_rest64gpr_ctr_26) evldd 26,96(11)
37335 + bdz _rest64_gpr_ctr_done
37336 +HIDDEN_FUNC(_rest64gpr_ctr_27) evldd 27,104(11)
37337 + bdz _rest64_gpr_ctr_done
37338 +HIDDEN_FUNC(_rest64gpr_ctr_28) evldd 28,112(11)
37339 + bdz _rest64_gpr_ctr_done
37340 +HIDDEN_FUNC(_rest64gpr_ctr_29) evldd 29,120(11)
37341 + bdz _rest64_gpr_ctr_done
37342 +HIDDEN_FUNC(_rest64gpr_ctr_30) evldd 30,128(11)
37343 + bdz _rest64_gpr_ctr_done
37344 +HIDDEN_FUNC(_rest64gpr_ctr_31) evldd 31,136(11)
37345 +_rest64gpr_ctr_done: blr
37346 +
37347 +#endif
37348 --- /dev/null
37349 +++ b/gcc/config/rs6000/e500crtrest32gpr.asm
37350 @@ -0,0 +1,86 @@
37351 +/*
37352 + * Special support for e500 eabi and SVR4
37353 + *
37354 + * Copyright (C) 2008 Free Software Foundation, Inc.
37355 + * Written by Nathan Froyd
37356 + *
37357 + * This file is free software; you can redistribute it and/or modify it
37358 + * under the terms of the GNU General Public License as published by the
37359 + * Free Software Foundation; either version 2, or (at your option) any
37360 + * later version.
37361 + *
37362 + * In addition to the permissions in the GNU General Public License, the
37363 + * Free Software Foundation gives you unlimited permission to link the
37364 + * compiled version of this file with other programs, and to distribute
37365 + * those programs without any restriction coming from the use of this
37366 + * file. (The General Public License restrictions do apply in other
37367 + * respects; for example, they cover modification of the file, and
37368 + * distribution when not linked into another program.)
37369 + *
37370 + * This file is distributed in the hope that it will be useful, but
37371 + * WITHOUT ANY WARRANTY; without even the implied warranty of
37372 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37373 + * General Public License for more details.
37374 + *
37375 + * You should have received a copy of the GNU General Public License
37376 + * along with this program; see the file COPYING. If not, write to
37377 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
37378 + * Boston, MA 02110-1301, USA.
37379 + *
37380 + * As a special exception, if you link this library with files
37381 + * compiled with GCC to produce an executable, this does not cause
37382 + * the resulting executable to be covered by the GNU General Public License.
37383 + * This exception does not however invalidate any other reasons why
37384 + * the executable file might be covered by the GNU General Public License.
37385 + */
37386 +
37387 + .file "e500crtrest32gpr.asm"
37388 + .section ".text"
37389 + #include "ppc-asm.h"
37390 +
37391 +#ifdef __SPE__
37392 +
37393 +/* Routines for restoring 32-bit integer registers, called by the compiler. */
37394 +/* "Tail" versions that perform a tail call. */
37395 +
37396 +HIDDEN_FUNC(_rest32gpr_14_t) lwz 14,-72(11)
37397 +HIDDEN_FUNC(_rest32gpr_15_t) lwz 15,-68(11)
37398 +HIDDEN_FUNC(_rest32gpr_16_t) lwz 16,-64(11)
37399 +HIDDEN_FUNC(_rest32gpr_17_t) lwz 17,-60(11)
37400 +HIDDEN_FUNC(_rest32gpr_18_t) lwz 18,-56(11)
37401 +HIDDEN_FUNC(_rest32gpr_19_t) lwz 19,-52(11)
37402 +HIDDEN_FUNC(_rest32gpr_20_t) lwz 20,-48(11)
37403 +HIDDEN_FUNC(_rest32gpr_21_t) lwz 21,-44(11)
37404 +HIDDEN_FUNC(_rest32gpr_22_t) lwz 22,-40(11)
37405 +HIDDEN_FUNC(_rest32gpr_23_t) lwz 23,-36(11)
37406 +HIDDEN_FUNC(_rest32gpr_24_t) lwz 24,-32(11)
37407 +HIDDEN_FUNC(_rest32gpr_25_t) lwz 25,-28(11)
37408 +HIDDEN_FUNC(_rest32gpr_26_t) lwz 26,-24(11)
37409 +HIDDEN_FUNC(_rest32gpr_27_t) lwz 27,-20(11)
37410 +HIDDEN_FUNC(_rest32gpr_28_t) lwz 28,-16(11)
37411 +HIDDEN_FUNC(_rest32gpr_29_t) lwz 29,-12(11)
37412 +HIDDEN_FUNC(_rest32gpr_30_t) lwz 30,-8(11)
37413 +HIDDEN_FUNC(_rest32gpr_31_t) lwz 31,-4(11)
37414 + lwz 0,4(11)
37415 + mr 1,11
37416 + blr
37417 +FUNC_END(_rest32gpr_31_t)
37418 +FUNC_END(_rest32gpr_30_t)
37419 +FUNC_END(_rest32gpr_29_t)
37420 +FUNC_END(_rest32gpr_28_t)
37421 +FUNC_END(_rest32gpr_27_t)
37422 +FUNC_END(_rest32gpr_26_t)
37423 +FUNC_END(_rest32gpr_25_t)
37424 +FUNC_END(_rest32gpr_24_t)
37425 +FUNC_END(_rest32gpr_23_t)
37426 +FUNC_END(_rest32gpr_22_t)
37427 +FUNC_END(_rest32gpr_21_t)
37428 +FUNC_END(_rest32gpr_20_t)
37429 +FUNC_END(_rest32gpr_19_t)
37430 +FUNC_END(_rest32gpr_18_t)
37431 +FUNC_END(_rest32gpr_17_t)
37432 +FUNC_END(_rest32gpr_16_t)
37433 +FUNC_END(_rest32gpr_15_t)
37434 +FUNC_END(_rest32gpr_14_t)
37435 +
37436 +#endif
37437 --- /dev/null
37438 +++ b/gcc/config/rs6000/e500crtrest64gpr.asm
37439 @@ -0,0 +1,85 @@
37440 +/*
37441 + * Special support for e500 eabi and SVR4
37442 + *
37443 + * Copyright (C) 2008 Free Software Foundation, Inc.
37444 + * Written by Nathan Froyd
37445 + *
37446 + * This file is free software; you can redistribute it and/or modify it
37447 + * under the terms of the GNU General Public License as published by the
37448 + * Free Software Foundation; either version 2, or (at your option) any
37449 + * later version.
37450 + *
37451 + * In addition to the permissions in the GNU General Public License, the
37452 + * Free Software Foundation gives you unlimited permission to link the
37453 + * compiled version of this file with other programs, and to distribute
37454 + * those programs without any restriction coming from the use of this
37455 + * file. (The General Public License restrictions do apply in other
37456 + * respects; for example, they cover modification of the file, and
37457 + * distribution when not linked into another program.)
37458 + *
37459 + * This file is distributed in the hope that it will be useful, but
37460 + * WITHOUT ANY WARRANTY; without even the implied warranty of
37461 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37462 + * General Public License for more details.
37463 + *
37464 + * You should have received a copy of the GNU General Public License
37465 + * along with this program; see the file COPYING. If not, write to
37466 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
37467 + * Boston, MA 02110-1301, USA.
37468 + *
37469 + * As a special exception, if you link this library with files
37470 + * compiled with GCC to produce an executable, this does not cause
37471 + * the resulting executable to be covered by the GNU General Public License.
37472 + * This exception does not however invalidate any other reasons why
37473 + * the executable file might be covered by the GNU General Public License.
37474 + */
37475 +
37476 + .file "e500crtrest64gpr.asm"
37477 + .section ".text"
37478 + #include "ppc-asm.h"
37479 +
37480 +#ifdef __SPE__
37481 +
37482 +/* "Tail" versions that perform a tail call. */
37483 +
37484 +HIDDEN_FUNC(_rest64gpr_14_t) evldd 14,0(11)
37485 +HIDDEN_FUNC(_rest64gpr_15_t) evldd 15,8(11)
37486 +HIDDEN_FUNC(_rest64gpr_16_t) evldd 16,16(11)
37487 +HIDDEN_FUNC(_rest64gpr_17_t) evldd 17,24(11)
37488 +HIDDEN_FUNC(_rest64gpr_18_t) evldd 18,32(11)
37489 +HIDDEN_FUNC(_rest64gpr_19_t) evldd 19,40(11)
37490 +HIDDEN_FUNC(_rest64gpr_20_t) evldd 20,48(11)
37491 +HIDDEN_FUNC(_rest64gpr_21_t) evldd 21,56(11)
37492 +HIDDEN_FUNC(_rest64gpr_22_t) evldd 22,64(11)
37493 +HIDDEN_FUNC(_rest64gpr_23_t) evldd 23,72(11)
37494 +HIDDEN_FUNC(_rest64gpr_24_t) evldd 24,80(11)
37495 +HIDDEN_FUNC(_rest64gpr_25_t) evldd 25,88(11)
37496 +HIDDEN_FUNC(_rest64gpr_26_t) evldd 26,96(11)
37497 +HIDDEN_FUNC(_rest64gpr_27_t) evldd 27,104(11)
37498 +HIDDEN_FUNC(_rest64gpr_28_t) evldd 28,112(11)
37499 +HIDDEN_FUNC(_rest64gpr_29_t) evldd 29,120(11)
37500 +HIDDEN_FUNC(_rest64gpr_30_t) evldd 30,128(11)
37501 +HIDDEN_FUNC(_rest64gpr_31_t) lwz 0,148(11)
37502 + evldd 31,136(11)
37503 + addi 1,11,144
37504 + blr
37505 +FUNC_END(_rest64gpr_31_t)
37506 +FUNC_END(_rest64gpr_30_t)
37507 +FUNC_END(_rest64gpr_29_t)
37508 +FUNC_END(_rest64gpr_28_t)
37509 +FUNC_END(_rest64gpr_27_t)
37510 +FUNC_END(_rest64gpr_26_t)
37511 +FUNC_END(_rest64gpr_25_t)
37512 +FUNC_END(_rest64gpr_24_t)
37513 +FUNC_END(_rest64gpr_23_t)
37514 +FUNC_END(_rest64gpr_22_t)
37515 +FUNC_END(_rest64gpr_21_t)
37516 +FUNC_END(_rest64gpr_20_t)
37517 +FUNC_END(_rest64gpr_19_t)
37518 +FUNC_END(_rest64gpr_18_t)
37519 +FUNC_END(_rest64gpr_17_t)
37520 +FUNC_END(_rest64gpr_16_t)
37521 +FUNC_END(_rest64gpr_15_t)
37522 +FUNC_END(_rest64gpr_14_t)
37523 +
37524 +#endif
37525 --- /dev/null
37526 +++ b/gcc/config/rs6000/e500crtresx32gpr.asm
37527 @@ -0,0 +1,87 @@
37528 +/*
37529 + * Special support for e500 eabi and SVR4
37530 + *
37531 + * Copyright (C) 2008 Free Software Foundation, Inc.
37532 + * Written by Nathan Froyd
37533 + *
37534 + * This file is free software; you can redistribute it and/or modify it
37535 + * under the terms of the GNU General Public License as published by the
37536 + * Free Software Foundation; either version 2, or (at your option) any
37537 + * later version.
37538 + *
37539 + * In addition to the permissions in the GNU General Public License, the
37540 + * Free Software Foundation gives you unlimited permission to link the
37541 + * compiled version of this file with other programs, and to distribute
37542 + * those programs without any restriction coming from the use of this
37543 + * file. (The General Public License restrictions do apply in other
37544 + * respects; for example, they cover modification of the file, and
37545 + * distribution when not linked into another program.)
37546 + *
37547 + * This file is distributed in the hope that it will be useful, but
37548 + * WITHOUT ANY WARRANTY; without even the implied warranty of
37549 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37550 + * General Public License for more details.
37551 + *
37552 + * You should have received a copy of the GNU General Public License
37553 + * along with this program; see the file COPYING. If not, write to
37554 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
37555 + * Boston, MA 02110-1301, USA.
37556 + *
37557 + * As a special exception, if you link this library with files
37558 + * compiled with GCC to produce an executable, this does not cause
37559 + * the resulting executable to be covered by the GNU General Public License.
37560 + * This exception does not however invalidate any other reasons why
37561 + * the executable file might be covered by the GNU General Public License.
37562 + */
37563 +
37564 + .file "e500crtresx32gpr.asm"
37565 + .section ".text"
37566 + #include "ppc-asm.h"
37567 +
37568 +#ifdef __SPE__
37569 +
37570 +/* Routines for restoring 32-bit integer registers, called by the compiler. */
37571 +/* "Exit" versions that return to the caller's caller. */
37572 +
37573 +HIDDEN_FUNC(_rest32gpr_14_x) lwz 14,-72(11)
37574 +HIDDEN_FUNC(_rest32gpr_15_x) lwz 15,-68(11)
37575 +HIDDEN_FUNC(_rest32gpr_16_x) lwz 16,-64(11)
37576 +HIDDEN_FUNC(_rest32gpr_17_x) lwz 17,-60(11)
37577 +HIDDEN_FUNC(_rest32gpr_18_x) lwz 18,-56(11)
37578 +HIDDEN_FUNC(_rest32gpr_19_x) lwz 19,-52(11)
37579 +HIDDEN_FUNC(_rest32gpr_20_x) lwz 20,-48(11)
37580 +HIDDEN_FUNC(_rest32gpr_21_x) lwz 21,-44(11)
37581 +HIDDEN_FUNC(_rest32gpr_22_x) lwz 22,-40(11)
37582 +HIDDEN_FUNC(_rest32gpr_23_x) lwz 23,-36(11)
37583 +HIDDEN_FUNC(_rest32gpr_24_x) lwz 24,-32(11)
37584 +HIDDEN_FUNC(_rest32gpr_25_x) lwz 25,-28(11)
37585 +HIDDEN_FUNC(_rest32gpr_26_x) lwz 26,-24(11)
37586 +HIDDEN_FUNC(_rest32gpr_27_x) lwz 27,-20(11)
37587 +HIDDEN_FUNC(_rest32gpr_28_x) lwz 28,-16(11)
37588 +HIDDEN_FUNC(_rest32gpr_29_x) lwz 29,-12(11)
37589 +HIDDEN_FUNC(_rest32gpr_30_x) lwz 30,-8(11)
37590 +HIDDEN_FUNC(_rest32gpr_31_x) lwz 0,4(11)
37591 + lwz 31,-4(11)
37592 + mr 1,11
37593 + mtlr 0
37594 + blr
37595 +FUNC_END(_rest32gpr_31_x)
37596 +FUNC_END(_rest32gpr_30_x)
37597 +FUNC_END(_rest32gpr_29_x)
37598 +FUNC_END(_rest32gpr_28_x)
37599 +FUNC_END(_rest32gpr_27_x)
37600 +FUNC_END(_rest32gpr_26_x)
37601 +FUNC_END(_rest32gpr_25_x)
37602 +FUNC_END(_rest32gpr_24_x)
37603 +FUNC_END(_rest32gpr_23_x)
37604 +FUNC_END(_rest32gpr_22_x)
37605 +FUNC_END(_rest32gpr_21_x)
37606 +FUNC_END(_rest32gpr_20_x)
37607 +FUNC_END(_rest32gpr_19_x)
37608 +FUNC_END(_rest32gpr_18_x)
37609 +FUNC_END(_rest32gpr_17_x)
37610 +FUNC_END(_rest32gpr_16_x)
37611 +FUNC_END(_rest32gpr_15_x)
37612 +FUNC_END(_rest32gpr_14_x)
37613 +
37614 +#endif
37615 --- /dev/null
37616 +++ b/gcc/config/rs6000/e500crtresx64gpr.asm
37617 @@ -0,0 +1,86 @@
37618 +/*
37619 + * Special support for e500 eabi and SVR4
37620 + *
37621 + * Copyright (C) 2008 Free Software Foundation, Inc.
37622 + * Written by Nathan Froyd
37623 + *
37624 + * This file is free software; you can redistribute it and/or modify it
37625 + * under the terms of the GNU General Public License as published by the
37626 + * Free Software Foundation; either version 2, or (at your option) any
37627 + * later version.
37628 + *
37629 + * In addition to the permissions in the GNU General Public License, the
37630 + * Free Software Foundation gives you unlimited permission to link the
37631 + * compiled version of this file with other programs, and to distribute
37632 + * those programs without any restriction coming from the use of this
37633 + * file. (The General Public License restrictions do apply in other
37634 + * respects; for example, they cover modification of the file, and
37635 + * distribution when not linked into another program.)
37636 + *
37637 + * This file is distributed in the hope that it will be useful, but
37638 + * WITHOUT ANY WARRANTY; without even the implied warranty of
37639 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37640 + * General Public License for more details.
37641 + *
37642 + * You should have received a copy of the GNU General Public License
37643 + * along with this program; see the file COPYING. If not, write to
37644 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
37645 + * Boston, MA 02110-1301, USA.
37646 + *
37647 + * As a special exception, if you link this library with files
37648 + * compiled with GCC to produce an executable, this does not cause
37649 + * the resulting executable to be covered by the GNU General Public License.
37650 + * This exception does not however invalidate any other reasons why
37651 + * the executable file might be covered by the GNU General Public License.
37652 + */
37653 +
37654 + .file "e500crtresx64gpr.asm"
37655 + .section ".text"
37656 + #include "ppc-asm.h"
37657 +
37658 +#ifdef __SPE__
37659 +
37660 +/* "Exit" versions that return to their caller's caller. */
37661 +
37662 +HIDDEN_FUNC(_rest64gpr_14_x) evldd 14,0(11)
37663 +HIDDEN_FUNC(_rest64gpr_15_x) evldd 15,8(11)
37664 +HIDDEN_FUNC(_rest64gpr_16_x) evldd 16,16(11)
37665 +HIDDEN_FUNC(_rest64gpr_17_x) evldd 17,24(11)
37666 +HIDDEN_FUNC(_rest64gpr_18_x) evldd 18,32(11)
37667 +HIDDEN_FUNC(_rest64gpr_19_x) evldd 19,40(11)
37668 +HIDDEN_FUNC(_rest64gpr_20_x) evldd 20,48(11)
37669 +HIDDEN_FUNC(_rest64gpr_21_x) evldd 21,56(11)
37670 +HIDDEN_FUNC(_rest64gpr_22_x) evldd 22,64(11)
37671 +HIDDEN_FUNC(_rest64gpr_23_x) evldd 23,72(11)
37672 +HIDDEN_FUNC(_rest64gpr_24_x) evldd 24,80(11)
37673 +HIDDEN_FUNC(_rest64gpr_25_x) evldd 25,88(11)
37674 +HIDDEN_FUNC(_rest64gpr_26_x) evldd 26,96(11)
37675 +HIDDEN_FUNC(_rest64gpr_27_x) evldd 27,104(11)
37676 +HIDDEN_FUNC(_rest64gpr_28_x) evldd 28,112(11)
37677 +HIDDEN_FUNC(_rest64gpr_29_x) evldd 29,120(11)
37678 +HIDDEN_FUNC(_rest64gpr_30_x) evldd 30,128(11)
37679 +HIDDEN_FUNC(_rest64gpr_31_x) lwz 0,148(11)
37680 + evldd 31,136(11)
37681 + addi 1,11,144
37682 + mtlr 0
37683 + blr
37684 +FUNC_END(_rest64gpr_31_x)
37685 +FUNC_END(_rest64gpr_30_x)
37686 +FUNC_END(_rest64gpr_29_x)
37687 +FUNC_END(_rest64gpr_28_x)
37688 +FUNC_END(_rest64gpr_27_x)
37689 +FUNC_END(_rest64gpr_26_x)
37690 +FUNC_END(_rest64gpr_25_x)
37691 +FUNC_END(_rest64gpr_24_x)
37692 +FUNC_END(_rest64gpr_23_x)
37693 +FUNC_END(_rest64gpr_22_x)
37694 +FUNC_END(_rest64gpr_21_x)
37695 +FUNC_END(_rest64gpr_20_x)
37696 +FUNC_END(_rest64gpr_19_x)
37697 +FUNC_END(_rest64gpr_18_x)
37698 +FUNC_END(_rest64gpr_17_x)
37699 +FUNC_END(_rest64gpr_16_x)
37700 +FUNC_END(_rest64gpr_15_x)
37701 +FUNC_END(_rest64gpr_14_x)
37702 +
37703 +#endif
37704 --- /dev/null
37705 +++ b/gcc/config/rs6000/e500crtsav32gpr.asm
37706 @@ -0,0 +1,84 @@
37707 +/*
37708 + * Special support for e500 eabi and SVR4
37709 + *
37710 + * Copyright (C) 2008 Free Software Foundation, Inc.
37711 + * Written by Nathan Froyd
37712 + *
37713 + * This file is free software; you can redistribute it and/or modify it
37714 + * under the terms of the GNU General Public License as published by the
37715 + * Free Software Foundation; either version 2, or (at your option) any
37716 + * later version.
37717 + *
37718 + * In addition to the permissions in the GNU General Public License, the
37719 + * Free Software Foundation gives you unlimited permission to link the
37720 + * compiled version of this file with other programs, and to distribute
37721 + * those programs without any restriction coming from the use of this
37722 + * file. (The General Public License restrictions do apply in other
37723 + * respects; for example, they cover modification of the file, and
37724 + * distribution when not linked into another program.)
37725 + *
37726 + * This file is distributed in the hope that it will be useful, but
37727 + * WITHOUT ANY WARRANTY; without even the implied warranty of
37728 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37729 + * General Public License for more details.
37730 + *
37731 + * You should have received a copy of the GNU General Public License
37732 + * along with this program; see the file COPYING. If not, write to
37733 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
37734 + * Boston, MA 02110-1301, USA.
37735 + *
37736 + * As a special exception, if you link this library with files
37737 + * compiled with GCC to produce an executable, this does not cause
37738 + * the resulting executable to be covered by the GNU General Public License.
37739 + * This exception does not however invalidate any other reasons why
37740 + * the executable file might be covered by the GNU General Public License.
37741 + */
37742 +
37743 + .file "e500crtsav32gpr.asm"
37744 + .section ".text"
37745 + #include "ppc-asm.h"
37746 +
37747 +#ifdef __SPE__
37748 +
37749 +/* Routines for saving 32-bit integer registers, called by the compiler. */
37750 +/* "Bare" versions that simply return to their caller. */
37751 +
37752 +HIDDEN_FUNC(_save32gpr_14) stw 14,-72(11)
37753 +HIDDEN_FUNC(_save32gpr_15) stw 15,-68(11)
37754 +HIDDEN_FUNC(_save32gpr_16) stw 16,-64(11)
37755 +HIDDEN_FUNC(_save32gpr_17) stw 17,-60(11)
37756 +HIDDEN_FUNC(_save32gpr_18) stw 18,-56(11)
37757 +HIDDEN_FUNC(_save32gpr_19) stw 19,-52(11)
37758 +HIDDEN_FUNC(_save32gpr_20) stw 20,-48(11)
37759 +HIDDEN_FUNC(_save32gpr_21) stw 21,-44(11)
37760 +HIDDEN_FUNC(_save32gpr_22) stw 22,-40(11)
37761 +HIDDEN_FUNC(_save32gpr_23) stw 23,-36(11)
37762 +HIDDEN_FUNC(_save32gpr_24) stw 24,-32(11)
37763 +HIDDEN_FUNC(_save32gpr_25) stw 25,-28(11)
37764 +HIDDEN_FUNC(_save32gpr_26) stw 26,-24(11)
37765 +HIDDEN_FUNC(_save32gpr_27) stw 27,-20(11)
37766 +HIDDEN_FUNC(_save32gpr_28) stw 28,-16(11)
37767 +HIDDEN_FUNC(_save32gpr_29) stw 29,-12(11)
37768 +HIDDEN_FUNC(_save32gpr_30) stw 30,-8(11)
37769 +HIDDEN_FUNC(_save32gpr_31) stw 31,-4(11)
37770 + blr
37771 +FUNC_END(_save32gpr_31)
37772 +FUNC_END(_save32gpr_30)
37773 +FUNC_END(_save32gpr_29)
37774 +FUNC_END(_save32gpr_28)
37775 +FUNC_END(_save32gpr_27)
37776 +FUNC_END(_save32gpr_26)
37777 +FUNC_END(_save32gpr_25)
37778 +FUNC_END(_save32gpr_24)
37779 +FUNC_END(_save32gpr_23)
37780 +FUNC_END(_save32gpr_22)
37781 +FUNC_END(_save32gpr_21)
37782 +FUNC_END(_save32gpr_20)
37783 +FUNC_END(_save32gpr_19)
37784 +FUNC_END(_save32gpr_18)
37785 +FUNC_END(_save32gpr_17)
37786 +FUNC_END(_save32gpr_16)
37787 +FUNC_END(_save32gpr_15)
37788 +FUNC_END(_save32gpr_14)
37789 +
37790 +#endif
37791 --- /dev/null
37792 +++ b/gcc/config/rs6000/e500crtsav64gpr.asm
37793 @@ -0,0 +1,83 @@
37794 +/*
37795 + * Special support for e500 eabi and SVR4
37796 + *
37797 + * Copyright (C) 2008 Free Software Foundation, Inc.
37798 + * Written by Nathan Froyd
37799 + *
37800 + * This file is free software; you can redistribute it and/or modify it
37801 + * under the terms of the GNU General Public License as published by the
37802 + * Free Software Foundation; either version 2, or (at your option) any
37803 + * later version.
37804 + *
37805 + * In addition to the permissions in the GNU General Public License, the
37806 + * Free Software Foundation gives you unlimited permission to link the
37807 + * compiled version of this file with other programs, and to distribute
37808 + * those programs without any restriction coming from the use of this
37809 + * file. (The General Public License restrictions do apply in other
37810 + * respects; for example, they cover modification of the file, and
37811 + * distribution when not linked into another program.)
37812 + *
37813 + * This file is distributed in the hope that it will be useful, but
37814 + * WITHOUT ANY WARRANTY; without even the implied warranty of
37815 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37816 + * General Public License for more details.
37817 + *
37818 + * You should have received a copy of the GNU General Public License
37819 + * along with this program; see the file COPYING. If not, write to
37820 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
37821 + * Boston, MA 02110-1301, USA.
37822 + *
37823 + * As a special exception, if you link this library with files
37824 + * compiled with GCC to produce an executable, this does not cause
37825 + * the resulting executable to be covered by the GNU General Public License.
37826 + * This exception does not however invalidate any other reasons why
37827 + * the executable file might be covered by the GNU General Public License.
37828 + */
37829 +
37830 + .file "e500crtsav64gpr.asm"
37831 + .section ".text"
37832 + #include "ppc-asm.h"
37833 +
37834 +#ifdef __SPE__
37835 +
37836 +/* Routines for saving 64-bit integer registers, called by the compiler. */
37837 +
37838 +HIDDEN_FUNC(_save64gpr_14) evstdd 14,0(11)
37839 +HIDDEN_FUNC(_save64gpr_15) evstdd 15,8(11)
37840 +HIDDEN_FUNC(_save64gpr_16) evstdd 16,16(11)
37841 +HIDDEN_FUNC(_save64gpr_17) evstdd 17,24(11)
37842 +HIDDEN_FUNC(_save64gpr_18) evstdd 18,32(11)
37843 +HIDDEN_FUNC(_save64gpr_19) evstdd 19,40(11)
37844 +HIDDEN_FUNC(_save64gpr_20) evstdd 20,48(11)
37845 +HIDDEN_FUNC(_save64gpr_21) evstdd 21,56(11)
37846 +HIDDEN_FUNC(_save64gpr_22) evstdd 22,64(11)
37847 +HIDDEN_FUNC(_save64gpr_23) evstdd 23,72(11)
37848 +HIDDEN_FUNC(_save64gpr_24) evstdd 24,80(11)
37849 +HIDDEN_FUNC(_save64gpr_25) evstdd 25,88(11)
37850 +HIDDEN_FUNC(_save64gpr_26) evstdd 26,96(11)
37851 +HIDDEN_FUNC(_save64gpr_27) evstdd 27,104(11)
37852 +HIDDEN_FUNC(_save64gpr_28) evstdd 28,112(11)
37853 +HIDDEN_FUNC(_save64gpr_29) evstdd 29,120(11)
37854 +HIDDEN_FUNC(_save64gpr_30) evstdd 30,128(11)
37855 +HIDDEN_FUNC(_save64gpr_31) evstdd 31,136(11)
37856 + blr
37857 +FUNC_END(_save64gpr_31)
37858 +FUNC_END(_save64gpr_30)
37859 +FUNC_END(_save64gpr_29)
37860 +FUNC_END(_save64gpr_28)
37861 +FUNC_END(_save64gpr_27)
37862 +FUNC_END(_save64gpr_26)
37863 +FUNC_END(_save64gpr_25)
37864 +FUNC_END(_save64gpr_24)
37865 +FUNC_END(_save64gpr_23)
37866 +FUNC_END(_save64gpr_22)
37867 +FUNC_END(_save64gpr_21)
37868 +FUNC_END(_save64gpr_20)
37869 +FUNC_END(_save64gpr_19)
37870 +FUNC_END(_save64gpr_18)
37871 +FUNC_END(_save64gpr_17)
37872 +FUNC_END(_save64gpr_16)
37873 +FUNC_END(_save64gpr_15)
37874 +FUNC_END(_save64gpr_14)
37875 +
37876 +#endif
37877 --- /dev/null
37878 +++ b/gcc/config/rs6000/e500crtsav64gprctr.asm
37879 @@ -0,0 +1,102 @@
37880 +/*
37881 + * Special support for e500 eabi and SVR4
37882 + *
37883 + * Copyright (C) 2008 Free Software Foundation, Inc.
37884 + * Written by Nathan Froyd
37885 + *
37886 + * This file is free software; you can redistribute it and/or modify it
37887 + * under the terms of the GNU General Public License as published by the
37888 + * Free Software Foundation; either version 2, or (at your option) any
37889 + * later version.
37890 + *
37891 + * In addition to the permissions in the GNU General Public License, the
37892 + * Free Software Foundation gives you unlimited permission to link the
37893 + * compiled version of this file with other programs, and to distribute
37894 + * those programs without any restriction coming from the use of this
37895 + * file. (The General Public License restrictions do apply in other
37896 + * respects; for example, they cover modification of the file, and
37897 + * distribution when not linked into another program.)
37898 + *
37899 + * This file is distributed in the hope that it will be useful, but
37900 + * WITHOUT ANY WARRANTY; without even the implied warranty of
37901 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37902 + * General Public License for more details.
37903 + *
37904 + * You should have received a copy of the GNU General Public License
37905 + * along with this program; see the file COPYING. If not, write to
37906 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
37907 + * Boston, MA 02110-1301, USA.
37908 + *
37909 + * As a special exception, if you link this library with files
37910 + * compiled with GCC to produce an executable, this does not cause
37911 + * the resulting executable to be covered by the GNU General Public License.
37912 + * This exception does not however invalidate any other reasons why
37913 + * the executable file might be covered by the GNU General Public License.
37914 + */
37915 +
37916 + .file "e500crtsav64gprctr.asm"
37917 + .section ".text"
37918 + #include "ppc-asm.h"
37919 +
37920 +#ifdef __SPE__
37921 +
37922 +/* Routines for saving 64-bit integer registers where the number of
37923 + registers to be saved is passed in CTR, called by the compiler. */
37924 +/* "Bare" versions that return to their caller. */
37925 +
37926 +HIDDEN_FUNC(_save64gpr_ctr_14) evstdd 14,0(11)
37927 + bdz _save64_gpr_ctr_done
37928 +HIDDEN_FUNC(_save64gpr_ctr_15) evstdd 15,8(11)
37929 + bdz _save64_gpr_ctr_done
37930 +HIDDEN_FUNC(_save64gpr_ctr_16) evstdd 16,16(11)
37931 + bdz _save64_gpr_ctr_done
37932 +HIDDEN_FUNC(_save64gpr_ctr_17) evstdd 17,24(11)
37933 + bdz _save64_gpr_ctr_done
37934 +HIDDEN_FUNC(_save64gpr_ctr_18) evstdd 18,32(11)
37935 + bdz _save64_gpr_ctr_done
37936 +HIDDEN_FUNC(_save64gpr_ctr_19) evstdd 19,40(11)
37937 + bdz _save64_gpr_ctr_done
37938 +HIDDEN_FUNC(_save64gpr_ctr_20) evstdd 20,48(11)
37939 + bdz _save64_gpr_ctr_done
37940 +HIDDEN_FUNC(_save64gpr_ctr_21) evstdd 21,56(11)
37941 + bdz _save64_gpr_ctr_done
37942 +HIDDEN_FUNC(_save64gpr_ctr_22) evstdd 22,64(11)
37943 + bdz _save64_gpr_ctr_done
37944 +HIDDEN_FUNC(_save64gpr_ctr_23) evstdd 23,72(11)
37945 + bdz _save64_gpr_ctr_done
37946 +HIDDEN_FUNC(_save64gpr_ctr_24) evstdd 24,80(11)
37947 + bdz _save64_gpr_ctr_done
37948 +HIDDEN_FUNC(_save64gpr_ctr_25) evstdd 25,88(11)
37949 + bdz _save64_gpr_ctr_done
37950 +HIDDEN_FUNC(_save64gpr_ctr_26) evstdd 26,96(11)
37951 + bdz _save64_gpr_ctr_done
37952 +HIDDEN_FUNC(_save64gpr_ctr_27) evstdd 27,104(11)
37953 + bdz _save64_gpr_ctr_done
37954 +HIDDEN_FUNC(_save64gpr_ctr_28) evstdd 28,112(11)
37955 + bdz _save64_gpr_ctr_done
37956 +HIDDEN_FUNC(_save64gpr_ctr_29) evstdd 29,120(11)
37957 + bdz _save64_gpr_ctr_done
37958 +HIDDEN_FUNC(_save64gpr_ctr_30) evstdd 30,128(11)
37959 + bdz _save64_gpr_ctr_done
37960 +HIDDEN_FUNC(_save64gpr_ctr_31) evstdd 31,136(11)
37961 +_save64gpr_ctr_done: blr
37962 +FUNC_END(_save64gpr_ctr_31)
37963 +FUNC_END(_save64gpr_ctr_30)
37964 +FUNC_END(_save64gpr_ctr_29)
37965 +FUNC_END(_save64gpr_ctr_28)
37966 +FUNC_END(_save64gpr_ctr_27)
37967 +FUNC_END(_save64gpr_ctr_26)
37968 +FUNC_END(_save64gpr_ctr_25)
37969 +FUNC_END(_save64gpr_ctr_24)
37970 +FUNC_END(_save64gpr_ctr_23)
37971 +FUNC_END(_save64gpr_ctr_22)
37972 +FUNC_END(_save64gpr_ctr_21)
37973 +FUNC_END(_save64gpr_ctr_20)
37974 +FUNC_END(_save64gpr_ctr_19)
37975 +FUNC_END(_save64gpr_ctr_18)
37976 +FUNC_END(_save64gpr_ctr_17)
37977 +FUNC_END(_save64gpr_ctr_16)
37978 +FUNC_END(_save64gpr_ctr_15)
37979 +FUNC_END(_save64gpr_ctr_14)
37980 +
37981 +#endif
37982 --- /dev/null
37983 +++ b/gcc/config/rs6000/e500crtsavg32gpr.asm
37984 @@ -0,0 +1,84 @@
37985 +/*
37986 + * Special support for e500 eabi and SVR4
37987 + *
37988 + * Copyright (C) 2008 Free Software Foundation, Inc.
37989 + * Written by Nathan Froyd
37990 + *
37991 + * This file is free software; you can redistribute it and/or modify it
37992 + * under the terms of the GNU General Public License as published by the
37993 + * Free Software Foundation; either version 2, or (at your option) any
37994 + * later version.
37995 + *
37996 + * In addition to the permissions in the GNU General Public License, the
37997 + * Free Software Foundation gives you unlimited permission to link the
37998 + * compiled version of this file with other programs, and to distribute
37999 + * those programs without any restriction coming from the use of this
38000 + * file. (The General Public License restrictions do apply in other
38001 + * respects; for example, they cover modification of the file, and
38002 + * distribution when not linked into another program.)
38003 + *
38004 + * This file is distributed in the hope that it will be useful, but
38005 + * WITHOUT ANY WARRANTY; without even the implied warranty of
38006 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
38007 + * General Public License for more details.
38008 + *
38009 + * You should have received a copy of the GNU General Public License
38010 + * along with this program; see the file COPYING. If not, write to
38011 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
38012 + * Boston, MA 02110-1301, USA.
38013 + *
38014 + * As a special exception, if you link this library with files
38015 + * compiled with GCC to produce an executable, this does not cause
38016 + * the resulting executable to be covered by the GNU General Public License.
38017 + * This exception does not however invalidate any other reasons why
38018 + * the executable file might be covered by the GNU General Public License.
38019 + */
38020 +
38021 + .file "e500crtsavg32gpr.asm"
38022 + .section ".text"
38023 + #include "ppc-asm.h"
38024 +
38025 +#ifdef __SPE__
38026 +
38027 +/* Routines for saving 32-bit integer registers, called by the compiler. */
38028 +/* "GOT" versions that load the address of the GOT into lr before returning. */
38029 +
38030 +HIDDEN_FUNC(_save32gpr_14_g) stw 14,-72(11)
38031 +HIDDEN_FUNC(_save32gpr_15_g) stw 15,-68(11)
38032 +HIDDEN_FUNC(_save32gpr_16_g) stw 16,-64(11)
38033 +HIDDEN_FUNC(_save32gpr_17_g) stw 17,-60(11)
38034 +HIDDEN_FUNC(_save32gpr_18_g) stw 18,-56(11)
38035 +HIDDEN_FUNC(_save32gpr_19_g) stw 19,-52(11)
38036 +HIDDEN_FUNC(_save32gpr_20_g) stw 20,-48(11)
38037 +HIDDEN_FUNC(_save32gpr_21_g) stw 21,-44(11)
38038 +HIDDEN_FUNC(_save32gpr_22_g) stw 22,-40(11)
38039 +HIDDEN_FUNC(_save32gpr_23_g) stw 23,-36(11)
38040 +HIDDEN_FUNC(_save32gpr_24_g) stw 24,-32(11)
38041 +HIDDEN_FUNC(_save32gpr_25_g) stw 25,-28(11)
38042 +HIDDEN_FUNC(_save32gpr_26_g) stw 26,-24(11)
38043 +HIDDEN_FUNC(_save32gpr_27_g) stw 27,-20(11)
38044 +HIDDEN_FUNC(_save32gpr_28_g) stw 28,-16(11)
38045 +HIDDEN_FUNC(_save32gpr_29_g) stw 29,-12(11)
38046 +HIDDEN_FUNC(_save32gpr_30_g) stw 30,-8(11)
38047 +HIDDEN_FUNC(_save32gpr_31_g) stw 31,-4(11)
38048 + b _GLOBAL_OFFSET_TABLE_-4
38049 +FUNC_END(_save32gpr_31_g)
38050 +FUNC_END(_save32gpr_30_g)
38051 +FUNC_END(_save32gpr_29_g)
38052 +FUNC_END(_save32gpr_28_g)
38053 +FUNC_END(_save32gpr_27_g)
38054 +FUNC_END(_save32gpr_26_g)
38055 +FUNC_END(_save32gpr_25_g)
38056 +FUNC_END(_save32gpr_24_g)
38057 +FUNC_END(_save32gpr_23_g)
38058 +FUNC_END(_save32gpr_22_g)
38059 +FUNC_END(_save32gpr_21_g)
38060 +FUNC_END(_save32gpr_20_g)
38061 +FUNC_END(_save32gpr_19_g)
38062 +FUNC_END(_save32gpr_18_g)
38063 +FUNC_END(_save32gpr_17_g)
38064 +FUNC_END(_save32gpr_16_g)
38065 +FUNC_END(_save32gpr_15_g)
38066 +FUNC_END(_save32gpr_14_g)
38067 +
38068 +#endif
38069 --- /dev/null
38070 +++ b/gcc/config/rs6000/e500crtsavg64gpr.asm
38071 @@ -0,0 +1,84 @@
38072 +/*
38073 + * Special support for e500 eabi and SVR4
38074 + *
38075 + * Copyright (C) 2008 Free Software Foundation, Inc.
38076 + * Written by Nathan Froyd
38077 + *
38078 + * This file is free software; you can redistribute it and/or modify it
38079 + * under the terms of the GNU General Public License as published by the
38080 + * Free Software Foundation; either version 2, or (at your option) any
38081 + * later version.
38082 + *
38083 + * In addition to the permissions in the GNU General Public License, the
38084 + * Free Software Foundation gives you unlimited permission to link the
38085 + * compiled version of this file with other programs, and to distribute
38086 + * those programs without any restriction coming from the use of this
38087 + * file. (The General Public License restrictions do apply in other
38088 + * respects; for example, they cover modification of the file, and
38089 + * distribution when not linked into another program.)
38090 + *
38091 + * This file is distributed in the hope that it will be useful, but
38092 + * WITHOUT ANY WARRANTY; without even the implied warranty of
38093 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
38094 + * General Public License for more details.
38095 + *
38096 + * You should have received a copy of the GNU General Public License
38097 + * along with this program; see the file COPYING. If not, write to
38098 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
38099 + * Boston, MA 02110-1301, USA.
38100 + *
38101 + * As a special exception, if you link this library with files
38102 + * compiled with GCC to produce an executable, this does not cause
38103 + * the resulting executable to be covered by the GNU General Public License.
38104 + * This exception does not however invalidate any other reasons why
38105 + * the executable file might be covered by the GNU General Public License.
38106 + */
38107 +
38108 + .file "e500crtsavg64gpr.asm"
38109 + .section ".text"
38110 + #include "ppc-asm.h"
38111 +
38112 +#ifdef __SPE__
38113 +
38114 +/* Routines for saving 64-bit integer registers, called by the compiler. */
38115 +/* "GOT" versions that load the address of the GOT into lr before returning. */
38116 +
38117 +HIDDEN_FUNC(_save64gpr_14_g) evstdd 14,0(11)
38118 +HIDDEN_FUNC(_save64gpr_15_g) evstdd 15,8(11)
38119 +HIDDEN_FUNC(_save64gpr_16_g) evstdd 16,16(11)
38120 +HIDDEN_FUNC(_save64gpr_17_g) evstdd 17,24(11)
38121 +HIDDEN_FUNC(_save64gpr_18_g) evstdd 18,32(11)
38122 +HIDDEN_FUNC(_save64gpr_19_g) evstdd 19,40(11)
38123 +HIDDEN_FUNC(_save64gpr_20_g) evstdd 20,48(11)
38124 +HIDDEN_FUNC(_save64gpr_21_g) evstdd 21,56(11)
38125 +HIDDEN_FUNC(_save64gpr_22_g) evstdd 22,64(11)
38126 +HIDDEN_FUNC(_save64gpr_23_g) evstdd 23,72(11)
38127 +HIDDEN_FUNC(_save64gpr_24_g) evstdd 24,80(11)
38128 +HIDDEN_FUNC(_save64gpr_25_g) evstdd 25,88(11)
38129 +HIDDEN_FUNC(_save64gpr_26_g) evstdd 26,96(11)
38130 +HIDDEN_FUNC(_save64gpr_27_g) evstdd 27,104(11)
38131 +HIDDEN_FUNC(_save64gpr_28_g) evstdd 28,112(11)
38132 +HIDDEN_FUNC(_save64gpr_29_g) evstdd 29,120(11)
38133 +HIDDEN_FUNC(_save64gpr_30_g) evstdd 30,128(11)
38134 +HIDDEN_FUNC(_save64gpr_31_g) evstdd 31,136(11)
38135 + b _GLOBAL_OFFSET_TABLE_-4
38136 +FUNC_END(_save64gpr_31_g)
38137 +FUNC_END(_save64gpr_30_g)
38138 +FUNC_END(_save64gpr_29_g)
38139 +FUNC_END(_save64gpr_28_g)
38140 +FUNC_END(_save64gpr_27_g)
38141 +FUNC_END(_save64gpr_26_g)
38142 +FUNC_END(_save64gpr_25_g)
38143 +FUNC_END(_save64gpr_24_g)
38144 +FUNC_END(_save64gpr_23_g)
38145 +FUNC_END(_save64gpr_22_g)
38146 +FUNC_END(_save64gpr_21_g)
38147 +FUNC_END(_save64gpr_20_g)
38148 +FUNC_END(_save64gpr_19_g)
38149 +FUNC_END(_save64gpr_18_g)
38150 +FUNC_END(_save64gpr_17_g)
38151 +FUNC_END(_save64gpr_16_g)
38152 +FUNC_END(_save64gpr_15_g)
38153 +FUNC_END(_save64gpr_14_g)
38154 +
38155 +#endif
38156 --- /dev/null
38157 +++ b/gcc/config/rs6000/e500crtsavg64gprctr.asm
38158 @@ -0,0 +1,101 @@
38159 +/*
38160 + * Special support for e500 eabi and SVR4
38161 + *
38162 + * Copyright (C) 2008 Free Software Foundation, Inc.
38163 + * Written by Nathan Froyd
38164 + *
38165 + * This file is free software; you can redistribute it and/or modify it
38166 + * under the terms of the GNU General Public License as published by the
38167 + * Free Software Foundation; either version 2, or (at your option) any
38168 + * later version.
38169 + *
38170 + * In addition to the permissions in the GNU General Public License, the
38171 + * Free Software Foundation gives you unlimited permission to link the
38172 + * compiled version of this file with other programs, and to distribute
38173 + * those programs without any restriction coming from the use of this
38174 + * file. (The General Public License restrictions do apply in other
38175 + * respects; for example, they cover modification of the file, and
38176 + * distribution when not linked into another program.)
38177 + *
38178 + * This file is distributed in the hope that it will be useful, but
38179 + * WITHOUT ANY WARRANTY; without even the implied warranty of
38180 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
38181 + * General Public License for more details.
38182 + *
38183 + * You should have received a copy of the GNU General Public License
38184 + * along with this program; see the file COPYING. If not, write to
38185 + * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
38186 + * Boston, MA 02110-1301, USA.
38187 + *
38188 + * As a special exception, if you link this library with files
38189 + * compiled with GCC to produce an executable, this does not cause
38190 + * the resulting executable to be covered by the GNU General Public License.
38191 + * This exception does not however invalidate any other reasons why
38192 + * the executable file might be covered by the GNU General Public License.
38193 + */
38194 +
38195 + .file "e500crtsavg64gprctr.asm"
38196 + .section ".text"
38197 + #include "ppc-asm.h"
38198 +
38199 +#ifdef __SPE__
38200 +
38201 +/* Routines for saving 64-bit integer registers, called by the compiler. */
38202 +/* "GOT" versions that load the address of the GOT into lr before returning. */
38203 +
38204 +HIDDEN_FUNC(_save64gpr_ctr_14_g) evstdd 14,0(11)
38205 + bdz _save64_gpr_ctr_g_done
38206 +HIDDEN_FUNC(_save64gpr_ctr_15_g) evstdd 15,8(11)
38207 + bdz _save64_gpr_ctr_g_done
38208 +HIDDEN_FUNC(_save64gpr_ctr_16_g) evstdd 16,16(11)
38209 + bdz _save64_gpr_ctr_g_done
38210 +HIDDEN_FUNC(_save64gpr_ctr_17_g) evstdd 17,24(11)
38211 + bdz _save64_gpr_ctr_g_done
38212 +HIDDEN_FUNC(_save64gpr_ctr_18_g) evstdd 18,32(11)
38213 + bdz _save64_gpr_ctr_g_done
38214 +HIDDEN_FUNC(_save64gpr_ctr_19_g) evstdd 19,40(11)
38215 + bdz _save64_gpr_ctr_g_done
38216 +HIDDEN_FUNC(_save64gpr_ctr_20_g) evstdd 20,48(11)
38217 + bdz _save64_gpr_ctr_g_done
38218 +HIDDEN_FUNC(_save64gpr_ctr_21_g) evstdd 21,56(11)
38219 + bdz _save64_gpr_ctr_g_done
38220 +HIDDEN_FUNC(_save64gpr_ctr_22_g) evstdd 22,64(11)
38221 + bdz _save64_gpr_ctr_g_done
38222 +HIDDEN_FUNC(_save64gpr_ctr_23_g) evstdd 23,72(11)
38223 + bdz _save64_gpr_ctr_g_done
38224 +HIDDEN_FUNC(_save64gpr_ctr_24_g) evstdd 24,80(11)
38225 + bdz _save64_gpr_ctr_g_done
38226 +HIDDEN_FUNC(_save64gpr_ctr_25_g) evstdd 25,88(11)
38227 + bdz _save64_gpr_ctr_g_done
38228 +HIDDEN_FUNC(_save64gpr_ctr_26_g) evstdd 26,96(11)
38229 + bdz _save64_gpr_ctr_g_done
38230 +HIDDEN_FUNC(_save64gpr_ctr_27_g) evstdd 27,104(11)
38231 + bdz _save64_gpr_ctr_g_done
38232 +HIDDEN_FUNC(_save64gpr_ctr_28_g) evstdd 28,112(11)
38233 + bdz _save64_gpr_ctr_g_done
38234 +HIDDEN_FUNC(_save64gpr_ctr_29_g) evstdd 29,120(11)
38235 + bdz _save64_gpr_ctr_g_done
38236 +HIDDEN_FUNC(_save64gpr_ctr_30_g) evstdd 30,128(11)
38237 + bdz _save64_gpr_ctr_g_done
38238 +HIDDEN_FUNC(_save64gpr_ctr_31_g) evstdd 31,136(11)
38239 +_save64gpr_ctr_g_done: b _GLOBAL_OFFSET_TABLE_-4
38240 +FUNC_END(_save64gpr_ctr_31_g)
38241 +FUNC_END(_save64gpr_ctr_30_g)
38242 +FUNC_END(_save64gpr_ctr_29_g)
38243 +FUNC_END(_save64gpr_ctr_28_g)
38244 +FUNC_END(_save64gpr_ctr_27_g)
38245 +FUNC_END(_save64gpr_ctr_26_g)
38246 +FUNC_END(_save64gpr_ctr_25_g)
38247 +FUNC_END(_save64gpr_ctr_24_g)
38248 +FUNC_END(_save64gpr_ctr_23_g)
38249 +FUNC_END(_save64gpr_ctr_22_g)
38250 +FUNC_END(_save64gpr_ctr_21_g)
38251 +FUNC_END(_save64gpr_ctr_20_g)
38252 +FUNC_END(_save64gpr_ctr_19_g)
38253 +FUNC_END(_save64gpr_ctr_18_g)
38254 +FUNC_END(_save64gpr_ctr_17_g)
38255 +FUNC_END(_save64gpr_ctr_16_g)
38256 +FUNC_END(_save64gpr_ctr_15_g)
38257 +FUNC_END(_save64gpr_ctr_14_g)
38258 +
38259 +#endif
38260 --- /dev/null
38261 +++ b/gcc/config/rs6000/e500mc.h
38262 @@ -0,0 +1,46 @@
38263 +/* Core target definitions for GNU compiler
38264 + for IBM RS/6000 PowerPC targeted to embedded ELF systems.
38265 + Copyright (C) 1995, 1996, 2000, 2003, 2004, 2007 Free Software Foundation, Inc.
38266 + Contributed by Cygnus Support.
38267 +
38268 + This file is part of GCC.
38269 +
38270 + GCC is free software; you can redistribute it and/or modify it
38271 + under the terms of the GNU General Public License as published
38272 + by the Free Software Foundation; either version 3, or (at your
38273 + option) any later version.
38274 +
38275 + GCC is distributed in the hope that it will be useful, but WITHOUT
38276 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
38277 + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
38278 + License for more details.
38279 +
38280 + You should have received a copy of the GNU General Public License
38281 + along with GCC; see the file COPYING3. If not see
38282 + <http://www.gnu.org/licenses/>. */
38283 +
38284 +/* Add -meabi to target flags. */
38285 +#undef TARGET_DEFAULT
38286 +#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_EABI)
38287 +
38288 +#undef TARGET_VERSION
38289 +#define TARGET_VERSION fprintf (stderr, " (PowerPC Embedded)");
38290 +
38291 +#undef TARGET_OS_CPP_BUILTINS
38292 +#define TARGET_OS_CPP_BUILTINS() \
38293 + do \
38294 + { \
38295 + builtin_define_std ("PPC"); \
38296 + builtin_define ("__embedded__"); \
38297 + builtin_assert ("system=embedded"); \
38298 + builtin_assert ("cpu=powerpc"); \
38299 + builtin_assert ("machine=powerpc"); \
38300 + TARGET_OS_SYSV_CPP_BUILTINS (); \
38301 + } \
38302 + while (0)
38303 +
38304 +#undef CC1_EXTRA_SPEC
38305 +#define CC1_EXTRA_SPEC "-maix-struct-return"
38306 +
38307 +#undef ASM_DEFAULT_SPEC
38308 +#define ASM_DEFAULT_SPEC "-mppc%{m64:64} -me500mc"
38309 --- /dev/null
38310 +++ b/gcc/config/rs6000/e500mc.md
38311 @@ -0,0 +1,198 @@
38312 +;; Pipeline description for Motorola PowerPC e500mc core.
38313 +;; Copyright (C) 2008 Free Software Foundation, Inc.
38314 +;; Contributed by Edmar Wienskoski (edmar@freescale.com)
38315 +;;
38316 +;; This file is part of GCC.
38317 +;;
38318 +;; GCC is free software; you can redistribute it and/or modify it
38319 +;; under the terms of the GNU General Public License as published
38320 +;; by the Free Software Foundation; either version 3, or (at your
38321 +;; option) any later version.
38322 +;;
38323 +;; GCC is distributed in the hope that it will be useful, but WITHOUT
38324 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
38325 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
38326 +;; License for more details.
38327 +;;
38328 +;; You should have received a copy of the GNU General Public License
38329 +;; along with GCC; see the file COPYING3. If not see
38330 +;; <http://www.gnu.org/licenses/>.
38331 +;;
38332 +;; e500mc 32-bit SU(2), LSU, FPU, BPU
38333 +;; Max issue 3 insns/clock cycle (includes 1 branch)
38334 +;; FP is half clocked, timings of other instructions are as in the e500v2.
38335 +
38336 +(define_automaton "e500mc_most,e500mc_long,e500mc_retire")
38337 +(define_cpu_unit "e500mc_decode_0,e500mc_decode_1" "e500mc_most")
38338 +(define_cpu_unit "e500mc_issue_0,e500mc_issue_1" "e500mc_most")
38339 +(define_cpu_unit "e500mc_retire_0,e500mc_retire_1" "e500mc_retire")
38340 +
38341 +;; SU.
38342 +(define_cpu_unit "e500mc_su0_stage0,e500mc_su1_stage0" "e500mc_most")
38343 +
38344 +;; MU.
38345 +(define_cpu_unit "e500mc_mu_stage0,e500mc_mu_stage1" "e500mc_most")
38346 +(define_cpu_unit "e500mc_mu_stage2,e500mc_mu_stage3" "e500mc_most")
38347 +
38348 +;; Non-pipelined division.
38349 +(define_cpu_unit "e500mc_mu_div" "e500mc_long")
38350 +
38351 +;; LSU.
38352 +(define_cpu_unit "e500mc_lsu" "e500mc_most")
38353 +
38354 +;; FPU.
38355 +(define_cpu_unit "e500mc_fpu" "e500mc_most")
38356 +
38357 +;; Branch unit.
38358 +(define_cpu_unit "e500mc_bu" "e500mc_most")
38359 +
38360 +;; The following units are used to make the automata deterministic.
38361 +(define_cpu_unit "present_e500mc_decode_0" "e500mc_most")
38362 +(define_cpu_unit "present_e500mc_issue_0" "e500mc_most")
38363 +(define_cpu_unit "present_e500mc_retire_0" "e500mc_retire")
38364 +(define_cpu_unit "present_e500mc_su0_stage0" "e500mc_most")
38365 +
38366 +;; The following sets to make automata deterministic when option ndfa is used.
38367 +(presence_set "present_e500mc_decode_0" "e500mc_decode_0")
38368 +(presence_set "present_e500mc_issue_0" "e500mc_issue_0")
38369 +(presence_set "present_e500mc_retire_0" "e500mc_retire_0")
38370 +(presence_set "present_e500mc_su0_stage0" "e500mc_su0_stage0")
38371 +
38372 +;; Some useful abbreviations.
38373 +(define_reservation "e500mc_decode"
38374 + "e500mc_decode_0|e500mc_decode_1+present_e500mc_decode_0")
38375 +(define_reservation "e500mc_issue"
38376 + "e500mc_issue_0|e500mc_issue_1+present_e500mc_issue_0")
38377 +(define_reservation "e500mc_retire"
38378 + "e500mc_retire_0|e500mc_retire_1+present_e500mc_retire_0")
38379 +(define_reservation "e500mc_su_stage0"
38380 + "e500mc_su0_stage0|e500mc_su1_stage0+present_e500mc_su0_stage0")
38381 +
38382 +;; Simple SU insns.
38383 +(define_insn_reservation "e500mc_su" 1
38384 + (and (eq_attr "type" "integer,insert_word,insert_dword,cmp,compare,\
38385 + delayed_compare,var_delayed_compare,fast_compare,\
38386 + shift,trap,var_shift_rotate,cntlz,exts")
38387 + (eq_attr "cpu" "ppce500mc"))
38388 + "e500mc_decode,e500mc_issue+e500mc_su_stage0+e500mc_retire")
38389 +
38390 +(define_insn_reservation "e500mc_two" 1
38391 + (and (eq_attr "type" "two")
38392 + (eq_attr "cpu" "ppce500mc"))
38393 + "e500mc_decode,e500mc_issue+e500mc_su_stage0+e500mc_retire,\
38394 + e500mc_issue+e500mc_su_stage0+e500mc_retire")
38395 +
38396 +(define_insn_reservation "e500mc_three" 1
38397 + (and (eq_attr "type" "three")
38398 + (eq_attr "cpu" "ppce500mc"))
38399 + "e500mc_decode,e500mc_issue+e500mc_su_stage0+e500mc_retire,\
38400 + e500mc_issue+e500mc_su_stage0+e500mc_retire,\
38401 + e500mc_issue+e500mc_su_stage0+e500mc_retire")
38402 +
38403 +;; Multiply.
38404 +(define_insn_reservation "e500mc_multiply" 4
38405 + (and (eq_attr "type" "imul,imul2,imul3,imul_compare")
38406 + (eq_attr "cpu" "ppce500mc"))
38407 + "e500mc_decode,e500mc_issue+e500mc_mu_stage0,e500mc_mu_stage1,\
38408 + e500mc_mu_stage2,e500mc_mu_stage3+e500mc_retire")
38409 +
38410 +;; Divide. We use the average latency time here.
38411 +(define_insn_reservation "e500mc_divide" 14
38412 + (and (eq_attr "type" "idiv")
38413 + (eq_attr "cpu" "ppce500mc"))
38414 + "e500mc_decode,e500mc_issue+e500mc_mu_stage0+e500mc_mu_div,\
38415 + e500mc_mu_div*13")
38416 +
38417 +;; Branch.
38418 +(define_insn_reservation "e500mc_branch" 1
38419 + (and (eq_attr "type" "jmpreg,branch,isync")
38420 + (eq_attr "cpu" "ppce500mc"))
38421 + "e500mc_decode,e500mc_bu,e500mc_retire")
38422 +
38423 +;; CR logical.
38424 +(define_insn_reservation "e500mc_cr_logical" 1
38425 + (and (eq_attr "type" "cr_logical,delayed_cr")
38426 + (eq_attr "cpu" "ppce500mc"))
38427 + "e500mc_decode,e500mc_bu,e500mc_retire")
38428 +
38429 +;; Mfcr.
38430 +(define_insn_reservation "e500mc_mfcr" 1
38431 + (and (eq_attr "type" "mfcr")
38432 + (eq_attr "cpu" "ppce500mc"))
38433 + "e500mc_decode,e500mc_issue+e500mc_su1_stage0+e500mc_retire")
38434 +
38435 +;; Mtcrf.
38436 +(define_insn_reservation "e500mc_mtcrf" 1
38437 + (and (eq_attr "type" "mtcr")
38438 + (eq_attr "cpu" "ppce500mc"))
38439 + "e500mc_decode,e500mc_issue+e500mc_su1_stage0+e500mc_retire")
38440 +
38441 +;; Mtjmpr.
38442 +(define_insn_reservation "e500mc_mtjmpr" 1
38443 + (and (eq_attr "type" "mtjmpr,mfjmpr")
38444 + (eq_attr "cpu" "ppce500mc"))
38445 + "e500mc_decode,e500mc_issue+e500mc_su_stage0+e500mc_retire")
38446 +
38447 +;; Brinc.
38448 +(define_insn_reservation "e500mc_brinc" 1
38449 + (and (eq_attr "type" "brinc")
38450 + (eq_attr "cpu" "ppce500mc"))
38451 + "e500mc_decode,e500mc_issue+e500mc_su_stage0+e500mc_retire")
38452 +
38453 +;; Loads.
38454 +(define_insn_reservation "e500mc_load" 3
38455 + (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,\
38456 + load_l,sync")
38457 + (eq_attr "cpu" "ppce500mc"))
38458 + "e500mc_decode,e500mc_issue+e500mc_lsu,nothing,e500mc_retire")
38459 +
38460 +(define_insn_reservation "e500mc_fpload" 4
38461 + (and (eq_attr "type" "fpload,fpload_ux,fpload_u")
38462 + (eq_attr "cpu" "ppce500mc"))
38463 + "e500mc_decode,e500mc_issue+e500mc_lsu,nothing*2,e500mc_retire")
38464 +
38465 +;; Stores.
38466 +(define_insn_reservation "e500mc_store" 3
38467 + (and (eq_attr "type" "store,store_ux,store_u,store_c")
38468 + (eq_attr "cpu" "ppce500mc"))
38469 + "e500mc_decode,e500mc_issue+e500mc_lsu,nothing,e500mc_retire")
38470 +
38471 +(define_insn_reservation "e500mc_fpstore" 3
38472 + (and (eq_attr "type" "fpstore,fpstore_ux,fpstore_u")
38473 + (eq_attr "cpu" "ppce500mc"))
38474 + "e500mc_decode,e500mc_issue+e500mc_lsu,nothing,e500mc_retire")
38475 +
38476 +;; Simple FP.
38477 +(define_insn_reservation "e500mc_simple_float" 8
38478 + (and (eq_attr "type" "fpsimple")
38479 + (eq_attr "cpu" "ppce500mc"))
38480 + "e500mc_decode,e500mc_issue+e500mc_fpu,nothing*6,e500mc_retire")
38481 +
38482 +;; FP.
38483 +(define_insn_reservation "e500mc_float" 8
38484 + (and (eq_attr "type" "fp")
38485 + (eq_attr "cpu" "ppce500mc"))
38486 + "e500mc_decode,e500mc_issue+e500mc_fpu,nothing*6,e500mc_retire")
38487 +
38488 +(define_insn_reservation "e500mc_fpcompare" 8
38489 + (and (eq_attr "type" "fpcompare")
38490 + (eq_attr "cpu" "ppce500mc"))
38491 + "e500mc_decode,e500mc_issue+e500mc_fpu,nothing*6,e500mc_retire")
38492 +
38493 +;; The following ignores the retire unit to avoid a large automata.
38494 +
38495 +(define_insn_reservation "e500mc_dmul" 10
38496 + (and (eq_attr "type" "dmul")
38497 + (eq_attr "cpu" "ppce500mc"))
38498 + "e500mc_decode,e500mc_issue+e500mc_fpu")
38499 +
38500 +;; FP divides are not pipelined.
38501 +(define_insn_reservation "e500mc_sdiv" 36
38502 + (and (eq_attr "type" "sdiv")
38503 + (eq_attr "cpu" "ppce500mc"))
38504 + "e500mc_decode,e500mc_issue+e500mc_fpu,e500mc_fpu*35")
38505 +
38506 +(define_insn_reservation "e500mc_ddiv" 66
38507 + (and (eq_attr "type" "ddiv")
38508 + (eq_attr "cpu" "ppce500mc"))
38509 + "e500mc_decode,e500mc_issue+e500mc_fpu,e500mc_fpu*65")
38510 --- a/gcc/config/rs6000/eabi-ci.asm
38511 +++ b/gcc/config/rs6000/eabi-ci.asm
38512 @@ -111,6 +111,7 @@ __EH_FRAME_BEGIN__:
38513 /* Head of __init function used for static constructors. */
38514 .section ".init","ax"
38515 .align 2
38516 +FUNC_START(_init)
38517 FUNC_START(__init)
38518 stwu 1,-16(1)
38519 mflr 0
38520 @@ -119,6 +120,7 @@ FUNC_START(__init)
38521 /* Head of __fini function used for static destructors. */
38522 .section ".fini","ax"
38523 .align 2
38524 +FUNC_START(_fini)
38525 FUNC_START(__fini)
38526 stwu 1,-16(1)
38527 mflr 0
38528 --- a/gcc/config/rs6000/eabi-cn.asm
38529 +++ b/gcc/config/rs6000/eabi-cn.asm
38530 @@ -36,7 +36,6 @@ Boston, MA 02110-1301, USA.
38531 /* This file just supplies labeled ending points for the .got* and other
38532 special sections. It is linked in last after other modules. */
38533
38534 - .file "crtn.s"
38535 .ident "GNU C crtn.s"
38536
38537 #ifndef __powerpc64__
38538 --- a/gcc/config/rs6000/eabi.asm
38539 +++ b/gcc/config/rs6000/eabi.asm
38540 @@ -114,6 +114,9 @@
38541 .Linit = .-.LCTOC1
38542 .long .Linit_p /* address of variable to say we've been called */
38543
38544 +.Lfini = .-.LCTOC1
38545 + .long __fini /* global destructors in .fini */
38546 +
38547 .text
38548 .align 2
38549 .Lptr:
38550 @@ -226,10 +229,12 @@ FUNC_START(__eabi)
38551
38552 lwz 2,.Lsda2(11) /* load r2 with _SDA2_BASE_ address */
38553
38554 -/* Done adjusting pointers, return by way of doing the C++ global constructors. */
38555 +/* Done adjusting pointers. We used to return here by way of doing the
38556 + C++ global constructors, but we currently let newlib take care of
38557 + running them and registering finalizers. */
38558
38559 .Ldone:
38560 - b FUNC_NAME(__init) /* do any C++ global constructors (which returns to caller) */
38561 + blr
38562 FUNC_END(__eabi)
38563
38564 /* Special subroutine to convert a bunch of pointers directly.
38565 @@ -240,7 +245,7 @@ FUNC_END(__eabi)
38566 r11 has the address of .LCTOC1 in it.
38567 r12 has the value to add to each pointer
38568 r13 .. r31 are unchanged */
38569 -
38570 +#ifdef _RELOCATABLE
38571 FUNC_START(__eabi_convert)
38572 cmplw 1,3,4 /* any pointers to convert? */
38573 subf 5,3,4 /* calculate number of words to convert */
38574 @@ -295,5 +300,6 @@ FUNC_START(__eabi_uconvert)
38575 blr
38576
38577 FUNC_END(__eabi_uconvert)
38578 +#endif /* _RELOCATABLE */
38579
38580 #endif
38581 --- a/gcc/config/rs6000/eabi.h
38582 +++ b/gcc/config/rs6000/eabi.h
38583 @@ -23,10 +23,6 @@
38584 #undef TARGET_DEFAULT
38585 #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_EABI)
38586
38587 -/* Invoke an initializer function to set up the GOT. */
38588 -#define NAME__MAIN "__eabi"
38589 -#define INVOKE__main
38590 -
38591 #undef TARGET_VERSION
38592 #define TARGET_VERSION fprintf (stderr, " (PowerPC Embedded)");
38593
38594 @@ -42,3 +38,20 @@
38595 TARGET_OS_SYSV_CPP_BUILTINS (); \
38596 } \
38597 while (0)
38598 +
38599 +/* Add -te500v1 and -te500v2 options for convenience in generating
38600 + multilibs. */
38601 +#undef CC1_EXTRA_SPEC
38602 +#define CC1_EXTRA_SPEC \
38603 + "%{te500v1: -mcpu=8540 -mfloat-gprs=single -mspe=yes -mabi=spe} " \
38604 + "%{te500v2: -mcpu=8548 -mfloat-gprs=double -mspe=yes -mabi=spe} " \
38605 + "%{te600: -mcpu=7400 -maltivec -mabi=altivec}" \
38606 + "%{te500mc: -mcpu=e500mc -maix-struct-return}"
38607 +
38608 +#undef ASM_DEFAULT_SPEC
38609 +#define ASM_DEFAULT_SPEC \
38610 + "%{te500v1:-mppc -mspe -me500 ; \
38611 + te500v2:-mppc -mspe -me500 ; \
38612 + te600:-mppc -maltivec ; \
38613 + te500mc:-mppc -me500mc ; \
38614 + :-mppc%{m64:64}}"
38615 --- a/gcc/config/rs6000/linux.h
38616 +++ b/gcc/config/rs6000/linux.h
38617 @@ -128,3 +128,29 @@
38618 #ifdef TARGET_DEFAULT_LONG_DOUBLE_128
38619 #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
38620 #endif
38621 +
38622 +/* Add -te500v1 and -te500v2 options for convenience in generating
38623 + multilibs. */
38624 +#undef CC1_EXTRA_SPEC
38625 +#define CC1_EXTRA_SPEC \
38626 + "%{te500v1: -mcpu=8540 -mfloat-gprs=single -mspe=yes -mabi=spe} " \
38627 + "%{te500v2: -mcpu=8548 -mfloat-gprs=double -mspe=yes -mabi=spe} " \
38628 + "%{te600: -mcpu=7400 -maltivec -mabi=altivec}" \
38629 + "%{te500mc: -mcpu=e500mc}"
38630 +
38631 +#undef ASM_DEFAULT_SPEC
38632 +#define ASM_DEFAULT_SPEC \
38633 + "%{te500v1:-mppc -mspe -me500 ; \
38634 + te500v2:-mppc -mspe -me500 ; \
38635 + te600:-mppc -maltivec ; \
38636 + te500mc:-me500mc ; \
38637 + :-mppc%{m64:64}}"
38638 +
38639 +/* The various C libraries each have their own subdirectory. */
38640 +#undef SYSROOT_SUFFIX_SPEC
38641 +#define SYSROOT_SUFFIX_SPEC \
38642 + "%{msoft-float:/nof ; \
38643 + te600:/te600 ; \
38644 + te500v1:/te500v1 ; \
38645 + te500v2:/te500v2 ; \
38646 + te500mc:/te500mc}"
38647 --- /dev/null
38648 +++ b/gcc/config/rs6000/montavista-linux.h
38649 @@ -0,0 +1,41 @@
38650 +/* MontaVista GNU/Linux Configuration.
38651 + Copyright (C) 2009
38652 + Free Software Foundation, Inc.
38653 +
38654 +This file is part of GCC.
38655 +
38656 +GCC is free software; you can redistribute it and/or modify
38657 +it under the terms of the GNU General Public License as published by
38658 +the Free Software Foundation; either version 3, or (at your option)
38659 +any later version.
38660 +
38661 +GCC is distributed in the hope that it will be useful,
38662 +but WITHOUT ANY WARRANTY; without even the implied warranty of
38663 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38664 +GNU General Public License for more details.
38665 +
38666 +You should have received a copy of the GNU General Public License
38667 +along with GCC; see the file COPYING3. If not see
38668 +<http://www.gnu.org/licenses/>. */
38669 +
38670 +/* Add -te500v2 option for convenience in generating multilibs. */
38671 +#undef CC1_EXTRA_SPEC
38672 +#define CC1_EXTRA_SPEC \
38673 + "%{te500v2: -mcpu=8548 -mfloat-gprs=double -mspe=yes -mabi=spe} " \
38674 + "%{te600: -mcpu=7400 -maltivec -mabi=altivec}" \
38675 + "%{te500mc: -mcpu=e500mc}"
38676 +
38677 +#undef ASM_DEFAULT_SPEC
38678 +#define ASM_DEFAULT_SPEC \
38679 + "%{te500v2:-mppc -mspe -me500 ; \
38680 + te600:-mppc -maltivec ; \
38681 + te500mc:-me500mc ; \
38682 + :-mppc}"
38683 +
38684 +/* The various C libraries each have their own subdirectory. */
38685 +#undef SYSROOT_SUFFIX_SPEC
38686 +#define SYSROOT_SUFFIX_SPEC \
38687 + "%{msoft-float:/soft-float ; \
38688 + te600:/te600 ; \
38689 + te500v2:/te500v2 ; \
38690 + te500mc:/te500mc}"
38691 --- a/gcc/config/rs6000/netbsd.h
38692 +++ b/gcc/config/rs6000/netbsd.h
38693 @@ -75,8 +75,7 @@
38694 #define STARTFILE_SPEC NETBSD_STARTFILE_SPEC
38695
38696 #undef ENDFILE_SPEC
38697 -#define ENDFILE_SPEC \
38698 - "crtsavres%O%s %(netbsd_endfile_spec)"
38699 +#define ENDFILE_SPEC "%(netbsd_endfile_spec)"
38700
38701 #undef LIB_SPEC
38702 #define LIB_SPEC NETBSD_LIB_SPEC
38703 --- a/gcc/config/rs6000/paired.md
38704 +++ b/gcc/config/rs6000/paired.md
38705 @@ -28,7 +28,7 @@
38706 (UNSPEC_EXTODD_V2SF 333)
38707 ])
38708
38709 -(define_insn "negv2sf2"
38710 +(define_insn "paired_negv2sf2"
38711 [(set (match_operand:V2SF 0 "gpc_reg_operand" "=f")
38712 (neg:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "f")))]
38713 "TARGET_PAIRED_FLOAT"
38714 @@ -42,7 +42,7 @@
38715 "ps_rsqrte %0,%1"
38716 [(set_attr "type" "fp")])
38717
38718 -(define_insn "absv2sf2"
38719 +(define_insn "paired_absv2sf2"
38720 [(set (match_operand:V2SF 0 "gpc_reg_operand" "=f")
38721 (abs:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "f")))]
38722 "TARGET_PAIRED_FLOAT"
38723 @@ -56,7 +56,7 @@
38724 "ps_nabs %0,%1"
38725 [(set_attr "type" "fp")])
38726
38727 -(define_insn "addv2sf3"
38728 +(define_insn "paired_addv2sf3"
38729 [(set (match_operand:V2SF 0 "gpc_reg_operand" "=f")
38730 (plus:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "%f")
38731 (match_operand:V2SF 2 "gpc_reg_operand" "f")))]
38732 @@ -64,7 +64,7 @@
38733 "ps_add %0,%1,%2"
38734 [(set_attr "type" "fp")])
38735
38736 -(define_insn "subv2sf3"
38737 +(define_insn "paired_subv2sf3"
38738 [(set (match_operand:V2SF 0 "gpc_reg_operand" "=f")
38739 (minus:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "f")
38740 (match_operand:V2SF 2 "gpc_reg_operand" "f")))]
38741 @@ -72,7 +72,7 @@
38742 "ps_sub %0,%1,%2"
38743 [(set_attr "type" "fp")])
38744
38745 -(define_insn "mulv2sf3"
38746 +(define_insn "paired_mulv2sf3"
38747 [(set (match_operand:V2SF 0 "gpc_reg_operand" "=f")
38748 (mult:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "%f")
38749 (match_operand:V2SF 2 "gpc_reg_operand" "f")))]
38750 @@ -87,7 +87,7 @@
38751 "ps_res %0,%1"
38752 [(set_attr "type" "fp")])
38753
38754 -(define_insn "divv2sf3"
38755 +(define_insn "paired_divv2sf3"
38756 [(set (match_operand:V2SF 0 "gpc_reg_operand" "=f")
38757 (div:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "f")
38758 (match_operand:V2SF 2 "gpc_reg_operand" "f")))]
38759 --- a/gcc/config/rs6000/ppc-asm.h
38760 +++ b/gcc/config/rs6000/ppc-asm.h
38761 @@ -110,6 +110,11 @@ name: \
38762 .globl GLUE(.,name); \
38763 GLUE(.,name):
38764
38765 +#define HIDDEN_FUNC(name) \
38766 + FUNC_START(name) \
38767 + .hidden name; \
38768 + .hidden GLUE(.,name);
38769 +
38770 #define FUNC_END(name) \
38771 GLUE(.L,name): \
38772 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
38773 @@ -136,6 +141,11 @@ name: \
38774 .globl GLUE(.,name); \
38775 GLUE(.,name):
38776
38777 +#define HIDDEN_FUNC(name) \
38778 + FUNC_START(name) \
38779 + .hidden name; \
38780 + .hidden GLUE(.,name);
38781 +
38782 #define FUNC_END(name) \
38783 GLUE(.L,name): \
38784 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
38785 @@ -153,6 +163,10 @@ GLUE(.L,name): \
38786 .globl FUNC_NAME(name); \
38787 FUNC_NAME(name):
38788
38789 +#define HIDDEN_FUNC(name) \
38790 + FUNC_START(name) \
38791 + .hidden FUNC_NAME(name);
38792 +
38793 #define FUNC_END(name) \
38794 GLUE(.L,name): \
38795 .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
38796 --- a/gcc/config/rs6000/predicates.md
38797 +++ b/gcc/config/rs6000/predicates.md
38798 @@ -915,7 +915,7 @@
38799 rtx elt;
38800 int count = XVECLEN (op, 0);
38801
38802 - if (count != 55)
38803 + if (count != 54)
38804 return 0;
38805
38806 index = 0;
38807 @@ -964,9 +964,8 @@
38808 || GET_MODE (SET_SRC (elt)) != Pmode)
38809 return 0;
38810
38811 - if (GET_CODE (XVECEXP (op, 0, index++)) != USE
38812 - || GET_CODE (XVECEXP (op, 0, index++)) != USE
38813 - || GET_CODE (XVECEXP (op, 0, index++)) != CLOBBER)
38814 + if (GET_CODE (XVECEXP (op, 0, index++)) != SET
38815 + || GET_CODE (XVECEXP (op, 0, index++)) != SET)
38816 return 0;
38817 return 1;
38818 })
38819 --- a/gcc/config/rs6000/rs6000.c
38820 +++ b/gcc/config/rs6000/rs6000.c
38821 @@ -174,9 +174,15 @@ int rs6000_ieeequad;
38822 /* Nonzero to use AltiVec ABI. */
38823 int rs6000_altivec_abi;
38824
38825 +/* Nonzero if we want SPE SIMD instructions. */
38826 +int rs6000_spe;
38827 +
38828 /* Nonzero if we want SPE ABI extensions. */
38829 int rs6000_spe_abi;
38830
38831 +/* Nonzero to use isel instructions. */
38832 +int rs6000_isel;
38833 +
38834 /* Nonzero if floating point operations are done in the GPRs. */
38835 int rs6000_float_gprs = 0;
38836
38837 @@ -669,6 +675,44 @@ struct processor_costs ppc8540_cost = {
38838 1, /* prefetch streams /*/
38839 };
38840
38841 +/* Instruction costs on E300C2 and E300C3 cores. */
38842 +static const
38843 +struct processor_costs ppce300c2c3_cost = {
38844 + COSTS_N_INSNS (4), /* mulsi */
38845 + COSTS_N_INSNS (4), /* mulsi_const */
38846 + COSTS_N_INSNS (4), /* mulsi_const9 */
38847 + COSTS_N_INSNS (4), /* muldi */
38848 + COSTS_N_INSNS (19), /* divsi */
38849 + COSTS_N_INSNS (19), /* divdi */
38850 + COSTS_N_INSNS (3), /* fp */
38851 + COSTS_N_INSNS (4), /* dmul */
38852 + COSTS_N_INSNS (18), /* sdiv */
38853 + COSTS_N_INSNS (33), /* ddiv */
38854 + 32,
38855 + 16, /* l1 cache */
38856 + 16, /* l2 cache */
38857 + 1, /* prefetch streams /*/
38858 +};
38859 +
38860 +/* Instruction costs on PPCE500MC processors. */
38861 +static const
38862 +struct processor_costs ppce500mc_cost = {
38863 + COSTS_N_INSNS (4), /* mulsi */
38864 + COSTS_N_INSNS (4), /* mulsi_const */
38865 + COSTS_N_INSNS (4), /* mulsi_const9 */
38866 + COSTS_N_INSNS (4), /* muldi */
38867 + COSTS_N_INSNS (14), /* divsi */
38868 + COSTS_N_INSNS (14), /* divdi */
38869 + COSTS_N_INSNS (8), /* fp */
38870 + COSTS_N_INSNS (10), /* dmul */
38871 + COSTS_N_INSNS (36), /* sdiv */
38872 + COSTS_N_INSNS (66), /* ddiv */
38873 + 64, /* cache line size */
38874 + 32, /* l1 cache */
38875 + 128, /* l2 cache */
38876 + 1, /* prefetch streams /*/
38877 +};
38878 +
38879 /* Instruction costs on POWER4 and POWER5 processors. */
38880 static const
38881 struct processor_costs power4_cost = {
38882 @@ -713,12 +757,11 @@ static const char *rs6000_invalid_within
38883 static rtx rs6000_generate_compare (enum rtx_code);
38884 static void rs6000_emit_stack_tie (void);
38885 static void rs6000_frame_related (rtx, rtx, HOST_WIDE_INT, rtx, rtx);
38886 -static rtx spe_synthesize_frame_save (rtx);
38887 static bool spe_func_has_64bit_regs_p (void);
38888 static void emit_frame_save (rtx, rtx, enum machine_mode, unsigned int,
38889 int, HOST_WIDE_INT);
38890 static rtx gen_frame_mem_offset (enum machine_mode, rtx, int);
38891 -static void rs6000_emit_allocate_stack (HOST_WIDE_INT, int);
38892 +static void rs6000_emit_allocate_stack (HOST_WIDE_INT, int, int);
38893 static unsigned rs6000_hash_constant (rtx);
38894 static unsigned toc_hash_function (const void *);
38895 static int toc_hash_eq (const void *, const void *);
38896 @@ -728,7 +771,7 @@ static bool legitimate_small_data_p (enu
38897 static bool legitimate_lo_sum_address_p (enum machine_mode, rtx, int);
38898 static struct machine_function * rs6000_init_machine_status (void);
38899 static bool rs6000_assemble_integer (rtx, unsigned int, int);
38900 -static bool no_global_regs_above (int);
38901 +static bool no_global_regs_above (int, bool);
38902 #ifdef HAVE_GAS_HIDDEN
38903 static void rs6000_assemble_visibility (tree, int);
38904 #endif
38905 @@ -741,7 +784,13 @@ static void rs6000_eliminate_indexed_mem
38906 static const char *rs6000_mangle_type (const_tree);
38907 extern const struct attribute_spec rs6000_attribute_table[];
38908 static void rs6000_set_default_type_attributes (tree);
38909 +static rtx rs6000_savres_routine_sym (rs6000_stack_t *, bool, bool, bool);
38910 +static void rs6000_emit_stack_reset (rs6000_stack_t *, rtx, rtx, int, bool);
38911 +static rtx rs6000_make_savres_rtx (rs6000_stack_t *, rtx, int,
38912 + enum machine_mode, bool, bool, bool);
38913 static bool rs6000_reg_live_or_pic_offset_p (int);
38914 +static int rs6000_savres_strategy (rs6000_stack_t *, bool, int, int);
38915 +static void rs6000_restore_saved_cr (rtx, int);
38916 static void rs6000_output_function_prologue (FILE *, HOST_WIDE_INT);
38917 static void rs6000_output_function_epilogue (FILE *, HOST_WIDE_INT);
38918 static void rs6000_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT,
38919 @@ -1420,6 +1469,9 @@ rs6000_override_options (const char *def
38920 {"8540", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN},
38921 /* 8548 has a dummy entry for now. */
38922 {"8548", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN},
38923 + {"e300c2", PROCESSOR_PPCE300C2, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
38924 + {"e300c3", PROCESSOR_PPCE300C3, POWERPC_BASE_MASK},
38925 + {"e500mc", PROCESSOR_PPCE500MC, POWERPC_BASE_MASK | MASK_PPC_GFXOPT},
38926 {"860", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
38927 {"970", PROCESSOR_POWER4,
38928 POWERPC_7400_MASK | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64},
38929 @@ -1523,9 +1575,20 @@ rs6000_override_options (const char *def
38930 }
38931 }
38932
38933 - if (TARGET_E500)
38934 + if ((TARGET_E500 || rs6000_cpu == PROCESSOR_PPCE500MC)
38935 + && !rs6000_explicit_options.isel)
38936 rs6000_isel = 1;
38937
38938 + if (rs6000_cpu == PROCESSOR_PPCE300C2
38939 + || rs6000_cpu == PROCESSOR_PPCE300C3
38940 + || rs6000_cpu == PROCESSOR_PPCE500MC)
38941 + {
38942 + if (TARGET_ALTIVEC)
38943 + error ("AltiVec not supported in this target");
38944 + if (TARGET_SPE)
38945 + error ("Spe not supported in this target");
38946 + }
38947 +
38948 /* If we are optimizing big endian systems for space, use the load/store
38949 multiple and string instructions. */
38950 if (BYTES_BIG_ENDIAN && optimize_size)
38951 @@ -1635,9 +1698,9 @@ rs6000_override_options (const char *def
38952 SUB3TARGET_OVERRIDE_OPTIONS;
38953 #endif
38954
38955 - if (TARGET_E500)
38956 + if (TARGET_E500 || rs6000_cpu == PROCESSOR_PPCE500MC)
38957 {
38958 - /* The e500 does not have string instructions, and we set
38959 + /* The e500 and e500mc do not have string instructions, and we set
38960 MASK_STRING above when optimizing for size. */
38961 if ((target_flags & MASK_STRING) != 0)
38962 target_flags = target_flags & ~MASK_STRING;
38963 @@ -1845,6 +1908,15 @@ rs6000_override_options (const char *def
38964 rs6000_cost = &ppc8540_cost;
38965 break;
38966
38967 + case PROCESSOR_PPCE300C2:
38968 + case PROCESSOR_PPCE300C3:
38969 + rs6000_cost = &ppce300c2c3_cost;
38970 + break;
38971 +
38972 + case PROCESSOR_PPCE500MC:
38973 + rs6000_cost = &ppce500mc_cost;
38974 + break;
38975 +
38976 case PROCESSOR_POWER4:
38977 case PROCESSOR_POWER5:
38978 rs6000_cost = &power4_cost;
38979 @@ -2144,11 +2216,21 @@ rs6000_handle_option (size_t code, const
38980 rs6000_parse_yes_no_option ("vrsave", arg, &(TARGET_ALTIVEC_VRSAVE));
38981 break;
38982
38983 + case OPT_misel:
38984 + rs6000_explicit_options.isel = true;
38985 + rs6000_isel = value;
38986 + break;
38987 +
38988 case OPT_misel_:
38989 rs6000_explicit_options.isel = true;
38990 rs6000_parse_yes_no_option ("isel", arg, &(rs6000_isel));
38991 break;
38992
38993 + case OPT_mspe:
38994 + rs6000_explicit_options.spe = true;
38995 + rs6000_spe = value;
38996 + break;
38997 +
38998 case OPT_mspe_:
38999 rs6000_explicit_options.spe = true;
39000 rs6000_parse_yes_no_option ("spe", arg, &(rs6000_spe));
39001 @@ -2395,6 +2477,8 @@ rs6000_file_start (void)
39002 (TARGET_ALTIVEC_ABI ? 2
39003 : TARGET_SPE_ABI ? 3
39004 : 1));
39005 + fprintf (file, "\t.gnu_attribute 12, %d\n",
39006 + aix_struct_return ? 2 : 1);
39007 }
39008 #endif
39009
39010 @@ -3145,24 +3229,26 @@ invalid_e500_subreg (rtx op, enum machin
39011 if (TARGET_E500_DOUBLE)
39012 {
39013 /* Reject (subreg:SI (reg:DF)); likewise with subreg:DI or
39014 - subreg:TI and reg:TF. */
39015 + subreg:TI and reg:TF. Decimal float modes are like integer
39016 + modes (only low part of each register used) for this
39017 + purpose. */
39018 if (GET_CODE (op) == SUBREG
39019 - && (mode == SImode || mode == DImode || mode == TImode)
39020 + && (mode == SImode || mode == DImode || mode == TImode
39021 + || mode == DDmode || mode == TDmode)
39022 && REG_P (SUBREG_REG (op))
39023 && (GET_MODE (SUBREG_REG (op)) == DFmode
39024 - || GET_MODE (SUBREG_REG (op)) == TFmode
39025 - || GET_MODE (SUBREG_REG (op)) == DDmode
39026 - || GET_MODE (SUBREG_REG (op)) == TDmode))
39027 + || GET_MODE (SUBREG_REG (op)) == TFmode))
39028 return true;
39029
39030 /* Reject (subreg:DF (reg:DI)); likewise with subreg:TF and
39031 reg:TI. */
39032 if (GET_CODE (op) == SUBREG
39033 - && (mode == DFmode || mode == TFmode
39034 - || mode == DDmode || mode == TDmode)
39035 + && (mode == DFmode || mode == TFmode)
39036 && REG_P (SUBREG_REG (op))
39037 && (GET_MODE (SUBREG_REG (op)) == DImode
39038 - || GET_MODE (SUBREG_REG (op)) == TImode))
39039 + || GET_MODE (SUBREG_REG (op)) == TImode
39040 + || GET_MODE (SUBREG_REG (op)) == DDmode
39041 + || GET_MODE (SUBREG_REG (op)) == TDmode))
39042 return true;
39043 }
39044
39045 @@ -3413,10 +3499,10 @@ rs6000_legitimate_offset_address_p (enum
39046 return SPE_CONST_OFFSET_OK (offset);
39047
39048 case DFmode:
39049 - case DDmode:
39050 if (TARGET_E500_DOUBLE)
39051 return SPE_CONST_OFFSET_OK (offset);
39052
39053 + case DDmode:
39054 case DImode:
39055 /* On e500v2, we may have:
39056
39057 @@ -3433,11 +3519,11 @@ rs6000_legitimate_offset_address_p (enum
39058 break;
39059
39060 case TFmode:
39061 - case TDmode:
39062 if (TARGET_E500_DOUBLE)
39063 return (SPE_CONST_OFFSET_OK (offset)
39064 && SPE_CONST_OFFSET_OK (offset + 8));
39065
39066 + case TDmode:
39067 case TImode:
39068 if (mode == TFmode || mode == TDmode || !TARGET_POWERPC64)
39069 extra = 12;
39070 @@ -3582,8 +3668,10 @@ rs6000_legitimize_address (rtx x, rtx ol
39071 && GET_CODE (XEXP (x, 1)) == CONST_INT
39072 && (unsigned HOST_WIDE_INT) (INTVAL (XEXP (x, 1)) + 0x8000) >= 0x10000
39073 && !(SPE_VECTOR_MODE (mode)
39074 + || ALTIVEC_VECTOR_MODE (mode)
39075 || (TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode
39076 - || mode == DImode))))
39077 + || mode == DImode || mode == DDmode
39078 + || mode == TDmode))))
39079 {
39080 HOST_WIDE_INT high_int, low_int;
39081 rtx sum;
39082 @@ -3591,7 +3679,14 @@ rs6000_legitimize_address (rtx x, rtx ol
39083 high_int = INTVAL (XEXP (x, 1)) - low_int;
39084 sum = force_operand (gen_rtx_PLUS (Pmode, XEXP (x, 0),
39085 GEN_INT (high_int)), 0);
39086 - return gen_rtx_PLUS (Pmode, sum, GEN_INT (low_int));
39087 + /* Using a REG+CONST 64-bit integer load on 64-bit platforms
39088 + requires that CONST be word-aligned. */
39089 + if (TARGET_POWERPC64
39090 + && (mode == DImode || mode == DDmode)
39091 + && (low_int & 0x3))
39092 + return gen_rtx_PLUS (Pmode, sum, force_reg (Pmode, GEN_INT (low_int)));
39093 + else
39094 + return gen_rtx_PLUS (Pmode, sum, GEN_INT (low_int));
39095 }
39096 else if (GET_CODE (x) == PLUS
39097 && GET_CODE (XEXP (x, 0)) == REG
39098 @@ -3599,11 +3694,12 @@ rs6000_legitimize_address (rtx x, rtx ol
39099 && GET_MODE_NUNITS (mode) == 1
39100 && ((TARGET_HARD_FLOAT && TARGET_FPRS)
39101 || TARGET_POWERPC64
39102 - || (((mode != DImode && mode != DFmode && mode != DDmode)
39103 - || TARGET_E500_DOUBLE)
39104 - && mode != TFmode && mode != TDmode))
39105 + || ((mode != DImode && mode != DFmode && mode != DDmode)
39106 + || (TARGET_E500_DOUBLE && mode != DDmode)))
39107 && (TARGET_POWERPC64 || mode != DImode)
39108 - && mode != TImode)
39109 + && mode != TImode
39110 + && mode != TFmode
39111 + && mode != TDmode)
39112 {
39113 return gen_rtx_PLUS (Pmode, XEXP (x, 0),
39114 force_reg (Pmode, force_operand (XEXP (x, 1), 0)));
39115 @@ -3630,19 +3726,29 @@ rs6000_legitimize_address (rtx x, rtx ol
39116 /* We accept [reg + reg] and [reg + OFFSET]. */
39117
39118 if (GET_CODE (x) == PLUS)
39119 - {
39120 - rtx op1 = XEXP (x, 0);
39121 - rtx op2 = XEXP (x, 1);
39122 -
39123 - op1 = force_reg (Pmode, op1);
39124 -
39125 - if (GET_CODE (op2) != REG
39126 - && (GET_CODE (op2) != CONST_INT
39127 - || !SPE_CONST_OFFSET_OK (INTVAL (op2))))
39128 - op2 = force_reg (Pmode, op2);
39129 -
39130 - return gen_rtx_PLUS (Pmode, op1, op2);
39131 - }
39132 + {
39133 + rtx op1 = XEXP (x, 0);
39134 + rtx op2 = XEXP (x, 1);
39135 + rtx y;
39136 +
39137 + op1 = force_reg (Pmode, op1);
39138 +
39139 + if (GET_CODE (op2) != REG
39140 + && (GET_CODE (op2) != CONST_INT
39141 + || !SPE_CONST_OFFSET_OK (INTVAL (op2))
39142 + || (GET_MODE_SIZE (mode) > 8
39143 + && !SPE_CONST_OFFSET_OK (INTVAL (op2) + 8))))
39144 + op2 = force_reg (Pmode, op2);
39145 +
39146 + /* We can't always do [reg + reg] for these, because [reg +
39147 + reg + offset] is not a legitimate addressing mode. */
39148 + y = gen_rtx_PLUS (Pmode, op1, op2);
39149 +
39150 + if ((GET_MODE_SIZE (mode) > 8 || mode == DDmode) && REG_P (op2))
39151 + return force_reg (Pmode, y);
39152 + else
39153 + return y;
39154 + }
39155
39156 return force_reg (Pmode, x);
39157 }
39158 @@ -4190,7 +4296,8 @@ rs6000_legitimate_address (enum machine_
39159 && mode != TDmode
39160 && ((TARGET_HARD_FLOAT && TARGET_FPRS)
39161 || TARGET_POWERPC64
39162 - || ((mode != DFmode && mode != DDmode) || TARGET_E500_DOUBLE))
39163 + || (mode != DFmode && mode != DDmode)
39164 + || (TARGET_E500_DOUBLE && mode != DDmode))
39165 && (TARGET_POWERPC64 || mode != DImode)
39166 && legitimate_indexed_address_p (x, reg_ok_strict))
39167 return 1;
39168 @@ -4314,7 +4421,8 @@ rs6000_hard_regno_nregs (int regno, enum
39169 would require function_arg and rs6000_spe_function_arg to handle
39170 SCmode so as to pass the value correctly in a pair of
39171 registers. */
39172 - if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode)
39173 + if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode
39174 + && !DECIMAL_FLOAT_MODE_P (mode))
39175 return (GET_MODE_SIZE (mode) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD;
39176
39177 return (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
39178 @@ -4394,16 +4502,19 @@ rs6000_conditional_register_usage (void)
39179 if (TARGET_ALTIVEC)
39180 global_regs[VSCR_REGNO] = 1;
39181
39182 - if (TARGET_ALTIVEC_ABI)
39183 - {
39184 - for (i = FIRST_ALTIVEC_REGNO; i < FIRST_ALTIVEC_REGNO + 20; ++i)
39185 - call_used_regs[i] = call_really_used_regs[i] = 1;
39186 + /* If we are not using the AltiVec ABI, pretend that the normally
39187 + call-saved registers are also call-used. We could use them
39188 + normally if we saved and restored them in the prologue; that
39189 + would require using the alignment padding around the register
39190 + save area, and some care with unwinding information. */
39191 + if (! TARGET_ALTIVEC_ABI)
39192 + for (i = FIRST_ALTIVEC_REGNO + 20; i <= LAST_ALTIVEC_REGNO; ++i)
39193 + call_used_regs[i] = call_really_used_regs[i] = 1;
39194
39195 - /* AIX reserves VR20:31 in non-extended ABI mode. */
39196 - if (TARGET_XCOFF)
39197 - for (i = FIRST_ALTIVEC_REGNO + 20; i < FIRST_ALTIVEC_REGNO + 32; ++i)
39198 - fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1;
39199 - }
39200 + if (TARGET_ALTIVEC_ABI && TARGET_XCOFF)
39201 + /* AIX reserves VR20:31 in non-extended ABI mode. */
39202 + for (i = FIRST_ALTIVEC_REGNO + 20; i < FIRST_ALTIVEC_REGNO + 32; ++i)
39203 + fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1;
39204 }
39205 \f
39206 /* Try to output insns to set TARGET equal to the constant C if it can
39207 @@ -5588,14 +5699,12 @@ spe_build_register_parallel (enum machin
39208 switch (mode)
39209 {
39210 case DFmode:
39211 - case DDmode:
39212 r1 = gen_rtx_REG (DImode, gregno);
39213 r1 = gen_rtx_EXPR_LIST (VOIDmode, r1, const0_rtx);
39214 return gen_rtx_PARALLEL (mode, gen_rtvec (1, r1));
39215
39216 case DCmode:
39217 case TFmode:
39218 - case TDmode:
39219 r1 = gen_rtx_REG (DImode, gregno);
39220 r1 = gen_rtx_EXPR_LIST (VOIDmode, r1, const0_rtx);
39221 r3 = gen_rtx_REG (DImode, gregno + 2);
39222 @@ -5628,13 +5737,12 @@ rs6000_spe_function_arg (CUMULATIVE_ARGS
39223 /* On E500 v2, double arithmetic is done on the full 64-bit GPR, but
39224 are passed and returned in a pair of GPRs for ABI compatibility. */
39225 if (TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode
39226 - || mode == DDmode || mode == TDmode
39227 || mode == DCmode || mode == TCmode))
39228 {
39229 int n_words = rs6000_arg_size (mode, type);
39230
39231 /* Doubles go in an odd/even register pair (r5/r6, etc). */
39232 - if (mode == DFmode || mode == DDmode)
39233 + if (mode == DFmode)
39234 gregno += (1 - gregno) & 1;
39235
39236 /* Multi-reg args are not split between registers and stack. */
39237 @@ -6047,10 +6155,8 @@ function_arg (CUMULATIVE_ARGS *cum, enum
39238 else if (TARGET_SPE_ABI && TARGET_SPE
39239 && (SPE_VECTOR_MODE (mode)
39240 || (TARGET_E500_DOUBLE && (mode == DFmode
39241 - || mode == DDmode
39242 || mode == DCmode
39243 || mode == TFmode
39244 - || mode == TDmode
39245 || mode == TCmode))))
39246 return rs6000_spe_function_arg (cum, mode, type);
39247
39248 @@ -7049,9 +7155,9 @@ static struct builtin_description bdesc_
39249 { MASK_ALTIVEC, CODE_FOR_altivec_vrlb, "__builtin_altivec_vrlb", ALTIVEC_BUILTIN_VRLB },
39250 { MASK_ALTIVEC, CODE_FOR_altivec_vrlh, "__builtin_altivec_vrlh", ALTIVEC_BUILTIN_VRLH },
39251 { MASK_ALTIVEC, CODE_FOR_altivec_vrlw, "__builtin_altivec_vrlw", ALTIVEC_BUILTIN_VRLW },
39252 - { MASK_ALTIVEC, CODE_FOR_altivec_vslb, "__builtin_altivec_vslb", ALTIVEC_BUILTIN_VSLB },
39253 - { MASK_ALTIVEC, CODE_FOR_altivec_vslh, "__builtin_altivec_vslh", ALTIVEC_BUILTIN_VSLH },
39254 - { MASK_ALTIVEC, CODE_FOR_altivec_vslw, "__builtin_altivec_vslw", ALTIVEC_BUILTIN_VSLW },
39255 + { MASK_ALTIVEC, CODE_FOR_ashlv16qi3, "__builtin_altivec_vslb", ALTIVEC_BUILTIN_VSLB },
39256 + { MASK_ALTIVEC, CODE_FOR_ashlv8hi3, "__builtin_altivec_vslh", ALTIVEC_BUILTIN_VSLH },
39257 + { MASK_ALTIVEC, CODE_FOR_ashlv4si3, "__builtin_altivec_vslw", ALTIVEC_BUILTIN_VSLW },
39258 { MASK_ALTIVEC, CODE_FOR_altivec_vsl, "__builtin_altivec_vsl", ALTIVEC_BUILTIN_VSL },
39259 { MASK_ALTIVEC, CODE_FOR_altivec_vslo, "__builtin_altivec_vslo", ALTIVEC_BUILTIN_VSLO },
39260 { MASK_ALTIVEC, CODE_FOR_altivec_vspltb, "__builtin_altivec_vspltb", ALTIVEC_BUILTIN_VSPLTB },
39261 @@ -7211,10 +7317,10 @@ static struct builtin_description bdesc_
39262 { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sums", ALTIVEC_BUILTIN_VEC_SUMS },
39263 { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_xor", ALTIVEC_BUILTIN_VEC_XOR },
39264
39265 - { 0, CODE_FOR_divv2sf3, "__builtin_paired_divv2sf3", PAIRED_BUILTIN_DIVV2SF3 },
39266 - { 0, CODE_FOR_addv2sf3, "__builtin_paired_addv2sf3", PAIRED_BUILTIN_ADDV2SF3 },
39267 - { 0, CODE_FOR_subv2sf3, "__builtin_paired_subv2sf3", PAIRED_BUILTIN_SUBV2SF3 },
39268 - { 0, CODE_FOR_mulv2sf3, "__builtin_paired_mulv2sf3", PAIRED_BUILTIN_MULV2SF3 },
39269 + { 0, CODE_FOR_paired_divv2sf3, "__builtin_paired_divv2sf3", PAIRED_BUILTIN_DIVV2SF3 },
39270 + { 0, CODE_FOR_paired_addv2sf3, "__builtin_paired_addv2sf3", PAIRED_BUILTIN_ADDV2SF3 },
39271 + { 0, CODE_FOR_paired_subv2sf3, "__builtin_paired_subv2sf3", PAIRED_BUILTIN_SUBV2SF3 },
39272 + { 0, CODE_FOR_paired_mulv2sf3, "__builtin_paired_mulv2sf3", PAIRED_BUILTIN_MULV2SF3 },
39273 { 0, CODE_FOR_paired_muls0, "__builtin_paired_muls0", PAIRED_BUILTIN_MULS0 },
39274 { 0, CODE_FOR_paired_muls1, "__builtin_paired_muls1", PAIRED_BUILTIN_MULS1 },
39275 { 0, CODE_FOR_paired_merge00, "__builtin_paired_merge00", PAIRED_BUILTIN_MERGE00 },
39276 @@ -7223,10 +7329,10 @@ static struct builtin_description bdesc_
39277 { 0, CODE_FOR_paired_merge11, "__builtin_paired_merge11", PAIRED_BUILTIN_MERGE11 },
39278
39279 /* Place holder, leave as first spe builtin. */
39280 - { 0, CODE_FOR_spe_evaddw, "__builtin_spe_evaddw", SPE_BUILTIN_EVADDW },
39281 - { 0, CODE_FOR_spe_evand, "__builtin_spe_evand", SPE_BUILTIN_EVAND },
39282 + { 0, CODE_FOR_addv2si3, "__builtin_spe_evaddw", SPE_BUILTIN_EVADDW },
39283 + { 0, CODE_FOR_andv2si3, "__builtin_spe_evand", SPE_BUILTIN_EVAND },
39284 { 0, CODE_FOR_spe_evandc, "__builtin_spe_evandc", SPE_BUILTIN_EVANDC },
39285 - { 0, CODE_FOR_spe_evdivws, "__builtin_spe_evdivws", SPE_BUILTIN_EVDIVWS },
39286 + { 0, CODE_FOR_divv2si3, "__builtin_spe_evdivws", SPE_BUILTIN_EVDIVWS },
39287 { 0, CODE_FOR_spe_evdivwu, "__builtin_spe_evdivwu", SPE_BUILTIN_EVDIVWU },
39288 { 0, CODE_FOR_spe_eveqv, "__builtin_spe_eveqv", SPE_BUILTIN_EVEQV },
39289 { 0, CODE_FOR_spe_evfsadd, "__builtin_spe_evfsadd", SPE_BUILTIN_EVFSADD },
39290 @@ -7502,7 +7608,7 @@ static struct builtin_description bdesc_
39291
39292 /* The SPE unary builtins must start with SPE_BUILTIN_EVABS and
39293 end with SPE_BUILTIN_EVSUBFUSIAAW. */
39294 - { 0, CODE_FOR_spe_evabs, "__builtin_spe_evabs", SPE_BUILTIN_EVABS },
39295 + { 0, CODE_FOR_absv2si2, "__builtin_spe_evabs", SPE_BUILTIN_EVABS },
39296 { 0, CODE_FOR_spe_evaddsmiaaw, "__builtin_spe_evaddsmiaaw", SPE_BUILTIN_EVADDSMIAAW },
39297 { 0, CODE_FOR_spe_evaddssiaaw, "__builtin_spe_evaddssiaaw", SPE_BUILTIN_EVADDSSIAAW },
39298 { 0, CODE_FOR_spe_evaddumiaaw, "__builtin_spe_evaddumiaaw", SPE_BUILTIN_EVADDUMIAAW },
39299 @@ -7534,9 +7640,9 @@ static struct builtin_description bdesc_
39300 /* Place-holder. Leave as last unary SPE builtin. */
39301 { 0, CODE_FOR_spe_evsubfusiaaw, "__builtin_spe_evsubfusiaaw", SPE_BUILTIN_EVSUBFUSIAAW },
39302
39303 - { 0, CODE_FOR_absv2sf2, "__builtin_paired_absv2sf2", PAIRED_BUILTIN_ABSV2SF2 },
39304 + { 0, CODE_FOR_paired_absv2sf2, "__builtin_paired_absv2sf2", PAIRED_BUILTIN_ABSV2SF2 },
39305 { 0, CODE_FOR_nabsv2sf2, "__builtin_paired_nabsv2sf2", PAIRED_BUILTIN_NABSV2SF2 },
39306 - { 0, CODE_FOR_negv2sf2, "__builtin_paired_negv2sf2", PAIRED_BUILTIN_NEGV2SF2 },
39307 + { 0, CODE_FOR_paired_negv2sf2, "__builtin_paired_negv2sf2", PAIRED_BUILTIN_NEGV2SF2 },
39308 { 0, CODE_FOR_sqrtv2sf2, "__builtin_paired_sqrtv2sf2", PAIRED_BUILTIN_SQRTV2SF2 },
39309 { 0, CODE_FOR_resv2sf2, "__builtin_paired_resv2sf2", PAIRED_BUILTIN_RESV2SF2 }
39310 };
39311 @@ -9051,6 +9157,8 @@ build_opaque_vector_type (tree node, int
39312 static void
39313 rs6000_init_builtins (void)
39314 {
39315 + tree tdecl;
39316 +
39317 V2SI_type_node = build_vector_type (intSI_type_node, 2);
39318 V2SF_type_node = build_vector_type (float_type_node, 2);
39319 V4HI_type_node = build_vector_type (intHI_type_node, 4);
39320 @@ -9088,60 +9196,75 @@ rs6000_init_builtins (void)
39321 float_type_internal_node = float_type_node;
39322 void_type_internal_node = void_type_node;
39323
39324 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39325 - get_identifier ("__bool char"),
39326 - bool_char_type_node));
39327 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39328 - get_identifier ("__bool short"),
39329 - bool_short_type_node));
39330 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39331 - get_identifier ("__bool int"),
39332 - bool_int_type_node));
39333 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39334 - get_identifier ("__pixel"),
39335 - pixel_type_node));
39336 + tdecl = build_decl (TYPE_DECL, get_identifier ("__bool char"),
39337 + bool_char_type_node);
39338 + TYPE_NAME (bool_char_type_node) = tdecl;
39339 + (*lang_hooks.decls.pushdecl) (tdecl);
39340 + tdecl = build_decl (TYPE_DECL, get_identifier ("__bool short"),
39341 + bool_short_type_node);
39342 + TYPE_NAME (bool_short_type_node) = tdecl;
39343 + (*lang_hooks.decls.pushdecl) (tdecl);
39344 + tdecl = build_decl (TYPE_DECL, get_identifier ("__bool int"),
39345 + bool_int_type_node);
39346 + TYPE_NAME (bool_int_type_node) = tdecl;
39347 + (*lang_hooks.decls.pushdecl) (tdecl);
39348 + tdecl = build_decl (TYPE_DECL, get_identifier ("__pixel"),
39349 + pixel_type_node);
39350 + TYPE_NAME (pixel_type_node) = tdecl;
39351 + (*lang_hooks.decls.pushdecl) (tdecl);
39352
39353 bool_V16QI_type_node = build_vector_type (bool_char_type_node, 16);
39354 bool_V8HI_type_node = build_vector_type (bool_short_type_node, 8);
39355 bool_V4SI_type_node = build_vector_type (bool_int_type_node, 4);
39356 pixel_V8HI_type_node = build_vector_type (pixel_type_node, 8);
39357
39358 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39359 - get_identifier ("__vector unsigned char"),
39360 - unsigned_V16QI_type_node));
39361 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39362 - get_identifier ("__vector signed char"),
39363 - V16QI_type_node));
39364 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39365 - get_identifier ("__vector __bool char"),
39366 - bool_V16QI_type_node));
39367 -
39368 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39369 - get_identifier ("__vector unsigned short"),
39370 - unsigned_V8HI_type_node));
39371 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39372 - get_identifier ("__vector signed short"),
39373 - V8HI_type_node));
39374 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39375 - get_identifier ("__vector __bool short"),
39376 - bool_V8HI_type_node));
39377 -
39378 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39379 - get_identifier ("__vector unsigned int"),
39380 - unsigned_V4SI_type_node));
39381 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39382 - get_identifier ("__vector signed int"),
39383 - V4SI_type_node));
39384 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39385 - get_identifier ("__vector __bool int"),
39386 - bool_V4SI_type_node));
39387 -
39388 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39389 - get_identifier ("__vector float"),
39390 - V4SF_type_node));
39391 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
39392 - get_identifier ("__vector __pixel"),
39393 - pixel_V8HI_type_node));
39394 + tdecl = build_decl (TYPE_DECL, get_identifier ("__vector unsigned char"),
39395 + unsigned_V16QI_type_node);
39396 + TYPE_NAME (unsigned_V16QI_type_node) = tdecl;
39397 + (*lang_hooks.decls.pushdecl) (tdecl);
39398 + tdecl = build_decl (TYPE_DECL, get_identifier ("__vector signed char"),
39399 + V16QI_type_node);
39400 + TYPE_NAME (V16QI_type_node) = tdecl;
39401 + (*lang_hooks.decls.pushdecl) (tdecl);
39402 + tdecl = build_decl (TYPE_DECL, get_identifier ("__vector __bool char"),
39403 + bool_V16QI_type_node);
39404 + TYPE_NAME ( bool_V16QI_type_node) = tdecl;
39405 + (*lang_hooks.decls.pushdecl) (tdecl);
39406 +
39407 + tdecl = build_decl (TYPE_DECL, get_identifier ("__vector unsigned short"),
39408 + unsigned_V8HI_type_node);
39409 + TYPE_NAME (unsigned_V8HI_type_node) = tdecl;
39410 + (*lang_hooks.decls.pushdecl) (tdecl);
39411 + tdecl = build_decl (TYPE_DECL, get_identifier ("__vector signed short"),
39412 + V8HI_type_node);
39413 + TYPE_NAME (V8HI_type_node) = tdecl;
39414 + (*lang_hooks.decls.pushdecl) (tdecl);
39415 + tdecl = build_decl (TYPE_DECL, get_identifier ("__vector __bool short"),
39416 + bool_V8HI_type_node);
39417 + TYPE_NAME (bool_V8HI_type_node) = tdecl;
39418 + (*lang_hooks.decls.pushdecl) (tdecl);
39419 +
39420 + tdecl = build_decl (TYPE_DECL, get_identifier ("__vector unsigned int"),
39421 + unsigned_V4SI_type_node);
39422 + TYPE_NAME (unsigned_V4SI_type_node) = tdecl;
39423 + (*lang_hooks.decls.pushdecl) (tdecl);
39424 + tdecl = build_decl (TYPE_DECL, get_identifier ("__vector signed int"),
39425 + V4SI_type_node);
39426 + TYPE_NAME (V4SI_type_node) = tdecl;
39427 + (*lang_hooks.decls.pushdecl) (tdecl);
39428 + tdecl = build_decl (TYPE_DECL, get_identifier ("__vector __bool int"),
39429 + bool_V4SI_type_node);
39430 + TYPE_NAME (bool_V4SI_type_node) = tdecl;
39431 + (*lang_hooks.decls.pushdecl) (tdecl);
39432 +
39433 + tdecl = build_decl (TYPE_DECL, get_identifier ("__vector float"),
39434 + V4SF_type_node);
39435 + TYPE_NAME (V4SF_type_node) = tdecl;
39436 + (*lang_hooks.decls.pushdecl) (tdecl);
39437 + tdecl = build_decl (TYPE_DECL, get_identifier ("__vector __pixel"),
39438 + pixel_V8HI_type_node);
39439 + TYPE_NAME (pixel_V8HI_type_node) = tdecl;
39440 + (*lang_hooks.decls.pushdecl) (tdecl);
39441
39442 if (TARGET_PAIRED_FLOAT)
39443 paired_init_builtins ();
39444 @@ -12472,7 +12595,7 @@ rs6000_generate_compare (enum rtx_code c
39445 switch (op_mode)
39446 {
39447 case SFmode:
39448 - cmp = flag_unsafe_math_optimizations
39449 + cmp = (flag_finite_math_only && !flag_trapping_math)
39450 ? gen_tstsfeq_gpr (compare_result, rs6000_compare_op0,
39451 rs6000_compare_op1)
39452 : gen_cmpsfeq_gpr (compare_result, rs6000_compare_op0,
39453 @@ -12480,7 +12603,7 @@ rs6000_generate_compare (enum rtx_code c
39454 break;
39455
39456 case DFmode:
39457 - cmp = flag_unsafe_math_optimizations
39458 + cmp = (flag_finite_math_only && !flag_trapping_math)
39459 ? gen_tstdfeq_gpr (compare_result, rs6000_compare_op0,
39460 rs6000_compare_op1)
39461 : gen_cmpdfeq_gpr (compare_result, rs6000_compare_op0,
39462 @@ -12488,7 +12611,7 @@ rs6000_generate_compare (enum rtx_code c
39463 break;
39464
39465 case TFmode:
39466 - cmp = flag_unsafe_math_optimizations
39467 + cmp = (flag_finite_math_only && !flag_trapping_math)
39468 ? gen_tsttfeq_gpr (compare_result, rs6000_compare_op0,
39469 rs6000_compare_op1)
39470 : gen_cmptfeq_gpr (compare_result, rs6000_compare_op0,
39471 @@ -12504,7 +12627,7 @@ rs6000_generate_compare (enum rtx_code c
39472 switch (op_mode)
39473 {
39474 case SFmode:
39475 - cmp = flag_unsafe_math_optimizations
39476 + cmp = (flag_finite_math_only && !flag_trapping_math)
39477 ? gen_tstsfgt_gpr (compare_result, rs6000_compare_op0,
39478 rs6000_compare_op1)
39479 : gen_cmpsfgt_gpr (compare_result, rs6000_compare_op0,
39480 @@ -12512,7 +12635,7 @@ rs6000_generate_compare (enum rtx_code c
39481 break;
39482
39483 case DFmode:
39484 - cmp = flag_unsafe_math_optimizations
39485 + cmp = (flag_finite_math_only && !flag_trapping_math)
39486 ? gen_tstdfgt_gpr (compare_result, rs6000_compare_op0,
39487 rs6000_compare_op1)
39488 : gen_cmpdfgt_gpr (compare_result, rs6000_compare_op0,
39489 @@ -12520,7 +12643,7 @@ rs6000_generate_compare (enum rtx_code c
39490 break;
39491
39492 case TFmode:
39493 - cmp = flag_unsafe_math_optimizations
39494 + cmp = (flag_finite_math_only && !flag_trapping_math)
39495 ? gen_tsttfgt_gpr (compare_result, rs6000_compare_op0,
39496 rs6000_compare_op1)
39497 : gen_cmptfgt_gpr (compare_result, rs6000_compare_op0,
39498 @@ -12536,7 +12659,7 @@ rs6000_generate_compare (enum rtx_code c
39499 switch (op_mode)
39500 {
39501 case SFmode:
39502 - cmp = flag_unsafe_math_optimizations
39503 + cmp = (flag_finite_math_only && !flag_trapping_math)
39504 ? gen_tstsflt_gpr (compare_result, rs6000_compare_op0,
39505 rs6000_compare_op1)
39506 : gen_cmpsflt_gpr (compare_result, rs6000_compare_op0,
39507 @@ -12544,7 +12667,7 @@ rs6000_generate_compare (enum rtx_code c
39508 break;
39509
39510 case DFmode:
39511 - cmp = flag_unsafe_math_optimizations
39512 + cmp = (flag_finite_math_only && !flag_trapping_math)
39513 ? gen_tstdflt_gpr (compare_result, rs6000_compare_op0,
39514 rs6000_compare_op1)
39515 : gen_cmpdflt_gpr (compare_result, rs6000_compare_op0,
39516 @@ -12552,7 +12675,7 @@ rs6000_generate_compare (enum rtx_code c
39517 break;
39518
39519 case TFmode:
39520 - cmp = flag_unsafe_math_optimizations
39521 + cmp = (flag_finite_math_only && !flag_trapping_math)
39522 ? gen_tsttflt_gpr (compare_result, rs6000_compare_op0,
39523 rs6000_compare_op1)
39524 : gen_cmptflt_gpr (compare_result, rs6000_compare_op0,
39525 @@ -12587,7 +12710,7 @@ rs6000_generate_compare (enum rtx_code c
39526 switch (op_mode)
39527 {
39528 case SFmode:
39529 - cmp = flag_unsafe_math_optimizations
39530 + cmp = (flag_finite_math_only && !flag_trapping_math)
39531 ? gen_tstsfeq_gpr (compare_result2, rs6000_compare_op0,
39532 rs6000_compare_op1)
39533 : gen_cmpsfeq_gpr (compare_result2, rs6000_compare_op0,
39534 @@ -12595,7 +12718,7 @@ rs6000_generate_compare (enum rtx_code c
39535 break;
39536
39537 case DFmode:
39538 - cmp = flag_unsafe_math_optimizations
39539 + cmp = (flag_finite_math_only && !flag_trapping_math)
39540 ? gen_tstdfeq_gpr (compare_result2, rs6000_compare_op0,
39541 rs6000_compare_op1)
39542 : gen_cmpdfeq_gpr (compare_result2, rs6000_compare_op0,
39543 @@ -12603,7 +12726,7 @@ rs6000_generate_compare (enum rtx_code c
39544 break;
39545
39546 case TFmode:
39547 - cmp = flag_unsafe_math_optimizations
39548 + cmp = (flag_finite_math_only && !flag_trapping_math)
39549 ? gen_tsttfeq_gpr (compare_result2, rs6000_compare_op0,
39550 rs6000_compare_op1)
39551 : gen_cmptfeq_gpr (compare_result2, rs6000_compare_op0,
39552 @@ -13946,8 +14069,8 @@ rs6000_split_multireg_move (rtx dst, rtx
39553 reg_mode = DECIMAL_FLOAT_MODE_P (mode) ? DDmode : DFmode;
39554 else if (ALTIVEC_REGNO_P (reg))
39555 reg_mode = V16QImode;
39556 - else if (TARGET_E500_DOUBLE && (mode == TFmode || mode == TDmode))
39557 - reg_mode = DECIMAL_FLOAT_MODE_P (mode) ? DDmode : DFmode;
39558 + else if (TARGET_E500_DOUBLE && mode == TFmode)
39559 + reg_mode = DFmode;
39560 else
39561 reg_mode = word_mode;
39562 reg_mode_size = GET_MODE_SIZE (reg_mode);
39563 @@ -14535,7 +14658,7 @@ rs6000_stack_info (void)
39564 {
39565 /* Align stack so SPE GPR save area is aligned on a
39566 double-word boundary. */
39567 - if (info_ptr->spe_gp_size != 0)
39568 + if (info_ptr->spe_gp_size != 0 && info_ptr->cr_save_offset != 0)
39569 info_ptr->spe_padding_size
39570 = 8 - (-info_ptr->cr_save_offset % 8);
39571 else
39572 @@ -14686,8 +14809,7 @@ spe_func_has_64bit_regs_p (void)
39573
39574 if (SPE_VECTOR_MODE (mode))
39575 return true;
39576 - if (TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode
39577 - || mode == DDmode || mode == TDmode))
39578 + if (TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode))
39579 return true;
39580 }
39581 }
39582 @@ -15191,10 +15313,12 @@ rs6000_emit_stack_tie (void)
39583
39584 /* Emit the correct code for allocating stack space, as insns.
39585 If COPY_R12, make sure a copy of the old frame is left in r12.
39586 + If COPY_R11, make sure a copy of the old frame is left in r11,
39587 + in preference to r12 if COPY_R12.
39588 The generated code may use hard register 0 as a temporary. */
39589
39590 static void
39591 -rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12)
39592 +rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12, int copy_r11)
39593 {
39594 rtx insn;
39595 rtx stack_reg = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM);
39596 @@ -15243,8 +15367,11 @@ rs6000_emit_allocate_stack (HOST_WIDE_IN
39597 warning (0, "stack limit expression is not supported");
39598 }
39599
39600 - if (copy_r12 || ! TARGET_UPDATE)
39601 - emit_move_insn (gen_rtx_REG (Pmode, 12), stack_reg);
39602 + if (copy_r12 || copy_r11 || ! TARGET_UPDATE)
39603 + emit_move_insn (copy_r11
39604 + ? gen_rtx_REG (Pmode, 11)
39605 + : gen_rtx_REG (Pmode, 12),
39606 + stack_reg);
39607
39608 if (TARGET_UPDATE)
39609 {
39610 @@ -15270,7 +15397,9 @@ rs6000_emit_allocate_stack (HOST_WIDE_IN
39611 ? gen_addsi3 (stack_reg, stack_reg, todec)
39612 : gen_adddi3 (stack_reg, stack_reg, todec));
39613 emit_move_insn (gen_rtx_MEM (Pmode, stack_reg),
39614 - gen_rtx_REG (Pmode, 12));
39615 + copy_r11
39616 + ? gen_rtx_REG (Pmode, 11)
39617 + : gen_rtx_REG (Pmode, 12));
39618 }
39619
39620 RTX_FRAME_RELATED_P (insn) = 1;
39621 @@ -15359,77 +15488,12 @@ rs6000_frame_related (rtx insn, rtx reg,
39622 }
39623 }
39624
39625 - if (TARGET_SPE)
39626 - real = spe_synthesize_frame_save (real);
39627 -
39628 RTX_FRAME_RELATED_P (insn) = 1;
39629 REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
39630 real,
39631 REG_NOTES (insn));
39632 }
39633
39634 -/* Given an SPE frame note, return a PARALLEL of SETs with the
39635 - original note, plus a synthetic register save. */
39636 -
39637 -static rtx
39638 -spe_synthesize_frame_save (rtx real)
39639 -{
39640 - rtx synth, offset, reg, real2;
39641 -
39642 - if (GET_CODE (real) != SET
39643 - || GET_MODE (SET_SRC (real)) != V2SImode)
39644 - return real;
39645 -
39646 - /* For the SPE, registers saved in 64-bits, get a PARALLEL for their
39647 - frame related note. The parallel contains a set of the register
39648 - being saved, and another set to a synthetic register (n+1200).
39649 - This is so we can differentiate between 64-bit and 32-bit saves.
39650 - Words cannot describe this nastiness. */
39651 -
39652 - gcc_assert (GET_CODE (SET_DEST (real)) == MEM
39653 - && GET_CODE (XEXP (SET_DEST (real), 0)) == PLUS
39654 - && GET_CODE (SET_SRC (real)) == REG);
39655 -
39656 - /* Transform:
39657 - (set (mem (plus (reg x) (const y)))
39658 - (reg z))
39659 - into:
39660 - (set (mem (plus (reg x) (const y+4)))
39661 - (reg z+1200))
39662 - */
39663 -
39664 - real2 = copy_rtx (real);
39665 - PUT_MODE (SET_DEST (real2), SImode);
39666 - reg = SET_SRC (real2);
39667 - real2 = replace_rtx (real2, reg, gen_rtx_REG (SImode, REGNO (reg)));
39668 - synth = copy_rtx (real2);
39669 -
39670 - if (BYTES_BIG_ENDIAN)
39671 - {
39672 - offset = XEXP (XEXP (SET_DEST (real2), 0), 1);
39673 - real2 = replace_rtx (real2, offset, GEN_INT (INTVAL (offset) + 4));
39674 - }
39675 -
39676 - reg = SET_SRC (synth);
39677 -
39678 - synth = replace_rtx (synth, reg,
39679 - gen_rtx_REG (SImode, REGNO (reg) + 1200));
39680 -
39681 - offset = XEXP (XEXP (SET_DEST (synth), 0), 1);
39682 - synth = replace_rtx (synth, offset,
39683 - GEN_INT (INTVAL (offset)
39684 - + (BYTES_BIG_ENDIAN ? 0 : 4)));
39685 -
39686 - RTX_FRAME_RELATED_P (synth) = 1;
39687 - RTX_FRAME_RELATED_P (real2) = 1;
39688 - if (BYTES_BIG_ENDIAN)
39689 - real = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, synth, real2));
39690 - else
39691 - real = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, real2, synth));
39692 -
39693 - return real;
39694 -}
39695 -
39696 /* Returns an insn that has a vrsave set operation with the
39697 appropriate CLOBBERs. */
39698
39699 @@ -15503,7 +15567,7 @@ emit_frame_save (rtx frame_reg, rtx fram
39700
39701 /* Some cases that need register indexed addressing. */
39702 if ((TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode))
39703 - || (TARGET_E500_DOUBLE && (mode == DFmode || mode == DDmode))
39704 + || (TARGET_E500_DOUBLE && mode == DFmode)
39705 || (TARGET_SPE_ABI
39706 && SPE_VECTOR_MODE (mode)
39707 && !SPE_CONST_OFFSET_OK (offset)))
39708 @@ -15543,7 +15607,7 @@ gen_frame_mem_offset (enum machine_mode
39709 int_rtx = GEN_INT (offset);
39710
39711 if ((TARGET_SPE_ABI && SPE_VECTOR_MODE (mode))
39712 - || (TARGET_E500_DOUBLE && (mode == DFmode || mode == DDmode)))
39713 + || (TARGET_E500_DOUBLE && mode == DFmode))
39714 {
39715 offset_rtx = gen_rtx_REG (Pmode, FIXED_SCRATCH);
39716 emit_move_insn (offset_rtx, int_rtx);
39717 @@ -15558,11 +15622,11 @@ gen_frame_mem_offset (enum machine_mode
39718 and cannot use stmw/lmw if there are any in its range. */
39719
39720 static bool
39721 -no_global_regs_above (int first_greg)
39722 +no_global_regs_above (int first, bool gpr)
39723 {
39724 int i;
39725 - for (i = 0; i < 32 - first_greg; i++)
39726 - if (global_regs[first_greg + i])
39727 + for (i = first; i < (gpr ? 32 : 64); i++)
39728 + if (global_regs[i])
39729 return false;
39730 return true;
39731 }
39732 @@ -15571,6 +15635,164 @@ no_global_regs_above (int first_greg)
39733 #define TARGET_FIX_AND_CONTINUE 0
39734 #endif
39735
39736 +/* It's really GPR 13 and FPR 14, but we need the smaller of the two. */
39737 +#define FIRST_SAVRES_REGISTER FIRST_SAVED_GP_REGNO
39738 +#define LAST_SAVRES_REGISTER 31
39739 +#define N_SAVRES_REGISTERS (LAST_SAVRES_REGISTER - FIRST_SAVRES_REGISTER + 1)
39740 +
39741 +static GTY(()) rtx savres_routine_syms[N_SAVRES_REGISTERS][8];
39742 +
39743 +/* Return the symbol for an out-of-line register save/restore routine.
39744 + We are saving/restoring GPRs if GPR is true. */
39745 +
39746 +static rtx
39747 +rs6000_savres_routine_sym (rs6000_stack_t *info, bool savep, bool gpr, bool exitp)
39748 +{
39749 + int regno = gpr ? info->first_gp_reg_save : (info->first_fp_reg_save - 32);
39750 + rtx sym;
39751 + int select = ((savep ? 1 : 0) << 2
39752 + | (TARGET_SPE_ABI
39753 + /* On the SPE, we never have any FPRs, but we do have
39754 + 32/64-bit versions of the routines. */
39755 + ? (info->spe_64bit_regs_used ? 1 : 0)
39756 + : (gpr ? 1 : 0)) << 1
39757 + | (exitp ? 1: 0));
39758 +
39759 + /* Don't generate bogus routine names. */
39760 + gcc_assert (FIRST_SAVRES_REGISTER <= regno && regno <= LAST_SAVRES_REGISTER);
39761 +
39762 + sym = savres_routine_syms[regno-FIRST_SAVRES_REGISTER][select];
39763 +
39764 + if (sym == NULL)
39765 + {
39766 + char name[30];
39767 + const char *action;
39768 + const char *regkind;
39769 + const char *exit_suffix;
39770 +
39771 + action = savep ? "save" : "rest";
39772 +
39773 + /* SPE has slightly different names for its routines depending on
39774 + whether we are saving 32-bit or 64-bit registers. */
39775 + if (TARGET_SPE_ABI)
39776 + {
39777 + /* No floating point saves on the SPE. */
39778 + gcc_assert (gpr);
39779 +
39780 + regkind = info->spe_64bit_regs_used ? "64gpr" : "32gpr";
39781 + }
39782 + else
39783 + regkind = gpr ? "gpr" : "fpr";
39784 +
39785 + exit_suffix = exitp ? "_x" : "";
39786 +
39787 + sprintf (name, "_%s%s_%d%s", action, regkind, regno, exit_suffix);
39788 +
39789 + sym = savres_routine_syms[regno-FIRST_SAVRES_REGISTER][select]
39790 + = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name));
39791 + SYMBOL_REF_FLAGS (sym) |= SYMBOL_FLAG_FUNCTION;
39792 + }
39793 +
39794 + return sym;
39795 +}
39796 +
39797 +/* Emit a sequence of insns, including a stack tie if needed, for
39798 + resetting the stack pointer. If SAVRES is true, then don't reset the
39799 + stack pointer, but move the base of the frame into r11 for use by
39800 + out-of-line register restore routines. */
39801 +
39802 +static void
39803 +rs6000_emit_stack_reset (rs6000_stack_t *info,
39804 + rtx sp_reg_rtx, rtx frame_reg_rtx,
39805 + int sp_offset, bool savres)
39806 +{
39807 + /* This blockage is needed so that sched doesn't decide to move
39808 + the sp change before the register restores. */
39809 + if (frame_reg_rtx != sp_reg_rtx
39810 + || (TARGET_SPE_ABI
39811 + && info->spe_64bit_regs_used != 0
39812 + && info->first_gp_reg_save != 32))
39813 + rs6000_emit_stack_tie ();
39814 +
39815 + if (frame_reg_rtx != sp_reg_rtx)
39816 + {
39817 + rs6000_emit_stack_tie ();
39818 + if (sp_offset != 0)
39819 + emit_insn (gen_addsi3 (sp_reg_rtx, frame_reg_rtx,
39820 + GEN_INT (sp_offset)));
39821 + else if (!savres)
39822 + emit_move_insn (sp_reg_rtx, frame_reg_rtx);
39823 + }
39824 + else if (sp_offset != 0)
39825 + {
39826 + /* If we are restoring registers out-of-line, we will be using the
39827 + "exit" variants of the restore routines, which will reset the
39828 + stack for us. But we do need to point r11 into the right place
39829 + for those routines. */
39830 + rtx dest_reg = (savres
39831 + ? gen_rtx_REG (Pmode, 11)
39832 + : sp_reg_rtx);
39833 +
39834 + emit_insn (TARGET_32BIT
39835 + ? gen_addsi3 (dest_reg, sp_reg_rtx,
39836 + GEN_INT (sp_offset))
39837 + : gen_adddi3 (dest_reg, sp_reg_rtx,
39838 + GEN_INT (sp_offset)));
39839 + }
39840 +}
39841 +
39842 +/* Construct a parallel rtx describing the effect of a call to an
39843 + out-of-line register save/restore routine. */
39844 +
39845 +static rtx
39846 +rs6000_make_savres_rtx (rs6000_stack_t *info,
39847 + rtx frame_reg_rtx, int save_area_offset,
39848 + enum machine_mode reg_mode,
39849 + bool savep, bool gpr, bool exitp)
39850 +{
39851 + int i;
39852 + int offset, start_reg, end_reg, n_regs;
39853 + int reg_size = GET_MODE_SIZE (reg_mode);
39854 + rtx sym;
39855 + rtvec p;
39856 +
39857 + offset = 0;
39858 + start_reg = (gpr
39859 + ? info->first_gp_reg_save
39860 + : info->first_fp_reg_save);
39861 + end_reg = gpr ? 32 : 64;
39862 + n_regs = end_reg - start_reg;
39863 + p = rtvec_alloc ((exitp ? 4 : 3) + n_regs);
39864 +
39865 + /* If we're saving registers, then we should never say we're exiting. */
39866 + gcc_assert ((savep && !exitp) || !savep);
39867 +
39868 + if (exitp)
39869 + RTVEC_ELT (p, offset++) = gen_rtx_RETURN (VOIDmode);
39870 +
39871 + RTVEC_ELT (p, offset++)
39872 + = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 65));
39873 +
39874 + sym = rs6000_savres_routine_sym (info, savep, gpr, exitp);
39875 + RTVEC_ELT (p, offset++) = gen_rtx_USE (VOIDmode, sym);
39876 + RTVEC_ELT (p, offset++) = gen_rtx_USE (VOIDmode, gen_rtx_REG (Pmode, 11));
39877 +
39878 + for (i = 0; i < end_reg - start_reg; i++)
39879 + {
39880 + rtx addr, reg, mem;
39881 + reg = gen_rtx_REG (reg_mode, start_reg + i);
39882 + addr = gen_rtx_PLUS (Pmode, frame_reg_rtx,
39883 + GEN_INT (save_area_offset + reg_size*i));
39884 + mem = gen_frame_mem (reg_mode, addr);
39885 +
39886 + RTVEC_ELT (p, i + offset) = gen_rtx_SET (VOIDmode,
39887 + savep ? mem : reg,
39888 + savep ? reg : mem);
39889 + }
39890 +
39891 + return gen_rtx_PARALLEL (VOIDmode, p);
39892 +}
39893 +
39894 /* Determine whether the gp REG is really used. */
39895
39896 static bool
39897 @@ -15585,6 +15807,93 @@ rs6000_reg_live_or_pic_offset_p (int reg
39898 || (DEFAULT_ABI == ABI_DARWIN && flag_pic))));
39899 }
39900
39901 +enum {
39902 + SAVRES_MULTIPLE = 0x1,
39903 + SAVRES_INLINE_FPRS = 0x2,
39904 + SAVRES_INLINE_GPRS = 0x4
39905 +};
39906 +
39907 +/* Determine the strategy for savings/restoring registers. */
39908 +
39909 +static int
39910 +rs6000_savres_strategy (rs6000_stack_t *info, bool savep,
39911 + int using_static_chain_p, int sibcall)
39912 +{
39913 + bool using_multiple_p;
39914 + bool common;
39915 + bool savres_fprs_inline;
39916 + bool savres_gprs_inline;
39917 + bool noclobber_global_gprs
39918 + = no_global_regs_above (info->first_gp_reg_save, /*gpr=*/true);
39919 +
39920 + using_multiple_p = (TARGET_MULTIPLE && ! TARGET_POWERPC64
39921 + && (!TARGET_SPE_ABI
39922 + || info->spe_64bit_regs_used == 0)
39923 + && info->first_gp_reg_save < 31
39924 + && noclobber_global_gprs);
39925 + /* Don't bother to try to save things out-of-line if r11 is occupied
39926 + by the static chain. It would require too much fiddling and the
39927 + static chain is rarely used anyway. */
39928 + common = (using_static_chain_p
39929 + || sibcall
39930 + || current_function_calls_eh_return
39931 + || !info->lr_save_p
39932 + || cfun->machine->ra_need_lr
39933 + || info->total_size > 32767);
39934 + savres_fprs_inline = (common
39935 + || info->first_fp_reg_save == 64
39936 + || !no_global_regs_above (info->first_fp_reg_save,
39937 + /*gpr=*/false)
39938 + || FP_SAVE_INLINE (info->first_fp_reg_save));
39939 + savres_gprs_inline = (common
39940 + /* Saving CR interferes with the exit routines
39941 + used on the SPE, so just punt here. */
39942 + || (!savep
39943 + && TARGET_SPE_ABI
39944 + && info->spe_64bit_regs_used != 0
39945 + && info->cr_save_p != 0)
39946 + || info->first_gp_reg_save == 32
39947 + || !noclobber_global_gprs
39948 + || GP_SAVE_INLINE (info->first_gp_reg_save));
39949 +
39950 + if (savep)
39951 + /* If we are going to use store multiple, then don't even bother
39952 + with the out-of-line routines, since the store-multiple instruction
39953 + will always be smaller. */
39954 + savres_gprs_inline = savres_gprs_inline || using_multiple_p;
39955 + else
39956 + {
39957 + /* The situation is more complicated with load multiple. We'd
39958 + prefer to use the out-of-line routines for restores, since the
39959 + "exit" out-of-line routines can handle the restore of LR and
39960 + the frame teardown. But we can only use the out-of-line
39961 + routines if we know that we've used store multiple or
39962 + out-of-line routines in the prologue, i.e. if we've saved all
39963 + the registers from first_gp_reg_save. Otherwise, we risk
39964 + loading garbage from the stack. Furthermore, we can only use
39965 + the "exit" out-of-line gpr restore if we haven't saved any
39966 + fprs. */
39967 + bool saved_all = !savres_gprs_inline || using_multiple_p;
39968 +
39969 + if (saved_all && info->first_fp_reg_save != 64)
39970 + /* We can't use the exit routine; use load multiple if it's
39971 + available. */
39972 + savres_gprs_inline = savres_gprs_inline || using_multiple_p;
39973 + }
39974 +
39975 + /* Code intended for use in shared libraries cannot be reliably linked
39976 + with out-of-line prologues and epilogues. */
39977 + if (flag_pic)
39978 + {
39979 + savres_gprs_inline = 1;
39980 + savres_fprs_inline = 1;
39981 + }
39982 +
39983 + return (using_multiple_p
39984 + | (savres_fprs_inline << 1)
39985 + | (savres_gprs_inline << 2));
39986 +}
39987 +
39988 /* Emit function prologue as insns. */
39989
39990 void
39991 @@ -15598,8 +15907,13 @@ rs6000_emit_prologue (void)
39992 rtx frame_reg_rtx = sp_reg_rtx;
39993 rtx cr_save_rtx = NULL_RTX;
39994 rtx insn;
39995 + int strategy;
39996 int saving_FPRs_inline;
39997 + int saving_GPRs_inline;
39998 int using_store_multiple;
39999 + int using_static_chain_p = (cfun->static_chain_decl != NULL_TREE
40000 + && df_regs_ever_live_p (STATIC_CHAIN_REGNUM)
40001 + && call_used_regs[STATIC_CHAIN_REGNUM]);
40002 HOST_WIDE_INT sp_offset = 0;
40003
40004 if (TARGET_FIX_AND_CONTINUE)
40005 @@ -15622,15 +15936,12 @@ rs6000_emit_prologue (void)
40006 reg_size = 8;
40007 }
40008
40009 - using_store_multiple = (TARGET_MULTIPLE && ! TARGET_POWERPC64
40010 - && (!TARGET_SPE_ABI
40011 - || info->spe_64bit_regs_used == 0)
40012 - && info->first_gp_reg_save < 31
40013 - && no_global_regs_above (info->first_gp_reg_save));
40014 - saving_FPRs_inline = (info->first_fp_reg_save == 64
40015 - || FP_SAVE_INLINE (info->first_fp_reg_save)
40016 - || current_function_calls_eh_return
40017 - || cfun->machine->ra_need_lr);
40018 + strategy = rs6000_savres_strategy (info, /*savep=*/true,
40019 + /*static_chain_p=*/using_static_chain_p,
40020 + /*sibcall=*/0);
40021 + using_store_multiple = strategy & SAVRES_MULTIPLE;
40022 + saving_FPRs_inline = strategy & SAVRES_INLINE_FPRS;
40023 + saving_GPRs_inline = strategy & SAVRES_INLINE_GPRS;
40024
40025 /* For V.4, update stack before we do any saving and set back pointer. */
40026 if (! WORLD_SAVE_P (info)
40027 @@ -15638,17 +15949,24 @@ rs6000_emit_prologue (void)
40028 && (DEFAULT_ABI == ABI_V4
40029 || current_function_calls_eh_return))
40030 {
40031 + bool need_r11 = (TARGET_SPE
40032 + ? (!saving_GPRs_inline
40033 + && info->spe_64bit_regs_used == 0)
40034 + : (!saving_FPRs_inline || !saving_GPRs_inline));
40035 if (info->total_size < 32767)
40036 sp_offset = info->total_size;
40037 else
40038 - frame_reg_rtx = frame_ptr_rtx;
40039 + frame_reg_rtx = (need_r11
40040 + ? gen_rtx_REG (Pmode, 11)
40041 + : frame_ptr_rtx);
40042 rs6000_emit_allocate_stack (info->total_size,
40043 (frame_reg_rtx != sp_reg_rtx
40044 && (info->cr_save_p
40045 || info->lr_save_p
40046 || info->first_fp_reg_save < 64
40047 || info->first_gp_reg_save < 32
40048 - )));
40049 + )),
40050 + need_r11);
40051 if (frame_reg_rtx != sp_reg_rtx)
40052 rs6000_emit_stack_tie ();
40053 }
40054 @@ -15825,40 +16143,147 @@ rs6000_emit_prologue (void)
40055 }
40056 else if (!WORLD_SAVE_P (info) && info->first_fp_reg_save != 64)
40057 {
40058 + rtx par;
40059 +
40060 + par = rs6000_make_savres_rtx (info, frame_reg_rtx,
40061 + info->fp_save_offset + sp_offset,
40062 + DFmode,
40063 + /*savep=*/true, /*gpr=*/false,
40064 + /*exitp=*/false);
40065 + insn = emit_insn (par);
40066 + rs6000_frame_related (insn, frame_ptr_rtx, info->total_size,
40067 + NULL_RTX, NULL_RTX);
40068 + }
40069 +
40070 + /* Save GPRs. This is done as a PARALLEL if we are using
40071 + the store-multiple instructions. */
40072 + if (!WORLD_SAVE_P (info)
40073 + && TARGET_SPE_ABI
40074 + && info->spe_64bit_regs_used != 0
40075 + && info->first_gp_reg_save != 32)
40076 + {
40077 int i;
40078 - char rname[30];
40079 - const char *alloc_rname;
40080 - rtvec p;
40081 - p = rtvec_alloc (2 + 64 - info->first_fp_reg_save);
40082 + rtx spe_save_area_ptr;
40083 +
40084 + /* Determine whether we can address all of the registers that need
40085 + to be saved with an offset from the stack pointer that fits in
40086 + the small const field for SPE memory instructions. */
40087 + int spe_regs_addressable_via_sp
40088 + = (SPE_CONST_OFFSET_OK(info->spe_gp_save_offset + sp_offset
40089 + + (32 - info->first_gp_reg_save - 1) * reg_size)
40090 + && saving_GPRs_inline);
40091 + int spe_offset;
40092 +
40093 + if (spe_regs_addressable_via_sp)
40094 + {
40095 + spe_save_area_ptr = frame_reg_rtx;
40096 + spe_offset = info->spe_gp_save_offset + sp_offset;
40097 + }
40098 + else
40099 + {
40100 + /* Make r11 point to the start of the SPE save area. We need
40101 + to be careful here if r11 is holding the static chain. If
40102 + it is, then temporarily save it in r0. We would use r0 as
40103 + our base register here, but using r0 as a base register in
40104 + loads and stores means something different from what we
40105 + would like. */
40106 + int ool_adjust = (saving_GPRs_inline
40107 + ? 0
40108 + : (info->first_gp_reg_save
40109 + - (FIRST_SAVRES_REGISTER+1))*8);
40110 + HOST_WIDE_INT offset = (info->spe_gp_save_offset
40111 + + sp_offset - ool_adjust);
40112
40113 - RTVEC_ELT (p, 0) = gen_rtx_CLOBBER (VOIDmode,
40114 - gen_rtx_REG (Pmode,
40115 - LR_REGNO));
40116 - sprintf (rname, "%s%d%s", SAVE_FP_PREFIX,
40117 - info->first_fp_reg_save - 32, SAVE_FP_SUFFIX);
40118 - alloc_rname = ggc_strdup (rname);
40119 - RTVEC_ELT (p, 1) = gen_rtx_USE (VOIDmode,
40120 - gen_rtx_SYMBOL_REF (Pmode,
40121 - alloc_rname));
40122 - for (i = 0; i < 64 - info->first_fp_reg_save; i++)
40123 + if (using_static_chain_p)
40124 + {
40125 + rtx r0 = gen_rtx_REG (Pmode, 0);
40126 + gcc_assert (info->first_gp_reg_save > 11);
40127 +
40128 + emit_move_insn (r0, gen_rtx_REG (Pmode, 11));
40129 + }
40130 +
40131 + spe_save_area_ptr = gen_rtx_REG (Pmode, 11);
40132 + insn = emit_insn (gen_addsi3 (spe_save_area_ptr,
40133 + frame_reg_rtx,
40134 + GEN_INT (offset)));
40135 + /* We need to make sure the move to r11 gets noted for
40136 + properly outputting unwind information. */
40137 + if (!saving_GPRs_inline)
40138 + rs6000_frame_related (insn, frame_reg_rtx, offset,
40139 + NULL_RTX, NULL_RTX);
40140 + spe_offset = 0;
40141 + }
40142 +
40143 + if (saving_GPRs_inline)
40144 {
40145 - rtx addr, reg, mem;
40146 - reg = gen_rtx_REG (DFmode, info->first_fp_reg_save + i);
40147 - addr = gen_rtx_PLUS (Pmode, frame_reg_rtx,
40148 - GEN_INT (info->fp_save_offset
40149 - + sp_offset + 8*i));
40150 - mem = gen_frame_mem (DFmode, addr);
40151 + for (i = 0; i < 32 - info->first_gp_reg_save; i++)
40152 + if (rs6000_reg_live_or_pic_offset_p (info->first_gp_reg_save + i))
40153 + {
40154 + rtx reg = gen_rtx_REG (reg_mode, info->first_gp_reg_save + i);
40155 + rtx offset, addr, mem;
40156 +
40157 + /* We're doing all this to ensure that the offset fits into
40158 + the immediate offset of 'evstdd'. */
40159 + gcc_assert (SPE_CONST_OFFSET_OK (reg_size * i + spe_offset));
40160 +
40161 + offset = GEN_INT (reg_size * i + spe_offset);
40162 + addr = gen_rtx_PLUS (Pmode, spe_save_area_ptr, offset);
40163 + mem = gen_rtx_MEM (V2SImode, addr);
40164 +
40165 + insn = emit_move_insn (mem, reg);
40166 +
40167 + rs6000_frame_related (insn, spe_save_area_ptr,
40168 + info->spe_gp_save_offset
40169 + + sp_offset + reg_size * i,
40170 + offset, const0_rtx);
40171 + }
40172 + }
40173 + else
40174 + {
40175 + rtx par;
40176
40177 - RTVEC_ELT (p, i + 2) = gen_rtx_SET (VOIDmode, mem, reg);
40178 + par = rs6000_make_savres_rtx (info, gen_rtx_REG (Pmode, 11),
40179 + 0, reg_mode,
40180 + /*savep=*/true, /*gpr=*/true,
40181 + /*exitp=*/false);
40182 + insn = emit_insn (par);
40183 + rs6000_frame_related (insn, frame_ptr_rtx, info->total_size,
40184 + NULL_RTX, NULL_RTX);
40185 }
40186 - insn = emit_insn (gen_rtx_PARALLEL (VOIDmode, p));
40187 +
40188 +
40189 + /* Move the static chain pointer back. */
40190 + if (using_static_chain_p && !spe_regs_addressable_via_sp)
40191 + emit_move_insn (gen_rtx_REG (Pmode, 11), gen_rtx_REG (Pmode, 0));
40192 + }
40193 + else if (!WORLD_SAVE_P (info) && !saving_GPRs_inline)
40194 + {
40195 + rtx par;
40196 +
40197 + /* Need to adjust r11 if we saved any FPRs. */
40198 + if (info->first_fp_reg_save != 64)
40199 + {
40200 + rtx r11 = gen_rtx_REG (reg_mode, 11);
40201 + rtx offset = GEN_INT (info->total_size
40202 + + (-8 * (64-info->first_fp_reg_save)));
40203 + rtx ptr_reg = (sp_reg_rtx == frame_reg_rtx
40204 + ? sp_reg_rtx : r11);
40205 +
40206 + emit_insn (TARGET_32BIT
40207 + ? gen_addsi3 (r11, ptr_reg, offset)
40208 + : gen_adddi3 (r11, ptr_reg, offset));
40209 + }
40210 +
40211 + par = rs6000_make_savres_rtx (info, frame_reg_rtx,
40212 + info->gp_save_offset + sp_offset,
40213 + reg_mode,
40214 + /*savep=*/true, /*gpr=*/true,
40215 + /*exitp=*/false);
40216 + insn = emit_insn (par);
40217 rs6000_frame_related (insn, frame_ptr_rtx, info->total_size,
40218 NULL_RTX, NULL_RTX);
40219 }
40220 -
40221 - /* Save GPRs. This is done as a PARALLEL if we are using
40222 - the store-multiple instructions. */
40223 - if (!WORLD_SAVE_P (info) && using_store_multiple)
40224 + else if (!WORLD_SAVE_P (info) && using_store_multiple)
40225 {
40226 rtvec p;
40227 int i;
40228 @@ -15879,80 +16304,6 @@ rs6000_emit_prologue (void)
40229 rs6000_frame_related (insn, frame_ptr_rtx, info->total_size,
40230 NULL_RTX, NULL_RTX);
40231 }
40232 - else if (!WORLD_SAVE_P (info)
40233 - && TARGET_SPE_ABI
40234 - && info->spe_64bit_regs_used != 0
40235 - && info->first_gp_reg_save != 32)
40236 - {
40237 - int i;
40238 - rtx spe_save_area_ptr;
40239 - int using_static_chain_p = (cfun->static_chain_decl != NULL_TREE
40240 - && df_regs_ever_live_p (STATIC_CHAIN_REGNUM)
40241 - && !call_used_regs[STATIC_CHAIN_REGNUM]);
40242 -
40243 - /* Determine whether we can address all of the registers that need
40244 - to be saved with an offset from the stack pointer that fits in
40245 - the small const field for SPE memory instructions. */
40246 - int spe_regs_addressable_via_sp
40247 - = SPE_CONST_OFFSET_OK(info->spe_gp_save_offset + sp_offset
40248 - + (32 - info->first_gp_reg_save - 1) * reg_size);
40249 - int spe_offset;
40250 -
40251 - if (spe_regs_addressable_via_sp)
40252 - {
40253 - spe_save_area_ptr = frame_reg_rtx;
40254 - spe_offset = info->spe_gp_save_offset + sp_offset;
40255 - }
40256 - else
40257 - {
40258 - /* Make r11 point to the start of the SPE save area. We need
40259 - to be careful here if r11 is holding the static chain. If
40260 - it is, then temporarily save it in r0. We would use r0 as
40261 - our base register here, but using r0 as a base register in
40262 - loads and stores means something different from what we
40263 - would like. */
40264 - if (using_static_chain_p)
40265 - {
40266 - rtx r0 = gen_rtx_REG (Pmode, 0);
40267 -
40268 - gcc_assert (info->first_gp_reg_save > 11);
40269 -
40270 - emit_move_insn (r0, gen_rtx_REG (Pmode, 11));
40271 - }
40272 -
40273 - spe_save_area_ptr = gen_rtx_REG (Pmode, 11);
40274 - emit_insn (gen_addsi3 (spe_save_area_ptr, frame_reg_rtx,
40275 - GEN_INT (info->spe_gp_save_offset + sp_offset)));
40276 -
40277 - spe_offset = 0;
40278 - }
40279 -
40280 - for (i = 0; i < 32 - info->first_gp_reg_save; i++)
40281 - if (rs6000_reg_live_or_pic_offset_p (info->first_gp_reg_save + i))
40282 - {
40283 - rtx reg = gen_rtx_REG (reg_mode, info->first_gp_reg_save + i);
40284 - rtx offset, addr, mem;
40285 -
40286 - /* We're doing all this to ensure that the offset fits into
40287 - the immediate offset of 'evstdd'. */
40288 - gcc_assert (SPE_CONST_OFFSET_OK (reg_size * i + spe_offset));
40289 -
40290 - offset = GEN_INT (reg_size * i + spe_offset);
40291 - addr = gen_rtx_PLUS (Pmode, spe_save_area_ptr, offset);
40292 - mem = gen_rtx_MEM (V2SImode, addr);
40293 -
40294 - insn = emit_move_insn (mem, reg);
40295 -
40296 - rs6000_frame_related (insn, spe_save_area_ptr,
40297 - info->spe_gp_save_offset
40298 - + sp_offset + reg_size * i,
40299 - offset, const0_rtx);
40300 - }
40301 -
40302 - /* Move the static chain pointer back. */
40303 - if (using_static_chain_p && !spe_regs_addressable_via_sp)
40304 - emit_move_insn (gen_rtx_REG (Pmode, 11), gen_rtx_REG (Pmode, 0));
40305 - }
40306 else if (!WORLD_SAVE_P (info))
40307 {
40308 int i;
40309 @@ -16052,7 +16403,8 @@ rs6000_emit_prologue (void)
40310 (frame_reg_rtx != sp_reg_rtx
40311 && ((info->altivec_size != 0)
40312 || (info->vrsave_mask != 0)
40313 - )));
40314 + )),
40315 + FALSE);
40316 if (frame_reg_rtx != sp_reg_rtx)
40317 rs6000_emit_stack_tie ();
40318 }
40319 @@ -16208,8 +16560,7 @@ rs6000_output_function_prologue (FILE *f
40320 && !FP_SAVE_INLINE (info->first_fp_reg_save))
40321 fprintf (file, "\t.extern %s%d%s\n\t.extern %s%d%s\n",
40322 SAVE_FP_PREFIX, info->first_fp_reg_save - 32, SAVE_FP_SUFFIX,
40323 - RESTORE_FP_PREFIX, info->first_fp_reg_save - 32,
40324 - RESTORE_FP_SUFFIX);
40325 + RESTORE_FP_PREFIX, info->first_fp_reg_save - 32, RESTORE_FP_SUFFIX);
40326
40327 /* Write .extern for AIX common mode routines, if needed. */
40328 if (! TARGET_POWER && ! TARGET_POWERPC && ! common_mode_defined)
40329 @@ -16253,6 +16604,54 @@ rs6000_output_function_prologue (FILE *f
40330 rs6000_pic_labelno++;
40331 }
40332
40333 +/* Reload CR from REG. */
40334 +
40335 +static void
40336 +rs6000_restore_saved_cr (rtx reg, int using_mfcr_multiple)
40337 +{
40338 + int count = 0;
40339 + int i;
40340 +
40341 + if (using_mfcr_multiple)
40342 + {
40343 + for (i = 0; i < 8; i++)
40344 + if (df_regs_ever_live_p (CR0_REGNO+i) && ! call_used_regs[CR0_REGNO+i])
40345 + count++;
40346 + gcc_assert (count);
40347 + }
40348 +
40349 + if (using_mfcr_multiple && count > 1)
40350 + {
40351 + rtvec p;
40352 + int ndx;
40353 +
40354 + p = rtvec_alloc (count);
40355 +
40356 + ndx = 0;
40357 + for (i = 0; i < 8; i++)
40358 + if (df_regs_ever_live_p (CR0_REGNO+i) && ! call_used_regs[CR0_REGNO+i])
40359 + {
40360 + rtvec r = rtvec_alloc (2);
40361 + RTVEC_ELT (r, 0) = reg;
40362 + RTVEC_ELT (r, 1) = GEN_INT (1 << (7-i));
40363 + RTVEC_ELT (p, ndx) =
40364 + gen_rtx_SET (VOIDmode, gen_rtx_REG (CCmode, CR0_REGNO+i),
40365 + gen_rtx_UNSPEC (CCmode, r, UNSPEC_MOVESI_TO_CR));
40366 + ndx++;
40367 + }
40368 + emit_insn (gen_rtx_PARALLEL (VOIDmode, p));
40369 + gcc_assert (ndx == count);
40370 + }
40371 + else
40372 + for (i = 0; i < 8; i++)
40373 + if (df_regs_ever_live_p (CR0_REGNO+i) && ! call_used_regs[CR0_REGNO+i])
40374 + {
40375 + emit_insn (gen_movsi_to_cr_one (gen_rtx_REG (CCmode,
40376 + CR0_REGNO+i),
40377 + reg));
40378 + }
40379 +}
40380 +
40381 /* Emit function epilogue as insns.
40382
40383 At present, dwarf2out_frame_debug_expr doesn't understand
40384 @@ -16264,10 +16663,13 @@ void
40385 rs6000_emit_epilogue (int sibcall)
40386 {
40387 rs6000_stack_t *info;
40388 + int restoring_GPRs_inline;
40389 int restoring_FPRs_inline;
40390 int using_load_multiple;
40391 int using_mtcr_multiple;
40392 int use_backchain_to_restore_sp;
40393 + int restore_lr;
40394 + int strategy;
40395 int sp_offset = 0;
40396 rtx sp_reg_rtx = gen_rtx_REG (Pmode, 1);
40397 rtx frame_reg_rtx = sp_reg_rtx;
40398 @@ -16283,15 +16685,11 @@ rs6000_emit_epilogue (int sibcall)
40399 reg_size = 8;
40400 }
40401
40402 - using_load_multiple = (TARGET_MULTIPLE && ! TARGET_POWERPC64
40403 - && (!TARGET_SPE_ABI
40404 - || info->spe_64bit_regs_used == 0)
40405 - && info->first_gp_reg_save < 31
40406 - && no_global_regs_above (info->first_gp_reg_save));
40407 - restoring_FPRs_inline = (sibcall
40408 - || current_function_calls_eh_return
40409 - || info->first_fp_reg_save == 64
40410 - || FP_SAVE_INLINE (info->first_fp_reg_save));
40411 + strategy = rs6000_savres_strategy (info, /*savep=*/false,
40412 + /*static_chain_p=*/0, sibcall);
40413 + using_load_multiple = strategy & SAVRES_MULTIPLE;
40414 + restoring_FPRs_inline = strategy & SAVRES_INLINE_FPRS;
40415 + restoring_GPRs_inline = strategy & SAVRES_INLINE_GPRS;
40416 use_backchain_to_restore_sp = (frame_pointer_needed
40417 || current_function_calls_alloca
40418 || info->total_size > 32767);
40419 @@ -16299,6 +16697,10 @@ rs6000_emit_epilogue (int sibcall)
40420 || rs6000_cpu == PROCESSOR_PPC603
40421 || rs6000_cpu == PROCESSOR_PPC750
40422 || optimize_size);
40423 + restore_lr = (info->lr_save_p
40424 + && (restoring_GPRs_inline
40425 + || (restoring_FPRs_inline
40426 + && info->first_fp_reg_save < 64)));
40427
40428 if (WORLD_SAVE_P (info))
40429 {
40430 @@ -16537,8 +16939,9 @@ rs6000_emit_epilogue (int sibcall)
40431 emit_insn (generate_set_vrsave (reg, info, 1));
40432 }
40433
40434 - /* Get the old lr if we saved it. */
40435 - if (info->lr_save_p)
40436 + /* Get the old lr if we saved it. If we are restoring registers
40437 + out-of-line, then the out-of-line routines can do this for us. */
40438 + if (restore_lr && restoring_GPRs_inline)
40439 {
40440 rtx mem = gen_frame_mem_offset (Pmode, frame_reg_rtx,
40441 info->lr_save_offset + sp_offset);
40442 @@ -16557,7 +16960,7 @@ rs6000_emit_epilogue (int sibcall)
40443 }
40444
40445 /* Set LR here to try to overlap restores below. */
40446 - if (info->lr_save_p)
40447 + if (restore_lr && restoring_GPRs_inline)
40448 emit_move_insn (gen_rtx_REG (Pmode, LR_REGNO),
40449 gen_rtx_REG (Pmode, 0));
40450
40451 @@ -16593,35 +16996,17 @@ rs6000_emit_epilogue (int sibcall)
40452
40453 /* Restore GPRs. This is done as a PARALLEL if we are using
40454 the load-multiple instructions. */
40455 - if (using_load_multiple)
40456 - {
40457 - rtvec p;
40458 - p = rtvec_alloc (32 - info->first_gp_reg_save);
40459 - for (i = 0; i < 32 - info->first_gp_reg_save; i++)
40460 - {
40461 - rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx,
40462 - GEN_INT (info->gp_save_offset
40463 - + sp_offset
40464 - + reg_size * i));
40465 - rtx mem = gen_frame_mem (reg_mode, addr);
40466 -
40467 - RTVEC_ELT (p, i) =
40468 - gen_rtx_SET (VOIDmode,
40469 - gen_rtx_REG (reg_mode, info->first_gp_reg_save + i),
40470 - mem);
40471 - }
40472 - emit_insn (gen_rtx_PARALLEL (VOIDmode, p));
40473 - }
40474 - else if (TARGET_SPE_ABI
40475 - && info->spe_64bit_regs_used != 0
40476 - && info->first_gp_reg_save != 32)
40477 + if (TARGET_SPE_ABI
40478 + && info->spe_64bit_regs_used != 0
40479 + && info->first_gp_reg_save != 32)
40480 {
40481 /* Determine whether we can address all of the registers that need
40482 to be saved with an offset from the stack pointer that fits in
40483 the small const field for SPE memory instructions. */
40484 int spe_regs_addressable_via_sp
40485 - = SPE_CONST_OFFSET_OK(info->spe_gp_save_offset + sp_offset
40486 - + (32 - info->first_gp_reg_save - 1) * reg_size);
40487 + = (SPE_CONST_OFFSET_OK(info->spe_gp_save_offset + sp_offset
40488 + + (32 - info->first_gp_reg_save - 1) * reg_size)
40489 + && restoring_GPRs_inline);
40490 int spe_offset;
40491
40492 if (spe_regs_addressable_via_sp)
40493 @@ -16633,10 +17018,17 @@ rs6000_emit_epilogue (int sibcall)
40494 not clobbering it when we were saving registers in the prologue.
40495 There's no need to worry here because the static chain is passed
40496 anew to every function. */
40497 + int ool_adjust = (restoring_GPRs_inline
40498 + ? 0
40499 + : (info->first_gp_reg_save
40500 + - (FIRST_SAVRES_REGISTER+1))*8);
40501 +
40502 if (frame_reg_rtx == sp_reg_rtx)
40503 frame_reg_rtx = gen_rtx_REG (Pmode, 11);
40504 emit_insn (gen_addsi3 (frame_reg_rtx, old_frame_reg_rtx,
40505 - GEN_INT (info->spe_gp_save_offset + sp_offset)));
40506 + GEN_INT (info->spe_gp_save_offset
40507 + + sp_offset
40508 + - ool_adjust)));
40509 /* Keep the invariant that frame_reg_rtx + sp_offset points
40510 at the top of the stack frame. */
40511 sp_offset = -info->spe_gp_save_offset;
40512 @@ -16644,26 +17036,80 @@ rs6000_emit_epilogue (int sibcall)
40513 spe_offset = 0;
40514 }
40515
40516 - for (i = 0; i < 32 - info->first_gp_reg_save; i++)
40517 - if (rs6000_reg_live_or_pic_offset_p (info->first_gp_reg_save + i))
40518 - {
40519 - rtx offset, addr, mem;
40520 + if (restoring_GPRs_inline)
40521 + {
40522 + for (i = 0; i < 32 - info->first_gp_reg_save; i++)
40523 + if (rs6000_reg_live_or_pic_offset_p (info->first_gp_reg_save + i))
40524 + {
40525 + rtx offset, addr, mem;
40526
40527 - /* We're doing all this to ensure that the immediate offset
40528 - fits into the immediate field of 'evldd'. */
40529 - gcc_assert (SPE_CONST_OFFSET_OK (spe_offset + reg_size * i));
40530 -
40531 - offset = GEN_INT (spe_offset + reg_size * i);
40532 - addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, offset);
40533 - mem = gen_rtx_MEM (V2SImode, addr);
40534 + /* We're doing all this to ensure that the immediate offset
40535 + fits into the immediate field of 'evldd'. */
40536 + gcc_assert (SPE_CONST_OFFSET_OK (spe_offset + reg_size * i));
40537 +
40538 + offset = GEN_INT (spe_offset + reg_size * i);
40539 + addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, offset);
40540 + mem = gen_rtx_MEM (V2SImode, addr);
40541
40542 - emit_move_insn (gen_rtx_REG (reg_mode, info->first_gp_reg_save + i),
40543 - mem);
40544 - }
40545 + emit_move_insn (gen_rtx_REG (reg_mode, info->first_gp_reg_save + i),
40546 + mem);
40547 + }
40548 + }
40549 + else
40550 + {
40551 + rtx par;
40552 +
40553 + par = rs6000_make_savres_rtx (info, gen_rtx_REG (Pmode, 11),
40554 + 0, reg_mode,
40555 + /*savep=*/false, /*gpr=*/true,
40556 + /*exitp=*/true);
40557 + emit_jump_insn (par);
40558 +
40559 + /* We don't want anybody else emitting things after we jumped
40560 + back. */
40561 + return;
40562 + }
40563 }
40564 - else
40565 - for (i = 0; i < 32 - info->first_gp_reg_save; i++)
40566 - if (rs6000_reg_live_or_pic_offset_p (info->first_gp_reg_save + i))
40567 + else if (!restoring_GPRs_inline)
40568 + {
40569 + /* We are jumping to an out-of-line function. */
40570 + bool can_use_exit = info->first_fp_reg_save == 64;
40571 + rtx par;
40572 +
40573 + /* Emit stack reset code if we need it. */
40574 + if (can_use_exit)
40575 + rs6000_emit_stack_reset (info, sp_reg_rtx, frame_reg_rtx,
40576 + sp_offset, can_use_exit);
40577 + else
40578 + emit_insn (gen_addsi3 (gen_rtx_REG (Pmode, 11),
40579 + sp_reg_rtx,
40580 + GEN_INT (sp_offset - info->fp_size)));
40581 +
40582 + par = rs6000_make_savres_rtx (info, frame_reg_rtx,
40583 + info->gp_save_offset, reg_mode,
40584 + /*savep=*/false, /*gpr=*/true,
40585 + /*exitp=*/can_use_exit);
40586 +
40587 + if (can_use_exit)
40588 + {
40589 + if (info->cr_save_p)
40590 + rs6000_restore_saved_cr (gen_rtx_REG (SImode, 12),
40591 + using_mtcr_multiple);
40592 +
40593 + emit_jump_insn (par);
40594 +
40595 + /* We don't want anybody else emitting things after we jumped
40596 + back. */
40597 + return;
40598 + }
40599 + else
40600 + emit_insn (par);
40601 + }
40602 + else if (using_load_multiple)
40603 + {
40604 + rtvec p;
40605 + p = rtvec_alloc (32 - info->first_gp_reg_save);
40606 + for (i = 0; i < 32 - info->first_gp_reg_save; i++)
40607 {
40608 rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx,
40609 GEN_INT (info->gp_save_offset
40610 @@ -16671,9 +17117,40 @@ rs6000_emit_epilogue (int sibcall)
40611 + reg_size * i));
40612 rtx mem = gen_frame_mem (reg_mode, addr);
40613
40614 - emit_move_insn (gen_rtx_REG (reg_mode,
40615 - info->first_gp_reg_save + i), mem);
40616 + RTVEC_ELT (p, i) =
40617 + gen_rtx_SET (VOIDmode,
40618 + gen_rtx_REG (reg_mode, info->first_gp_reg_save + i),
40619 + mem);
40620 }
40621 + emit_insn (gen_rtx_PARALLEL (VOIDmode, p));
40622 + }
40623 + else
40624 + {
40625 + for (i = 0; i < 32 - info->first_gp_reg_save; i++)
40626 + if (rs6000_reg_live_or_pic_offset_p (info->first_gp_reg_save + i))
40627 + {
40628 + rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx,
40629 + GEN_INT (info->gp_save_offset
40630 + + sp_offset
40631 + + reg_size * i));
40632 + rtx mem = gen_frame_mem (reg_mode, addr);
40633 +
40634 + emit_move_insn (gen_rtx_REG (reg_mode,
40635 + info->first_gp_reg_save + i), mem);
40636 + }
40637 + }
40638 +
40639 + if (restore_lr && !restoring_GPRs_inline)
40640 + {
40641 + rtx mem = gen_frame_mem_offset (Pmode, frame_reg_rtx,
40642 + info->lr_save_offset + sp_offset);
40643 +
40644 + emit_move_insn (gen_rtx_REG (Pmode, 0), mem);
40645 + }
40646 +
40647 + if (restore_lr && !restoring_GPRs_inline)
40648 + emit_move_insn (gen_rtx_REG (Pmode, LR_REGNO),
40649 + gen_rtx_REG (Pmode, 0));
40650
40651 /* Restore fpr's if we need to do it without calling a function. */
40652 if (restoring_FPRs_inline)
40653 @@ -16695,69 +17172,12 @@ rs6000_emit_epilogue (int sibcall)
40654
40655 /* If we saved cr, restore it here. Just those that were used. */
40656 if (info->cr_save_p)
40657 - {
40658 - rtx r12_rtx = gen_rtx_REG (SImode, 12);
40659 - int count = 0;
40660 -
40661 - if (using_mtcr_multiple)
40662 - {
40663 - for (i = 0; i < 8; i++)
40664 - if (df_regs_ever_live_p (CR0_REGNO+i) && ! call_used_regs[CR0_REGNO+i])
40665 - count++;
40666 - gcc_assert (count);
40667 - }
40668 -
40669 - if (using_mtcr_multiple && count > 1)
40670 - {
40671 - rtvec p;
40672 - int ndx;
40673 -
40674 - p = rtvec_alloc (count);
40675 -
40676 - ndx = 0;
40677 - for (i = 0; i < 8; i++)
40678 - if (df_regs_ever_live_p (CR0_REGNO+i) && ! call_used_regs[CR0_REGNO+i])
40679 - {
40680 - rtvec r = rtvec_alloc (2);
40681 - RTVEC_ELT (r, 0) = r12_rtx;
40682 - RTVEC_ELT (r, 1) = GEN_INT (1 << (7-i));
40683 - RTVEC_ELT (p, ndx) =
40684 - gen_rtx_SET (VOIDmode, gen_rtx_REG (CCmode, CR0_REGNO+i),
40685 - gen_rtx_UNSPEC (CCmode, r, UNSPEC_MOVESI_TO_CR));
40686 - ndx++;
40687 - }
40688 - emit_insn (gen_rtx_PARALLEL (VOIDmode, p));
40689 - gcc_assert (ndx == count);
40690 - }
40691 - else
40692 - for (i = 0; i < 8; i++)
40693 - if (df_regs_ever_live_p (CR0_REGNO+i) && ! call_used_regs[CR0_REGNO+i])
40694 - {
40695 - emit_insn (gen_movsi_to_cr_one (gen_rtx_REG (CCmode,
40696 - CR0_REGNO+i),
40697 - r12_rtx));
40698 - }
40699 - }
40700 + rs6000_restore_saved_cr (gen_rtx_REG (SImode, 12), using_mtcr_multiple);
40701
40702 /* If this is V.4, unwind the stack pointer after all of the loads
40703 have been done. */
40704 - if (frame_reg_rtx != sp_reg_rtx)
40705 - {
40706 - /* This blockage is needed so that sched doesn't decide to move
40707 - the sp change before the register restores. */
40708 - rs6000_emit_stack_tie ();
40709 - if (sp_offset != 0)
40710 - emit_insn (gen_addsi3 (sp_reg_rtx, frame_reg_rtx,
40711 - GEN_INT (sp_offset)));
40712 - else
40713 - emit_move_insn (sp_reg_rtx, frame_reg_rtx);
40714 - }
40715 - else if (sp_offset != 0)
40716 - emit_insn (TARGET_32BIT
40717 - ? gen_addsi3 (sp_reg_rtx, sp_reg_rtx,
40718 - GEN_INT (sp_offset))
40719 - : gen_adddi3 (sp_reg_rtx, sp_reg_rtx,
40720 - GEN_INT (sp_offset)));
40721 + rs6000_emit_stack_reset (info, sp_reg_rtx, frame_reg_rtx,
40722 + sp_offset, !restoring_FPRs_inline);
40723
40724 if (current_function_calls_eh_return)
40725 {
40726 @@ -16771,30 +17191,30 @@ rs6000_emit_epilogue (int sibcall)
40727 {
40728 rtvec p;
40729 if (! restoring_FPRs_inline)
40730 - p = rtvec_alloc (3 + 64 - info->first_fp_reg_save);
40731 + p = rtvec_alloc (4 + 64 - info->first_fp_reg_save);
40732 else
40733 p = rtvec_alloc (2);
40734
40735 RTVEC_ELT (p, 0) = gen_rtx_RETURN (VOIDmode);
40736 - RTVEC_ELT (p, 1) = gen_rtx_USE (VOIDmode,
40737 - gen_rtx_REG (Pmode,
40738 - LR_REGNO));
40739 + RTVEC_ELT (p, 1) = (restoring_FPRs_inline
40740 + ? gen_rtx_USE (VOIDmode, gen_rtx_REG (Pmode, 65))
40741 + : gen_rtx_CLOBBER (VOIDmode,
40742 + gen_rtx_REG (Pmode, 65)));
40743
40744 /* If we have to restore more than two FP registers, branch to the
40745 restore function. It will return to our caller. */
40746 if (! restoring_FPRs_inline)
40747 {
40748 int i;
40749 - char rname[30];
40750 - const char *alloc_rname;
40751 -
40752 - sprintf (rname, "%s%d%s", RESTORE_FP_PREFIX,
40753 - info->first_fp_reg_save - 32, RESTORE_FP_SUFFIX);
40754 - alloc_rname = ggc_strdup (rname);
40755 - RTVEC_ELT (p, 2) = gen_rtx_USE (VOIDmode,
40756 - gen_rtx_SYMBOL_REF (Pmode,
40757 - alloc_rname));
40758 + rtx sym;
40759
40760 + sym = rs6000_savres_routine_sym (info,
40761 + /*savep=*/false,
40762 + /*gpr=*/false,
40763 + /*exitp=*/true);
40764 + RTVEC_ELT (p, 2) = gen_rtx_USE (VOIDmode, sym);
40765 + RTVEC_ELT (p, 3) = gen_rtx_USE (VOIDmode,
40766 + gen_rtx_REG (Pmode, 11));
40767 for (i = 0; i < 64 - info->first_fp_reg_save; i++)
40768 {
40769 rtx addr, mem;
40770 @@ -16802,7 +17222,7 @@ rs6000_emit_epilogue (int sibcall)
40771 GEN_INT (info->fp_save_offset + 8*i));
40772 mem = gen_frame_mem (DFmode, addr);
40773
40774 - RTVEC_ELT (p, i+3) =
40775 + RTVEC_ELT (p, i+4) =
40776 gen_rtx_SET (VOIDmode,
40777 gen_rtx_REG (DFmode, info->first_fp_reg_save + i),
40778 mem);
40779 @@ -18611,6 +19031,9 @@ rs6000_issue_rate (void)
40780 case CPU_PPC7400:
40781 case CPU_PPC8540:
40782 case CPU_CELL:
40783 + case CPU_PPCE300C2:
40784 + case CPU_PPCE300C3:
40785 + case CPU_PPCE500MC:
40786 return 2;
40787 case CPU_RIOS2:
40788 case CPU_PPC604:
40789 @@ -21814,8 +22237,8 @@ rs6000_function_value (const_tree valtyp
40790 && ALTIVEC_VECTOR_MODE (mode))
40791 regno = ALTIVEC_ARG_RETURN;
40792 else if (TARGET_E500_DOUBLE && TARGET_HARD_FLOAT
40793 - && (mode == DFmode || mode == DDmode || mode == DCmode
40794 - || mode == TFmode || mode == TDmode || mode == TCmode))
40795 + && (mode == DFmode || mode == DCmode
40796 + || mode == TFmode || mode == TCmode))
40797 return spe_build_register_parallel (mode, GP_ARG_RETURN);
40798 else
40799 regno = GP_ARG_RETURN;
40800 @@ -21856,8 +22279,8 @@ rs6000_libcall_value (enum machine_mode
40801 else if (COMPLEX_MODE_P (mode) && targetm.calls.split_complex_arg)
40802 return rs6000_complex_function_value (mode);
40803 else if (TARGET_E500_DOUBLE && TARGET_HARD_FLOAT
40804 - && (mode == DFmode || mode == DDmode || mode == DCmode
40805 - || mode == TFmode || mode == TDmode || mode == TCmode))
40806 + && (mode == DFmode || mode == DCmode
40807 + || mode == TFmode || mode == TCmode))
40808 return spe_build_register_parallel (mode, GP_ARG_RETURN);
40809 else
40810 regno = GP_ARG_RETURN;
40811 @@ -21904,19 +22327,22 @@ rs6000_is_opaque_type (const_tree type)
40812 {
40813 return (type == opaque_V2SI_type_node
40814 || type == opaque_V2SF_type_node
40815 - || type == opaque_p_V2SI_type_node
40816 || type == opaque_V4SI_type_node);
40817 }
40818
40819 static rtx
40820 rs6000_dwarf_register_span (rtx reg)
40821 {
40822 - unsigned regno;
40823 + rtx parts[8];
40824 + int i, words;
40825 + unsigned regno = REGNO (reg);
40826 + enum machine_mode mode = GET_MODE (reg);
40827
40828 if (TARGET_SPE
40829 + && regno < 32
40830 && (SPE_VECTOR_MODE (GET_MODE (reg))
40831 - || (TARGET_E500_DOUBLE
40832 - && (GET_MODE (reg) == DFmode || GET_MODE (reg) == DDmode))))
40833 + || (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode)
40834 + && mode != SFmode && mode != SDmode && mode != SCmode)))
40835 ;
40836 else
40837 return NULL_RTX;
40838 @@ -21926,15 +22352,23 @@ rs6000_dwarf_register_span (rtx reg)
40839 /* The duality of the SPE register size wreaks all kinds of havoc.
40840 This is a way of distinguishing r0 in 32-bits from r0 in
40841 64-bits. */
40842 - return
40843 - gen_rtx_PARALLEL (VOIDmode,
40844 - BYTES_BIG_ENDIAN
40845 - ? gen_rtvec (2,
40846 - gen_rtx_REG (SImode, regno + 1200),
40847 - gen_rtx_REG (SImode, regno))
40848 - : gen_rtvec (2,
40849 - gen_rtx_REG (SImode, regno),
40850 - gen_rtx_REG (SImode, regno + 1200)));
40851 + words = (GET_MODE_SIZE (mode) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD;
40852 + gcc_assert (words <= 4);
40853 + for (i = 0; i < words; i++, regno++)
40854 + {
40855 + if (BYTES_BIG_ENDIAN)
40856 + {
40857 + parts[2 * i] = gen_rtx_REG (SImode, regno + 1200);
40858 + parts[2 * i + 1] = gen_rtx_REG (SImode, regno);
40859 + }
40860 + else
40861 + {
40862 + parts[2 * i] = gen_rtx_REG (SImode, regno);
40863 + parts[2 * i + 1] = gen_rtx_REG (SImode, regno + 1200);
40864 + }
40865 + }
40866 +
40867 + return gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (words * 2, parts));
40868 }
40869
40870 /* Fill in sizes for SPE register high parts in table used by unwinder. */
40871 --- a/gcc/config/rs6000/rs6000.h
40872 +++ b/gcc/config/rs6000/rs6000.h
40873 @@ -117,6 +117,9 @@
40874 %{mcpu=G5: -mpower4 -maltivec} \
40875 %{mcpu=8540: -me500} \
40876 %{mcpu=8548: -me500} \
40877 +%{mcpu=e300c2: -mppc} \
40878 +%{mcpu=e300c3: -mppc -mpmr} \
40879 +%{mcpu=e500mc: -me500mc} \
40880 %{maltivec: -maltivec} \
40881 -many"
40882
40883 @@ -262,6 +265,9 @@ enum processor_type
40884 PROCESSOR_PPC7400,
40885 PROCESSOR_PPC7450,
40886 PROCESSOR_PPC8540,
40887 + PROCESSOR_PPCE300C2,
40888 + PROCESSOR_PPCE300C3,
40889 + PROCESSOR_PPCE500MC,
40890 PROCESSOR_POWER4,
40891 PROCESSOR_POWER5,
40892 PROCESSOR_POWER6,
40893 @@ -313,12 +319,15 @@ enum group_termination
40894 };
40895
40896 /* Support for a compile-time default CPU, et cetera. The rules are:
40897 - --with-cpu is ignored if -mcpu is specified.
40898 + --with-cpu is ignored if -mcpu is specified; likewise --with-cpu32
40899 + and --with-cpu64.
40900 --with-tune is ignored if -mtune is specified.
40901 --with-float is ignored if -mhard-float or -msoft-float are
40902 specified. */
40903 #define OPTION_DEFAULT_SPECS \
40904 - {"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }, \
40905 + {"cpu", "%{mcpu=*|te500mc|te500v1|te500v2|te600:;:-mcpu=%(VALUE)}" }, \
40906 + {"cpu32", "%{m64|mcpu=*|te500mc|te500v1|te500v2|te600:;:-mcpu=%(VALUE)}" }, \
40907 + {"cpu64", "%{m32|mcpu=*|te500mc|te500v1|te500v2|te600:;:-mcpu=%(VALUE)}" }, \
40908 {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
40909 {"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" }
40910
40911 @@ -349,6 +358,8 @@ extern int rs6000_long_double_type_size;
40912 extern int rs6000_ieeequad;
40913 extern int rs6000_altivec_abi;
40914 extern int rs6000_spe_abi;
40915 +extern int rs6000_spe;
40916 +extern int rs6000_isel;
40917 extern int rs6000_float_gprs;
40918 extern int rs6000_alignment_flags;
40919 extern const char *rs6000_sched_insert_nops_str;
40920 @@ -378,7 +389,7 @@ extern enum rs6000_nop_insertion rs6000_
40921 #define TARGET_SPE_ABI 0
40922 #define TARGET_SPE 0
40923 #define TARGET_E500 0
40924 -#define TARGET_ISEL 0
40925 +#define TARGET_ISEL rs6000_isel
40926 #define TARGET_FPRS 1
40927 #define TARGET_E500_SINGLE 0
40928 #define TARGET_E500_DOUBLE 0
40929 @@ -561,7 +572,7 @@ extern enum rs6000_nop_insertion rs6000_
40930 #define LOCAL_ALIGNMENT(TYPE, ALIGN) \
40931 ((TARGET_ALTIVEC && TREE_CODE (TYPE) == VECTOR_TYPE) ? 128 : \
40932 (TARGET_E500_DOUBLE \
40933 - && (TYPE_MODE (TYPE) == DFmode || TYPE_MODE (TYPE) == DDmode)) ? 64 : \
40934 + && TYPE_MODE (TYPE) == DFmode) ? 64 : \
40935 ((TARGET_SPE && TREE_CODE (TYPE) == VECTOR_TYPE \
40936 && SPE_VECTOR_MODE (TYPE_MODE (TYPE))) || (TARGET_PAIRED_FLOAT \
40937 && TREE_CODE (TYPE) == VECTOR_TYPE \
40938 @@ -587,7 +598,7 @@ extern enum rs6000_nop_insertion rs6000_
40939 fit into 1, whereas DI still needs two. */
40940 #define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) \
40941 ((TARGET_SPE && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
40942 - || (TARGET_E500_DOUBLE && ((MODE) == DFmode || (MODE) == DDmode)))
40943 + || (TARGET_E500_DOUBLE && (MODE) == DFmode))
40944
40945 /* A bit-field declared as `int' forces `int' alignment for the struct. */
40946 #define PCC_BITFIELD_TYPE_MATTERS 1
40947 @@ -596,6 +607,7 @@ extern enum rs6000_nop_insertion rs6000_
40948 Make vector constants quadword aligned. */
40949 #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
40950 (TREE_CODE (EXP) == STRING_CST \
40951 + && (STRICT_ALIGNMENT || !optimize_size) \
40952 && (ALIGN) < BITS_PER_WORD \
40953 ? BITS_PER_WORD \
40954 : (ALIGN))
40955 @@ -607,7 +619,7 @@ extern enum rs6000_nop_insertion rs6000_
40956 (TREE_CODE (TYPE) == VECTOR_TYPE ? ((TARGET_SPE_ABI \
40957 || TARGET_PAIRED_FLOAT) ? 64 : 128) \
40958 : (TARGET_E500_DOUBLE \
40959 - && (TYPE_MODE (TYPE) == DFmode || TYPE_MODE (TYPE) == DDmode)) ? 64 \
40960 + && TYPE_MODE (TYPE) == DFmode) ? 64 \
40961 : TREE_CODE (TYPE) == ARRAY_TYPE \
40962 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
40963 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
40964 @@ -731,8 +743,8 @@ extern enum rs6000_nop_insertion rs6000_
40965 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
40966 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, \
40967 /* AltiVec registers. */ \
40968 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
40969 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
40970 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
40971 + 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
40972 1, 1 \
40973 , 1, 1, 1 \
40974 }
40975 @@ -750,8 +762,8 @@ extern enum rs6000_nop_insertion rs6000_
40976 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
40977 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, \
40978 /* AltiVec registers. */ \
40979 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
40980 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
40981 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
40982 + 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
40983 0, 0 \
40984 , 0, 0, 0 \
40985 }
40986 @@ -1189,7 +1201,7 @@ enum reg_class
40987 (((CLASS) == FLOAT_REGS) \
40988 ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \
40989 : (TARGET_E500_DOUBLE && (CLASS) == GENERAL_REGS \
40990 - && ((MODE) == DFmode || (MODE) == DDmode)) \
40991 + && (MODE) == DFmode) \
40992 ? 1 \
40993 : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
40994
40995 --- a/gcc/config/rs6000/rs6000.md
40996 +++ b/gcc/config/rs6000/rs6000.md
40997 @@ -133,7 +133,7 @@
40998 ;; Processor type -- this attribute must exactly match the processor_type
40999 ;; enumeration in rs6000.h.
41000
41001 -(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc440,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,power4,power5,power6,cell"
41002 +(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc440,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,ppce300c2,ppce300c3,ppce500mc,power4,power5,power6,cell"
41003 (const (symbol_ref "rs6000_cpu_attr")))
41004
41005
41006 @@ -166,6 +166,8 @@
41007 (include "7xx.md")
41008 (include "7450.md")
41009 (include "8540.md")
41010 +(include "e300c2c3.md")
41011 +(include "e500mc.md")
41012 (include "power4.md")
41013 (include "power5.md")
41014 (include "power6.md")
41015 @@ -8887,7 +8889,7 @@
41016 rtx label = gen_label_rtx ();
41017 if (TARGET_E500_DOUBLE)
41018 {
41019 - if (flag_unsafe_math_optimizations)
41020 + if (flag_finite_math_only && !flag_trapping_math)
41021 emit_insn (gen_spe_abstf2_tst (operands[0], operands[1], label));
41022 else
41023 emit_insn (gen_spe_abstf2_cmp (operands[0], operands[1], label));
41024 @@ -11642,7 +11644,7 @@
41025
41026 (define_expand "bltgt"
41027 [(use (match_operand 0 "" ""))]
41028 - ""
41029 + "! (TARGET_HARD_FLOAT && !TARGET_FPRS)"
41030 "{ rs6000_emit_cbranch (LTGT, operands[0]); DONE; }")
41031
41032 ;; For SNE, we would prefer that the xor/abs sequence be used for integers.
41033 @@ -11776,7 +11778,7 @@
41034
41035 (define_expand "sltgt"
41036 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
41037 - ""
41038 + "! (TARGET_HARD_FLOAT && !TARGET_FPRS)"
41039 "{ rs6000_emit_sCOND (LTGT, operands[0]); DONE; }")
41040
41041 (define_expand "stack_protect_set"
41042 @@ -12084,7 +12086,7 @@
41043 (define_insn "move_from_CR_gt_bit"
41044 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
41045 (unspec:SI [(match_operand 1 "cc_reg_operand" "y")] UNSPEC_MV_CR_GT))]
41046 - "TARGET_E500"
41047 + "TARGET_HARD_FLOAT && !TARGET_FPRS"
41048 "mfcr %0\;{rlinm|rlwinm} %0,%0,%D1,31,31"
41049 [(set_attr "type" "mfcr")
41050 (set_attr "length" "8")])
41051 @@ -14469,10 +14471,23 @@
41052 "{stm|stmw} %2,%1"
41053 [(set_attr "type" "store_ux")])
41054
41055 +(define_insn "*save_gpregs_<mode>"
41056 + [(match_parallel 0 "any_parallel_operand"
41057 + [(clobber (reg:P 65))
41058 + (use (match_operand:P 1 "symbol_ref_operand" "s"))
41059 + (use (reg:P 11))
41060 + (set (match_operand:P 2 "memory_operand" "=m")
41061 + (match_operand:P 3 "gpc_reg_operand" "r"))])]
41062 + ""
41063 + "bl %z1"
41064 + [(set_attr "type" "branch")
41065 + (set_attr "length" "4")])
41066 +
41067 (define_insn "*save_fpregs_<mode>"
41068 [(match_parallel 0 "any_parallel_operand"
41069 [(clobber (reg:P 65))
41070 - (use (match_operand:P 1 "call_operand" "s"))
41071 + (use (match_operand:P 1 "symbol_ref_operand" "s"))
41072 + (use (reg:P 11))
41073 (set (match_operand:DF 2 "memory_operand" "=m")
41074 (match_operand:DF 3 "gpc_reg_operand" "f"))])]
41075 ""
41076 @@ -14562,15 +14577,43 @@
41077 ; FIXME: This would probably be somewhat simpler if the Cygnus sibcall
41078 ; stuff was in GCC. Oh, and "any_parallel_operand" is a bit flexible...
41079
41080 +(define_insn "*restore_gpregs_<mode>"
41081 + [(match_parallel 0 "any_parallel_operand"
41082 + [(clobber (match_operand:P 1 "register_operand" "=l"))
41083 + (use (match_operand:P 2 "symbol_ref_operand" "s"))
41084 + (use (reg:P 11))
41085 + (set (match_operand:P 3 "gpc_reg_operand" "=r")
41086 + (match_operand:P 4 "memory_operand" "m"))])]
41087 + ""
41088 + "bl %z2"
41089 + [(set_attr "type" "branch")
41090 + (set_attr "length" "4")])
41091 +
41092 +(define_insn "*return_and_restore_gpregs_<mode>"
41093 + [(match_parallel 0 "any_parallel_operand"
41094 + [(return)
41095 + (clobber (match_operand:P 1 "register_operand" "=l"))
41096 + (use (match_operand:P 2 "symbol_ref_operand" "s"))
41097 + (use (reg:P 11))
41098 + (set (match_operand:P 3 "gpc_reg_operand" "=r")
41099 + (match_operand:P 4 "memory_operand" "m"))])]
41100 + ""
41101 + "b %z2"
41102 + [(set_attr "type" "branch")
41103 + (set_attr "length" "4")])
41104 +
41105 (define_insn "*return_and_restore_fpregs_<mode>"
41106 [(match_parallel 0 "any_parallel_operand"
41107 [(return)
41108 - (use (reg:P 65))
41109 - (use (match_operand:P 1 "call_operand" "s"))
41110 - (set (match_operand:DF 2 "gpc_reg_operand" "=f")
41111 - (match_operand:DF 3 "memory_operand" "m"))])]
41112 + (clobber (match_operand:P 1 "register_operand" "=l"))
41113 + (use (match_operand:P 2 "symbol_ref_operand" "s"))
41114 + (use (reg:P 11))
41115 + (set (match_operand:DF 3 "gpc_reg_operand" "=f")
41116 + (match_operand:DF 4 "memory_operand" "m"))])]
41117 ""
41118 - "b %z1")
41119 + "b %z2"
41120 + [(set_attr "type" "branch")
41121 + (set_attr "length" "4")])
41122
41123 ; This is used in compiling the unwind routines.
41124 (define_expand "eh_return"
41125 @@ -14617,6 +14660,120 @@
41126 }"
41127 [(set_attr "type" "load")])
41128 \f
41129 +;;; Expanders for vector insn patterns shared between the SPE and TARGET_PAIRED systems.
41130 +
41131 +(define_expand "absv2sf2"
41132 + [(set (match_operand:V2SF 0 "gpc_reg_operand" "")
41133 + (abs:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "")))]
41134 + "TARGET_PAIRED_FLOAT || TARGET_SPE"
41135 + "
41136 +{
41137 + if (TARGET_SPE)
41138 + {
41139 + /* We need to make a note that we clobber SPEFSCR. */
41140 + emit_insn (gen_rtx_SET (VOIDmode, operands[0],
41141 + gen_rtx_ABS (V2SFmode, operands[1])));
41142 + emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, SPEFSCR_REGNO)));
41143 + DONE;
41144 + }
41145 +}")
41146 +
41147 +(define_expand "negv2sf2"
41148 + [(set (match_operand:V2SF 0 "gpc_reg_operand" "")
41149 + (neg:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "")))]
41150 + "TARGET_PAIRED_FLOAT || TARGET_SPE"
41151 + "
41152 +{
41153 + if (TARGET_SPE)
41154 + {
41155 + /* We need to make a note that we clobber SPEFSCR. */
41156 + emit_insn (gen_rtx_SET (VOIDmode, operands[0],
41157 + gen_rtx_NEG (V2SFmode, operands[1])));
41158 + emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, SPEFSCR_REGNO)));
41159 + DONE;
41160 + }
41161 +}")
41162 +
41163 +(define_expand "addv2sf3"
41164 + [(set (match_operand:V2SF 0 "gpc_reg_operand" "")
41165 + (plus:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "")
41166 + (match_operand:V2SF 2 "gpc_reg_operand" "")))]
41167 + "TARGET_PAIRED_FLOAT || TARGET_SPE"
41168 + "
41169 +{
41170 + if (TARGET_SPE)
41171 + {
41172 + /* We need to make a note that we clobber SPEFSCR. */
41173 + rtx par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (2));
41174 +
41175 + XVECEXP (par, 0, 0) = gen_rtx_SET (VOIDmode, operands[0],
41176 + gen_rtx_PLUS (V2SFmode, operands[1], operands[2]));
41177 + XVECEXP (par, 0, 1) = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, SPEFSCR_REGNO));
41178 + emit_insn (par);
41179 + DONE;
41180 + }
41181 +}")
41182 +
41183 +(define_expand "subv2sf3"
41184 + [(set (match_operand:V2SF 0 "gpc_reg_operand" "")
41185 + (minus:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "")
41186 + (match_operand:V2SF 2 "gpc_reg_operand" "")))]
41187 + "TARGET_PAIRED_FLOAT || TARGET_SPE"
41188 + "
41189 +{
41190 + if (TARGET_SPE)
41191 + {
41192 + /* We need to make a note that we clobber SPEFSCR. */
41193 + rtx par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (2));
41194 +
41195 + XVECEXP (par, 0, 0) = gen_rtx_SET (VOIDmode, operands[0],
41196 + gen_rtx_MINUS (V2SFmode, operands[1], operands[2]));
41197 + XVECEXP (par, 0, 1) = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, SPEFSCR_REGNO));
41198 + emit_insn (par);
41199 + DONE;
41200 + }
41201 +}")
41202 +
41203 +(define_expand "mulv2sf3"
41204 + [(set (match_operand:V2SF 0 "gpc_reg_operand" "")
41205 + (mult:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "")
41206 + (match_operand:V2SF 2 "gpc_reg_operand" "")))]
41207 + "TARGET_PAIRED_FLOAT || TARGET_SPE"
41208 + "
41209 +{
41210 + if (TARGET_SPE)
41211 + {
41212 + /* We need to make a note that we clobber SPEFSCR. */
41213 + rtx par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (2));
41214 +
41215 + XVECEXP (par, 0, 0) = gen_rtx_SET (VOIDmode, operands[0],
41216 + gen_rtx_MULT (V2SFmode, operands[1], operands[2]));
41217 + XVECEXP (par, 0, 1) = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, SPEFSCR_REGNO));
41218 + emit_insn (par);
41219 + DONE;
41220 + }
41221 +}")
41222 +
41223 +(define_expand "divv2sf3"
41224 + [(set (match_operand:V2SF 0 "gpc_reg_operand" "")
41225 + (div:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "")
41226 + (match_operand:V2SF 2 "gpc_reg_operand" "")))]
41227 + "TARGET_PAIRED_FLOAT || TARGET_SPE"
41228 + "
41229 +{
41230 + if (TARGET_SPE)
41231 + {
41232 + /* We need to make a note that we clobber SPEFSCR. */
41233 + rtx par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (2));
41234 +
41235 + XVECEXP (par, 0, 0) = gen_rtx_SET (VOIDmode, operands[0],
41236 + gen_rtx_DIV (V2SFmode, operands[1], operands[2]));
41237 + XVECEXP (par, 0, 1) = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, SPEFSCR_REGNO));
41238 + emit_insn (par);
41239 + DONE;
41240 + }
41241 +}")
41242 +\f
41243
41244 (include "sync.md")
41245 (include "altivec.md")
41246 --- a/gcc/config/rs6000/rs6000.opt
41247 +++ b/gcc/config/rs6000/rs6000.opt
41248 @@ -190,7 +190,7 @@ Target RejectNegative Joined
41249 -mvrsave=yes/no Deprecated option. Use -mvrsave/-mno-vrsave instead
41250
41251 misel
41252 -Target Var(rs6000_isel)
41253 +Target
41254 Generate isel instructions
41255
41256 misel=
41257 @@ -198,7 +198,7 @@ Target RejectNegative Joined
41258 -misel=yes/no Deprecated option. Use -misel/-mno-isel instead
41259
41260 mspe
41261 -Target Var(rs6000_spe)
41262 +Target
41263 Generate SPE SIMD instructions on E500
41264
41265 mpaired
41266 --- a/gcc/config/rs6000/sol-ci.asm
41267 +++ b/gcc/config/rs6000/sol-ci.asm
41268 @@ -36,7 +36,6 @@
41269 # This file just supplies labeled starting points for the .got* and other
41270 # special sections. It is linked in first before other modules.
41271
41272 - .file "scrti.s"
41273 .ident "GNU C scrti.s"
41274
41275 #ifndef __powerpc64__
41276 --- a/gcc/config/rs6000/sol-cn.asm
41277 +++ b/gcc/config/rs6000/sol-cn.asm
41278 @@ -36,7 +36,6 @@
41279 # This file just supplies labeled ending points for the .got* and other
41280 # special sections. It is linked in last after other modules.
41281
41282 - .file "scrtn.s"
41283 .ident "GNU C scrtn.s"
41284
41285 #ifndef __powerpc64__
41286 --- a/gcc/config/rs6000/spe.md
41287 +++ b/gcc/config/rs6000/spe.md
41288 @@ -164,7 +164,7 @@
41289
41290 ;; SPE SIMD instructions
41291
41292 -(define_insn "spe_evabs"
41293 +(define_insn "absv2si2"
41294 [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
41295 (abs:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")))]
41296 "TARGET_SPE"
41297 @@ -181,7 +181,7 @@
41298 [(set_attr "type" "vecsimple")
41299 (set_attr "length" "4")])
41300
41301 -(define_insn "spe_evand"
41302 +(define_insn "andv2si3"
41303 [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
41304 (and:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
41305 (match_operand:V2SI 2 "gpc_reg_operand" "r")))]
41306 @@ -1898,7 +1898,7 @@
41307 [(set_attr "type" "veccomplex")
41308 (set_attr "length" "4")])
41309
41310 -(define_insn "spe_evaddw"
41311 +(define_insn "addv2si3"
41312 [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
41313 (plus:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
41314 (match_operand:V2SI 2 "gpc_reg_operand" "r")))]
41315 @@ -2028,7 +2028,7 @@
41316 [(set_attr "type" "veccomplex")
41317 (set_attr "length" "4")])
41318
41319 -(define_insn "spe_evdivws"
41320 +(define_insn "divv2si3"
41321 [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
41322 (div:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
41323 (match_operand:V2SI 2 "gpc_reg_operand" "r")))
41324 @@ -2933,7 +2933,8 @@
41325 [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r")
41326 (match_operand:SF 2 "gpc_reg_operand" "r"))]
41327 1000))]
41328 - "TARGET_HARD_FLOAT && !TARGET_FPRS && !flag_unsafe_math_optimizations"
41329 + "TARGET_HARD_FLOAT && !TARGET_FPRS
41330 + && !(flag_finite_math_only && !flag_trapping_math)"
41331 "efscmpeq %0,%1,%2"
41332 [(set_attr "type" "veccmp")])
41333
41334 @@ -2943,7 +2944,8 @@
41335 [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r")
41336 (match_operand:SF 2 "gpc_reg_operand" "r"))]
41337 1001))]
41338 - "TARGET_HARD_FLOAT && !TARGET_FPRS && flag_unsafe_math_optimizations"
41339 + "TARGET_HARD_FLOAT && !TARGET_FPRS
41340 + && flag_finite_math_only && !flag_trapping_math"
41341 "efststeq %0,%1,%2"
41342 [(set_attr "type" "veccmpsimple")])
41343
41344 @@ -2953,7 +2955,8 @@
41345 [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r")
41346 (match_operand:SF 2 "gpc_reg_operand" "r"))]
41347 1002))]
41348 - "TARGET_HARD_FLOAT && !TARGET_FPRS && !flag_unsafe_math_optimizations"
41349 + "TARGET_HARD_FLOAT && !TARGET_FPRS
41350 + && !(flag_finite_math_only && !flag_trapping_math)"
41351 "efscmpgt %0,%1,%2"
41352 [(set_attr "type" "veccmp")])
41353
41354 @@ -2963,7 +2966,8 @@
41355 [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r")
41356 (match_operand:SF 2 "gpc_reg_operand" "r"))]
41357 1003))]
41358 - "TARGET_HARD_FLOAT && !TARGET_FPRS && flag_unsafe_math_optimizations"
41359 + "TARGET_HARD_FLOAT && !TARGET_FPRS
41360 + && flag_finite_math_only && !flag_trapping_math"
41361 "efststgt %0,%1,%2"
41362 [(set_attr "type" "veccmpsimple")])
41363
41364 @@ -2973,7 +2977,8 @@
41365 [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r")
41366 (match_operand:SF 2 "gpc_reg_operand" "r"))]
41367 1004))]
41368 - "TARGET_HARD_FLOAT && !TARGET_FPRS && !flag_unsafe_math_optimizations"
41369 + "TARGET_HARD_FLOAT && !TARGET_FPRS
41370 + && !(flag_finite_math_only && !flag_trapping_math)"
41371 "efscmplt %0,%1,%2"
41372 [(set_attr "type" "veccmp")])
41373
41374 @@ -2983,7 +2988,8 @@
41375 [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r")
41376 (match_operand:SF 2 "gpc_reg_operand" "r"))]
41377 1005))]
41378 - "TARGET_HARD_FLOAT && !TARGET_FPRS && flag_unsafe_math_optimizations"
41379 + "TARGET_HARD_FLOAT && !TARGET_FPRS
41380 + && flag_finite_math_only && !flag_trapping_math"
41381 "efststlt %0,%1,%2"
41382 [(set_attr "type" "veccmpsimple")])
41383
41384 @@ -2995,7 +3001,8 @@
41385 [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
41386 (match_operand:DF 2 "gpc_reg_operand" "r"))]
41387 CMPDFEQ_GPR))]
41388 - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && !flag_unsafe_math_optimizations"
41389 + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE
41390 + && !(flag_finite_math_only && !flag_trapping_math)"
41391 "efdcmpeq %0,%1,%2"
41392 [(set_attr "type" "veccmp")])
41393
41394 @@ -3005,7 +3012,8 @@
41395 [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
41396 (match_operand:DF 2 "gpc_reg_operand" "r"))]
41397 TSTDFEQ_GPR))]
41398 - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && flag_unsafe_math_optimizations"
41399 + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE
41400 + && flag_finite_math_only && !flag_trapping_math"
41401 "efdtsteq %0,%1,%2"
41402 [(set_attr "type" "veccmpsimple")])
41403
41404 @@ -3015,7 +3023,8 @@
41405 [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
41406 (match_operand:DF 2 "gpc_reg_operand" "r"))]
41407 CMPDFGT_GPR))]
41408 - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && !flag_unsafe_math_optimizations"
41409 + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE
41410 + && !(flag_finite_math_only && !flag_trapping_math)"
41411 "efdcmpgt %0,%1,%2"
41412 [(set_attr "type" "veccmp")])
41413
41414 @@ -3025,7 +3034,8 @@
41415 [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
41416 (match_operand:DF 2 "gpc_reg_operand" "r"))]
41417 TSTDFGT_GPR))]
41418 - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && flag_unsafe_math_optimizations"
41419 + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE
41420 + && flag_finite_math_only && !flag_trapping_math"
41421 "efdtstgt %0,%1,%2"
41422 [(set_attr "type" "veccmpsimple")])
41423
41424 @@ -3035,7 +3045,8 @@
41425 [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
41426 (match_operand:DF 2 "gpc_reg_operand" "r"))]
41427 CMPDFLT_GPR))]
41428 - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && !flag_unsafe_math_optimizations"
41429 + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE
41430 + && !(flag_finite_math_only && !flag_trapping_math)"
41431 "efdcmplt %0,%1,%2"
41432 [(set_attr "type" "veccmp")])
41433
41434 @@ -3045,7 +3056,8 @@
41435 [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
41436 (match_operand:DF 2 "gpc_reg_operand" "r"))]
41437 TSTDFLT_GPR))]
41438 - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && flag_unsafe_math_optimizations"
41439 + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE
41440 + && flag_finite_math_only && !flag_trapping_math"
41441 "efdtstlt %0,%1,%2"
41442 [(set_attr "type" "veccmpsimple")])
41443
41444 @@ -3059,7 +3071,7 @@
41445 CMPTFEQ_GPR))]
41446 "!TARGET_IEEEQUAD
41447 && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128
41448 - && !flag_unsafe_math_optimizations"
41449 + && !(flag_finite_math_only && !flag_trapping_math)"
41450 "efdcmpeq %0,%1,%2\;bng %0,$+8\;efdcmpeq %0,%L1,%L2"
41451 [(set_attr "type" "veccmp")
41452 (set_attr "length" "12")])
41453 @@ -3072,7 +3084,7 @@
41454 TSTTFEQ_GPR))]
41455 "!TARGET_IEEEQUAD
41456 && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128
41457 - && flag_unsafe_math_optimizations"
41458 + && flag_finite_math_only && !flag_trapping_math"
41459 "efdtsteq %0,%1,%2\;bng %0,$+8\;efdtsteq %0,%L1,%L2"
41460 [(set_attr "type" "veccmpsimple")
41461 (set_attr "length" "12")])
41462 @@ -3085,7 +3097,7 @@
41463 CMPTFGT_GPR))]
41464 "!TARGET_IEEEQUAD
41465 && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128
41466 - && !flag_unsafe_math_optimizations"
41467 + && !(flag_finite_math_only && !flag_trapping_math)"
41468 "efdcmpgt %0,%1,%2\;bgt %0,$+16\;efdcmpeq %0,%1,%2\;bng %0,$+8\;efdcmpgt %0,%L1,%L2"
41469 [(set_attr "type" "veccmp")
41470 (set_attr "length" "20")])
41471 @@ -3098,7 +3110,7 @@
41472 TSTTFGT_GPR))]
41473 "!TARGET_IEEEQUAD
41474 && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128
41475 - && flag_unsafe_math_optimizations"
41476 + && flag_finite_math_only && !flag_trapping_math"
41477 "efdtstgt %0,%1,%2\;bgt %0,$+16\;efdtsteq %0,%1,%2\;bng %0,$+8\;efdtstgt %0,%L1,%L2"
41478 [(set_attr "type" "veccmpsimple")
41479 (set_attr "length" "20")])
41480 @@ -3111,7 +3123,7 @@
41481 CMPTFLT_GPR))]
41482 "!TARGET_IEEEQUAD
41483 && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128
41484 - && !flag_unsafe_math_optimizations"
41485 + && !(flag_finite_math_only && !flag_trapping_math)"
41486 "efdcmplt %0,%1,%2\;bgt %0,$+16\;efdcmpeq %0,%1,%2\;bng %0,$+8\;efdcmplt %0,%L1,%L2"
41487 [(set_attr "type" "veccmp")
41488 (set_attr "length" "20")])
41489 @@ -3124,7 +3136,7 @@
41490 TSTTFLT_GPR))]
41491 "!TARGET_IEEEQUAD
41492 && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128
41493 - && flag_unsafe_math_optimizations"
41494 + && flag_finite_math_only && !flag_trapping_math"
41495 "efdtstlt %0,%1,%2\;bgt %0,$+16\;efdtsteq %0,%1,%2\;bng %0,$+8\;efdtstlt %0,%L1,%L2"
41496 [(set_attr "type" "veccmpsimple")
41497 (set_attr "length" "20")])
41498 @@ -3135,6 +3147,44 @@
41499 (unspec:CCFP [(match_operand 1 "cc_reg_operand" "y")
41500 (match_operand 2 "cc_reg_operand" "y")]
41501 E500_CR_IOR_COMPARE))]
41502 - "TARGET_E500"
41503 + "TARGET_HARD_FLOAT && !TARGET_FPRS"
41504 "cror 4*%0+gt,4*%1+gt,4*%2+gt"
41505 [(set_attr "type" "cr_logical")])
41506 +
41507 +;; Out-of-line prologues and epilogues.
41508 +(define_insn "*save_gpregs_spe"
41509 + [(match_parallel 0 "any_parallel_operand"
41510 + [(clobber (reg:P 65))
41511 + (use (match_operand:P 1 "symbol_ref_operand" "s"))
41512 + (use (reg:P 11))
41513 + (set (match_operand:V2SI 2 "memory_operand" "=m")
41514 + (match_operand:V2SI 3 "gpc_reg_operand" "r"))])]
41515 + "TARGET_SPE_ABI"
41516 + "bl %z1"
41517 + [(set_attr "type" "branch")
41518 + (set_attr "length" "4")])
41519 +
41520 +(define_insn "*restore_gpregs_spe"
41521 + [(match_parallel 0 "any_parallel_operand"
41522 + [(clobber (reg:P 65))
41523 + (use (match_operand:P 1 "symbol_ref_operand" "s"))
41524 + (use (reg:P 11))
41525 + (set (match_operand:V2SI 2 "gpc_reg_operand" "=r")
41526 + (match_operand:V2SI 3 "memory_operand" "m"))])]
41527 + "TARGET_SPE_ABI"
41528 + "bl %z1"
41529 + [(set_attr "type" "branch")
41530 + (set_attr "length" "4")])
41531 +
41532 +(define_insn "*return_and_restore_gpregs_spe"
41533 + [(match_parallel 0 "any_parallel_operand"
41534 + [(return)
41535 + (clobber (reg:P 65))
41536 + (use (match_operand:P 1 "symbol_ref_operand" "s"))
41537 + (use (reg:P 11))
41538 + (set (match_operand:V2SI 2 "gpc_reg_operand" "=r")
41539 + (match_operand:V2SI 3 "memory_operand" "m"))])]
41540 + "TARGET_SPE_ABI"
41541 + "b %z1"
41542 + [(set_attr "type" "branch")
41543 + (set_attr "length" "4")])
41544 --- a/gcc/config/rs6000/sysv4.h
41545 +++ b/gcc/config/rs6000/sysv4.h
41546 @@ -266,19 +266,27 @@ do { \
41547 #endif
41548
41549 /* Define cutoff for using external functions to save floating point.
41550 - Currently on V.4, always use inline stores. */
41551 -#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)
41552 + Currently on 64-bit V.4, always use inline stores. When optimizing
41553 + for size on 32-bit targets, use external functions when
41554 + profitable. */
41555 +#define FP_SAVE_INLINE(FIRST_REG) (optimize_size && !TARGET_64BIT \
41556 + ? ((FIRST_REG) == 62 \
41557 + || (FIRST_REG) == 63) \
41558 + : (FIRST_REG) < 64)
41559 +/* And similarly for general purpose registers. */
41560 +#define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32 \
41561 + && (TARGET_64BIT || !optimize_size))
41562
41563 /* Put jump tables in read-only memory, rather than in .text. */
41564 #define JUMP_TABLES_IN_TEXT_SECTION 0
41565
41566 /* Prefix and suffix to use to saving floating point. */
41567 #define SAVE_FP_PREFIX "_savefpr_"
41568 -#define SAVE_FP_SUFFIX "_l"
41569 +#define SAVE_FP_SUFFIX (TARGET_64BIT ? "_l" : "")
41570
41571 /* Prefix and suffix to use to restoring floating point. */
41572 #define RESTORE_FP_PREFIX "_restfpr_"
41573 -#define RESTORE_FP_SUFFIX "_l"
41574 +#define RESTORE_FP_SUFFIX (TARGET_64BIT ? "_l" : "")
41575
41576 /* Type used for ptrdiff_t, as a string used in a declaration. */
41577 #define PTRDIFF_TYPE "int"
41578 @@ -577,9 +585,9 @@ extern int fixuplabelno;
41579 /* Override svr4.h definition. */
41580 #undef ASM_SPEC
41581 #define ASM_SPEC "%(asm_cpu) \
41582 -%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
41583 -%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
41584 -%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
41585 +%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}" \
41586 +SVR4_ASM_SPEC \
41587 +"%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
41588 %{memb|msdata|msdata=eabi: -memb} \
41589 %{mlittle|mlittle-endian:-mlittle; \
41590 mbig|mbig-endian :-mbig; \
41591 @@ -606,6 +614,9 @@ extern int fixuplabelno;
41592 #define CC1_SECURE_PLT_DEFAULT_SPEC ""
41593 #endif
41594
41595 +#undef CC1_EXTRA_SPEC
41596 +#define CC1_EXTRA_SPEC ""
41597 +
41598 /* Pass -G xxx to the compiler and set correct endian mode. */
41599 #define CC1_SPEC "%{G*} %(cc1_cpu) \
41600 %{mlittle|mlittle-endian: %(cc1_endian_little); \
41601 @@ -630,7 +641,7 @@ extern int fixuplabelno;
41602 %{msdata: -msdata=default} \
41603 %{mno-sdata: -msdata=none} \
41604 %{!mbss-plt: %{!msecure-plt: %(cc1_secure_plt_default)}} \
41605 -%{profile: -p}"
41606 +%{profile: -p}" CC1_EXTRA_SPEC
41607
41608 /* Don't put -Y P,<path> for cross compilers. */
41609 #ifndef CROSS_DIRECTORY_STRUCTURE
41610 @@ -777,19 +788,19 @@ extern int fixuplabelno;
41611 /* Override svr4.h definition. */
41612 #undef ENDFILE_SPEC
41613 #define ENDFILE_SPEC "\
41614 -%{mads : crtsavres.o%s %(endfile_ads) ; \
41615 - myellowknife : crtsavres.o%s %(endfile_yellowknife) ; \
41616 - mmvme : crtsavres.o%s %(endfile_mvme) ; \
41617 - msim : crtsavres.o%s %(endfile_sim) ; \
41618 +%{mads : %(endfile_ads) ; \
41619 + myellowknife : %(endfile_yellowknife) ; \
41620 + mmvme : %(endfile_mvme) ; \
41621 + msim : %(endfile_sim) ; \
41622 mwindiss : %(endfile_windiss) ; \
41623 - mcall-freebsd: crtsavres.o%s %(endfile_freebsd) ; \
41624 - mcall-linux : crtsavres.o%s %(endfile_linux) ; \
41625 - mcall-gnu : crtsavres.o%s %(endfile_gnu) ; \
41626 - mcall-netbsd : crtsavres.o%s %(endfile_netbsd) ; \
41627 - mcall-openbsd: crtsavres.o%s %(endfile_openbsd) ; \
41628 + mcall-freebsd: %(endfile_freebsd) ; \
41629 + mcall-linux : %(endfile_linux) ; \
41630 + mcall-gnu : %(endfile_gnu) ; \
41631 + mcall-netbsd : %(endfile_netbsd) ; \
41632 + mcall-openbsd: %(endfile_openbsd) ; \
41633 : %(crtsavres_default) %(endfile_default) }"
41634
41635 -#define CRTSAVRES_DEFAULT_SPEC "crtsavres.o%s"
41636 +#define CRTSAVRES_DEFAULT_SPEC ""
41637
41638 #define ENDFILE_DEFAULT_SPEC "crtend.o%s ecrtn.o%s"
41639
41640 @@ -833,15 +844,15 @@ extern int fixuplabelno;
41641 #define CPP_OS_MVME_SPEC ""
41642
41643 /* PowerPC simulator based on netbsd system calls support. */
41644 -#define LIB_SIM_SPEC "--start-group -lsim -lc --end-group"
41645 +#define LIB_SIM_SPEC LIB_DEFAULT_SPEC
41646
41647 -#define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s crtbegin.o%s"
41648 +#define STARTFILE_SIM_SPEC "ecrti.o%s crtbegin.o%s"
41649
41650 -#define ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s"
41651 +#define ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s -Tsim-hosted.ld"
41652
41653 #define LINK_START_SIM_SPEC ""
41654
41655 -#define LINK_OS_SIM_SPEC "-m elf32ppcsim"
41656 +#define LINK_OS_SIM_SPEC ""
41657
41658 #define CPP_OS_SIM_SPEC ""
41659
41660 --- /dev/null
41661 +++ b/gcc/config/rs6000/t-cs-eabi
41662 @@ -0,0 +1,17 @@
41663 +# Multilibs for powerpc embedded ELF targets.
41664 +
41665 +MULTILIB_OPTIONS = te500v1/te500v2/te600/te500mc \
41666 + msoft-float
41667 +
41668 +MULTILIB_DIRNAMES = te500v1 te500v2 te600 te500mc \
41669 + nof
41670 +
41671 +MULTILIB_EXCEPTIONS = *te600*/*msoft-float* \
41672 + *te500v1*/*msoft-float* \
41673 + *te500v2*/*msoft-float* \
41674 + *te500mc*/*msoft-float*
41675 +
41676 +MULTILIB_EXTRA_OPTS = mno-eabi mstrict-align
41677 +
41678 +MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT} \
41679 + ${MULTILIB_MATCHES_ENDIAN}
41680 --- /dev/null
41681 +++ b/gcc/config/rs6000/t-linux
41682 @@ -0,0 +1,12 @@
41683 +# Multilibs for powerpc-linux-gnu targets.
41684 +
41685 +MULTILIB_OPTIONS = te500v1/te500v2/te600/te500mc \
41686 + msoft-float
41687 +
41688 +MULTILIB_DIRNAMES = te500v1 te500v2 te600 te500mc \
41689 + nof
41690 +
41691 +MULTILIB_EXCEPTIONS = *te600*/*msoft-float* \
41692 + *te500v1*/*msoft-float* \
41693 + *te500v2*/*msoft-float* \
41694 + *te500mc*/*msoft-float*
41695 --- /dev/null
41696 +++ b/gcc/config/rs6000/t-montavista-linux
41697 @@ -0,0 +1,26 @@
41698 +# MontaVista GNU/Linux Configuration.
41699 +# Copyright (C) 2009
41700 +# Free Software Foundation, Inc.
41701 +#
41702 +# This file is part of GCC.
41703 +#
41704 +# GCC is free software; you can redistribute it and/or modify
41705 +# it under the terms of the GNU General Public License as published by
41706 +# the Free Software Foundation; either version 3, or (at your option)
41707 +# any later version.
41708 +#
41709 +# GCC is distributed in the hope that it will be useful,
41710 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
41711 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41712 +# GNU General Public License for more details.
41713 +#
41714 +# You should have received a copy of the GNU General Public License
41715 +# along with GCC; see the file COPYING3. If not see
41716 +# <http://www.gnu.org/licenses/>.
41717 +
41718 +# Build hard-float, soft-float, E500mc, E500v2 and E600
41719 +# libraries.
41720 +MULTILIB_OPTIONS = msoft-float/te500mc/te500v2/te600
41721 +MULTILIB_DIRNAMES = soft-float te500mc te500v2 te600
41722 +MULTILIB_EXCEPTIONS =
41723 +MULTILIB_OSDIRNAMES = msoft-float=!soft-float
41724 --- a/gcc/config/rs6000/t-netbsd
41725 +++ b/gcc/config/rs6000/t-netbsd
41726 @@ -2,13 +2,32 @@
41727
41728 LIB2FUNCS_EXTRA = tramp.S
41729
41730 +LIB2FUNCS_STATIC_EXTRA = crtsavfpr.S crtresfpr.S \
41731 + crtsavgpr.S crtresgpr.S \
41732 + crtresxfpr.S crtresxgpr.S
41733 +
41734 tramp.S: $(srcdir)/config/rs6000/tramp.asm
41735 cat $(srcdir)/config/rs6000/tramp.asm > tramp.S
41736
41737 -crtsavres.S: $(srcdir)/config/rs6000/crtsavres.asm
41738 - cat $(srcdir)/config/rs6000/crtsavres.asm >crtsavres.S
41739 +crtsavfpr.S: $(srcdir)/config/rs6000/crtsavfpr.asm
41740 + cat $(srcdir)/config/rs6000/crtsavfpr.asm >crtsavfpr.S
41741 +
41742 +crtresfpr.S: $(srcdir)/config/rs6000/crtresfpr.asm
41743 + cat $(srcdir)/config/rs6000/crtresfpr.asm >crtresfpr.S
41744 +
41745 +crtsavgpr.S: $(srcdir)/config/rs6000/crtsavgpr.asm
41746 + cat $(srcdir)/config/rs6000/crtsavgpr.asm >crtsavgpr.S
41747 +
41748 +crtresgpr.S: $(srcdir)/config/rs6000/crtresgpr.asm
41749 + cat $(srcdir)/config/rs6000/crtresgpr.asm >crtresgpr.S
41750 +
41751 +crtresxfpr.S: $(srcdir)/config/rs6000/crtresxfpr.asm
41752 + cat $(srcdir)/config/rs6000/crtresxfpr.asm >crtresxfpr.S
41753 +
41754 +crtresxgpr.S: $(srcdir)/config/rs6000/crtresxgpr.asm
41755 + cat $(srcdir)/config/rs6000/crtresxgpr.asm >crtresxgpr.S
41756
41757 -EXTRA_PARTS += crtsavres$(objext)
41758 +EXTRA_PARTS += libcrtsavres.a
41759
41760 # It is important that crtbegin.o, etc., aren't surprised by stuff in .sdata.
41761 CRTSTUFF_T_CFLAGS += -msdata=none
41762 @@ -37,6 +56,20 @@ EXTRA_MULTILIB_PARTS = crtbegin$(objext)
41763 crtbeginS$(objext) crtendS$(objext) crtbeginT$(objext) \
41764 crtsavres$(objext)
41765
41766 -$(T)crtsavres$(objext): crtsavres.S
41767 - $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
41768 - -c crtsavres.S -o $(T)crtsavres$(objext)
41769 +$(T)crtsavfpr$(objext): crtsavfpr.S
41770 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavfpr.S -o $(T)crtsavfpr$(objext)
41771 +
41772 +$(T)crtresfpr$(objext): crtresfpr.S
41773 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresfpr.S -o $(T)crtresfpr$(objext)
41774 +
41775 +$(T)crtsavgpr$(objext): crtsavgpr.S
41776 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavgpr.S -o $(T)crtsavgpr$(objext)
41777 +
41778 +$(T)crtresgpr$(objext): crtresgpr.S
41779 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresgpr.S -o $(T)crtresgpr$(objext)
41780 +
41781 +$(T)crtresxfpr$(objext): crtresxfpr.S
41782 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresxfpr.S -o $(T)crtresxfpr$(objext)
41783 +
41784 +$(T)crtresxgpr$(objext): crtresxgpr.S
41785 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresxgpr.S -o $(T)crtresxgpr$(objext)
41786 --- /dev/null
41787 +++ b/gcc/config/rs6000/t-ppc-e500mc
41788 @@ -0,0 +1,12 @@
41789 +# Multilibs for powerpc embedded ELF targets.
41790 +
41791 +MULTILIB_OPTIONS =
41792 +
41793 +MULTILIB_DIRNAMES =
41794 +
41795 +MULTILIB_EXCEPTIONS =
41796 +
41797 +MULTILIB_EXTRA_OPTS = mno-eabi mstrict-align
41798 +
41799 +MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT} \
41800 + ${MULTILIB_MATCHES_ENDIAN}
41801 --- a/gcc/config/rs6000/t-ppccomm
41802 +++ b/gcc/config/rs6000/t-ppccomm
41803 @@ -2,11 +2,24 @@
41804
41805 LIB2FUNCS_EXTRA += tramp.S $(srcdir)/config/rs6000/darwin-ldouble.c
41806
41807 -# This one can't end up in shared libgcc
41808 -LIB2FUNCS_STATIC_EXTRA = eabi.S
41809 -
41810 -eabi.S: $(srcdir)/config/rs6000/eabi.asm
41811 - cat $(srcdir)/config/rs6000/eabi.asm > eabi.S
41812 +# These can't end up in shared libgcc
41813 +LIB2FUNCS_STATIC_EXTRA = \
41814 + crtsavfpr.S crtresfpr.S \
41815 + crtsavgpr.S crtresgpr.S \
41816 + crtresxfpr.S crtresxgpr.S \
41817 + e500crtres32gpr.S \
41818 + e500crtres64gpr.S \
41819 + e500crtres64gprctr.S \
41820 + e500crtrest32gpr.S \
41821 + e500crtrest64gpr.S \
41822 + e500crtresx32gpr.S \
41823 + e500crtresx64gpr.S \
41824 + e500crtsav32gpr.S \
41825 + e500crtsav64gpr.S \
41826 + e500crtsav64gprctr.S \
41827 + e500crtsavg32gpr.S \
41828 + e500crtsavg64gpr.S \
41829 + e500crtsavg64gprctr.S
41830
41831 tramp.S: $(srcdir)/config/rs6000/tramp.asm
41832 cat $(srcdir)/config/rs6000/tramp.asm > tramp.S
41833 @@ -18,8 +31,7 @@ MULTILIB_MATCHES_SYSV = mcall-sysv=mcall
41834 EXTRA_MULTILIB_PARTS = crtbegin$(objext) crtend$(objext) \
41835 crtbeginS$(objext) crtendS$(objext) crtbeginT$(objext) \
41836 ecrti$(objext) ecrtn$(objext) \
41837 - ncrti$(objext) ncrtn$(objext) \
41838 - crtsavres$(objext)
41839 + ncrti$(objext) ncrtn$(objext)
41840
41841 # We build {e,n}crti.o and {e,n}crtn.o, which serve to add begin and
41842 # end labels to all of the special sections used when we link using gcc.
41843 @@ -37,8 +49,62 @@ ncrti.S: $(srcdir)/config/rs6000/sol-ci.
41844 ncrtn.S: $(srcdir)/config/rs6000/sol-cn.asm
41845 cat $(srcdir)/config/rs6000/sol-cn.asm >ncrtn.S
41846
41847 -crtsavres.S: $(srcdir)/config/rs6000/crtsavres.asm
41848 - cat $(srcdir)/config/rs6000/crtsavres.asm >crtsavres.S
41849 +crtsavfpr.S: $(srcdir)/config/rs6000/crtsavfpr.asm
41850 + cat $(srcdir)/config/rs6000/crtsavfpr.asm >crtsavfpr.S
41851 +
41852 +crtresfpr.S: $(srcdir)/config/rs6000/crtresfpr.asm
41853 + cat $(srcdir)/config/rs6000/crtresfpr.asm >crtresfpr.S
41854 +
41855 +crtsavgpr.S: $(srcdir)/config/rs6000/crtsavgpr.asm
41856 + cat $(srcdir)/config/rs6000/crtsavgpr.asm >crtsavgpr.S
41857 +
41858 +crtresgpr.S: $(srcdir)/config/rs6000/crtresgpr.asm
41859 + cat $(srcdir)/config/rs6000/crtresgpr.asm >crtresgpr.S
41860 +
41861 +crtresxfpr.S: $(srcdir)/config/rs6000/crtresxfpr.asm
41862 + cat $(srcdir)/config/rs6000/crtresxfpr.asm >crtresxfpr.S
41863 +
41864 +crtresxgpr.S: $(srcdir)/config/rs6000/crtresxgpr.asm
41865 + cat $(srcdir)/config/rs6000/crtresxgpr.asm >crtresxgpr.S
41866 +
41867 +e500crtres32gpr.S: $(srcdir)/config/rs6000/e500crtres32gpr.asm
41868 + cat $(srcdir)/config/rs6000/e500crtres32gpr.asm >e500crtres32gpr.S
41869 +
41870 +e500crtres64gpr.S: $(srcdir)/config/rs6000/e500crtres64gpr.asm
41871 + cat $(srcdir)/config/rs6000/e500crtres64gpr.asm >e500crtres64gpr.S
41872 +
41873 +e500crtres64gprctr.S: $(srcdir)/config/rs6000/e500crtres64gprctr.asm
41874 + cat $(srcdir)/config/rs6000/e500crtres64gprctr.asm >e500crtres64gprctr.S
41875 +
41876 +e500crtrest32gpr.S: $(srcdir)/config/rs6000/e500crtrest32gpr.asm
41877 + cat $(srcdir)/config/rs6000/e500crtrest32gpr.asm >e500crtrest32gpr.S
41878 +
41879 +e500crtrest64gpr.S: $(srcdir)/config/rs6000/e500crtrest64gpr.asm
41880 + cat $(srcdir)/config/rs6000/e500crtrest64gpr.asm >e500crtrest64gpr.S
41881 +
41882 +e500crtresx32gpr.S: $(srcdir)/config/rs6000/e500crtresx32gpr.asm
41883 + cat $(srcdir)/config/rs6000/e500crtresx32gpr.asm >e500crtresx32gpr.S
41884 +
41885 +e500crtresx64gpr.S: $(srcdir)/config/rs6000/e500crtresx64gpr.asm
41886 + cat $(srcdir)/config/rs6000/e500crtresx64gpr.asm >e500crtresx64gpr.S
41887 +
41888 +e500crtsav32gpr.S: $(srcdir)/config/rs6000/e500crtsav32gpr.asm
41889 + cat $(srcdir)/config/rs6000/e500crtsav32gpr.asm >e500crtsav32gpr.S
41890 +
41891 +e500crtsav64gpr.S: $(srcdir)/config/rs6000/e500crtsav64gpr.asm
41892 + cat $(srcdir)/config/rs6000/e500crtsav64gpr.asm >e500crtsav64gpr.S
41893 +
41894 +e500crtsav64gprctr.S: $(srcdir)/config/rs6000/e500crtsav64gprctr.asm
41895 + cat $(srcdir)/config/rs6000/e500crtsav64gprctr.asm >e500crtsav64gprctr.S
41896 +
41897 +e500crtsavg32gpr.S: $(srcdir)/config/rs6000/e500crtsavg32gpr.asm
41898 + cat $(srcdir)/config/rs6000/e500crtsavg32gpr.asm >e500crtsavg32gpr.S
41899 +
41900 +e500crtsavg64gpr.S: $(srcdir)/config/rs6000/e500crtsavg64gpr.asm
41901 + cat $(srcdir)/config/rs6000/e500crtsavg64gpr.asm >e500crtsavg64gpr.S
41902 +
41903 +e500crtsavg64gprctr.S: $(srcdir)/config/rs6000/e500crtsavg64gprctr.asm
41904 + cat $(srcdir)/config/rs6000/e500crtsavg64gprctr.asm >e500crtsavg64gprctr.S
41905
41906 # Build multiple copies of ?crt{i,n}.o, one for each target switch.
41907 $(T)ecrti$(objext): ecrti.S
41908 @@ -53,8 +119,62 @@ $(T)ncrti$(objext): ncrti.S
41909 $(T)ncrtn$(objext): ncrtn.S
41910 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ncrtn.S -o $(T)ncrtn$(objext)
41911
41912 -$(T)crtsavres$(objext): crtsavres.S
41913 - $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavres.S -o $(T)crtsavres$(objext)
41914 +$(T)crtsavfpr$(objext): crtsavfpr.S
41915 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavfpr.S -o $(T)crtsavfpr$(objext)
41916 +
41917 +$(T)crtresfpr$(objext): crtresfpr.S
41918 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresfpr.S -o $(T)crtresfpr$(objext)
41919 +
41920 +$(T)crtsavgpr$(objext): crtsavgpr.S
41921 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavgpr.S -o $(T)crtsavgpr$(objext)
41922 +
41923 +$(T)crtresgpr$(objext): crtresgpr.S
41924 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresgpr.S -o $(T)crtresgpr$(objext)
41925 +
41926 +$(T)crtresxfpr$(objext): crtresxfpr.S
41927 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresxfpr.S -o $(T)crtresxfpr$(objext)
41928 +
41929 +$(T)crtresxgpr$(objext): crtresxgpr.S
41930 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresxgpr.S -o $(T)crtresxgpr$(objext)
41931 +
41932 +$(T)e500crtres32gpr$(objext): e500crtres32gpr.S
41933 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtres32gpr.S -o $(T)e500crtres32gpr$(objext)
41934 +
41935 +$(T)e500crtres64gpr$(objext): e500crtres64gpr.S
41936 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtres64gpr.S -o $(T)e500crtres64gpr$(objext)
41937 +
41938 +$(T)e500crtres64gprctr$(objext): e500crtres64gprctr.S
41939 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtres64gprctr.S -o $(T)e500crtres64gprctr$(objext)
41940 +
41941 +$(T)e500crtrest32gpr$(objext): e500crtrest32gpr.S
41942 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtrest32gpr.S -o $(T)e500crtrest32gpr$(objext)
41943 +
41944 +$(T)e500crtrest64gpr$(objext): e500crtrest64gpr.S
41945 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtrest64gpr.S -o $(T)e500crtrest64gpr$(objext)
41946 +
41947 +$(T)e500crtresx32gpr$(objext): e500crtresx32gpr.S
41948 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtresx32gpr.S -o $(T)e500crtresx32gpr$(objext)
41949 +
41950 +$(T)e500crtresx64gpr$(objext): e500crtresx64gpr.S
41951 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtresx64gpr.S -o $(T)e500crtresx64gpr$(objext)
41952 +
41953 +$(T)e500crtsav32gpr$(objext): e500crtsav32gpr.S
41954 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtsav32gpr.S -o $(T)e500crtsav32gpr$(objext)
41955 +
41956 +$(T)e500crtsav64gpr$(objext): e500crtsav64gpr.S
41957 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtsav64gpr.S -o $(T)e500crtsav64gpr$(objext)
41958 +
41959 +$(T)e500crtsav64gprctr$(objext): e500crtsav64gprctr.S
41960 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtsav64gprctr.S -o $(T)e500crtsav64gprctr$(objext)
41961 +
41962 +$(T)e500crtsavg32gpr$(objext): e500crtsavg32gpr.S
41963 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtsavg32gpr.S -o $(T)e500crtsavg32gpr$(objext)
41964 +
41965 +$(T)e500crtsavg64gpr$(objext): e500crtsavg64gpr.S
41966 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtsavg64gpr.S -o $(T)e500crtsavg64gpr$(objext)
41967 +
41968 +$(T)e500crtsavg64gprctr$(objext): e500crtsavg64gprctr.S
41969 + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtsavg64gprctr.S -o $(T)e500crtsavg64gprctr$(objext)
41970
41971 # It is important that crtbegin.o, etc., aren't surprised by stuff in .sdata.
41972 CRTSTUFF_T_CFLAGS = -msdata=none
41973 --- a/gcc/config/rs6000/t-ppcgas
41974 +++ b/gcc/config/rs6000/t-ppcgas
41975 @@ -1,14 +1,16 @@
41976 # Multilibs for powerpc embedded ELF targets.
41977
41978 -MULTILIB_OPTIONS = msoft-float \
41979 - mlittle/mbig \
41980 - fleading-underscore
41981 +MULTILIB_OPTIONS = te500v1/te500v2/te600 \
41982 + msoft-float
41983
41984 -MULTILIB_DIRNAMES = nof \
41985 - le be \
41986 - und
41987 +MULTILIB_DIRNAMES = te500v1 te500v2 te600 \
41988 + nof
41989
41990 -MULTILIB_EXTRA_OPTS = mrelocatable-lib mno-eabi mstrict-align
41991 +MULTILIB_EXCEPTIONS = *te600*/*msoft-float* \
41992 + *te500v1*/*msoft-float* \
41993 + *te500v2*/*msoft-float*
41994 +
41995 +MULTILIB_EXTRA_OPTS = mno-eabi mstrict-align
41996
41997 MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT} \
41998 ${MULTILIB_MATCHES_ENDIAN}
41999 --- /dev/null
42000 +++ b/gcc/config/rs6000/t-timesys
42001 @@ -0,0 +1,17 @@
42002 +# Overrides for timesys
42003 +
42004 +# We want to build six multilibs:
42005 +# . (default, -mcpu=740)
42006 +# 4xx (-mcpu=405)
42007 +# 44x (-mcpu=440)
42008 +# 8xx (-mcpu=801)
42009 +# 85xx (-te500v1)
42010 +# 74xx (-te600)
42011 +
42012 +MULTILIB_OPTIONS = mcpu=405/mcpu=440/mcpu=801/te500v1/te600
42013 +
42014 +MULTILIB_DIRNAMES = 4xx 44x 8xx 85xx 74xx
42015 +
42016 +MULTILIB_MATCHES =
42017 +
42018 +MULTILIB_EXCEPTIONS =
42019 --- /dev/null
42020 +++ b/gcc/config/rs6000/t-wrs-linux
42021 @@ -0,0 +1,30 @@
42022 +# Wind River GNU/Linux Configuration.
42023 +# Copyright (C) 2006, 2007
42024 +# Free Software Foundation, Inc.
42025 +#
42026 +# This file is part of GCC.
42027 +#
42028 +# GCC is free software; you can redistribute it and/or modify
42029 +# it under the terms of the GNU General Public License as published by
42030 +# the Free Software Foundation; either version 3, or (at your option)
42031 +# any later version.
42032 +#
42033 +# GCC is distributed in the hope that it will be useful,
42034 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
42035 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42036 +# GNU General Public License for more details.
42037 +#
42038 +# You should have received a copy of the GNU General Public License
42039 +# along with GCC; see the file COPYING3. If not see
42040 +# <http://www.gnu.org/licenses/>.
42041 +
42042 +# Build hard-float (32-bit and 64-bit), soft-float, E500v1 and E500v2
42043 +# libraries.
42044 +MULTILIB_OPTIONS = muclibc m64 msoft-float te500v1 te500v2
42045 +MULTILIB_DIRNAMES = uclibc 64 soft-float te500v1 te500v2
42046 +MULTILIB_EXCEPTIONS = *muclibc*/*m64* *muclibc*/*msoft-float*
42047 +MULTILIB_EXCEPTIONS += *muclibc*/*te500v1* *muclibc*/*te500v2*
42048 +MULTILIB_EXCEPTIONS += *m64*/*msoft-float* *m64*/*te500v1* *m64*/*te500v2*
42049 +MULTILIB_EXCEPTIONS += *msoft-float*/*te500v1* *msoft-float*/*te500v2*
42050 +MULTILIB_EXCEPTIONS += *te500v1*/*te500v2*
42051 +MULTILIB_OSDIRNAMES = muclibc=!uclibc m64=../lib64 msoft-float=!soft-float
42052 --- /dev/null
42053 +++ b/gcc/config/rs6000/timesys-linux.h
42054 @@ -0,0 +1,41 @@
42055 +/* Configuration file for timesys ARM GNU/Linux EABI targets.
42056 + Copyright (C) 2007
42057 + Free Software Foundation, Inc.
42058 + Contributed by CodeSourcery, LLC
42059 +
42060 + This file is part of GCC.
42061 +
42062 + GCC is free software; you can redistribute it and/or modify it
42063 + under the terms of the GNU General Public License as published
42064 + by the Free Software Foundation; either version 3, or (at your
42065 + option) any later version.
42066 +
42067 + GCC is distributed in the hope that it will be useful, but WITHOUT
42068 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
42069 + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
42070 + License for more details.
42071 +
42072 + You should have received a copy of the GNU General Public License
42073 + along with GCC; see the file COPYING3. If not see
42074 + <http://www.gnu.org/licenses/>. */
42075 +
42076 +/* Add -t flags for convenience in generating multilibs. */
42077 +#undef CC1_EXTRA_SPEC
42078 +#define CC1_EXTRA_SPEC \
42079 + "%{te500v1: -mcpu=8540 -mfloat-gprs=single -mspe=yes -mabi=spe} " \
42080 + "%{te600: -mcpu=7400 -maltivec -mabi=altivec} "
42081 +
42082 +#undef ASM_DEFAULT_SPEC
42083 +#define ASM_DEFAULT_SPEC \
42084 + "%{te500v1:-mppc -mspe -me500 ; \
42085 + te600:-mppc -maltivec ; \
42086 + mcpu=405:-m405 ; \
42087 + mcpu=440:-m440 ; \
42088 + :-mppc%{m64:64}}"
42089 +
42090 +
42091 +/* FIXME:We should be dynamically creating this from the makefile.
42092 + See m68k for an example. */
42093 +#undef SYSROOT_SUFFIX_SPEC
42094 +#define SYSROOT_SUFFIX_SPEC \
42095 + "%{mcpu=405:/4xx ; mcpu=440:/44x ; mcpu=801:/8xx ; te500v1:/85xx ; te600:/74xx}"
42096 --- /dev/null
42097 +++ b/gcc/config/rs6000/wrs-linux.h
42098 @@ -0,0 +1,44 @@
42099 +/* Wind River GNU/Linux Configuration.
42100 + Copyright (C) 2006, 2007
42101 + Free Software Foundation, Inc.
42102 +
42103 +This file is part of GCC.
42104 +
42105 +GCC is free software; you can redistribute it and/or modify
42106 +it under the terms of the GNU General Public License as published by
42107 +the Free Software Foundation; either version 3, or (at your option)
42108 +any later version.
42109 +
42110 +GCC is distributed in the hope that it will be useful,
42111 +but WITHOUT ANY WARRANTY; without even the implied warranty of
42112 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42113 +GNU General Public License for more details.
42114 +
42115 +You should have received a copy of the GNU General Public License
42116 +along with GCC; see the file COPYING3. If not see
42117 +<http://www.gnu.org/licenses/>. */
42118 +
42119 +/* Add -te500v1 and -te500v2 options for convenience in generating
42120 + multilibs. */
42121 +#undef CC1_EXTRA_SPEC
42122 +#define CC1_EXTRA_SPEC "%{te500v1: -mcpu=8540 -mfloat-gprs=single -mspe=yes -mabi=spe} %{te500v2: -mcpu=8548 -mfloat-gprs=double -mspe=yes -mabi=spe}"
42123 +
42124 +#undef ASM_DEFAULT_SPEC
42125 +#define ASM_DEFAULT_SPEC \
42126 + "%{te500v1:-mppc -mspe -me500 ; \
42127 + te500v2:-mppc -mspe -me500 ; \
42128 + :-mppc%{m64:64}}"
42129 +
42130 +/* The GLIBC headers are in /usr/include, relative to the sysroot; the
42131 + uClibc headers are in /uclibc/usr/include. */
42132 +#undef SYSROOT_HEADERS_SUFFIX_SPEC
42133 +#define SYSROOT_HEADERS_SUFFIX_SPEC \
42134 + "%{muclibc:/uclibc}"
42135 +
42136 +/* The various C libraries each have their own subdirectory. */
42137 +#undef SYSROOT_SUFFIX_SPEC
42138 +#define SYSROOT_SUFFIX_SPEC \
42139 + "%{muclibc:/uclibc ; \
42140 + msoft-float:/soft-float ; \
42141 + te500v1:/te500v1 ; \
42142 + te500v2:/te500v2}"
42143 --- /dev/null
42144 +++ b/gcc/config/sh/cs-sgxxlite-linux.h
42145 @@ -0,0 +1,23 @@
42146 +/* SH SourceryG++ GNU/Linux Configuration.
42147 + Copyright (C) 2008
42148 + Free Software Foundation, Inc.
42149 +
42150 +This file is part of GCC.
42151 +
42152 +GCC is free software; you can redistribute it and/or modify
42153 +it under the terms of the GNU General Public License as published by
42154 +the Free Software Foundation; either version 3, or (at your option)
42155 +any later version.
42156 +
42157 +GCC is distributed in the hope that it will be useful,
42158 +but WITHOUT ANY WARRANTY; without even the implied warranty of
42159 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42160 +GNU General Public License for more details.
42161 +
42162 +You should have received a copy of the GNU General Public License
42163 +along with GCC; see the file COPYING3. If not see
42164 +<http://www.gnu.org/licenses/>. */
42165 +
42166 +#undef SYSROOT_HEADERS_SUFFIX_SPEC
42167 +#define SYSROOT_HEADERS_SUFFIX_SPEC \
42168 + "%{muclibc:/uclibc}"
42169 --- a/gcc/config/sh/lib1funcs.asm
42170 +++ b/gcc/config/sh/lib1funcs.asm
42171 @@ -2084,8 +2084,9 @@ GLOBAL(ic_invalidate):
42172 GLOBAL(ic_invalidate):
42173 ocbwb @r4
42174 synco
42175 - rts
42176 icbi @r4
42177 + rts
42178 + nop
42179 ENDFUNC(GLOBAL(ic_invalidate))
42180 #elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) || (defined(__SH4_NOFPU__) && !defined(__SH5__))
42181 /* For system code, we use ic_invalidate_line_i, but user code
42182 --- a/gcc/config/sh/linux-unwind.h
42183 +++ b/gcc/config/sh/linux-unwind.h
42184 @@ -27,7 +27,10 @@ the Free Software Foundation, 51 Frankli
42185 Boston, MA 02110-1301, USA. */
42186
42187 /* Do code reading to identify a signal frame, and set the frame
42188 - state data appropriately. See unwind-dw2.c for the structs. */
42189 + state data appropriately. See unwind-dw2.c for the structs.
42190 + Don't use this at all if inhibit_libc is used. */
42191 +
42192 +#ifndef inhibit_libc
42193
42194 #include <signal.h>
42195 #include <sys/ucontext.h>
42196 @@ -251,3 +254,5 @@ sh_fallback_frame_state (struct _Unwind_
42197 return _URC_NO_REASON;
42198 }
42199 #endif /* defined (__SH5__) */
42200 +
42201 +#endif /* inhibit_libc */
42202 --- a/gcc/config/sh/t-1e
42203 +++ /dev/null
42204 @@ -1 +0,0 @@
42205 -MULTILIB_ENDIAN =
42206 --- a/gcc/config/sh/t-linux
42207 +++ b/gcc/config/sh/t-linux
42208 @@ -4,6 +4,5 @@ LIB2FUNCS_EXTRA= $(srcdir)/config/sh/lin
42209
42210 MULTILIB_DIRNAMES=
42211 MULTILIB_MATCHES =
42212 -MULTILIB_EXCEPTIONS=
42213
42214 EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
42215 --- a/gcc/config/sh/t-mlib-sh1
42216 +++ /dev/null
42217 @@ -1 +0,0 @@
42218 -ML_sh1=m1/
42219 --- a/gcc/config/sh/t-mlib-sh2
42220 +++ /dev/null
42221 @@ -1 +0,0 @@
42222 -ML_sh2=m2/
42223 --- a/gcc/config/sh/t-mlib-sh2a
42224 +++ /dev/null
42225 @@ -1 +0,0 @@
42226 -ML_sh2a=m2a/
42227 --- a/gcc/config/sh/t-mlib-sh2a-nofpu
42228 +++ /dev/null
42229 @@ -1 +0,0 @@
42230 -ML_sh2a_nofpu=m2a-nofpu/
42231 --- a/gcc/config/sh/t-mlib-sh2a-single
42232 +++ /dev/null
42233 @@ -1 +0,0 @@
42234 -ML_sh2a_single=m2a-single/
42235 --- a/gcc/config/sh/t-mlib-sh2a-single-only
42236 +++ /dev/null
42237 @@ -1 +0,0 @@
42238 -ML_sh2a_single_only=m2a-single-only/
42239 --- a/gcc/config/sh/t-mlib-sh2e
42240 +++ /dev/null
42241 @@ -1 +0,0 @@
42242 -ML_sh2e=m2e/
42243 --- a/gcc/config/sh/t-mlib-sh3
42244 +++ /dev/null
42245 @@ -1 +0,0 @@
42246 -ML_sh3=m3/
42247 --- a/gcc/config/sh/t-mlib-sh3e
42248 +++ /dev/null
42249 @@ -1 +0,0 @@
42250 -ML_sh3e=m3e/
42251 --- a/gcc/config/sh/t-mlib-sh4
42252 +++ /dev/null
42253 @@ -1 +0,0 @@
42254 -ML_sh4=m4/
42255 --- a/gcc/config/sh/t-mlib-sh4-nofpu
42256 +++ /dev/null
42257 @@ -1 +0,0 @@
42258 -ML_sh4_nofpu=m4-nofpu/
42259 --- a/gcc/config/sh/t-mlib-sh4-single
42260 +++ /dev/null
42261 @@ -1 +0,0 @@
42262 -ML_sh4_single=m4-single/
42263 --- a/gcc/config/sh/t-mlib-sh4-single-only
42264 +++ /dev/null
42265 @@ -1 +0,0 @@
42266 -ML_sh4_single_only=m4-single-only/
42267 --- a/gcc/config/sh/t-mlib-sh4a
42268 +++ /dev/null
42269 @@ -1 +0,0 @@
42270 -ML_sh4a=m4a/
42271 --- a/gcc/config/sh/t-mlib-sh4a-nofpu
42272 +++ /dev/null
42273 @@ -1 +0,0 @@
42274 -ML_sh4a_nofpu=m4a-nofpu/
42275 --- a/gcc/config/sh/t-mlib-sh4a-single
42276 +++ /dev/null
42277 @@ -1 +0,0 @@
42278 -ML_sh4a_single=m4a-single/
42279 --- a/gcc/config/sh/t-mlib-sh4a-single-only
42280 +++ /dev/null
42281 @@ -1 +0,0 @@
42282 -ML_sh4a_single_only=m4a-single-only/
42283 --- a/gcc/config/sh/t-mlib-sh4al
42284 +++ /dev/null
42285 @@ -1 +0,0 @@
42286 -ML_sh4al=m4al/
42287 --- a/gcc/config/sh/t-mlib-sh5-32media
42288 +++ /dev/null
42289 @@ -1 +0,0 @@
42290 -ML_sh5_32media=m5-32media/
42291 --- a/gcc/config/sh/t-mlib-sh5-32media-nofpu
42292 +++ /dev/null
42293 @@ -1 +0,0 @@
42294 -ML_sh5_32media_nofpu=m5-32media-nofpu/
42295 --- a/gcc/config/sh/t-mlib-sh5-64media
42296 +++ /dev/null
42297 @@ -1 +0,0 @@
42298 -ML_sh5_64media=m5-64media/
42299 --- a/gcc/config/sh/t-mlib-sh5-64media-nofpu
42300 +++ /dev/null
42301 @@ -1 +0,0 @@
42302 -ML_sh5_64media_nofpu=m5-64media-nofpu/
42303 --- a/gcc/config/sh/t-mlib-sh5-compact
42304 +++ /dev/null
42305 @@ -1 +0,0 @@
42306 -ML_sh5_compact=m5-compact/
42307 --- a/gcc/config/sh/t-mlib-sh5-compact-nofpu
42308 +++ /dev/null
42309 @@ -1 +0,0 @@
42310 -ML_sh5_compact_nofpu=m5-compact-nofpu/
42311 --- /dev/null
42312 +++ b/gcc/config/sh/t-sgxxlite-linux
42313 @@ -0,0 +1,3 @@
42314 +MULTILIB_OPTIONS += muclibc
42315 +MULTILIB_OSDIRNAMES += muclibc=!uclibc m4al/muclibc=!m4al/uclibc mb/muclibc=!mb/uclibc
42316 +MULTILIB_EXCEPTIONS += mb/m4al/muclibc
42317 --- a/gcc/config/sh/t-sh
42318 +++ b/gcc/config/sh/t-sh
42319 @@ -27,10 +27,10 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
42320 echo '#endif' >> fp-bit.c
42321 cat $(srcdir)/config/fp-bit.c >> fp-bit.c
42322
42323 -MULTILIB_ENDIAN = ml/mb
42324 -MULTILIB_CPUS= $(ML_sh1)$(ML_sh2a)$(ML_sh2a_nofpu)$(ML_sh2a_single_only)$(ML_sh2a_single)$(ML_sh2e)$(ML_sh2)$(ML_sh3e)$(ML_sh3)$(ML_sh4_nofpu)$(ML_sh4_single_only)$(ML_sh4_single)$(ML_sh4)$(ML_sh4a_nofpu)$(ML_sh4a_single_only)$(ML_sh4a_single)$(ML_sh4a)$(ML_sh5_32media)$(ML_sh5_32media_nofpu)$(ML_sh5_compact)$(ML_sh5_compact_nofpu)$(ML_sh5_64media)$(ML_sh5_64media_nofpu)
42325 +DEFAULT_ENDIAN = $(word 1,$(TM_ENDIAN_CONFIG))
42326 +OTHER_ENDIAN = $(word 2,$(TM_ENDIAN_CONFIG))
42327
42328 -MULTILIB_OPTIONS= $(MULTILIB_ENDIAN) $(MULTILIB_CPUS:/=)
42329 +MULTILIB_OPTIONS= $(OTHER_ENDIAN) $(TM_MULTILIB_CONFIG)
42330 MULTILIB_DIRNAMES=
42331
42332 # The separate entries for m2a-nofpu and m2a-single-only with
42333 @@ -58,7 +58,34 @@ MULTILIB_MATCHES = $(shell \
42334 done)
42335
42336 # SH1 only supports big endian.
42337 -MULTILIB_EXCEPTIONS = ml/m1 ml/m2a*
42338 +MULTILIB_EXCEPTIONS = ml/m1 ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
42339 +
42340 +MULTILIB_OSDIRNAMES = \
42341 + $(OTHER_ENDIAN)=!$(OTHER_ENDIAN) \
42342 + m1=!m1 $(OTHER_ENDIAN)/m1=!$(OTHER_ENDIAN)/m1 \
42343 + m2a=!m2a $(OTHER_ENDIAN)/m2a=!$(OTHER_ENDIAN)/m2a \
42344 + m2a-nofpu=!m2a-nofpu $(OTHER_ENDIAN)/m2a-nofpu=!$(OTHER_ENDIAN)/m2a-nofpu \
42345 + m2a-single-only=!m2a-single-only $(OTHER_ENDIAN)/m2a-single-only=!$(OTHER_ENDIAN)/m2a-single-only \
42346 + m2a-single=!m2a-single $(OTHER_ENDIAN)/m2a-single=!$(OTHER_ENDIAN)/m2a-single \
42347 + m2e=!m2e $(OTHER_ENDIAN)/m2e=!$(OTHER_ENDIAN)/m2e \
42348 + m2=!m2 $(OTHER_ENDIAN)/m2=!$(OTHER_ENDIAN)/m2 \
42349 + m3e=!m3e $(OTHER_ENDIAN)/m3e=!$(OTHER_ENDIAN)/m3e \
42350 + m3=!m3 $(OTHER_ENDIAN)/m3=!$(OTHER_ENDIAN)/m3 \
42351 + m4-nofpu=!m4-nofpu $(OTHER_ENDIAN)/m4-nofpu=!$(OTHER_ENDIAN)/m4-nofpu \
42352 + m4-single-only=!m4-single-only $(OTHER_ENDIAN)/m4-single-only=!$(OTHER_ENDIAN)/m4-single-only \
42353 + m4-single=!m4-single $(OTHER_ENDIAN)/m4-single=!$(OTHER_ENDIAN)/m4-single \
42354 + m4=!m4 $(OTHER_ENDIAN)/m4=!$(OTHER_ENDIAN)/m4 \
42355 + m4a-nofpu=!m4a-nofpu $(OTHER_ENDIAN)/m4a-nofpu=!$(OTHER_ENDIAN)/m4a-nofpu \
42356 + m4a-single-only=!m4a-single-only $(OTHER_ENDIAN)/m4a-single-only=!$(OTHER_ENDIAN)/m4a-single-only \
42357 + m4a-single=!m4a-single $(OTHER_ENDIAN)/m4a-single=!$(OTHER_ENDIAN)/m4a-single \
42358 + m4a=!m4a $(OTHER_ENDIAN)/m4a=!$(OTHER_ENDIAN)/m4a \
42359 + m4al=!m4al $(OTHER_ENDIAN)/m4al=!$(OTHER_ENDIAN)/m4al \
42360 + m5-32media=!m5-32media $(OTHER_ENDIAN)/m5-32media=!$(OTHER_ENDIAN)/m5-32media \
42361 + m5-32media-nofpu=!m5-32media-nofpu $(OTHER_ENDIAN)/m5-32media-nofpu=!$(OTHER_ENDIAN)/m5-32media-nofpu \
42362 + m5-compact=!m5-compact $(OTHER_ENDIAN)/m5-compact=!$(OTHER_ENDIAN)/m5-compact \
42363 + m5-compact-nofpu=!m5-compact-nofpu $(OTHER_ENDIAN)/m5-compact-nofpu=!$(OTHER_ENDIAN)/m5-compact-nofpu \
42364 + m5-64media=!m5-64media $(OTHER_ENDIAN)/m5-64media=!$(OTHER_ENDIAN)/m5-64media \
42365 + m5-64media-nofpu=!m5-64media-nofpu $(OTHER_ENDIAN)/m5-64media-nofpu=!$(OTHER_ENDIAN)/m5-64media-nofpu
42366
42367 LIBGCC = stmp-multilib
42368 INSTALL_LIBGCC = install-multilib
42369 --- a/gcc/config/sol2.h
42370 +++ b/gcc/config/sol2.h
42371 @@ -123,12 +123,12 @@ along with GCC; see the file COPYING3.
42372 %{YP,*} \
42373 %{R*} \
42374 %{compat-bsd: \
42375 - %{!YP,*:%{p|pg:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
42376 - %{!p:%{!pg:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}}} \
42377 - -R /usr/ucblib} \
42378 + %{!YP,*:%{p|pg:-Y P,%R/usr/ucblib:%R/usr/ccs/lib/libp:%R/usr/lib/libp:%R/usr/ccs/lib:%R/usr/lib} \
42379 + %{!p:%{!pg:-Y P,%R/usr/ucblib:%R/usr/ccs/lib:%R/usr/lib}}} \
42380 + -R %R/usr/ucblib} \
42381 %{!compat-bsd: \
42382 - %{!YP,*:%{p|pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
42383 - %{!p:%{!pg:-Y P,/usr/ccs/lib:/usr/lib}}}}"
42384 + %{!YP,*:%{p|pg:-Y P,%R/usr/ccs/lib/libp:%R/usr/lib/libp:%R/usr/ccs/lib:%R/usr/lib} \
42385 + %{!p:%{!pg:-Y P,%R/usr/ccs/lib:%R/usr/lib}}}}"
42386
42387 #undef LINK_ARCH32_SPEC
42388 #define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE
42389 --- a/gcc/config/sparc/linux64.h
42390 +++ b/gcc/config/sparc/linux64.h
42391 @@ -49,10 +49,15 @@ along with GCC; see the file COPYING3.
42392 in a Medium/Low code model environment. */
42393
42394 #undef TARGET_DEFAULT
42395 +#ifdef BIARCH_32BIT_DEFAULT
42396 +#define TARGET_DEFAULT \
42397 + (MASK_APP_REGS + MASK_FPU)
42398 +#else
42399 #define TARGET_DEFAULT \
42400 (MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \
42401 + MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128)
42402 #endif
42403 +#endif
42404
42405 #undef ASM_CPU_DEFAULT_SPEC
42406 #define ASM_CPU_DEFAULT_SPEC "-Av9a"
42407 @@ -167,7 +172,7 @@ along with GCC; see the file COPYING3.
42408 { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
42409 { "link_arch", LINK_ARCH_SPEC },
42410
42411 -#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
42412 +#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,%R/usr/lib %{shared:-shared} \
42413 %{!shared: \
42414 %{!ibcs: \
42415 %{!static: \
42416 @@ -176,7 +181,7 @@ along with GCC; see the file COPYING3.
42417 %{static:-static}}} \
42418 "
42419
42420 -#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
42421 +#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
42422 %{!shared: \
42423 %{!ibcs: \
42424 %{!static: \
42425 @@ -257,7 +262,7 @@ along with GCC; see the file COPYING3.
42426 #else /* !SPARC_BI_ARCH */
42427
42428 #undef LINK_SPEC
42429 -#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
42430 +#define LINK_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
42431 %{!shared: \
42432 %{!ibcs: \
42433 %{!static: \
42434 --- a/gcc/config/sparc/sol2-bi.h
42435 +++ b/gcc/config/sparc/sol2-bi.h
42436 @@ -172,12 +172,12 @@
42437 %{YP,*} \
42438 %{R*} \
42439 %{compat-bsd: \
42440 - %{!YP,*:%{p|pg:-Y P,/usr/ucblib/sparcv9:/usr/lib/libp/sparcv9:/usr/lib/sparcv9} \
42441 - %{!p:%{!pg:-Y P,/usr/ucblib/sparcv9:/usr/lib/sparcv9}}} \
42442 - -R /usr/ucblib/sparcv9} \
42443 + %{!YP,*:%{p|pg:-Y P,%R/usr/ucblib/sparcv9:%R/usr/lib/libp/sparcv9:%R/usr/lib/sparcv9} \
42444 + %{!p:%{!pg:-Y P,%R/usr/ucblib/sparcv9:%R/usr/lib/sparcv9}}} \
42445 + -R %R/usr/ucblib/sparcv9} \
42446 %{!compat-bsd: \
42447 - %{!YP,*:%{p|pg:-Y P,/usr/lib/libp/sparcv9:/usr/lib/sparcv9} \
42448 - %{!p:%{!pg:-Y P,/usr/lib/sparcv9}}}}"
42449 + %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/sparcv9:%R/usr/lib/sparcv9} \
42450 + %{!p:%{!pg:-Y P,%R/usr/lib/sparcv9}}}}"
42451
42452 #define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE
42453
42454 --- a/gcc/config/sparc/sparc.c
42455 +++ b/gcc/config/sparc/sparc.c
42456 @@ -2371,6 +2371,8 @@ emit_soft_tfmode_cvt (enum rtx_code code
42457 {
42458 case SImode:
42459 func = "_Qp_itoq";
42460 + if (TARGET_ARCH64)
42461 + operands[1] = gen_rtx_SIGN_EXTEND (DImode, operands[1]);
42462 break;
42463 case DImode:
42464 func = "_Qp_xtoq";
42465 @@ -2385,6 +2387,8 @@ emit_soft_tfmode_cvt (enum rtx_code code
42466 {
42467 case SImode:
42468 func = "_Qp_uitoq";
42469 + if (TARGET_ARCH64)
42470 + operands[1] = gen_rtx_ZERO_EXTEND (DImode, operands[1]);
42471 break;
42472 case DImode:
42473 func = "_Qp_uxtoq";
42474 @@ -4623,6 +4627,7 @@ function_arg_slotno (const struct sparc_
42475 {
42476 case MODE_FLOAT:
42477 case MODE_COMPLEX_FLOAT:
42478 + case MODE_VECTOR_INT:
42479 if (TARGET_ARCH64 && TARGET_FPU && named)
42480 {
42481 if (slotno >= SPARC_FP_ARG_MAX)
42482 @@ -6097,7 +6102,7 @@ void
42483 sparc_emit_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison)
42484 {
42485 const char *qpfunc;
42486 - rtx slot0, slot1, result, tem, tem2;
42487 + rtx slot0, slot1, result, tem, tem2, libfunc;
42488 enum machine_mode mode;
42489
42490 switch (comparison)
42491 @@ -6159,7 +6164,8 @@ sparc_emit_float_lib_cmp (rtx x, rtx y,
42492 else
42493 slot1 = y;
42494
42495 - emit_library_call (gen_rtx_SYMBOL_REF (Pmode, qpfunc), LCT_NORMAL,
42496 + libfunc = gen_rtx_SYMBOL_REF (Pmode, qpfunc);
42497 + emit_library_call (libfunc, LCT_NORMAL,
42498 DImode, 2,
42499 XEXP (slot0, 0), Pmode,
42500 XEXP (slot1, 0), Pmode);
42501 @@ -6168,7 +6174,8 @@ sparc_emit_float_lib_cmp (rtx x, rtx y,
42502 }
42503 else
42504 {
42505 - emit_library_call (gen_rtx_SYMBOL_REF (Pmode, qpfunc), LCT_NORMAL,
42506 + libfunc = gen_rtx_SYMBOL_REF (Pmode, qpfunc);
42507 + emit_library_call (libfunc, LCT_NORMAL,
42508 SImode, 2,
42509 x, TFmode, y, TFmode);
42510
42511 @@ -6180,7 +6187,7 @@ sparc_emit_float_lib_cmp (rtx x, rtx y,
42512 register so reload doesn't clobber the value if it needs
42513 the return register for a spill reg. */
42514 result = gen_reg_rtx (mode);
42515 - emit_move_insn (result, hard_libcall_value (mode));
42516 + emit_move_insn (result, hard_libcall_value (mode, libfunc));
42517
42518 switch (comparison)
42519 {
42520 --- a/gcc/config/svr4.h
42521 +++ b/gcc/config/svr4.h
42522 @@ -55,7 +55,8 @@ along with GCC; see the file COPYING3.
42523 && strcmp (STR, "Tdata") && strcmp (STR, "Ttext") \
42524 && strcmp (STR, "Tbss"))
42525
42526 -/* Provide an ASM_SPEC appropriate for svr4. Here we try to support as
42527 +/* Provide an ASM_SPEC appropriate for svr4.
42528 + If we're not using GAS, we try to support as
42529 many of the specialized svr4 assembler options as seems reasonable,
42530 given that there are certain options which we can't (or shouldn't)
42531 support directly due to the fact that they conflict with other options
42532 @@ -74,9 +75,16 @@ along with GCC; see the file COPYING3.
42533 read its stdin.
42534 */
42535
42536 -#undef ASM_SPEC
42537 -#define ASM_SPEC \
42538 +#ifdef USE_GAS
42539 +#define SVR4_ASM_SPEC \
42540 + "%{v:-V} %{Wa,*:%*}"
42541 +#else
42542 +#define SVR4_ASM_SPEC \
42543 "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
42544 +#endif
42545 +
42546 +#undef ASM_SPEC
42547 +#define ASM_SPEC SVR4_ASM_SPEC
42548
42549 #define AS_NEEDS_DASH_FOR_PIPED_INPUT
42550
42551 --- /dev/null
42552 +++ b/gcc/config/t-eglibc
42553 @@ -0,0 +1,25 @@
42554 +# multilibs -*- mode:Makefile -*-
42555 +
42556 +MULTILIB_EXCEPTIONS :=
42557 +MULTILIB_MATCHES :=
42558 +MULTILIB_ALIASES :=
42559 +
42560 +# For all items in EGLIBC_CONFIGS except for the last one
42561 +# do $1. For the last one do $2. The items are separated with ",".
42562 +EGLIBC_AWK = $(shell echo $(EGLIBC_CONFIGS) | $(AWK) \
42563 + '{ \
42564 + N=split ($$0, configs, ","); \
42565 + for (i = 1; i < N; ++i) $1; \
42566 + $2; \
42567 + }')
42568 +
42569 +MULTILIB_OPTIONS := $(call EGLIBC_AWK, \
42570 + printf ("feglibc=%s/", configs[i]), \
42571 + printf ("feglibc=%s\n", configs[i]))
42572 +MULTILIB_DIRNAMES := $(call EGLIBC_AWK, \
42573 + printf ("%s ", configs[i]), \
42574 + printf ("%s\n", configs[i]))
42575 +MULTILIB_OSDIRNAMES := $(call EGLIBC_AWK, \
42576 + printf ("feglibc.%s=!%s ", configs[i], configs[i]), \
42577 + printf ("feglibc.%s=!%s\n", configs[i], configs[i]))
42578 +
42579 --- /dev/null
42580 +++ b/gcc/config/t-sysroot-suffix
42581 @@ -0,0 +1,6 @@
42582 +# Generate SYSROOT_SUFFIX_SPEC from MULTILIB_OSDIRNAMES
42583 +
42584 +sysroot-suffix.h: $(srcdir)/config/print-sysroot-suffix.sh
42585 + $(SHELL) $(srcdir)/config/print-sysroot-suffix.sh \
42586 + "$(MULTILIB_OSDIRNAMES)" "$(MULTILIB_OPTIONS)" \
42587 + "$(MULTILIB_MATCHES)" "$(MULTILIB_ALIASES)" > $@
42588 --- a/gcc/configure
42589 +++ b/gcc/configure
42590 @@ -458,7 +458,7 @@ ac_includes_default="\
42591 # include <unistd.h>
42592 #endif"
42593
42594 -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn cxx_compat_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN ac_ct_AR STRIP ac_ct_STRIP lt_ECHO objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS'
42595 +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical licensedir build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn cxx_compat_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR CONFIGURE_SPECS EGLIBC_CONFIGS onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN ac_ct_AR STRIP ac_ct_STRIP lt_ECHO objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file TM_ENDIAN_CONFIG TM_CPU_CONFIG TM_MULTILIB_CONFIG TM_MULTILIB_EXCEPTIONS_CONFIG extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS'
42596 ac_subst_files='language_hooks'
42597
42598 # Initialize some variables set by options.
42599 @@ -1048,6 +1048,7 @@ Optional Features:
42600 arrange to use setjmp/longjmp exception handling
42601 --enable-secureplt enable -msecure-plt by default for PowerPC
42602 --enable-cld enable -mcld by default for 32bit x86
42603 + --enable-mips-nonpic enable non-PIC ABI by default for MIPS GNU/Linux o32
42604 --disable-win32-registry
42605 disable lookup of installation paths in the
42606 Registry on Windows hosts
42607 @@ -1068,6 +1069,8 @@ Optional Features:
42608 --enable-version-specific-runtime-libs
42609 specify that runtime libraries should be
42610 installed in a compiler-specific directory
42611 + --enable-poison-system-directories
42612 + warn for use of native system header directories
42613
42614 Optional Packages:
42615 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
42616 @@ -1089,6 +1092,9 @@ Optional Packages:
42617 --with-build-sysroot=sysroot
42618 use sysroot as the system root during the build
42619 --with-sysroot=DIR Search for usr/lib, usr/include, et al, within DIR.
42620 + --with-specs=SPECS add SPECS to driver command-line processing
42621 + --with-eglibc-configs=CONFIGS
42622 + build multilibs for these EGLIBC configurations
42623 --with-pkgversion=PKG Use PKG in the version string in place of "GCC"
42624 --with-bugurl=URL Direct users to URL to report a bug
42625 --with-gnu-ld assume the C compiler uses GNU ld default=no
42626 @@ -7367,6 +7373,28 @@ fi;
42627
42628
42629
42630 +
42631 +# Check whether --with-specs or --without-specs was given.
42632 +if test "${with_specs+set}" = set; then
42633 + withval="$with_specs"
42634 + CONFIGURE_SPECS=$withval
42635 +else
42636 + CONFIGURE_SPECS=
42637 +
42638 +fi;
42639 +
42640 +
42641 +
42642 +# Check whether --with-eglibc-configs or --without-eglibc-configs was given.
42643 +if test "${with_eglibc_configs+set}" = set; then
42644 + withval="$with_eglibc_configs"
42645 + EGLIBC_CONFIGS=$withval
42646 +else
42647 + EGLIBC_CONFIGS=
42648 +
42649 +fi;
42650 +
42651 +
42652 # Build with intermodule optimisations
42653 # Check whether --enable-intermodule or --disable-intermodule was given.
42654 if test "${enable_intermodule+set}" = set; then
42655 @@ -12971,7 +12999,7 @@ else
42656 *) realsrcdir=../${srcdir};;
42657 esac
42658 saved_CFLAGS="${CFLAGS}"
42659 - CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
42660 + CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" LDFLAGS="" \
42661 ${realsrcdir}/configure \
42662 --enable-languages=${enable_languages-all} \
42663 --target=$target_alias --host=$build_alias --build=$build_alias
42664 @@ -13119,6 +13147,12 @@ else
42665 enable_cld=no
42666 fi;
42667
42668 +# Check whether --enable-mips-nonpic or --disable-mips-nonpic was given.
42669 +if test "${enable_mips_nonpic+set}" = set; then
42670 + enableval="$enable_mips_nonpic"
42671 +
42672 +fi;
42673 +
42674 # Windows32 Registry support for specifying GCC installation paths.
42675 # Check whether --enable-win32-registry or --disable-win32-registry was given.
42676 if test "${enable_win32_registry+set}" = set; then
42677 @@ -14064,13 +14098,13 @@ if test "${lt_cv_nm_interface+set}" = se
42678 else
42679 lt_cv_nm_interface="BSD nm"
42680 echo "int some_variable = 0;" > conftest.$ac_ext
42681 - (eval echo "\"\$as_me:14067: $ac_compile\"" >&5)
42682 + (eval echo "\"\$as_me:14173: $ac_compile\"" >&5)
42683 (eval "$ac_compile" 2>conftest.err)
42684 cat conftest.err >&5
42685 - (eval echo "\"\$as_me:14070: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
42686 + (eval echo "\"\$as_me:14176: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
42687 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
42688 cat conftest.err >&5
42689 - (eval echo "\"\$as_me:14073: output\"" >&5)
42690 + (eval echo "\"\$as_me:14179: output\"" >&5)
42691 cat conftest.out >&5
42692 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
42693 lt_cv_nm_interface="MS dumpbin"
42694 @@ -15125,7 +15159,7 @@ ia64-*-hpux*)
42695 ;;
42696 *-*-irix6*)
42697 # Find out which ABI we are using.
42698 - echo '#line 15128 "configure"' > conftest.$ac_ext
42699 + echo '#line 15234 "configure"' > conftest.$ac_ext
42700 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
42701 (eval $ac_compile) 2>&5
42702 ac_status=$?
42703 @@ -15745,11 +15779,11 @@ else
42704 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
42705 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
42706 -e 's:$: $lt_compiler_flag:'`
42707 - (eval echo "\"\$as_me:15748: $lt_compile\"" >&5)
42708 + (eval echo "\"\$as_me:15854: $lt_compile\"" >&5)
42709 (eval "$lt_compile" 2>conftest.err)
42710 ac_status=$?
42711 cat conftest.err >&5
42712 - echo "$as_me:15752: \$? = $ac_status" >&5
42713 + echo "$as_me:15858: \$? = $ac_status" >&5
42714 if (exit $ac_status) && test -s "$ac_outfile"; then
42715 # The compiler can only warn and ignore the option if not recognized
42716 # So say no if there are warnings other than the usual output.
42717 @@ -16067,11 +16101,11 @@ else
42718 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
42719 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
42720 -e 's:$: $lt_compiler_flag:'`
42721 - (eval echo "\"\$as_me:16070: $lt_compile\"" >&5)
42722 + (eval echo "\"\$as_me:16176: $lt_compile\"" >&5)
42723 (eval "$lt_compile" 2>conftest.err)
42724 ac_status=$?
42725 cat conftest.err >&5
42726 - echo "$as_me:16074: \$? = $ac_status" >&5
42727 + echo "$as_me:16180: \$? = $ac_status" >&5
42728 if (exit $ac_status) && test -s "$ac_outfile"; then
42729 # The compiler can only warn and ignore the option if not recognized
42730 # So say no if there are warnings other than the usual output.
42731 @@ -16172,11 +16206,11 @@ else
42732 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
42733 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
42734 -e 's:$: $lt_compiler_flag:'`
42735 - (eval echo "\"\$as_me:16175: $lt_compile\"" >&5)
42736 + (eval echo "\"\$as_me:16281: $lt_compile\"" >&5)
42737 (eval "$lt_compile" 2>out/conftest.err)
42738 ac_status=$?
42739 cat out/conftest.err >&5
42740 - echo "$as_me:16179: \$? = $ac_status" >&5
42741 + echo "$as_me:16285: \$? = $ac_status" >&5
42742 if (exit $ac_status) && test -s out/conftest2.$ac_objext
42743 then
42744 # The compiler can only warn and ignore the option if not recognized
42745 @@ -16227,11 +16261,11 @@ else
42746 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
42747 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
42748 -e 's:$: $lt_compiler_flag:'`
42749 - (eval echo "\"\$as_me:16230: $lt_compile\"" >&5)
42750 + (eval echo "\"\$as_me:16336: $lt_compile\"" >&5)
42751 (eval "$lt_compile" 2>out/conftest.err)
42752 ac_status=$?
42753 cat out/conftest.err >&5
42754 - echo "$as_me:16234: \$? = $ac_status" >&5
42755 + echo "$as_me:16340: \$? = $ac_status" >&5
42756 if (exit $ac_status) && test -s out/conftest2.$ac_objext
42757 then
42758 # The compiler can only warn and ignore the option if not recognized
42759 @@ -19024,7 +19058,7 @@ else
42760 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
42761 lt_status=$lt_dlunknown
42762 cat > conftest.$ac_ext <<_LT_EOF
42763 -#line 19027 "configure"
42764 +#line 19133 "configure"
42765 #include "confdefs.h"
42766
42767 #if HAVE_DLFCN_H
42768 @@ -19124,7 +19158,7 @@ else
42769 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
42770 lt_status=$lt_dlunknown
42771 cat > conftest.$ac_ext <<_LT_EOF
42772 -#line 19127 "configure"
42773 +#line 19233 "configure"
42774 #include "confdefs.h"
42775
42776 #if HAVE_DLFCN_H
42777 @@ -20592,6 +20626,22 @@ x:
42778 tls_first_minor=16
42779 tls_as_opt='-32 --fatal-warnings'
42780 ;;
42781 + m68k-*-*)
42782 + conftest_s='
42783 + .section .tdata,"awT",@progbits
42784 +x:
42785 + .word 2
42786 + .text
42787 +foo:
42788 + move.l x@TLSGD(%a5),%a0
42789 + move.l x@TLSLDM(%a5),%a0
42790 + move.l x@TLSLDO(%a5),%a0
42791 + move.l x@TLSIE(%a5),%a0
42792 + move.l x@TLSLE(%a5),%a0'
42793 + tls_first_major=2
42794 + tls_first_minor=19
42795 + tls_as_opt='--fatal-warnings'
42796 + ;;
42797 powerpc-*-*)
42798 conftest_s='
42799 .section ".tdata","awT",@progbits
42800 @@ -22098,7 +22148,8 @@ esac
42801 case "$target" in
42802 i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
42803 | x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-* \
42804 - | xstormy16*-*-* | cris-*-* | xtensa-*-* | bfin-*-* | score*-*-* | spu-*-*)
42805 + | xstormy16*-*-* | cris-*-* | xtensa-*-* | bfin-*-* | score*-*-* \
42806 + | spu-*-* | fido*-*-*)
42807 insn="nop"
42808 ;;
42809 ia64*-*-* | s390*-*-*)
42810 @@ -23088,6 +23139,21 @@ fi
42811 fi;
42812
42813
42814 +# Check whether --enable-poison-system-directories or --disable-poison-system-directories was given.
42815 +if test "${enable_poison_system_directories+set}" = set; then
42816 + enableval="$enable_poison_system_directories"
42817 +
42818 +else
42819 + enable_poison_system_directories=no
42820 +fi;
42821 +if test "x${enable_poison_system_directories}" = "xyes"; then
42822 +
42823 +cat >>confdefs.h <<\_ACEOF
42824 +#define ENABLE_POISON_SYSTEM_DIRECTORIES 1
42825 +_ACEOF
42826 +
42827 +fi
42828 +
42829
42830 # Check whether --with-datarootdir or --without-datarootdir was given.
42831 if test "${with_datarootdir+set}" = set; then
42832 @@ -23175,6 +23241,10 @@ fi;
42833
42834
42835
42836 +
42837 +
42838 +
42839 +
42840 # Echo link setup.
42841 if test x${build} = x${host} ; then
42842 if test x${host} = x${target} ; then
42843 @@ -23844,6 +23914,7 @@ s,@target_cpu@,$target_cpu,;t t
42844 s,@target_vendor@,$target_vendor,;t t
42845 s,@target_os@,$target_os,;t t
42846 s,@target_noncanonical@,$target_noncanonical,;t t
42847 +s,@licensedir@,$licensedir,;t t
42848 s,@build_libsubdir@,$build_libsubdir,;t t
42849 s,@build_subdir@,$build_subdir,;t t
42850 s,@host_subdir@,$host_subdir,;t t
42851 @@ -23877,6 +23948,8 @@ s,@enable_shared@,$enable_shared,;t t
42852 s,@TARGET_SYSTEM_ROOT@,$TARGET_SYSTEM_ROOT,;t t
42853 s,@TARGET_SYSTEM_ROOT_DEFINE@,$TARGET_SYSTEM_ROOT_DEFINE,;t t
42854 s,@CROSS_SYSTEM_HEADER_DIR@,$CROSS_SYSTEM_HEADER_DIR,;t t
42855 +s,@CONFIGURE_SPECS@,$CONFIGURE_SPECS,;t t
42856 +s,@EGLIBC_CONFIGS@,$EGLIBC_CONFIGS,;t t
42857 s,@onestep@,$onestep,;t t
42858 s,@PKGVERSION@,$PKGVERSION,;t t
42859 s,@REPORT_BUGS_TO@,$REPORT_BUGS_TO,;t t
42860 @@ -23983,6 +24056,10 @@ s,@check_languages@,$check_languages,;t
42861 s,@cpp_install_dir@,$cpp_install_dir,;t t
42862 s,@xmake_file@,$xmake_file,;t t
42863 s,@tmake_file@,$tmake_file,;t t
42864 +s,@TM_ENDIAN_CONFIG@,$TM_ENDIAN_CONFIG,;t t
42865 +s,@TM_CPU_CONFIG@,$TM_CPU_CONFIG,;t t
42866 +s,@TM_MULTILIB_CONFIG@,$TM_MULTILIB_CONFIG,;t t
42867 +s,@TM_MULTILIB_EXCEPTIONS_CONFIG@,$TM_MULTILIB_EXCEPTIONS_CONFIG,;t t
42868 s,@extra_gcc_objs@,$extra_gcc_objs,;t t
42869 s,@extra_headers_list@,$extra_headers_list,;t t
42870 s,@extra_objs@,$extra_objs,;t t
42871 --- a/gcc/configure.ac
42872 +++ b/gcc/configure.ac
42873 @@ -767,6 +767,22 @@ AC_SUBST(TARGET_SYSTEM_ROOT)
42874 AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
42875 AC_SUBST(CROSS_SYSTEM_HEADER_DIR)
42876
42877 +AC_ARG_WITH(specs,
42878 + [AS_HELP_STRING([--with-specs=SPECS],
42879 + [add SPECS to driver command-line processing])],
42880 + [CONFIGURE_SPECS=$withval],
42881 + [CONFIGURE_SPECS=]
42882 +)
42883 +AC_SUBST(CONFIGURE_SPECS)
42884 +
42885 +AC_ARG_WITH(eglibc-configs,
42886 + [AS_HELP_STRING([--with-eglibc-configs=CONFIGS],
42887 + [build multilibs for these EGLIBC configurations])],
42888 + [EGLIBC_CONFIGS=$withval],
42889 + [EGLIBC_CONFIGS=]
42890 +)
42891 +AC_SUBST(EGLIBC_CONFIGS)
42892 +
42893 # Build with intermodule optimisations
42894 AC_ARG_ENABLE(intermodule,
42895 [ --enable-intermodule build the compiler in one step],
42896 @@ -1479,7 +1495,7 @@ else
42897 *) realsrcdir=../${srcdir};;
42898 esac
42899 saved_CFLAGS="${CFLAGS}"
42900 - CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
42901 + CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" LDFLAGS="" \
42902 ${realsrcdir}/configure \
42903 --enable-languages=${enable_languages-all} \
42904 --target=$target_alias --host=$build_alias --build=$build_alias
42905 @@ -1552,6 +1568,10 @@ AC_ARG_ENABLE(cld,
42906 [ --enable-cld enable -mcld by default for 32bit x86], [],
42907 [enable_cld=no])
42908
42909 +AC_ARG_ENABLE(mips-nonpic,
42910 +[ --enable-mips-nonpic enable non-PIC ABI by default for MIPS GNU/Linux o32],
42911 +[], [])
42912 +
42913 # Windows32 Registry support for specifying GCC installation paths.
42914 AC_ARG_ENABLE(win32-registry,
42915 [ --disable-win32-registry
42916 @@ -2455,6 +2475,22 @@ x:
42917 tls_first_minor=16
42918 tls_as_opt='-32 --fatal-warnings'
42919 ;;
42920 + m68k-*-*)
42921 + conftest_s='
42922 + .section .tdata,"awT",@progbits
42923 +x:
42924 + .word 2
42925 + .text
42926 +foo:
42927 + move.l x@TLSGD(%a5),%a0
42928 + move.l x@TLSLDM(%a5),%a0
42929 + move.l x@TLSLDO(%a5),%a0
42930 + move.l x@TLSIE(%a5),%a0
42931 + move.l x@TLSLE(%a5),%a0'
42932 + tls_first_major=2
42933 + tls_first_minor=19
42934 + tls_as_opt='--fatal-warnings'
42935 + ;;
42936 powerpc-*-*)
42937 conftest_s='
42938 .section ".tdata","awT",@progbits
42939 @@ -3077,7 +3113,8 @@ esac
42940 case "$target" in
42941 i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
42942 | x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-* \
42943 - | xstormy16*-*-* | cris-*-* | xtensa-*-* | bfin-*-* | score*-*-* | spu-*-*)
42944 + | xstormy16*-*-* | cris-*-* | xtensa-*-* | bfin-*-* | score*-*-* \
42945 + | spu-*-* | fido*-*-*)
42946 insn="nop"
42947 ;;
42948 ia64*-*-* | s390*-*-*)
42949 @@ -3731,6 +3768,16 @@ else
42950 fi)
42951 AC_SUBST(slibdir)
42952
42953 +AC_ARG_ENABLE([poison-system-directories],
42954 + AS_HELP_STRING([--enable-poison-system-directories],
42955 + [warn for use of native system header directories]),,
42956 + [enable_poison_system_directories=no])
42957 +if test "x${enable_poison_system_directories}" = "xyes"; then
42958 + AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
42959 + [1],
42960 + [Define to warn for use of native system header directories])
42961 +fi
42962 +
42963 AC_ARG_WITH(datarootdir,
42964 [ --with-datarootdir=DIR Use DIR as the data root [[PREFIX/share]]],
42965 datarootdir="\${prefix}/$with_datarootdir",
42966 @@ -3768,6 +3815,10 @@ AC_SUBST(check_languages)
42967 AC_SUBST(cpp_install_dir)
42968 AC_SUBST(xmake_file)
42969 AC_SUBST(tmake_file)
42970 +AC_SUBST(TM_ENDIAN_CONFIG)
42971 +AC_SUBST(TM_CPU_CONFIG)
42972 +AC_SUBST(TM_MULTILIB_CONFIG)
42973 +AC_SUBST(TM_MULTILIB_EXCEPTIONS_CONFIG)
42974 AC_SUBST(extra_gcc_objs)
42975 AC_SUBST(extra_headers_list)
42976 AC_SUBST(extra_objs)
42977 --- a/gcc/cp/class.c
42978 +++ b/gcc/cp/class.c
42979 @@ -6030,7 +6030,7 @@ resolve_address_of_overloaded_function (
42980 if (flags & tf_error)
42981 {
42982 error ("no matches converting function %qD to type %q#T",
42983 - DECL_NAME (OVL_FUNCTION (overload)),
42984 + DECL_NAME (OVL_CURRENT (overload)),
42985 target_type);
42986
42987 /* print_candidates expects a chain with the functions in
42988 @@ -6179,13 +6179,8 @@ instantiate_type (tree lhstype, tree rhs
42989 dependent on overload resolution. */
42990 gcc_assert (TREE_CODE (rhs) == ADDR_EXPR
42991 || TREE_CODE (rhs) == COMPONENT_REF
42992 - || TREE_CODE (rhs) == COMPOUND_EXPR
42993 - || really_overloaded_fn (rhs));
42994 -
42995 - /* We don't overwrite rhs if it is an overloaded function.
42996 - Copying it would destroy the tree link. */
42997 - if (TREE_CODE (rhs) != OVERLOAD)
42998 - rhs = copy_node (rhs);
42999 + || really_overloaded_fn (rhs)
43000 + || (flag_ms_extensions && TREE_CODE (rhs) == FUNCTION_DECL));
43001
43002 /* This should really only be used when attempting to distinguish
43003 what sort of a pointer to function we have. For now, any
43004 @@ -6237,19 +6232,6 @@ instantiate_type (tree lhstype, tree rhs
43005 /*explicit_targs=*/NULL_TREE,
43006 access_path);
43007
43008 - case COMPOUND_EXPR:
43009 - TREE_OPERAND (rhs, 0)
43010 - = instantiate_type (lhstype, TREE_OPERAND (rhs, 0), flags);
43011 - if (TREE_OPERAND (rhs, 0) == error_mark_node)
43012 - return error_mark_node;
43013 - TREE_OPERAND (rhs, 1)
43014 - = instantiate_type (lhstype, TREE_OPERAND (rhs, 1), flags);
43015 - if (TREE_OPERAND (rhs, 1) == error_mark_node)
43016 - return error_mark_node;
43017 -
43018 - TREE_TYPE (rhs) = lhstype;
43019 - return rhs;
43020 -
43021 case ADDR_EXPR:
43022 {
43023 if (PTRMEM_OK_P (rhs))
43024 --- a/gcc/cp/cvt.c
43025 +++ b/gcc/cp/cvt.c
43026 @@ -580,6 +580,7 @@ ocp_convert (tree type, tree expr, int c
43027 tree e = expr;
43028 enum tree_code code = TREE_CODE (type);
43029 const char *invalid_conv_diag;
43030 + tree e1;
43031
43032 if (error_operand_p (e) || type == error_mark_node)
43033 return error_mark_node;
43034 @@ -628,6 +629,9 @@ ocp_convert (tree type, tree expr, int c
43035 }
43036 }
43037
43038 + if (e1 = targetm.convert_to_type (type, e))
43039 + return e1;
43040 +
43041 if (code == VOID_TYPE && (convtype & CONV_STATIC))
43042 {
43043 e = convert_to_void (e, /*implicit=*/NULL);
43044 @@ -1190,11 +1194,18 @@ build_expr_type_conversion (int desires,
43045 tree
43046 type_promotes_to (tree type)
43047 {
43048 + tree promoted_type;
43049 +
43050 if (type == error_mark_node)
43051 return error_mark_node;
43052
43053 type = TYPE_MAIN_VARIANT (type);
43054
43055 + /* Check for promotions of target-defined types first. */
43056 + promoted_type = targetm.promoted_type (type);
43057 + if (promoted_type)
43058 + return promoted_type;
43059 +
43060 /* bool always promotes to int (not unsigned), even if it's the same
43061 size. */
43062 if (type == boolean_type_node)
43063 --- a/gcc/cp/decl.c
43064 +++ b/gcc/cp/decl.c
43065 @@ -4379,7 +4379,7 @@ maybe_deduce_size_from_array_init (tree
43066
43067 cp_apply_type_quals_to_decl (cp_type_quals (TREE_TYPE (decl)), decl);
43068
43069 - layout_decl (decl, 0);
43070 + relayout_decl (decl);
43071 }
43072 }
43073
43074 @@ -7413,6 +7413,7 @@ grokdeclarator (const cp_declarator *dec
43075 bool type_was_error_mark_node = false;
43076 bool parameter_pack_p = declarator? declarator->parameter_pack_p : false;
43077 bool set_no_warning = false;
43078 + const char *errmsg;
43079
43080 signed_p = declspecs->specs[(int)ds_signed];
43081 unsigned_p = declspecs->specs[(int)ds_unsigned];
43082 @@ -8092,6 +8093,12 @@ grokdeclarator (const cp_declarator *dec
43083 error ("%qs declared as function returning an array", name);
43084 type = integer_type_node;
43085 }
43086 + errmsg = targetm.invalid_return_type (type);
43087 + if (errmsg)
43088 + {
43089 + error (errmsg);
43090 + type = integer_type_node;
43091 + }
43092
43093 /* Pick up type qualifiers which should be applied to `this'. */
43094 memfn_quals = declarator->u.function.qualifiers;
43095 @@ -8585,8 +8592,14 @@ grokdeclarator (const cp_declarator *dec
43096
43097 /* Replace the anonymous name with the real name everywhere. */
43098 for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
43099 - if (TYPE_NAME (t) == oldname)
43100 - TYPE_NAME (t) = decl;
43101 + {
43102 + if (TYPE_NAME (t) == oldname)
43103 + {
43104 + debug_hooks->set_name (t, decl);
43105 + TYPE_NAME (t) = decl;
43106 + }
43107 + }
43108 +
43109
43110 if (TYPE_LANG_SPECIFIC (type))
43111 TYPE_WAS_ANONYMOUS (type) = 1;
43112 @@ -9378,6 +9391,7 @@ grokparms (cp_parameter_declarator *firs
43113 tree init = parm->default_argument;
43114 tree attrs;
43115 tree decl;
43116 + const char *errmsg;
43117
43118 if (parm == no_parameters)
43119 break;
43120 @@ -9418,6 +9432,14 @@ grokparms (cp_parameter_declarator *firs
43121 init = NULL_TREE;
43122 }
43123
43124 + if (type != error_mark_node
43125 + && (errmsg = targetm.invalid_parameter_type (type)))
43126 + {
43127 + error (errmsg);
43128 + type = error_mark_node;
43129 + TREE_TYPE (decl) = error_mark_node;
43130 + }
43131 +
43132 if (type != error_mark_node)
43133 {
43134 /* Top-level qualifiers on the parameters are
43135 --- a/gcc/cp/decl2.c
43136 +++ b/gcc/cp/decl2.c
43137 @@ -1682,6 +1682,10 @@ decl_needed_p (tree decl)
43138 || (DECL_ASSEMBLER_NAME_SET_P (decl)
43139 && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
43140 return true;
43141 + /* Functions marked "dllexport" must be emitted so that they are
43142 + visible to other DLLs. */
43143 + if (lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)))
43144 + return true;
43145 /* Otherwise, DECL does not need to be emitted -- yet. A subsequent
43146 reference to DECL might cause it to be emitted later. */
43147 return false;
43148 @@ -1963,6 +1967,14 @@ determine_visibility (tree decl)
43149 /* tinfo visibility is based on the type it's for. */
43150 constrain_visibility
43151 (decl, type_visibility (TREE_TYPE (DECL_NAME (decl))));
43152 +
43153 + /* Give the target a chance to override the visibility associated
43154 + with DECL. */
43155 + if (TREE_PUBLIC (decl)
43156 + && !DECL_REALLY_EXTERN (decl)
43157 + && CLASS_TYPE_P (TREE_TYPE (DECL_NAME (decl)))
43158 + && !CLASSTYPE_VISIBILITY_SPECIFIED (TREE_TYPE (DECL_NAME (decl))))
43159 + targetm.cxx.determine_class_data_visibility (decl);
43160 }
43161 else if (use_template)
43162 /* Template instantiations and specializations get visibility based
43163 --- a/gcc/cp/mangle.c
43164 +++ b/gcc/cp/mangle.c
43165 @@ -1593,6 +1593,13 @@ write_type (tree type)
43166 if (target_mangling)
43167 {
43168 write_string (target_mangling);
43169 + /* Add substitutions for types other than fundamental
43170 + types. */
43171 + if (TREE_CODE (type) != VOID_TYPE
43172 + && TREE_CODE (type) != INTEGER_TYPE
43173 + && TREE_CODE (type) != REAL_TYPE
43174 + && TREE_CODE (type) != BOOLEAN_TYPE)
43175 + add_substitution (type);
43176 return;
43177 }
43178
43179 --- a/gcc/cp/semantics.c
43180 +++ b/gcc/cp/semantics.c
43181 @@ -3218,8 +3218,10 @@ expand_or_defer_fn (tree fn)
43182
43183 /* If the user wants us to keep all inline functions, then mark
43184 this function as needed so that finish_file will make sure to
43185 - output it later. */
43186 - if (flag_keep_inline_functions && DECL_DECLARED_INLINE_P (fn))
43187 + output it later. Similarly, all dllexport'd functions must
43188 + be emitted; there may be callers in other DLLs. */
43189 + if ((flag_keep_inline_functions && DECL_DECLARED_INLINE_P (fn))
43190 + || lookup_attribute ("dllexport", DECL_ATTRIBUTES (fn)))
43191 mark_needed (fn);
43192 }
43193
43194 --- a/gcc/cp/typeck.c
43195 +++ b/gcc/cp/typeck.c
43196 @@ -1627,10 +1627,14 @@ decay_conversion (tree exp)
43197 tree
43198 default_conversion (tree exp)
43199 {
43200 + /* Check for target-specific promotions. */
43201 + tree promoted_type = targetm.promoted_type (TREE_TYPE (exp));
43202 + if (promoted_type)
43203 + exp = cp_convert (promoted_type, exp);
43204 /* Perform the integral promotions first so that bitfield
43205 expressions (which may promote to "int", even if the bitfield is
43206 declared "unsigned") are promoted correctly. */
43207 - if (INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (exp)))
43208 + else if (INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (exp)))
43209 exp = perform_integral_promotions (exp);
43210 /* Perform the other conversions. */
43211 exp = decay_conversion (exp);
43212 @@ -4837,6 +4841,12 @@ build_compound_expr (tree lhs, tree rhs)
43213 return rhs;
43214 }
43215
43216 + if (type_unknown_p (rhs))
43217 + {
43218 + error ("no context to resolve type of %qE", rhs);
43219 + return error_mark_node;
43220 + }
43221 +
43222 return build2 (COMPOUND_EXPR, TREE_TYPE (rhs), lhs, rhs);
43223 }
43224
43225 @@ -6814,6 +6824,7 @@ static int
43226 comp_ptr_ttypes_real (tree to, tree from, int constp)
43227 {
43228 bool to_more_cv_qualified = false;
43229 + bool is_opaque_pointer = false;
43230
43231 for (; ; to = TREE_TYPE (to), from = TREE_TYPE (from))
43232 {
43233 @@ -6848,9 +6859,13 @@ comp_ptr_ttypes_real (tree to, tree from
43234 constp &= TYPE_READONLY (to);
43235 }
43236
43237 + if (TREE_CODE (to) == VECTOR_TYPE)
43238 + is_opaque_pointer = vector_targets_convertible_p (to, from);
43239 +
43240 if (TREE_CODE (to) != POINTER_TYPE && !TYPE_PTRMEM_P (to))
43241 return ((constp >= 0 || to_more_cv_qualified)
43242 - && same_type_ignoring_top_level_qualifiers_p (to, from));
43243 + && (is_opaque_pointer
43244 + || same_type_ignoring_top_level_qualifiers_p (to, from)));
43245 }
43246 }
43247
43248 @@ -6911,6 +6926,8 @@ ptr_reasonably_similar (const_tree to, c
43249 bool
43250 comp_ptr_ttypes_const (tree to, tree from)
43251 {
43252 + bool is_opaque_pointer = false;
43253 +
43254 for (; ; to = TREE_TYPE (to), from = TREE_TYPE (from))
43255 {
43256 if (TREE_CODE (to) != TREE_CODE (from))
43257 @@ -6921,8 +6938,12 @@ comp_ptr_ttypes_const (tree to, tree fro
43258 TYPE_OFFSET_BASETYPE (to)))
43259 continue;
43260
43261 + if (TREE_CODE (to) == VECTOR_TYPE)
43262 + is_opaque_pointer = vector_targets_convertible_p (to, from);
43263 +
43264 if (TREE_CODE (to) != POINTER_TYPE)
43265 - return same_type_ignoring_top_level_qualifiers_p (to, from);
43266 + return (is_opaque_pointer
43267 + || same_type_ignoring_top_level_qualifiers_p (to, from));
43268 }
43269 }
43270
43271 --- a/gcc/cse.c
43272 +++ b/gcc/cse.c
43273 @@ -5776,6 +5776,11 @@ cse_process_notes_1 (rtx x, rtx object,
43274 validate_change (object, &XEXP (x, i),
43275 cse_process_notes (XEXP (x, i), object, changed), 0);
43276
43277 + /* Rebuild a PLUS expression in canonical form if the first operand
43278 + ends up as a constant. */
43279 + if (code == PLUS && GET_CODE (XEXP (x, 0)) == CONST_INT)
43280 + return plus_constant (XEXP(x, 1), INTVAL (XEXP (x, 0)));
43281 +
43282 return x;
43283 }
43284
43285 --- a/gcc/dbxout.c
43286 +++ b/gcc/dbxout.c
43287 @@ -373,6 +373,7 @@ const struct gcc_debug_hooks dbx_debug_h
43288 dbxout_handle_pch, /* handle_pch */
43289 debug_nothing_rtx, /* var_location */
43290 debug_nothing_void, /* switch_text_section */
43291 + debug_nothing_tree_tree, /* set_name */
43292 0 /* start_end_main_source_file */
43293 };
43294 #endif /* DBX_DEBUGGING_INFO */
43295 --- a/gcc/debug.c
43296 +++ b/gcc/debug.c
43297 @@ -49,6 +49,7 @@ const struct gcc_debug_hooks do_nothing_
43298 debug_nothing_int, /* handle_pch */
43299 debug_nothing_rtx, /* var_location */
43300 debug_nothing_void, /* switch_text_section */
43301 + debug_nothing_tree_tree, /* set_name */
43302 0 /* start_end_main_source_file */
43303 };
43304
43305 --- a/gcc/debug.h
43306 +++ b/gcc/debug.h
43307 @@ -124,6 +124,8 @@ struct gcc_debug_hooks
43308 text sections. */
43309 void (* switch_text_section) (void);
43310
43311 + void (* set_name) (tree, tree);
43312 +
43313 /* This is 1 if the debug writer wants to see start and end commands for the
43314 main source files, and 0 otherwise. */
43315 int start_end_main_source_file;
43316 --- a/gcc/doc/extend.texi
43317 +++ b/gcc/doc/extend.texi
43318 @@ -28,10 +28,10 @@ extensions, accepted by GCC in C89 mode
43319 * Local Labels:: Labels local to a block.
43320 * Labels as Values:: Getting pointers to labels, and computed gotos.
43321 * Nested Functions:: As in Algol and Pascal, lexical scoping of functions.
43322 -* Constructing Calls:: Dispatching a call to another function.
43323 +* Constructing Calls:: Dispatching a call to another function.
43324 * Typeof:: @code{typeof}: referring to the type of an expression.
43325 * Conditionals:: Omitting the middle operand of a @samp{?:} expression.
43326 -* Long Long:: Double-word integers---@code{long long int}.
43327 +* Long Long:: Double-word integers---@code{long long int}.
43328 * Complex:: Data types for complex numbers.
43329 * Floating Types:: Additional Floating Types.
43330 * Decimal Float:: Decimal Floating Types.
43331 @@ -40,41 +40,41 @@ extensions, accepted by GCC in C89 mode
43332 * Zero Length:: Zero-length arrays.
43333 * Variable Length:: Arrays whose length is computed at run time.
43334 * Empty Structures:: Structures with no members.
43335 -* Variadic Macros:: Macros with a variable number of arguments.
43336 +* Variadic Macros:: Macros with a variable number of arguments.
43337 * Escaped Newlines:: Slightly looser rules for escaped newlines.
43338 * Subscripting:: Any array can be subscripted, even if not an lvalue.
43339 * Pointer Arith:: Arithmetic on @code{void}-pointers and function pointers.
43340 * Initializers:: Non-constant initializers.
43341 * Compound Literals:: Compound literals give structures, unions
43342 - or arrays as values.
43343 -* Designated Inits:: Labeling elements of initializers.
43344 + or arrays as values.
43345 +* Designated Inits:: Labeling elements of initializers.
43346 * Cast to Union:: Casting to union type from any member of the union.
43347 -* Case Ranges:: `case 1 ... 9' and such.
43348 -* Mixed Declarations:: Mixing declarations and code.
43349 +* Case Ranges:: `case 1 ... 9' and such.
43350 +* Mixed Declarations:: Mixing declarations and code.
43351 * Function Attributes:: Declaring that functions have no side effects,
43352 - or that they can never return.
43353 + or that they can never return.
43354 * Attribute Syntax:: Formal syntax for attributes.
43355 * Function Prototypes:: Prototype declarations and old-style definitions.
43356 * C++ Comments:: C++ comments are recognized.
43357 * Dollar Signs:: Dollar sign is allowed in identifiers.
43358 * Character Escapes:: @samp{\e} stands for the character @key{ESC}.
43359 -* Variable Attributes:: Specifying attributes of variables.
43360 -* Type Attributes:: Specifying attributes of types.
43361 +* Variable Attributes:: Specifying attributes of variables.
43362 +* Type Attributes:: Specifying attributes of types.
43363 * Alignment:: Inquiring about the alignment of a type or variable.
43364 * Inline:: Defining inline functions (as fast as macros).
43365 * Extended Asm:: Assembler instructions with C expressions as operands.
43366 - (With them you can define ``built-in'' functions.)
43367 + (With them you can define ``built-in'' functions.)
43368 * Constraints:: Constraints for asm operands
43369 * Asm Labels:: Specifying the assembler name to use for a C symbol.
43370 * Explicit Reg Vars:: Defining variables residing in specified registers.
43371 * Alternate Keywords:: @code{__const__}, @code{__asm__}, etc., for header files.
43372 * Incomplete Enums:: @code{enum foo;}, with details to follow.
43373 -* Function Names:: Printable strings which are the name of the current
43374 - function.
43375 +* Function Names:: Printable strings which are the name of the current
43376 + function.
43377 * Return Address:: Getting the return or frame address of a function.
43378 * Vector Extensions:: Using vector instructions through built-in functions.
43379 * Offsetof:: Special syntax for implementing @code{offsetof}.
43380 -* Atomic Builtins:: Built-in functions for atomic memory access.
43381 +* Atomic Builtins:: Built-in functions for atomic memory access.
43382 * Object Size Checking:: Built-in functions for limited buffer overflow
43383 checking.
43384 * Other Builtins:: Other built-in functions.
43385 @@ -2486,7 +2486,13 @@ defined by shared libraries.
43386 @cindex function without a prologue/epilogue code
43387 Use this attribute on the ARM, AVR, IP2K and SPU ports to indicate that
43388 the specified function does not need prologue/epilogue sequences generated by
43389 -the compiler. It is up to the programmer to provide these sequences.
43390 +the compiler. It is up to the programmer to provide these sequences. The
43391 +only statements that can be safely included in naked functions are
43392 +@code{asm} statements that do not have operands. All other statements,
43393 +including declarations of local variables, @code{if} statements, and so
43394 +forth, should be avoided. Naked functions should be used to implement the
43395 +body of an assembly function, while allowing the compiler to construct
43396 +the requisite function declaration for the assembler.
43397
43398 @item near
43399 @cindex functions which do not handle memory bank switching on 68HC11/68HC12
43400 @@ -2539,7 +2545,7 @@ be non-null pointers. For instance, the
43401 @smallexample
43402 extern void *
43403 my_memcpy (void *dest, const void *src, size_t len)
43404 - __attribute__((nonnull (1, 2)));
43405 + __attribute__((nonnull (1, 2)));
43406 @end smallexample
43407
43408 @noindent
43409 @@ -2557,7 +2563,7 @@ following declaration is equivalent to t
43410 @smallexample
43411 extern void *
43412 my_memcpy (void *dest, const void *src, size_t len)
43413 - __attribute__((nonnull));
43414 + __attribute__((nonnull));
43415 @end smallexample
43416
43417 @item noreturn
43418 @@ -3710,13 +3716,13 @@ targets. You can use @code{__declspec (
43419 compilers.
43420
43421 @item weak
43422 -The @code{weak} attribute is described in @xref{Function Attributes}.
43423 +The @code{weak} attribute is described in @ref{Function Attributes}.
43424
43425 @item dllimport
43426 -The @code{dllimport} attribute is described in @xref{Function Attributes}.
43427 +The @code{dllimport} attribute is described in @ref{Function Attributes}.
43428
43429 @item dllexport
43430 -The @code{dllexport} attribute is described in @xref{Function Attributes}.
43431 +The @code{dllexport} attribute is described in @ref{Function Attributes}.
43432
43433 @end table
43434
43435 @@ -3897,21 +3903,21 @@ Three attributes currently are defined f
43436 @code{altivec}, @code{ms_struct} and @code{gcc_struct}.
43437
43438 For full documentation of the struct attributes please see the
43439 -documentation in the @xref{i386 Variable Attributes}, section.
43440 +documentation in @ref{i386 Variable Attributes}.
43441
43442 For documentation of @code{altivec} attribute please see the
43443 -documentation in the @xref{PowerPC Type Attributes}, section.
43444 +documentation in @ref{PowerPC Type Attributes}.
43445
43446 @subsection SPU Variable Attributes
43447
43448 The SPU supports the @code{spu_vector} attribute for variables. For
43449 -documentation of this attribute please see the documentation in the
43450 -@xref{SPU Type Attributes}, section.
43451 +documentation of this attribute please see the documentation in
43452 +@ref{SPU Type Attributes}.
43453
43454 @subsection Xstormy16 Variable Attributes
43455
43456 One attribute is currently defined for xstormy16 configurations:
43457 -@code{below100}
43458 +@code{below100}.
43459
43460 @table @code
43461 @item below100
43462 @@ -4231,6 +4237,8 @@ and caught in another, the class must ha
43463 Otherwise the two shared objects will be unable to use the same
43464 typeinfo node and exception handling will break.
43465
43466 +@end table
43467 +
43468 @subsection ARM Type Attributes
43469
43470 On those ARM targets that support @code{dllimport} (such as Symbian
43471 @@ -4258,7 +4266,9 @@ most Symbian OS code uses @code{__declsp
43472 @subsection i386 Type Attributes
43473
43474 Two attributes are currently defined for i386 configurations:
43475 -@code{ms_struct} and @code{gcc_struct}
43476 +@code{ms_struct} and @code{gcc_struct}.
43477 +
43478 +@table @code
43479
43480 @item ms_struct
43481 @itemx gcc_struct
43482 @@ -4286,8 +4296,8 @@ packed))}.
43483 Three attributes currently are defined for PowerPC configurations:
43484 @code{altivec}, @code{ms_struct} and @code{gcc_struct}.
43485
43486 -For full documentation of the struct attributes please see the
43487 -documentation in the @xref{i386 Type Attributes}, section.
43488 +For full documentation of the @code{ms_struct} and @code{gcc_struct}
43489 +attributes please see the documentation in @ref{i386 Type Attributes}.
43490
43491 The @code{altivec} attribute allows one to declare AltiVec vector data
43492 types supported by the AltiVec Programming Interface Manual. The
43493 @@ -5231,7 +5241,6 @@ GCC provides three magic variables which
43494 function, as a string. The first of these is @code{__func__}, which
43495 is part of the C99 standard:
43496
43497 -@display
43498 The identifier @code{__func__} is implicitly declared by the translator
43499 as if, immediately following the opening brace of each function
43500 definition, the declaration
43501 @@ -5240,9 +5249,9 @@ definition, the declaration
43502 static const char __func__[] = "function-name";
43503 @end smallexample
43504
43505 +@noindent
43506 appeared, where function-name is the name of the lexically-enclosing
43507 function. This name is the unadorned name of the function.
43508 -@end display
43509
43510 @code{__FUNCTION__} is another name for @code{__func__}. Older
43511 versions of GCC recognize only this name. However, it is not
43512 @@ -5451,12 +5460,12 @@ the @code{offsetof} macro.
43513
43514 @smallexample
43515 primary:
43516 - "__builtin_offsetof" "(" @code{typename} "," offsetof_member_designator ")"
43517 + "__builtin_offsetof" "(" @code{typename} "," offsetof_member_designator ")"
43518
43519 offsetof_member_designator:
43520 - @code{identifier}
43521 - | offsetof_member_designator "." @code{identifier}
43522 - | offsetof_member_designator "[" @code{expr} "]"
43523 + @code{identifier}
43524 + | offsetof_member_designator "." @code{identifier}
43525 + | offsetof_member_designator "[" @code{expr} "]"
43526 @end smallexample
43527
43528 This extension is sufficient such that
43529 @@ -5649,7 +5658,7 @@ assert (__builtin_object_size (p, 0) ==
43530 assert (__builtin_object_size (p, 1) == sizeof (var.buf1) - 1);
43531 /* The object q points to is var. */
43532 assert (__builtin_object_size (q, 0)
43533 - == (char *) (&var + 1) - (char *) &var.b);
43534 + == (char *) (&var + 1) - (char *) &var.b);
43535 /* The subobject q points to is var.b. */
43536 assert (__builtin_object_size (q, 1) == sizeof (var.b));
43537 @end smallexample
43538 @@ -5701,11 +5710,11 @@ There are also checking built-in functio
43539 @smallexample
43540 int __builtin___sprintf_chk (char *s, int flag, size_t os, const char *fmt, ...);
43541 int __builtin___snprintf_chk (char *s, size_t maxlen, int flag, size_t os,
43542 - const char *fmt, ...);
43543 + const char *fmt, ...);
43544 int __builtin___vsprintf_chk (char *s, int flag, size_t os, const char *fmt,
43545 - va_list ap);
43546 + va_list ap);
43547 int __builtin___vsnprintf_chk (char *s, size_t maxlen, int flag, size_t os,
43548 - const char *fmt, va_list ap);
43549 + const char *fmt, va_list ap);
43550 @end smallexample
43551
43552 The added @var{flag} argument is passed unchanged to @code{__sprintf_chk}
43553 @@ -11518,7 +11527,7 @@ test specifically for GNU C++ (@pxref{Co
43554 Predefined Macros,cpp,The GNU C Preprocessor}).
43555
43556 @menu
43557 -* Volatiles:: What constitutes an access to a volatile object.
43558 +* Volatiles:: What constitutes an access to a volatile object.
43559 * Restricted Pointers:: C99 restricted pointers and references.
43560 * Vague Linkage:: Where G++ puts inlines, vtables and such.
43561 * C++ Interface:: You can use a single C++ header file for both
43562 @@ -12039,7 +12048,7 @@ interface table mechanism, instead of re
43563
43564 @end table
43565
43566 -See also @xref{Namespace Association}.
43567 +See also @ref{Namespace Association}.
43568
43569 @node Namespace Association
43570 @section Namespace Association
43571 @@ -12266,7 +12275,7 @@ should work just fine for standard-confo
43572 Previously it was possible to use an empty prototype parameter list to
43573 indicate an unspecified number of parameters (like C), rather than no
43574 parameters, as C++ demands. This feature has been removed, except where
43575 -it is required for backwards compatibility @xref{Backwards Compatibility}.
43576 +it is required for backwards compatibility. @xref{Backwards Compatibility}.
43577 @end table
43578
43579 G++ allows a virtual function returning @samp{void *} to be overridden
43580 @@ -12317,7 +12326,7 @@ used to be acceptable in previous drafts
43581 compilation of C++ written to such drafts, G++ contains some backwards
43582 compatibilities. @emph{All such backwards compatibility features are
43583 liable to disappear in future versions of G++.} They should be considered
43584 -deprecated @xref{Deprecated Features}.
43585 +deprecated. @xref{Deprecated Features}.
43586
43587 @table @code
43588 @item For scope
43589 --- a/gcc/doc/fragments.texi
43590 +++ b/gcc/doc/fragments.texi
43591 @@ -143,6 +143,22 @@ options enabled. Therefore @code{MULTIL
43592 *mthumb/*mhard-float*
43593 @end smallexample
43594
43595 +@findex MULTILIB_ALIASES
43596 +@item MULTILIB_ALIASES
43597 +Sometimes it is desirable to support a large set of multilib options, but
43598 +only build libraries for a subset of those multilibs. The remaining
43599 +combinations use a sutiable alternative multilb. In that case, set
43600 +@code{MULTILIB_ALIASES} to a list of the form @samp{realname=aliasname}.
43601 +
43602 +For example, consider a little-endian ARM toolchain with big-endian and
43603 +Thumb multilibs. If a big-endian Thumb multilib is not wanted, then
43604 +setting @code{MULTILIB_ALIASES} to @samp{mbig-endian=mbig-endian/mthumb}
43605 +makes this combination use the big-endian ARM libraries instead.
43606 +
43607 +If the multilib is instead excluded by setting @code{MULTILIB_EXCEPTIONS}
43608 +then big-endian Thumb code uses the default multilib as none of the
43609 +remaining multilibs match.
43610 +
43611 @findex MULTILIB_EXTRA_OPTS
43612 @item MULTILIB_EXTRA_OPTS
43613 Sometimes it is desirable that when building multiple versions of
43614 --- a/gcc/doc/gcc.texi
43615 +++ b/gcc/doc/gcc.texi
43616 @@ -147,12 +147,12 @@ Introduction, gccint, GNU Compiler Colle
43617 * GNU Project:: The GNU Project and GNU/Linux.
43618
43619 * Copying:: GNU General Public License says
43620 - how you can copy and share GCC.
43621 + how you can copy and share GCC.
43622 * GNU Free Documentation License:: How you can copy and share this manual.
43623 * Contributors:: People who have contributed to GCC.
43624
43625 * Option Index:: Index to command line options.
43626 -* Keyword Index:: Index of concepts and symbol names.
43627 +* Keyword Index:: Index of concepts and symbol names.
43628 @end menu
43629
43630 @include frontends.texi
43631 --- a/gcc/doc/install.texi
43632 +++ b/gcc/doc/install.texi
43633 @@ -671,7 +671,7 @@ internal data files of GCC@. The defaul
43634
43635 @item --libexecdir=@var{dirname}
43636 Specify the installation directory for internal executables of GCC@.
43637 - The default is @file{@var{exec-prefix}/libexec}.
43638 +The default is @file{@var{exec-prefix}/libexec}.
43639
43640 @item --with-slibdir=@var{dirname}
43641 Specify the installation directory for the shared libgcc library. The
43642 @@ -3513,15 +3513,17 @@ applications. There are no standard Uni
43643 @end html
43644 @heading @anchor{m68k-x-x}m68k-*-*
43645 By default, @samp{m68k-*-aout}, @samp{m68k-*-coff*},
43646 -@samp{m68k-*-elf*}, @samp{m68k-*-rtems} and @samp{m68k-*-uclinux}
43647 +@samp{m68k-*-elf*}, @samp{m68k-*-rtems}, @samp{m68k-*-uclinux} and
43648 +@samp{m68k-*-linux}
43649 build libraries for both M680x0 and ColdFire processors. If you only
43650 need the M680x0 libraries, you can omit the ColdFire ones by passing
43651 @option{--with-arch=m68k} to @command{configure}. Alternatively, you
43652 can omit the M680x0 libraries by passing @option{--with-arch=cf} to
43653 -@command{configure}. These targets default to 5206 code when
43654 +@command{configure}. These targets default to 5206 or 5475 code as
43655 +appropriate for the target system when
43656 configured with @option{--with-arch=cf} and 68020 code otherwise.
43657
43658 -The @samp{m68k-*-linux-gnu}, @samp{m68k-*-netbsd} and
43659 +The @samp{m68k-*-netbsd} and
43660 @samp{m68k-*-openbsd} targets also support the @option{--with-arch}
43661 option. They will generate ColdFire CFV4e code when configured with
43662 @option{--with-arch=cf} and 68020 code otherwise.
43663 --- a/gcc/doc/invoke.texi
43664 +++ b/gcc/doc/invoke.texi
43665 @@ -120,11 +120,11 @@ only one of these two forms, whichever o
43666 @xref{Option Index}, for an index to GCC's options.
43667
43668 @menu
43669 -* Option Summary:: Brief list of all options, without explanations.
43670 +* Option Summary:: Brief list of all options, without explanations.
43671 * Overall Options:: Controlling the kind of output:
43672 an executable, object files, assembler files,
43673 or preprocessed source.
43674 -* Invoking G++:: Compiling C++ programs.
43675 +* Invoking G++:: Compiling C++ programs.
43676 * C Dialect Options:: Controlling the variant of C language compiled.
43677 * C++ Dialect Options:: Variations on C++.
43678 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
43679 @@ -248,6 +248,7 @@ Objective-C and Objective-C++ Dialects}.
43680 -Wno-multichar -Wnonnull -Wno-overflow @gol
43681 -Woverlength-strings -Wpacked -Wpadded @gol
43682 -Wparentheses -Wpointer-arith -Wno-pointer-to-int-cast @gol
43683 +-Wno-poison-system-directories @gol
43684 -Wredundant-decls @gol
43685 -Wreturn-type -Wsequence-point -Wshadow @gol
43686 -Wsign-compare -Wsign-conversion -Wstack-protector @gol
43687 @@ -309,13 +310,13 @@ Objective-C and Objective-C++ Dialects}.
43688 -p -pg -print-file-name=@var{library} -print-libgcc-file-name @gol
43689 -print-multi-directory -print-multi-lib @gol
43690 -print-prog-name=@var{program} -print-search-dirs -Q @gol
43691 --print-sysroot-headers-suffix @gol
43692 +-print-sysroot -print-sysroot-headers-suffix @gol
43693 -save-temps -time}
43694
43695 @item Optimization Options
43696 @xref{Optimize Options,,Options that Control Optimization}.
43697 @gccoptlist{
43698 --falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
43699 +-falign-arrays -falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
43700 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
43701 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
43702 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
43703 @@ -388,7 +389,7 @@ Objective-C and Objective-C++ Dialects}.
43704 @gccoptlist{@var{object-file-name} -l@var{library} @gol
43705 -nostartfiles -nodefaultlibs -nostdlib -pie -rdynamic @gol
43706 -s -static -static-libgcc -shared -shared-libgcc -symbolic @gol
43707 --Wl,@var{option} -Xlinker @var{option} @gol
43708 +-T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol
43709 -u @var{symbol}}
43710
43711 @item Directory Options
43712 @@ -421,8 +422,11 @@ Objective-C and Objective-C++ Dialects}.
43713 -msched-prolog -mno-sched-prolog @gol
43714 -mlittle-endian -mbig-endian -mwords-little-endian @gol
43715 -mfloat-abi=@var{name} -msoft-float -mhard-float -mfpe @gol
43716 +-mfp16-format=@var{name}
43717 -mthumb-interwork -mno-thumb-interwork @gol
43718 +-mfix-janus-2cc @gol
43719 -mcpu=@var{name} -march=@var{name} -mfpu=@var{name} @gol
43720 +-mmarvell-div @gol
43721 -mstructure-size-boundary=@var{n} @gol
43722 -mabort-on-noreturn @gol
43723 -mlong-calls -mno-long-calls @gol
43724 @@ -434,7 +438,9 @@ Objective-C and Objective-C++ Dialects}.
43725 -mthumb -marm @gol
43726 -mtpcs-frame -mtpcs-leaf-frame @gol
43727 -mcaller-super-interworking -mcallee-super-interworking @gol
43728 --mtp=@var{name}}
43729 +-mtp=@var{name} @gol
43730 +-mlow-irq-latency -mword-relocations @gol
43731 +-mfix-cortex-m3-ldrd}
43732
43733 @emph{AVR Options}
43734 @gccoptlist{-mmcu=@var{mcu} -msize -minit-stack=@var{n} -mno-interrupts @gol
43735 @@ -602,7 +608,8 @@ Objective-C and Objective-C++ Dialects}.
43736 -mnobitfield -mrtd -mno-rtd -mdiv -mno-div -mshort @gol
43737 -mno-short -mhard-float -m68881 -msoft-float -mpcrel @gol
43738 -malign-int -mstrict-align -msep-data -mno-sep-data @gol
43739 --mshared-library-id=n -mid-shared-library -mno-id-shared-library}
43740 +-mshared-library-id=n -mid-shared-library -mno-id-shared-library @gol
43741 +-mxgot -mno-xgot}
43742
43743 @emph{M68hc1x Options}
43744 @gccoptlist{-m6811 -m6812 -m68hc11 -m68hc12 -m68hcs12 @gol
43745 @@ -619,7 +626,7 @@ Objective-C and Objective-C++ Dialects}.
43746 @emph{MIPS Options}
43747 @gccoptlist{-EL -EB -march=@var{arch} -mtune=@var{arch} @gol
43748 -mips1 -mips2 -mips3 -mips4 -mips32 -mips32r2 -mips64 @gol
43749 --mips16 -mno-mips16 -mflip-mips16 @gol
43750 +-mips16 -mips16e -mno-mips16 -mflip-mips16 @gol
43751 -minterlink-mips16 -mno-interlink-mips16 @gol
43752 -mabi=@var{abi} -mabicalls -mno-abicalls @gol
43753 -mshared -mno-shared -mxgot -mno-xgot -mgp32 -mgp64 @gol
43754 @@ -642,11 +649,12 @@ Objective-C and Objective-C++ Dialects}.
43755 -mmad -mno-mad -mfused-madd -mno-fused-madd -nocpp @gol
43756 -mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400 @gol
43757 -mfix-vr4120 -mno-fix-vr4120 -mfix-vr4130 -mno-fix-vr4130 @gol
43758 --mfix-sb1 -mno-fix-sb1 @gol
43759 +-mfix-ice9a -mno-fix-ice9a -mfix-sb1 -mno-fix-sb1 @gol
43760 -mflush-func=@var{func} -mno-flush-func @gol
43761 -mbranch-cost=@var{num} -mbranch-likely -mno-branch-likely @gol
43762 -mfp-exceptions -mno-fp-exceptions @gol
43763 --mvr4130-align -mno-vr4130-align}
43764 +-mvr4130-align -mno-vr4130-align @gol
43765 +-mwarn-framesize=@var{framesize}}
43766
43767 @emph{MMIX Options}
43768 @gccoptlist{-mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon -mabi=gnu @gol
43769 @@ -746,7 +754,7 @@ See RS/6000 and PowerPC Options.
43770 -mprefergot -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
43771 -mdivsi3_libfunc=@var{name} @gol
43772 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
43773 - -minvalid-symbols}
43774 +-minvalid-symbols}
43775
43776 @emph{SPARC Options}
43777 @gccoptlist{-mcpu=@var{cpu-type} @gol
43778 @@ -3377,6 +3385,14 @@ code. However, note that using @option{
43779 option will @emph{not} warn about unknown pragmas in system
43780 headers---for that, @option{-Wunknown-pragmas} must also be used.
43781
43782 +@item -Wno-poison-system-directories
43783 +@opindex Wno-poison-system-directories
43784 +Do not warn for @option{-I} or @option{-L} options using system
43785 +directories such as @file{/usr/include} when cross compiling. This
43786 +option is intended for use in chroot environments when such
43787 +directories contain the correct headers and libraries for the target
43788 +system rather than the host.
43789 +
43790 @item -Wfloat-equal
43791 @opindex Wfloat-equal
43792 @opindex Wno-float-equal
43793 @@ -5065,6 +5081,14 @@ variable @env{GCC_EXEC_PREFIX} to the di
43794 Don't forget the trailing @samp{/}.
43795 @xref{Environment Variables}.
43796
43797 +@item -print-sysroot
43798 +@opindex print-sysroot
43799 +Print the target sysroot directory that will be used during
43800 +compilation. This is the target sysroot specified either at configure
43801 +time or or using the @option{--sysroot} option, possibly with an extra
43802 +suffix that depends on compilation options. If no target sysroot is
43803 +specified, the options prints nothing.
43804 +
43805 @item -print-sysroot-headers-suffix
43806 @opindex print-sysroot-headers-suffix
43807 Print the suffix added to the target sysroot when searching for
43808 @@ -5128,7 +5152,13 @@ the compiler to use information gained f
43809 compiling each of them.
43810
43811 Not all optimizations are controlled directly by a flag. Only
43812 -optimizations that have a flag are listed.
43813 +optimizations that have a flag are listed in this section.
43814 +
43815 +Depending on the target and how GCC was configured, a slightly different
43816 +set of optimizations may be enabled at each @option{-O} level than
43817 +those listed here. You can invoke GCC with @samp{-Q --help=optimizers}
43818 +to find out the exact set of optimizations that are enabled at each level.
43819 +@xref{Overall Options}, for examples.
43820
43821 @table @gcctabopt
43822 @item -O
43823 @@ -5355,9 +5385,9 @@ as follows:
43824
43825 @table @gcctabopt
43826 @item max-inline-insns-single
43827 - is set to @var{n}/2.
43828 +is set to @var{n}/2.
43829 @item max-inline-insns-auto
43830 - is set to @var{n}/2.
43831 +is set to @var{n}/2.
43832 @end table
43833
43834 See below for a documentation of the individual
43835 @@ -6207,6 +6237,14 @@ arithmetic on constants, the overflowed
43836 The @option{-fstrict-overflow} option is enabled at levels
43837 @option{-O2}, @option{-O3}, @option{-Os}.
43838
43839 +@item -falign-arrays
43840 +@opindex falign-arrays
43841 +Set the minimum alignment for array variables to be the largest power
43842 +of two less than or equal to their total storage size, or the biggest
43843 +alignment used on the machine, whichever is smaller. This option may be
43844 +helpful when compiling legacy code that uses type punning on arrays that
43845 +does not strictly conform to the C standard.
43846 +
43847 @item -falign-functions
43848 @itemx -falign-functions=@var{n}
43849 @opindex falign-functions
43850 @@ -6757,6 +6795,21 @@ int foo (void)
43851
43852 Not all targets support this option.
43853
43854 +@item -fremove-local-statics
43855 +@opindex fremove-local-statics
43856 +Converts function-local static variables to automatic variables when it
43857 +is safe to do so. This transformation can reduce the number of
43858 +instructions executed due to automatic variables being cheaper to
43859 +read/write than static variables.
43860 +
43861 +@item -fpromote-loop-indices
43862 +@opindex fpromote-loop-indices
43863 +Converts loop indices that have a type shorter than the word size to
43864 +word-sized quantities. This transformation can reduce the overhead
43865 +associated with sign/zero-extension and truncation of such variables.
43866 +Using @option{-funsafe-loop-optimizations} with this option may result
43867 +in more effective optimization.
43868 +
43869 @item --param @var{name}=@var{value}
43870 @opindex param
43871 In some places, GCC uses various constants to control the amount of
43872 @@ -7582,23 +7635,42 @@ about any unresolved references (unless
43873 option @samp{-Xlinker -z -Xlinker defs}). Only a few systems support
43874 this option.
43875
43876 +@item -T @var{script}
43877 +@opindex T
43878 +@cindex linker script
43879 +Use @var{script} as the linker script. This option is supported by most
43880 +systems using the GNU linker. On some targets, such as bare-board
43881 +targets without an operating system, the @option{-T} option may be required
43882 +when linking to avoid references to undefined symbols.
43883 +
43884 @item -Xlinker @var{option}
43885 @opindex Xlinker
43886 Pass @var{option} as an option to the linker. You can use this to
43887 supply system-specific linker options which GCC does not know how to
43888 recognize.
43889
43890 -If you want to pass an option that takes an argument, you must use
43891 +If you want to pass an option that takes a separate argument, you must use
43892 @option{-Xlinker} twice, once for the option and once for the argument.
43893 For example, to pass @option{-assert definitions}, you must write
43894 @samp{-Xlinker -assert -Xlinker definitions}. It does not work to write
43895 @option{-Xlinker "-assert definitions"}, because this passes the entire
43896 string as a single argument, which is not what the linker expects.
43897
43898 +When using the GNU linker, it is usually more convenient to pass
43899 +arguments to linker options using the @option{@var{option}=@var{value}}
43900 +syntax than as separate arguments. For example, you can specify
43901 +@samp{-Xlinker -Map=output.map} rather than
43902 +@samp{-Xlinker -Map -Xlinker output.map}. Other linkers may not support
43903 +this syntax for command-line options.
43904 +
43905 @item -Wl,@var{option}
43906 @opindex Wl
43907 Pass @var{option} as an option to the linker. If @var{option} contains
43908 -commas, it is split into multiple options at the commas.
43909 +commas, it is split into multiple options at the commas. You can use this
43910 +syntax to pass an argument to the option.
43911 +For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
43912 +linker. When using the GNU linker, you can also get the same effect with
43913 +@samp{-Wl,-Map=output.map}.
43914
43915 @item -u @var{symbol}
43916 @opindex u
43917 @@ -8500,35 +8572,30 @@ different function prologues), and this
43918 locate the start if functions inside an executable piece of code. The
43919 default is @option{-msched-prolog}.
43920
43921 +@item -mfloat-abi=@var{name}
43922 +@opindex mfloat-abi
43923 +Specifies which floating-point ABI to use. Permissible values
43924 +are: @samp{soft}, @samp{softfp} and @samp{hard}.
43925 +
43926 +Specifying @samp{soft} causes GCC to generate output containing
43927 +library calls for floating-point operations.
43928 +@samp{softfp} allows the generation of code using hardware floating-point
43929 +instructions, but still uses the soft-float calling conventions.
43930 +@samp{hard} allows generation of floating-point instructions
43931 +and uses FPU-specific calling conventions.
43932 +
43933 +The default depends on the specific target configuration. Note that
43934 +the hard-float and soft-float ABIs are not link-compatible; you must
43935 +compile your entire program with the same ABI, and link with a
43936 +compatible set of libraries.
43937 +
43938 @item -mhard-float
43939 @opindex mhard-float
43940 -Generate output containing floating point instructions. This is the
43941 -default.
43942 +Equivalent to @option{-mfloat-abi=hard}.
43943
43944 @item -msoft-float
43945 @opindex msoft-float
43946 -Generate output containing library calls for floating point.
43947 -@strong{Warning:} the requisite libraries are not available for all ARM
43948 -targets. Normally the facilities of the machine's usual C compiler are
43949 -used, but this cannot be done directly in cross-compilation. You must make
43950 -your own arrangements to provide suitable library functions for
43951 -cross-compilation.
43952 -
43953 -@option{-msoft-float} changes the calling convention in the output file;
43954 -therefore, it is only useful if you compile @emph{all} of a program with
43955 -this option. In particular, you need to compile @file{libgcc.a}, the
43956 -library that comes with GCC, with @option{-msoft-float} in order for
43957 -this to work.
43958 -
43959 -@item -mfloat-abi=@var{name}
43960 -@opindex mfloat-abi
43961 -Specifies which ABI to use for floating point values. Permissible values
43962 -are: @samp{soft}, @samp{softfp} and @samp{hard}.
43963 -
43964 -@samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
43965 -and @option{-mhard-float} respectively. @samp{softfp} allows the generation
43966 -of floating point instructions, but still uses the soft-float calling
43967 -conventions.
43968 +Equivalent to @option{-mfloat-abi=soft}.
43969
43970 @item -mlittle-endian
43971 @opindex mlittle-endian
43972 @@ -8567,8 +8634,9 @@ assembly code. Permissible names are: @
43973 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
43974 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
43975 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
43976 -@samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-m3},
43977 -@samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
43978 +@samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m3},
43979 +@samp{cortex-m1}, @samp{cortex-m0},
43980 +@samp{xscale}, @samp{iwmmxt}, @samp{ep9312} @samp{marvell-f}.
43981
43982 @itemx -mtune=@var{name}
43983 @opindex mtune
43984 @@ -8600,13 +8668,26 @@ of the @option{-mcpu=} option. Permissi
43985 @opindex mfp
43986 This specifies what floating point hardware (or hardware emulation) is
43987 available on the target. Permissible names are: @samp{fpa}, @samp{fpe2},
43988 -@samp{fpe3}, @samp{maverick}, @samp{vfp}. @option{-mfp} and @option{-mfpe}
43989 +@samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-d16},
43990 +@samp{neon}, and @samp{neon-fp16}. @option{-mfp} and @option{-mfpe}
43991 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
43992 with older versions of GCC@.
43993
43994 If @option{-msoft-float} is specified this specifies the format of
43995 floating point values.
43996
43997 +@item -mfp16-format=@var{name}
43998 +@opindex mfp16-format
43999 +Specify the format of the @code{__fp16} half-precision floating-point type.
44000 +Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
44001 +the default is @samp{none}, in which case the @code{__fp16} type is not
44002 +defined. Refer to the ARM Half-precision Extensions documentation for
44003 +details of the formats.
44004 +
44005 +@item -mmarvell-div
44006 +@opindex mmarvell-div
44007 +Generate hardware integer division instructions supported by some Marvell cores.
44008 +
44009 @item -mstructure-size-boundary=@var{n}
44010 @opindex mstructure-size-boundary
44011 The size of all structures and unions will be rounded up to a multiple
44012 @@ -8714,6 +8795,10 @@ This option automatically enables either
44013 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
44014 and @option{-march=@var{name}} options.
44015
44016 +@item -mfix-janus-2cc
44017 +@opindex mfix-janus-2cc
44018 +Work around hardware errata for Avalent Janus 2CC cores.
44019 +
44020 @item -mtpcs-frame
44021 @opindex mtpcs-frame
44022 Generate a stack frame that is compliant with the Thumb Procedure Call
44023 @@ -8749,6 +8834,25 @@ models are @option{soft}, which generate
44024 best available method for the selected processor. The default setting is
44025 @option{auto}.
44026
44027 +@item -mlow-irq-latency
44028 +@opindex mlow-irq-latency
44029 +Avoid instructions with high interrupt latency when generating
44030 +code. This can increase code size and reduce performance.
44031 +The option is off by default.
44032 +
44033 +@item -mword-relocations
44034 +@opindex mword-relocations
44035 +Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
44036 +This is enabled by default on targets (uClinux, SymbianOS) where the runtime
44037 +loader imposes this restriction.
44038 +
44039 +@item -mfix-cortex-m3-ldrd
44040 +@opindex mfix-cortex-m3-ldrd
44041 +Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
44042 +with overlapping destination and base registers are used. This option avoids
44043 +generating these instructions. This option is enabled by default when
44044 +@option{-mcpu=cortex-m3} is specified.
44045 +
44046 @end table
44047
44048 @node AVR Options
44049 @@ -11402,7 +11506,7 @@ below, which also classifies the CPUs in
44050
44051 @multitable @columnfractions 0.20 0.80
44052 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
44053 -@item @samp{51qe} @tab @samp{51qe}
44054 +@item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
44055 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
44056 @item @samp{5206e} @tab @samp{5206e}
44057 @item @samp{5208} @tab @samp{5207} @samp{5208}
44058 @@ -11411,6 +11515,7 @@ below, which also classifies the CPUs in
44059 @item @samp{5216} @tab @samp{5214} @samp{5216}
44060 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
44061 @item @samp{5225} @tab @samp{5224} @samp{5225}
44062 +@item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
44063 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
44064 @item @samp{5249} @tab @samp{5249}
44065 @item @samp{5250} @tab @samp{5250}
44066 @@ -11418,6 +11523,7 @@ below, which also classifies the CPUs in
44067 @item @samp{5272} @tab @samp{5272}
44068 @item @samp{5275} @tab @samp{5274} @samp{5275}
44069 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
44070 +@item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
44071 @item @samp{5307} @tab @samp{5307}
44072 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
44073 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
44074 @@ -11711,6 +11817,38 @@ compiled. Specifying a value of 0 will
44075 other values will force the allocation of that number to the current
44076 library but is no more space or time efficient than omitting this option.
44077
44078 +@item -mxgot
44079 +@itemx -mno-xgot
44080 +@opindex mxgot
44081 +@opindex mno-xgot
44082 +When generating position-independent code for ColdFire, generate code
44083 +that works if the GOT has more than 8192 entries. This code is
44084 +larger and slower than code generated without this option. On M680x0
44085 +processors, this option is not needed; @option{-fPIC} suffices.
44086 +
44087 +GCC normally uses a single instruction to load values from the GOT@.
44088 +While this is relatively efficient, it only works if the GOT
44089 +is smaller than about 64k. Anything larger causes the linker
44090 +to report an error such as:
44091 +
44092 +@cindex relocation truncated to fit (ColdFire)
44093 +@smallexample
44094 +relocation truncated to fit: R_68K_GOT16O foobar
44095 +@end smallexample
44096 +
44097 +If this happens, you should recompile your code with @option{-mxgot}.
44098 +It should then work with very large GOTs. However, code generated with
44099 +@option{-mxgot} is less efficient, since it takes 4 instructions to fetch
44100 +the value of a global symbol.
44101 +
44102 +Note that some linkers, including newer versions of the GNU linker,
44103 +can create multiple GOTs and sort GOT entries. If you have such a linker,
44104 +you should only need to use @option{-mxgot} when compiling a single
44105 +object file that accesses more than 8192 GOT entries. Very few do.
44106 +
44107 +These options have no effect unless GCC is generating
44108 +position-independent code.
44109 +
44110 @end table
44111
44112 @node M68hc1x Options
44113 @@ -11871,6 +12009,7 @@ The processor names are:
44114 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
44115 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
44116 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
44117 +@samp{ice9},
44118 @samp{m4k},
44119 @samp{orion},
44120 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
44121 @@ -11879,7 +12018,8 @@ The processor names are:
44122 @samp{sb1},
44123 @samp{sr71000},
44124 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
44125 -@samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
44126 +@samp{vr5000}, @samp{vr5400}, @samp{vr5500}
44127 +and @samp{xlr}.
44128 The special value @samp{from-abi} selects the
44129 most compatible architecture for the selected ABI (that is,
44130 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
44131 @@ -11957,11 +12097,14 @@ Equivalent to @samp{-march=mips32r2}.
44132 Equivalent to @samp{-march=mips64}.
44133
44134 @item -mips16
44135 +@itemx -mips16e
44136 @itemx -mno-mips16
44137 @opindex mips16
44138 +@opindex mips16e
44139 @opindex mno-mips16
44140 Generate (do not generate) MIPS16 code. If GCC is targetting a
44141 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
44142 +@option{-mips16e} is a deprecated alias for @option{-mips16}.
44143
44144 MIPS16 code generation can also be controlled on a per-function basis
44145 by means of @code{mips16} and @code{nomips16} attributes.
44146 @@ -12453,6 +12596,12 @@ although GCC will avoid using @code{mflo
44147 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
44148 instructions are available instead.
44149
44150 +@item -mfix-ice9a
44151 +@itemx -mno-fix-ice9a
44152 +@opindex mfix-ice9a
44153 +Work around ICE9A double floating-point multiplication
44154 +errata. When enabled, the preprocessor defines @code{_MIPS_FIX_ICE9A}.
44155 +
44156 @item -mfix-sb1
44157 @itemx -mno-fix-sb1
44158 @opindex mfix-sb1
44159 @@ -12512,6 +12661,13 @@ thinks should execute in parallel.
44160 This option only has an effect when optimizing for the VR4130.
44161 It normally makes code faster, but at the expense of making it bigger.
44162 It is enabled by default at optimization level @option{-O3}.
44163 +
44164 +@item -mwarn-framesize=@var{framesize}
44165 +@opindex mwarn-framesize
44166 +Emit a compile-time warning if the current function exceeds the given
44167 +frame size. This is intended to help identify functions which
44168 +may cause a stack overflow in run-time environments with limited or
44169 +absent stack, e.g., BIOS.
44170 @end table
44171
44172 @node MMIX Options
44173 @@ -12943,11 +13099,12 @@ Supported values for @var{cpu_type} are
44174 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
44175 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
44176 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
44177 -@samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
44178 -@samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
44179 -@samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
44180 -@samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
44181 -@samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
44182 +@samp{860}, @samp{970}, @samp{8540}, @samp{e300c2}, @samp{e300c3},
44183 +@samp{e500mc}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
44184 +@samp{power}, @samp{power2}, @samp{power3}, @samp{power4},
44185 +@samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x},
44186 +@samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
44187 +@samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
44188
44189 @option{-mcpu=common} selects a completely generic processor. Code
44190 generated under this option will run on any POWER or PowerPC processor.
44191 @@ -13482,12 +13639,11 @@ header to indicate that @samp{eabi} exte
44192 On System V.4 and embedded PowerPC systems do (do not) adhere to the
44193 Embedded Applications Binary Interface (eabi) which is a set of
44194 modifications to the System V.4 specifications. Selecting @option{-meabi}
44195 -means that the stack is aligned to an 8 byte boundary, a function
44196 -@code{__eabi} is called to from @code{main} to set up the eabi
44197 -environment, and the @option{-msdata} option can use both @code{r2} and
44198 +means that the stack is aligned to an 8 byte boundary,
44199 +and the @option{-msdata} option can use both @code{r2} and
44200 @code{r13} to point to two separate small data areas. Selecting
44201 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
44202 -do not call an initialization function from @code{main}, and the
44203 +and the
44204 @option{-msdata} option will only use @code{r13} to point to a single
44205 small data area. The @option{-meabi} option is on by default if you
44206 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
44207 @@ -14916,12 +15072,25 @@ Use it to conform to a non-default appli
44208
44209 @item -fno-common
44210 @opindex fno-common
44211 -In C, allocate even uninitialized global variables in the data section of the
44212 -object file, rather than generating them as common blocks. This has the
44213 -effect that if the same variable is declared (without @code{extern}) in
44214 -two different compilations, you will get an error when you link them.
44215 -The only reason this might be useful is if you wish to verify that the
44216 -program will work on other systems which always work this way.
44217 +In C code, controls the placement of uninitialized global variables.
44218 +Unix C compilers have traditionally permitted multiple definitions of
44219 +such variables in different compilation units by placing the variables
44220 +in a common block.
44221 +This is the behavior specified by @option{-fcommon}, and is the default
44222 +for GCC on most targets.
44223 +On the other hand, this behavior is not required by ISO C, and on some
44224 +targets may carry a speed or code size penalty on variable references.
44225 +The @option{-fno-common} option specifies that the compiler should place
44226 +uninitialized global variables in the data section of the object file,
44227 +rather than generating them as common blocks.
44228 +This has the effect that if the same variable is declared
44229 +(without @code{extern}) in two different compilations,
44230 +you will get a multiple-definition error when you link them.
44231 +In this case, you must compile with @option{-fcommon} instead.
44232 +Compiling with @option{-fno-common} is useful on targets for which
44233 +it provides better performance, or if you wish to verify that the
44234 +program will work on other systems which always treat uninitialized
44235 +variable declarations this way.
44236
44237 @item -fno-ident
44238 @opindex fno-ident
44239 --- a/gcc/doc/md.texi
44240 +++ b/gcc/doc/md.texi
44241 @@ -25,11 +25,11 @@ See the next chapter for information on
44242 * Example:: An explained example of a @code{define_insn} pattern.
44243 * RTL Template:: The RTL template defines what insns match a pattern.
44244 * Output Template:: The output template says how to make assembler code
44245 - from such an insn.
44246 + from such an insn.
44247 * Output Statement:: For more generality, write C code to output
44248 - the assembler code.
44249 + the assembler code.
44250 * Predicates:: Controlling what kinds of operands can be used
44251 - for an insn.
44252 + for an insn.
44253 * Constraints:: Fine-tuning operand selection.
44254 * Standard Names:: Names mark patterns to use for code generation.
44255 * Pattern Ordering:: When the order of patterns makes a difference.
44256 @@ -38,13 +38,13 @@ See the next chapter for information on
44257 * Looping Patterns:: How to define patterns for special looping insns.
44258 * Insn Canonicalizations::Canonicalization of Instructions
44259 * Expander Definitions::Generating a sequence of several RTL insns
44260 - for a standard operation.
44261 + for a standard operation.
44262 * Insn Splitting:: Splitting Instructions into Multiple Instructions.
44263 -* Including Patterns:: Including Patterns in Machine Descriptions.
44264 +* Including Patterns:: Including Patterns in Machine Descriptions.
44265 * Peephole Definitions::Defining machine-specific peephole optimizations.
44266 * Insn Attributes:: Specifying the value of attributes for generated insns.
44267 * Conditional Execution::Generating @code{define_insn} patterns for
44268 - predication.
44269 + predication.
44270 * Constant Definitions::Defining symbolic constants that can be used in the
44271 md file.
44272 * Iterators:: Using iterators to generate patterns from a template.
44273 @@ -1626,7 +1626,7 @@ it includes both constraints that are us
44274 constraints that aren't. The compiler source file mentioned in the
44275 table heading for each architecture is the definitive reference for
44276 the meanings of that architecture's constraints.
44277 -
44278 +
44279 @table @emph
44280 @item ARM family---@file{config/arm/arm.h}
44281 @table @code
44282 @@ -2889,10 +2889,10 @@ Signed 16-bit constant (@minus{}32768--3
44283 @item L
44284 Value appropriate as displacement.
44285 @table @code
44286 - @item (0..4095)
44287 - for short displacement
44288 - @item (-524288..524287)
44289 - for long displacement
44290 +@item (0..4095)
44291 +for short displacement
44292 +@item (-524288..524287)
44293 +for long displacement
44294 @end table
44295
44296 @item M
44297 @@ -2901,14 +2901,14 @@ Constant integer with a value of 0x7ffff
44298 @item N
44299 Multiple letter constraint followed by 4 parameter letters.
44300 @table @code
44301 - @item 0..9:
44302 - number of the part counting from most to least significant
44303 - @item H,Q:
44304 - mode of the part
44305 - @item D,S,H:
44306 - mode of the containing operand
44307 - @item 0,F:
44308 - value of the other parts (F---all bits set)
44309 +@item 0..9:
44310 +number of the part counting from most to least significant
44311 +@item H,Q:
44312 +mode of the part
44313 +@item D,S,H:
44314 +mode of the containing operand
44315 +@item 0,F:
44316 +value of the other parts (F---all bits set)
44317 @end table
44318 The constraint matches if the specified part of a constant
44319 has a value different from its other parts.
44320 @@ -3345,8 +3345,8 @@ definition from the i386 machine descrip
44321 (define_peephole2
44322 [(match_scratch:SI 3 "r")
44323 (set (match_operand:SI 0 "register_operand" "")
44324 - (mult:SI (match_operand:SI 1 "memory_operand" "")
44325 - (match_operand:SI 2 "immediate_operand" "")))]
44326 + (mult:SI (match_operand:SI 1 "memory_operand" "")
44327 + (match_operand:SI 2 "immediate_operand" "")))]
44328
44329 "!satisfies_constraint_K (operands[2])"
44330
44331 @@ -5378,15 +5378,15 @@ following for its @code{dbra} instructio
44332 @group
44333 (define_insn "decrement_and_branch_until_zero"
44334 [(set (pc)
44335 - (if_then_else
44336 - (ge (plus:SI (match_operand:SI 0 "general_operand" "+d*am")
44337 - (const_int -1))
44338 - (const_int 0))
44339 - (label_ref (match_operand 1 "" ""))
44340 - (pc)))
44341 + (if_then_else
44342 + (ge (plus:SI (match_operand:SI 0 "general_operand" "+d*am")
44343 + (const_int -1))
44344 + (const_int 0))
44345 + (label_ref (match_operand 1 "" ""))
44346 + (pc)))
44347 (set (match_dup 0)
44348 - (plus:SI (match_dup 0)
44349 - (const_int -1)))]
44350 + (plus:SI (match_dup 0)
44351 + (const_int -1)))]
44352 "find_reg_note (insn, REG_NONNEG, 0)"
44353 "@dots{}")
44354 @end group
44355 @@ -5404,14 +5404,14 @@ pattern will not be matched by the combi
44356 @group
44357 (define_insn "decrement_and_branch_until_zero"
44358 [(set (pc)
44359 - (if_then_else
44360 - (ge (match_operand:SI 0 "general_operand" "+d*am")
44361 - (const_int 1))
44362 - (label_ref (match_operand 1 "" ""))
44363 - (pc)))
44364 + (if_then_else
44365 + (ge (match_operand:SI 0 "general_operand" "+d*am")
44366 + (const_int 1))
44367 + (label_ref (match_operand 1 "" ""))
44368 + (pc)))
44369 (set (match_dup 0)
44370 - (plus:SI (match_dup 0)
44371 - (const_int -1)))]
44372 + (plus:SI (match_dup 0)
44373 + (const_int -1)))]
44374 "find_reg_note (insn, REG_NONNEG, 0)"
44375 "@dots{}")
44376 @end group
44377 @@ -6033,7 +6033,7 @@ from i386.md:
44378 "&& reload_completed"
44379 [(parallel [(set (match_dup 0)
44380 (and:SI (match_dup 0) (const_int 65535)))
44381 - (clobber (reg:CC 17))])]
44382 + (clobber (reg:CC 17))])]
44383 ""
44384 [(set_attr "type" "alu1")])
44385
44386 @@ -7158,10 +7158,10 @@ the instruction issue is possible if the
44387 automaton state to another one. This algorithm is very fast, and
44388 furthermore, its speed is not dependent on processor
44389 complexity@footnote{However, the size of the automaton depends on
44390 - processor complexity. To limit this effect, machine descriptions
44391 - can split orthogonal parts of the machine description among several
44392 - automata: but then, since each of these must be stepped independently,
44393 - this does cause a small decrease in the algorithm's performance.}.
44394 +processor complexity. To limit this effect, machine descriptions
44395 +can split orthogonal parts of the machine description among several
44396 +automata: but then, since each of these must be stepped independently,
44397 +this does cause a small decrease in the algorithm's performance.}.
44398
44399 @cindex automaton based pipeline description
44400 The rest of this section describes the directives that constitute
44401 @@ -7761,8 +7761,8 @@ rtx-based construct, such as a @code{def
44402
44403 @menu
44404 * Defining Mode Iterators:: Defining a new mode iterator.
44405 -* Substitutions:: Combining mode iterators with substitutions
44406 -* Examples:: Examples
44407 +* Substitutions:: Combining mode iterators with substitutions
44408 +* Examples:: Examples
44409 @end menu
44410
44411 @node Defining Mode Iterators
44412 --- a/gcc/doc/options.texi
44413 +++ b/gcc/doc/options.texi
44414 @@ -29,13 +29,13 @@ The files can contain the following type
44415
44416 @itemize @bullet
44417 @item
44418 -A language definition record.  These records have two fields: the
44419 -string @samp{Language} and the name of the language.  Once a language
44420 +A language definition record. These records have two fields: the
44421 +string @samp{Language} and the name of the language. Once a language
44422 has been declared in this way, it can be used as an option property.
44423 @xref{Option properties}.
44424
44425 @item
44426 -An option definition record.  These records have the following fields:
44427 +An option definition record. These records have the following fields:
44428
44429 @enumerate
44430 @item
44431 @@ -62,11 +62,11 @@ tab forms the help text. This allows yo
44432 of argument the option takes.
44433
44434 @item
44435 -A target mask record.  These records have one field of the form
44436 -@samp{Mask(@var{x})}.  The options-processing script will automatically
44437 +A target mask record. These records have one field of the form
44438 +@samp{Mask(@var{x})}. The options-processing script will automatically
44439 allocate a bit in @code{target_flags} (@pxref{Run-time Target}) for
44440 each mask name @var{x} and set the macro @code{MASK_@var{x}} to the
44441 -appropriate bitmask.  It will also declare a @code{TARGET_@var{x}}
44442 +appropriate bitmask. It will also declare a @code{TARGET_@var{x}}
44443 macro that has the value 1 when bit @code{MASK_@var{x}} is set and
44444 0 otherwise.
44445
44446 --- a/gcc/doc/passes.texi
44447 +++ b/gcc/doc/passes.texi
44448 @@ -20,7 +20,7 @@ where near complete.
44449 @menu
44450 * Parsing pass:: The language front end turns text into bits.
44451 * Gimplification pass:: The bits are turned into something we can optimize.
44452 -* Pass manager:: Sequencing the optimization passes.
44453 +* Pass manager:: Sequencing the optimization passes.
44454 * Tree-SSA passes:: Optimizations on a high-level representation.
44455 * RTL passes:: Optimizations on a low-level representation.
44456 @end menu
44457 --- a/gcc/doc/rtl.texi
44458 +++ b/gcc/doc/rtl.texi
44459 @@ -3019,11 +3019,9 @@ represents @var{x} before @var{x} is mod
44460 @var{m} must be the machine mode for pointers on the machine in use.
44461
44462 The expression @var{y} must be one of three forms:
44463 -@table @code
44464 @code{(plus:@var{m} @var{x} @var{z})},
44465 @code{(minus:@var{m} @var{x} @var{z})}, or
44466 @code{(plus:@var{m} @var{x} @var{i})},
44467 -@end table
44468 where @var{z} is an index register and @var{i} is a constant.
44469
44470 Here is an example of its use:
44471 --- a/gcc/doc/sourcebuild.texi
44472 +++ b/gcc/doc/sourcebuild.texi
44473 @@ -198,9 +198,7 @@ timestamp.
44474
44475 @itemize @bullet
44476 @item The standard GNU @file{config.sub} and @file{config.guess}
44477 -files, kept in the top level directory, are used. FIXME: when is the
44478 -@file{config.guess} file in the @file{gcc} directory (that just calls
44479 -the top level one) used?
44480 +files, kept in the top level directory, are used.
44481
44482 @item The file @file{config.gcc} is used to handle configuration
44483 specific to the particular target machine. The file
44484 @@ -1021,7 +1019,11 @@ an empty @var{exclude-opts} list.
44485
44486 @item @{ dg-xfail-if @var{comment} @{ @var{selector} @} @{ @var{include-opts} @} @{ @var{exclude-opts} @} @}
44487 Expect the test to fail if the conditions (which are the same as for
44488 -@code{dg-skip-if}) are met.
44489 +@code{dg-skip-if}) are met. This does not affect the execute step.
44490 +
44491 +@item @{ dg-xfail-run-if @var{comment} @{ @var{selector} @} @{ @var{include-opts} @} @{ @var{exclude-opts} @} @}
44492 +Expect the execute step of a test to fail if the conditions (which are
44493 +the same as for @code{dg-skip-if}) and @code{dg-xfail-if}) are met.
44494
44495 @item @{ dg-require-@var{support} args @}
44496 Skip the test if the target does not provide the required support;
44497 --- a/gcc/doc/tm.texi
44498 +++ b/gcc/doc/tm.texi
44499 @@ -35,7 +35,7 @@ through the macros defined in the @file{
44500 * Register Classes:: Defining the classes of hardware registers.
44501 * Old Constraints:: The old way to define machine-specific constraints.
44502 * Stack and Calling:: Defining which way the stack grows and by how much.
44503 -* Varargs:: Defining the varargs macros.
44504 +* Varargs:: Defining the varargs macros.
44505 * Trampolines:: Code set up at run time to enter a nested function.
44506 * Library Calls:: Controlling how library routines are implicitly called.
44507 * Addressing Modes:: Defining addressing modes valid for memory operands.
44508 @@ -44,7 +44,7 @@ through the macros defined in the @file{
44509 * Costs:: Defining relative costs of different operations.
44510 * Scheduling:: Adjusting the behavior of the instruction scheduler.
44511 * Sections:: Dividing storage into text, data, and other sections.
44512 -* PIC:: Macros for position independent code.
44513 +* PIC:: Macros for position independent code.
44514 * Assembler Format:: Defining how to write insns and pseudo-ops to output.
44515 * Debugging Info:: Defining the format of debugging output.
44516 * Floating Point:: Handling floating point for cross-compilers.
44517 @@ -1138,6 +1138,9 @@ macro is used instead of that alignment
44518
44519 If this macro is not defined, then @var{basic-align} is used.
44520
44521 +This macro should never be used directly; use
44522 +@code{calculate_global_alignment} instead.
44523 +
44524 @findex strcpy
44525 One use of this macro is to increase alignment of medium-size data to
44526 make it all fit in fewer cache lines. Another is to cause character
44527 @@ -1169,6 +1172,9 @@ If this macro is not defined, then @var{
44528
44529 One use of this macro is to increase alignment of medium-size data to
44530 make it all fit in fewer cache lines.
44531 +
44532 +This macro should never be used directly; use
44533 +@code{calculate_local_alignment} instead.
44534 @end defmac
44535
44536 @defmac EMPTY_FIELD_BOUNDARY
44537 @@ -1895,11 +1901,11 @@ For passing values in registers, see @re
44538 For returning values in registers, see @ref{Scalar Return}.
44539
44540 @menu
44541 -* Register Basics:: Number and kinds of registers.
44542 -* Allocation Order:: Order in which registers are allocated.
44543 -* Values in Registers:: What kinds of values each reg can hold.
44544 -* Leaf Functions:: Renumbering registers for leaf functions.
44545 -* Stack Registers:: Handling a register stack such as 80387.
44546 +* Register Basics:: Number and kinds of registers.
44547 +* Allocation Order:: Order in which registers are allocated.
44548 +* Values in Registers:: What kinds of values each reg can hold.
44549 +* Leaf Functions:: Renumbering registers for leaf functions.
44550 +* Stack Registers:: Handling a register stack such as 80387.
44551 @end menu
44552
44553 @node Register Basics
44554 @@ -2064,6 +2070,15 @@ machines, define @code{REG_ALLOC_ORDER}
44555 the highest numbered allocable register first.
44556 @end defmac
44557
44558 +@deftypefn {Target Hook} void TARGET_ADJUST_REG_ALLOC_ORDER (int *@var{order})
44559 +If @code{REG_ALLOC_ORDER} has been defined, this hook is called after
44560 +all command-line options have been processed. It enables adjustment of
44561 +the allocation order based on target-specific flags. Any such adjustment
44562 +should be performed by the hook directly on the elements of the
44563 +array @code{order}. On entry to the hook this array is an
44564 +unmodified copy of @code{REG_ALLOC_ORDER}.
44565 +@end deftypefn
44566 +
44567 @defmac ORDER_REGS_FOR_LOCAL_ALLOC
44568 A C statement (sans semicolon) to choose the order in which to allocate
44569 hard registers for pseudo-registers local to a basic block.
44570 @@ -2476,6 +2491,15 @@ address where its value is either multip
44571 added to another register (as well as added to a displacement).
44572 @end defmac
44573
44574 +@defmac MODE_INDEX_REG_CLASS (@var{mode})
44575 +This is a variation of the @code{INDEX_REG_CLASS} macro which allows
44576 +the selection of an index register in a mode dependent manner. It can
44577 +return @code{NO_REGS} for modes that do not support any form of index
44578 +register. If @var{mode} is @code{VOIDmode} then the macro should
44579 +return a class of registers that is suitable for all addresses in
44580 +which an index register of some form is allowed.
44581 +@end defmac
44582 +
44583 @defmac REGNO_OK_FOR_BASE_P (@var{num})
44584 A C expression which is nonzero if register number @var{num} is
44585 suitable for use as a base register in operand addresses. It may be
44586 @@ -2535,6 +2559,14 @@ looking for one that is valid, and will
44587 only if neither labeling works.
44588 @end defmac
44589
44590 +@defmac REGNO_MODE_OK_FOR_INDEX_P (@var{num}, @var{mode})
44591 +A C expression that is just like @code{REGNO_OK_FOR_INDEX_P}, except
44592 +that the expression may examine the mode of the memory reference
44593 +in @var{mode}. If @var{mode} is @code{VOIDmode}, the macro should
44594 +return true if @var{x} is suitable for all modes in which some
44595 +form of index register is allowed.
44596 +@end defmac
44597 +
44598 @defmac PREFERRED_RELOAD_CLASS (@var{x}, @var{class})
44599 A C expression that places additional restrictions on the register class
44600 to use when it is necessary to copy value @var{x} into a register in class
44601 @@ -2969,7 +3001,7 @@ be treated like memory constraints by th
44602
44603 It should return 1 if the operand type represented by the constraint
44604 at the start of @var{str}, the first letter of which is the letter @var{c},
44605 - comprises a subset of all memory references including
44606 +comprises a subset of all memory references including
44607 all those whose address is simply a base register. This allows the reload
44608 pass to reload an operand, if it does not directly correspond to the operand
44609 type of @var{c}, by copying its address into a base register.
44610 @@ -4272,6 +4304,18 @@ The definition of @code{LIBRARY_VALUE} n
44611 data types, because none of the library functions returns such types.
44612 @end defmac
44613
44614 +@deftypefn {Target Hook} rtx TARGET_LIBCALL_VALUE (enum machine_mode
44615 +@var{mode}, rtx @var{fun})
44616 +Define this hook if the back-end needs to know the name of the libcall
44617 +function in order to determine where the result should be returned.
44618 +
44619 +The mode of the result is given by @var{mode} and the name of the called
44620 +library function is given by @var{fun}. The hook should return an RTX
44621 +representing the place where the library function result will be returned.
44622 +
44623 +If this hook is not defined, then LIBCALL_VALUE will be used.
44624 +@end deftypefn
44625 +
44626 @defmac FUNCTION_VALUE_REGNO_P (@var{regno})
44627 A C expression that is nonzero if @var{regno} is the number of a hard
44628 register in which the values of called function may come back.
44629 @@ -6741,10 +6785,10 @@ instructions do.
44630 * Uninitialized Data:: Output of uninitialized variables.
44631 * Label Output:: Output and generation of labels.
44632 * Initialization:: General principles of initialization
44633 - and termination routines.
44634 + and termination routines.
44635 * Macros for Initialization::
44636 - Specific macros that control the handling of
44637 - initialization and termination routines.
44638 + Specific macros that control the handling of
44639 + initialization and termination routines.
44640 * Instruction Output:: Output of actual instructions.
44641 * Dispatch Tables:: Output of jump tables.
44642 * Exception Region Output:: Output of exception region code.
44643 @@ -6873,7 +6917,7 @@ This is true on most ELF targets.
44644 Choose a set of section attributes for use by @code{TARGET_ASM_NAMED_SECTION}
44645 based on a variable or function decl, a section name, and whether or not the
44646 declaration's initializer may contain runtime relocations. @var{decl} may be
44647 - null, in which case read-write data should be assumed.
44648 +null, in which case read-write data should be assumed.
44649
44650 The default version of this function handles choosing code vs data,
44651 read-only vs read-write data, and @code{flag_pic}. You should only
44652 @@ -7077,7 +7121,7 @@ assembler for grouping arithmetic expres
44653 default to normal parentheses, which is correct for most assemblers.
44654 @end deftypevr
44655
44656 - These macros are provided by @file{real.h} for writing the definitions
44657 +These macros are provided by @file{real.h} for writing the definitions
44658 of @code{ASM_OUTPUT_DOUBLE} and the like:
44659
44660 @defmac REAL_VALUE_TO_TARGET_SINGLE (@var{x}, @var{l})
44661 @@ -10355,6 +10399,36 @@ and @var{type2}, or @code{NULL} if valid
44662 the front end.
44663 @end deftypefn
44664
44665 +@deftypefn {Target Hook} {const char *} TARGET_INVALID_PARAMETER_TYPE (tree @var{type})
44666 +If defined, this macro returns the diagnostic message when it is
44667 +invalid for functions to include parameters of type @var{type},
44668 +or @code{NULL} if validity should be determined by
44669 +the front end.
44670 +@end deftypefn
44671 +
44672 +@deftypefn {Target Hook} {const char *} TARGET_INVALID_RETURN_TYPE (tree @var{type})
44673 +If defined, this macro returns the diagnostic message when it is
44674 +invalid for functions to have return type @var{type},
44675 +or @code{NULL} if validity should be determined by
44676 +the front end.
44677 +@end deftypefn
44678 +
44679 +@deftypefn {Target Hook} {tree} TARGET_PROMOTED_TYPE (tree @var{type})
44680 +If defined, this target hook returns the type to which values of
44681 +@var{type} should be promoted when they appear in expressions,
44682 +analogous to the integer promotions, or @code{NULL_TREE} to use the
44683 +front end's normal promotion rules. This hook is useful when there are
44684 +target-specific types with special promotion rules.
44685 +@end deftypefn
44686 +
44687 +@deftypefn {Target Hook} {tree} TARGET_CONVERT_TO_TYPE (tree @var{type}, tree @var{expr})
44688 +If defined, this hook returns the result of converting @var{expr} to
44689 +@var{type}. It should return the converted expression,
44690 +or @code{NULL_TREE} to apply the front end's normal conversion rules.
44691 +This hook is useful when there are target-specific types with special
44692 +conversion rules.
44693 +@end deftypefn
44694 +
44695 @defmac TARGET_USE_JCR_SECTION
44696 This macro determines whether to use the JCR section to register Java
44697 classes. By default, TARGET_USE_JCR_SECTION is defined to 1 if both
44698 @@ -10372,3 +10446,14 @@ to the functions in @file{libgcc} that p
44699 call stack unwinding. It is used in declarations in @file{unwind-generic.h}
44700 and the associated definitions of those functions.
44701 @end defmac
44702 +
44703 +@deftypefn {Target Hook} {bool} TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS (void)
44704 +When optimization is disabled, this hook indicates whether or not
44705 +arguments should be allocated to stack slots. Normally, GCC allocates
44706 +stacks slots for arguments when not optimizing in order to make
44707 +debugging easier. However, when a function is declared with
44708 +@code{__attribute__((naked))}, there is no stack frame, and the compiler
44709 +cannot safely move arguments from the registers in which they are passed
44710 +to the stack. Therefore, this hook should return true in general, but
44711 +false for naked functions. The default implementation always returns true.
44712 +@end deftypefn
44713 --- a/gcc/doc/tree-ssa.texi
44714 +++ b/gcc/doc/tree-ssa.texi
44715 @@ -37,12 +37,12 @@ functions and programming constructs nee
44716 passes for GIMPLE@.
44717
44718 @menu
44719 -* GENERIC:: A high-level language-independent representation.
44720 +* GENERIC:: A high-level language-independent representation.
44721 * GIMPLE:: A lower-level factored tree representation.
44722 -* Annotations:: Attributes for statements and variables.
44723 -* Statement Operands:: Variables referenced by GIMPLE statements.
44724 -* SSA:: Static Single Assignment representation.
44725 -* Alias analysis:: Representing aliased loads and stores.
44726 +* Annotations:: Attributes for statements and variables.
44727 +* Statement Operands:: Variables referenced by GIMPLE statements.
44728 +* SSA:: Static Single Assignment representation.
44729 +* Alias analysis:: Representing aliased loads and stores.
44730 @end menu
44731
44732 @node GENERIC
44733 @@ -735,10 +735,10 @@ void f()
44734 | RELOP
44735 op0 -> val
44736 op1 -> val
44737 - | COND_EXPR
44738 - op0 -> condition
44739 - op1 -> val
44740 - op2 -> val
44741 + | COND_EXPR
44742 + op0 -> condition
44743 + op1 -> val
44744 + op2 -> val
44745 @end smallexample
44746
44747 @node Annotations
44748 @@ -943,7 +943,7 @@ How to choose the appropriate iterator:
44749
44750 @enumerate
44751 @item Determine whether you are need to see the operand pointers, or just the
44752 - trees, and choose the appropriate macro:
44753 +trees, and choose the appropriate macro:
44754
44755 @smallexample
44756 Need Macro:
44757 @@ -954,12 +954,12 @@ tree FOR_EACH_SSA_TREE_OPERAN
44758 @end smallexample
44759
44760 @item You need to declare a variable of the type you are interested
44761 - in, and an ssa_op_iter structure which serves as the loop
44762 - controlling variable.
44763 +in, and an ssa_op_iter structure which serves as the loop controlling
44764 +variable.
44765
44766 @item Determine which operands you wish to use, and specify the flags of
44767 - those you are interested in. They are documented in
44768 - @file{tree-ssa-operands.h}:
44769 +those you are interested in. They are documented in
44770 +@file{tree-ssa-operands.h}:
44771
44772 @smallexample
44773 #define SSA_OP_USE 0x01 /* @r{Real USE operands.} */
44774 @@ -1228,27 +1228,27 @@ which''.
44775
44776 The following macros can be used to examine PHI nodes
44777
44778 -@defmac PHI_RESULT (@var{phi})
44779 +@defmac PHI_RESULT (@var{phi})
44780 Returns the @code{SSA_NAME} created by PHI node @var{phi} (i.e.,
44781 @var{phi}'s LHS)@.
44782 @end defmac
44783
44784 -@defmac PHI_NUM_ARGS (@var{phi})
44785 +@defmac PHI_NUM_ARGS (@var{phi})
44786 Returns the number of arguments in @var{phi}. This number is exactly
44787 the number of incoming edges to the basic block holding @var{phi}@.
44788 @end defmac
44789
44790 -@defmac PHI_ARG_ELT (@var{phi}, @var{i})
44791 +@defmac PHI_ARG_ELT (@var{phi}, @var{i})
44792 Returns a tuple representing the @var{i}th argument of @var{phi}@.
44793 Each element of this tuple contains an @code{SSA_NAME} @var{var} and
44794 the incoming edge through which @var{var} flows.
44795 @end defmac
44796
44797 -@defmac PHI_ARG_EDGE (@var{phi}, @var{i})
44798 +@defmac PHI_ARG_EDGE (@var{phi}, @var{i})
44799 Returns the incoming edge for the @var{i}th argument of @var{phi}.
44800 @end defmac
44801
44802 -@defmac PHI_ARG_DEF (@var{phi}, @var{i})
44803 +@defmac PHI_ARG_DEF (@var{phi}, @var{i})
44804 Returns the @code{SSA_NAME} for the @var{i}th argument of @var{phi}.
44805 @end defmac
44806
44807 @@ -1274,36 +1274,36 @@ the program@.
44808 For instance, given the following code:
44809
44810 @smallexample
44811 - 1 L0:
44812 - 2 x_1 = PHI (0, x_5)
44813 - 3 if (x_1 < 10)
44814 - 4 if (x_1 > 7)
44815 - 5 y_2 = 0
44816 - 6 else
44817 - 7 y_3 = x_1 + x_7
44818 - 8 endif
44819 - 9 x_5 = x_1 + 1
44820 + 1 L0:
44821 + 2 x_1 = PHI (0, x_5)
44822 + 3 if (x_1 < 10)
44823 + 4 if (x_1 > 7)
44824 + 5 y_2 = 0
44825 + 6 else
44826 + 7 y_3 = x_1 + x_7
44827 + 8 endif
44828 + 9 x_5 = x_1 + 1
44829 10 goto L0;
44830 - 11 endif
44831 + 11 endif
44832 @end smallexample
44833
44834 Suppose that we insert new names @code{x_10} and @code{x_11} (lines
44835 @code{4} and @code{8})@.
44836
44837 @smallexample
44838 - 1 L0:
44839 - 2 x_1 = PHI (0, x_5)
44840 - 3 if (x_1 < 10)
44841 - 4 x_10 = @dots{}
44842 - 5 if (x_1 > 7)
44843 - 6 y_2 = 0
44844 - 7 else
44845 - 8 x_11 = @dots{}
44846 - 9 y_3 = x_1 + x_7
44847 - 10 endif
44848 - 11 x_5 = x_1 + 1
44849 - 12 goto L0;
44850 - 13 endif
44851 + 1 L0:
44852 + 2 x_1 = PHI (0, x_5)
44853 + 3 if (x_1 < 10)
44854 + 4 x_10 = @dots{}
44855 + 5 if (x_1 > 7)
44856 + 6 y_2 = 0
44857 + 7 else
44858 + 8 x_11 = @dots{}
44859 + 9 y_3 = x_1 + x_7
44860 + 10 endif
44861 + 11 x_5 = x_1 + 1
44862 + 12 goto L0;
44863 + 13 endif
44864 @end smallexample
44865
44866 We want to replace all the uses of @code{x_1} with the new definitions
44867 @@ -1341,40 +1341,40 @@ There are several @code{TODO} flags that
44868
44869 @itemize @bullet
44870 @item @code{TODO_update_ssa}. Update the SSA form inserting PHI nodes
44871 - for newly exposed symbols and virtual names marked for updating.
44872 - When updating real names, only insert PHI nodes for a real name
44873 - @code{O_j} in blocks reached by all the new and old definitions for
44874 - @code{O_j}. If the iterated dominance frontier for @code{O_j}
44875 - is not pruned, we may end up inserting PHI nodes in blocks that
44876 - have one or more edges with no incoming definition for
44877 - @code{O_j}. This would lead to uninitialized warnings for
44878 - @code{O_j}'s symbol@.
44879 +for newly exposed symbols and virtual names marked for updating.
44880 +When updating real names, only insert PHI nodes for a real name
44881 +@code{O_j} in blocks reached by all the new and old definitions for
44882 +@code{O_j}. If the iterated dominance frontier for @code{O_j}
44883 +is not pruned, we may end up inserting PHI nodes in blocks that
44884 +have one or more edges with no incoming definition for
44885 +@code{O_j}. This would lead to uninitialized warnings for
44886 +@code{O_j}'s symbol@.
44887
44888 @item @code{TODO_update_ssa_no_phi}. Update the SSA form without
44889 - inserting any new PHI nodes at all. This is used by passes that
44890 - have either inserted all the PHI nodes themselves or passes that
44891 - need only to patch use-def and def-def chains for virtuals
44892 - (e.g., DCE)@.
44893 +inserting any new PHI nodes at all. This is used by passes that
44894 +have either inserted all the PHI nodes themselves or passes that
44895 +need only to patch use-def and def-def chains for virtuals
44896 +(e.g., DCE)@.
44897
44898
44899 @item @code{TODO_update_ssa_full_phi}. Insert PHI nodes everywhere
44900 - they are needed. No pruning of the IDF is done. This is used
44901 - by passes that need the PHI nodes for @code{O_j} even if it
44902 - means that some arguments will come from the default definition
44903 - of @code{O_j}'s symbol (e.g., @code{pass_linear_transform})@.
44904 -
44905 - WARNING: If you need to use this flag, chances are that your
44906 - pass may be doing something wrong. Inserting PHI nodes for an
44907 - old name where not all edges carry a new replacement may lead to
44908 - silent codegen errors or spurious uninitialized warnings@.
44909 +they are needed. No pruning of the IDF is done. This is used
44910 +by passes that need the PHI nodes for @code{O_j} even if it
44911 +means that some arguments will come from the default definition
44912 +of @code{O_j}'s symbol (e.g., @code{pass_linear_transform})@.
44913 +
44914 +WARNING: If you need to use this flag, chances are that your
44915 +pass may be doing something wrong. Inserting PHI nodes for an
44916 +old name where not all edges carry a new replacement may lead to
44917 +silent codegen errors or spurious uninitialized warnings@.
44918
44919 @item @code{TODO_update_ssa_only_virtuals}. Passes that update the
44920 - SSA form on their own may want to delegate the updating of
44921 - virtual names to the generic updater. Since FUD chains are
44922 - easier to maintain, this simplifies the work they need to do.
44923 - NOTE: If this flag is used, any OLD->NEW mappings for real names
44924 - are explicitly destroyed and only the symbols marked for
44925 - renaming are processed@.
44926 +SSA form on their own may want to delegate the updating of
44927 +virtual names to the generic updater. Since FUD chains are
44928 +easier to maintain, this simplifies the work they need to do.
44929 +NOTE: If this flag is used, any OLD->NEW mappings for real names
44930 +are explicitly destroyed and only the symbols marked for
44931 +renaming are processed@.
44932 @end itemize
44933
44934 @subsection Preserving the virtual SSA form
44935 @@ -1445,8 +1445,8 @@ slightly different. For each argument @
44936 function will:
44937
44938 @enumerate
44939 -@item Walk the use-def chains for @var{arg}.
44940 -@item Call @code{FN (@var{arg}, @var{phi}, @var{data})}.
44941 +@item Walk the use-def chains for @var{arg}.
44942 +@item Call @code{FN (@var{arg}, @var{phi}, @var{data})}.
44943 @end enumerate
44944
44945 Note how the first argument to @var{fn} is no longer the original
44946 @@ -1466,26 +1466,26 @@ hooks to execute custom code at various
44947
44948 @enumerate
44949 @item Once to initialize any local data needed while processing
44950 - @var{bb} and its children. This local data is pushed into an
44951 - internal stack which is automatically pushed and popped as the
44952 - walker traverses the dominator tree.
44953 +@var{bb} and its children. This local data is pushed into an
44954 +internal stack which is automatically pushed and popped as the
44955 +walker traverses the dominator tree.
44956
44957 @item Once before traversing all the statements in the @var{bb}.
44958
44959 @item Once for every statement inside @var{bb}.
44960
44961 @item Once after traversing all the statements and before recursing
44962 - into @var{bb}'s dominator children.
44963 +into @var{bb}'s dominator children.
44964
44965 @item It then recurses into all the dominator children of @var{bb}.
44966
44967 @item After recursing into all the dominator children of @var{bb} it
44968 - can, optionally, traverse every statement in @var{bb} again
44969 - (i.e., repeating steps 2 and 3).
44970 +can, optionally, traverse every statement in @var{bb} again
44971 +(i.e., repeating steps 2 and 3).
44972
44973 @item Once after walking the statements in @var{bb} and @var{bb}'s
44974 - dominator children. At this stage, the block local data stack
44975 - is popped.
44976 +dominator children. At this stage, the block local data stack
44977 +is popped.
44978 @end enumerate
44979 @end deftypefn
44980
44981 @@ -1535,16 +1535,16 @@ int bar (void)
44982 If you copy the symbol tag for a variable for some reason, you probably
44983 also want to copy the subvariables for that variable.
44984
44985 -@item Points-to and escape analysis.
44986 +@item Points-to and escape analysis.
44987
44988 This phase walks the use-def chains in the SSA web looking for
44989 three things:
44990
44991 - @itemize @bullet
44992 - @item Assignments of the form @code{P_i = &VAR}
44993 - @item Assignments of the form P_i = malloc()
44994 - @item Pointers and ADDR_EXPR that escape the current function.
44995 - @end itemize
44996 +@itemize @bullet
44997 +@item Assignments of the form @code{P_i = &VAR}
44998 +@item Assignments of the form P_i = malloc()
44999 +@item Pointers and ADDR_EXPR that escape the current function.
45000 +@end itemize
45001
45002 The concept of `escaping' is the same one used in the Java world.
45003 When a pointer or an ADDR_EXPR escapes, it means that it has been
45004 @@ -1562,7 +1562,7 @@ call-clobbered. Simply put, if an ADDR_
45005 variable is call-clobbered. If a pointer P_i escapes, then all
45006 the variables pointed-to by P_i (and its memory tag) also escape.
45007
45008 -@item Compute flow-sensitive aliases
45009 +@item Compute flow-sensitive aliases
45010
45011 We have two classes of memory tags. Memory tags associated with
45012 the pointed-to data type of the pointers in the program. These
45013 @@ -1579,7 +1579,7 @@ associated with each pointer P_i. If P_
45014 call-clobbered the variables it points to and its tag.
45015
45016
45017 -@item Compute flow-insensitive aliases
45018 +@item Compute flow-insensitive aliases
45019
45020 This pass will compare the alias set of every symbol memory tag and
45021 every addressable variable found in the program. Given a symbol
45022 --- a/gcc/doc/trouble.texi
45023 +++ b/gcc/doc/trouble.texi
45024 @@ -19,21 +19,21 @@ missing features that are too much work
45025 where people's opinions differ as to what is best.
45026
45027 @menu
45028 -* Actual Bugs:: Bugs we will fix later.
45029 -* Cross-Compiler Problems:: Common problems of cross compiling with GCC.
45030 +* Actual Bugs:: Bugs we will fix later.
45031 +* Cross-Compiler Problems:: Common problems of cross compiling with GCC.
45032 * Interoperation:: Problems using GCC with other compilers,
45033 - and with certain linkers, assemblers and debuggers.
45034 + and with certain linkers, assemblers and debuggers.
45035 * Incompatibilities:: GCC is incompatible with traditional C.
45036 * Fixed Headers:: GCC uses corrected versions of system header files.
45037 - This is necessary, but doesn't always work smoothly.
45038 + This is necessary, but doesn't always work smoothly.
45039 * Standard Libraries:: GCC uses the system C library, which might not be
45040 - compliant with the ISO C standard.
45041 + compliant with the ISO C standard.
45042 * Disappointments:: Regrettable things we can't change, but not quite bugs.
45043 -* C++ Misunderstandings:: Common misunderstandings with GNU C++.
45044 +* C++ Misunderstandings:: Common misunderstandings with GNU C++.
45045 * Protoize Caveats:: Things to watch out for when using @code{protoize}.
45046 -* Non-bugs:: Things we think are right, but some others disagree.
45047 +* Non-bugs:: Things we think are right, but some others disagree.
45048 * Warnings and Errors:: Which problems in your code get warnings,
45049 - and which get errors.
45050 + and which get errors.
45051 @end menu
45052
45053 @node Actual Bugs
45054 --- a/gcc/dse.c
45055 +++ b/gcc/dse.c
45056 @@ -228,7 +228,7 @@ struct store_info
45057 /* An bitmask as wide as the number of bytes in the word that
45058 contains a 1 if the byte may be needed. The store is unused if
45059 all of the bits are 0. */
45060 - long positions_needed;
45061 + unsigned HOST_WIDEST_INT positions_needed;
45062
45063 /* The next store info for this insn. */
45064 struct store_info *next;
45065 @@ -239,6 +239,15 @@ struct store_info
45066 rtx rhs;
45067 };
45068
45069 +/* Return a bitmask with the first N low bits set. */
45070 +
45071 +static unsigned HOST_WIDEST_INT
45072 +lowpart_bitmask (int n)
45073 +{
45074 + unsigned HOST_WIDEST_INT mask = ~(unsigned HOST_WIDEST_INT) 0;
45075 + return mask >> (HOST_BITS_PER_WIDEST_INT - n);
45076 +}
45077 +
45078 typedef struct store_info *store_info_t;
45079 static alloc_pool cse_store_info_pool;
45080 static alloc_pool rtx_store_info_pool;
45081 @@ -1153,6 +1162,39 @@ clear_rhs_from_active_local_stores (void
45082 }
45083 }
45084
45085 +/* Mark byte POS bytes from the beginning of store S_INFO as unneeded. */
45086 +
45087 +static inline void
45088 +set_position_unneeded (store_info_t s_info, int pos)
45089 +{
45090 + s_info->positions_needed &= ~(((unsigned HOST_WIDEST_INT) 1) << pos);
45091 +}
45092 +
45093 +/* Mark the whole store S_INFO as unneeded. */
45094 +
45095 +static inline void
45096 +set_all_positions_unneeded (store_info_t s_info)
45097 +{
45098 + s_info->positions_needed = (unsigned HOST_WIDEST_INT) 0;
45099 +}
45100 +
45101 +/* Return TRUE if any bytes from S_INFO store are needed. */
45102 +
45103 +static inline bool
45104 +any_positions_needed_p (store_info_t s_info)
45105 +{
45106 + return (s_info->positions_needed != (unsigned HOST_WIDEST_INT) 0);
45107 +}
45108 +
45109 +/* Return TRUE if all bytes START through START+WIDTH-1 from S_INFO
45110 + store are needed. */
45111 +
45112 +static inline bool
45113 +all_positions_needed_p (store_info_t s_info, int start, int width)
45114 +{
45115 + unsigned HOST_WIDEST_INT mask = lowpart_bitmask (width) << start;
45116 + return (s_info->positions_needed & mask) == mask;
45117 +}
45118
45119 /* BODY is an instruction pattern that belongs to INSN. Return 1 if
45120 there is a candidate store, after adding it to the appropriate
45121 @@ -1223,6 +1265,7 @@ record_store (rtx body, bb_info_t bb_inf
45122 }
45123
45124 width = GET_MODE_SIZE (GET_MODE (mem));
45125 + gcc_assert ((unsigned) width <= HOST_BITS_PER_WIDEST_INT);
45126
45127 if (spill_alias_set)
45128 {
45129 @@ -1308,7 +1351,7 @@ record_store (rtx body, bb_info_t bb_inf
45130 && (GET_MODE (mem) == entry->mode))
45131 {
45132 delete = true;
45133 - s_info->positions_needed = 0;
45134 + set_all_positions_unneeded (s_info);
45135 }
45136 if (dump_file)
45137 fprintf (dump_file, " trying spill store in insn=%d alias_set=%d\n",
45138 @@ -1322,9 +1365,10 @@ record_store (rtx body, bb_info_t bb_inf
45139 fprintf (dump_file, " trying store in insn=%d gid=%d[%d..%d)\n",
45140 INSN_UID (ptr->insn), s_info->group_id,
45141 (int)s_info->begin, (int)s_info->end);
45142 - for (i = offset; i < offset+width; i++)
45143 - if (i >= s_info->begin && i < s_info->end)
45144 - s_info->positions_needed &= ~(1L << (i - s_info->begin));
45145 + for (i = MAX (offset, s_info->begin);
45146 + i < offset + width && i < s_info->end;
45147 + i++)
45148 + set_position_unneeded (s_info, i - s_info->begin);
45149 }
45150 else if (s_info->rhs)
45151 /* Need to see if it is possible for this store to overwrite
45152 @@ -1340,9 +1384,9 @@ record_store (rtx body, bb_info_t bb_inf
45153
45154 /* An insn can be deleted if every position of every one of
45155 its s_infos is zero. */
45156 - if (s_info->positions_needed != 0)
45157 + if (any_positions_needed_p (s_info))
45158 delete = false;
45159 -
45160 +
45161 if (delete)
45162 {
45163 insn_info_t insn_to_delete = ptr;
45164 @@ -1360,8 +1404,6 @@ record_store (rtx body, bb_info_t bb_inf
45165 ptr = next;
45166 }
45167
45168 - gcc_assert ((unsigned) width < sizeof (store_info->positions_needed) * CHAR_BIT);
45169 -
45170 /* Finish filling in the store_info. */
45171 store_info->next = insn_info->store_rec;
45172 insn_info->store_rec = store_info;
45173 @@ -1369,7 +1411,7 @@ record_store (rtx body, bb_info_t bb_inf
45174 store_info->alias_set = spill_alias_set;
45175 store_info->mem_addr = get_addr (XEXP (mem, 0));
45176 store_info->cse_base = base;
45177 - store_info->positions_needed = (1L << width) - 1;
45178 + store_info->positions_needed = lowpart_bitmask (width);
45179 store_info->group_id = group_id;
45180 store_info->begin = offset;
45181 store_info->end = offset + width;
45182 @@ -1820,16 +1862,14 @@ check_mem_read_rtx (rtx *loc, void *data
45183 else
45184 {
45185 if (store_info->rhs
45186 - && (offset >= store_info->begin)
45187 - && (offset + width <= store_info->end))
45188 - {
45189 - int mask = ((1L << width) - 1) << (offset - store_info->begin);
45190 -
45191 - if ((store_info->positions_needed & mask) == mask
45192 - && replace_read (store_info, i_ptr,
45193 - read_info, insn_info, loc))
45194 - return 0;
45195 - }
45196 + && offset >= store_info->begin
45197 + && offset + width <= store_info->end
45198 + && all_positions_needed_p (store_info,
45199 + offset - store_info->begin,
45200 + width)
45201 + && replace_read (store_info, i_ptr, read_info,
45202 + insn_info, loc))
45203 + return 0;
45204 /* The bases are the same, just see if the offsets
45205 overlap. */
45206 if ((offset < store_info->end)
45207 @@ -1887,16 +1927,12 @@ check_mem_read_rtx (rtx *loc, void *data
45208 if (store_info->rhs
45209 && store_info->group_id == -1
45210 && store_info->cse_base == base
45211 - && (offset >= store_info->begin)
45212 - && (offset + width <= store_info->end))
45213 - {
45214 - int mask = ((1L << width) - 1) << (offset - store_info->begin);
45215 -
45216 - if ((store_info->positions_needed & mask) == mask
45217 - && replace_read (store_info, i_ptr,
45218 - read_info, insn_info, loc))
45219 - return 0;
45220 - }
45221 + && offset >= store_info->begin
45222 + && offset + width <= store_info->end
45223 + && all_positions_needed_p (store_info,
45224 + offset - store_info->begin, width)
45225 + && replace_read (store_info, i_ptr, read_info, insn_info, loc))
45226 + return 0;
45227
45228 if (!store_info->alias_set)
45229 remove = canon_true_dependence (store_info->mem,
45230 --- a/gcc/dwarf2out.c
45231 +++ b/gcc/dwarf2out.c
45232 @@ -1705,7 +1705,7 @@ static dw_cfa_location cfa_temp;
45233 static void
45234 dwarf2out_frame_debug_expr (rtx expr, const char *label)
45235 {
45236 - rtx src, dest;
45237 + rtx src, dest, span;
45238 HOST_WIDE_INT offset;
45239
45240 /* If RTX_FRAME_RELATED_P is set on a PARALLEL, process each member of
45241 @@ -2081,7 +2081,32 @@ dwarf2out_frame_debug_expr (rtx expr, co
45242 }
45243
45244 def_cfa_1 (label, &cfa);
45245 - queue_reg_save (label, src, NULL_RTX, offset);
45246 + {
45247 + span = targetm.dwarf_register_span (src);
45248 +
45249 + if (!span)
45250 + queue_reg_save (label, src, NULL_RTX, offset);
45251 + else
45252 + {
45253 + /* We have a PARALLEL describing where the contents of SRC
45254 + live. Queue register saves for each piece of the
45255 + PARALLEL. */
45256 + int par_index;
45257 + int limit;
45258 + HOST_WIDE_INT span_offset = offset;
45259 +
45260 + gcc_assert (GET_CODE (span) == PARALLEL);
45261 +
45262 + limit = XVECLEN (span, 0);
45263 + for (par_index = 0; par_index < limit; par_index++)
45264 + {
45265 + rtx elem = XVECEXP (span, 0, par_index);
45266 +
45267 + queue_reg_save (label, elem, NULL_RTX, span_offset);
45268 + span_offset += GET_MODE_SIZE (GET_MODE (elem));
45269 + }
45270 + }
45271 + }
45272 break;
45273
45274 default:
45275 @@ -3914,6 +3939,7 @@ static void dwarf2out_imported_module_or
45276 static void dwarf2out_abstract_function (tree);
45277 static void dwarf2out_var_location (rtx);
45278 static void dwarf2out_begin_function (tree);
45279 +static void dwarf2out_set_name (tree, tree);
45280
45281 /* The debug hooks structure. */
45282
45283 @@ -3947,6 +3973,7 @@ const struct gcc_debug_hooks dwarf2_debu
45284 debug_nothing_int, /* handle_pch */
45285 dwarf2out_var_location,
45286 dwarf2out_switch_text_section,
45287 + dwarf2out_set_name,
45288 1 /* start_end_main_source_file */
45289 };
45290 #endif
45291 @@ -5334,12 +5361,9 @@ debug_str_eq (const void *x1, const void
45292 (const char *)x2) == 0;
45293 }
45294
45295 -/* Add a string attribute value to a DIE. */
45296 -
45297 -static inline void
45298 -add_AT_string (dw_die_ref die, enum dwarf_attribute attr_kind, const char *str)
45299 +static struct indirect_string_node *
45300 +find_AT_string (const char *str)
45301 {
45302 - dw_attr_node attr;
45303 struct indirect_string_node *node;
45304 void **slot;
45305
45306 @@ -5360,6 +5384,18 @@ add_AT_string (dw_die_ref die, enum dwar
45307 node = (struct indirect_string_node *) *slot;
45308
45309 node->refcount++;
45310 + return node;
45311 +}
45312 +
45313 +/* Add a string attribute value to a DIE. */
45314 +
45315 +static inline void
45316 +add_AT_string (dw_die_ref die, enum dwarf_attribute attr_kind, const char *str)
45317 +{
45318 + dw_attr_node attr;
45319 + struct indirect_string_node *node;
45320 +
45321 + node = find_AT_string (str);
45322
45323 attr.dw_attr = attr_kind;
45324 attr.dw_attr_val.val_class = dw_val_class_str;
45325 @@ -14538,6 +14574,31 @@ maybe_emit_file (struct dwarf_file_data
45326 return fd->emitted_number;
45327 }
45328
45329 +/* Replace DW_AT_name for the decl with name. */
45330 +
45331 +static void
45332 +dwarf2out_set_name (tree decl, tree name)
45333 +{
45334 + dw_die_ref die;
45335 + dw_attr_ref attr;
45336 +
45337 + die = TYPE_SYMTAB_DIE (decl);
45338 + if (!die)
45339 + return;
45340 +
45341 + attr = get_AT (die, DW_AT_name);
45342 + if (attr)
45343 + {
45344 + struct indirect_string_node *node;
45345 +
45346 + node = find_AT_string (dwarf2_name (name, 0));
45347 + /* replace the string. */
45348 + attr->dw_attr_val.v.val_str = node;
45349 + }
45350 +
45351 + else
45352 + add_name_attribute (die, dwarf2_name (name, 0));
45353 +}
45354 /* Called by the final INSN scan whenever we see a var location. We
45355 use it to drop labels in the right places, and throw the location in
45356 our lookup table. */
45357 --- a/gcc/emit-rtl.c
45358 +++ b/gcc/emit-rtl.c
45359 @@ -1909,6 +1909,7 @@ adjust_address_1 (rtx memref, enum machi
45360 rtx memoffset = MEM_OFFSET (memref);
45361 rtx size = 0;
45362 unsigned int memalign = MEM_ALIGN (memref);
45363 + int pbits;
45364
45365 /* If there are no changes, just return the original memory reference. */
45366 if (mode == GET_MODE (memref) && !offset
45367 @@ -1920,6 +1921,16 @@ adjust_address_1 (rtx memref, enum machi
45368 (plus (plus reg reg) const_int) -- so do this always. */
45369 addr = copy_rtx (addr);
45370
45371 + /* Convert a possibly large offset to a signed value within the
45372 + range of the target address space. */
45373 + pbits = GET_MODE_BITSIZE (Pmode);
45374 + if (HOST_BITS_PER_WIDE_INT > pbits)
45375 + {
45376 + int shift = HOST_BITS_PER_WIDE_INT - pbits;
45377 + offset = (((HOST_WIDE_INT) ((unsigned HOST_WIDE_INT) offset << shift))
45378 + >> shift);
45379 + }
45380 +
45381 if (adjust)
45382 {
45383 /* If MEMREF is a LO_SUM and the offset is within the alignment of the
45384 --- a/gcc/explow.c
45385 +++ b/gcc/explow.c
45386 @@ -489,6 +489,7 @@ memory_address (enum machine_mode mode,
45387
45388 done:
45389
45390 + gcc_assert (memory_address_p (mode, x));
45391 /* If we didn't change the address, we are done. Otherwise, mark
45392 a reg as a pointer if we have REG or REG + CONST_INT. */
45393 if (oldx == x)
45394 @@ -1489,9 +1490,9 @@ hard_function_value (const_tree valtype,
45395 in which a scalar value of mode MODE was returned by a library call. */
45396
45397 rtx
45398 -hard_libcall_value (enum machine_mode mode)
45399 +hard_libcall_value (enum machine_mode mode, rtx fun)
45400 {
45401 - return LIBCALL_VALUE (mode);
45402 + return targetm.calls.libcall_value (mode, fun);
45403 }
45404
45405 /* Look up the tree code for a given rtx code
45406 --- a/gcc/expmed.c
45407 +++ b/gcc/expmed.c
45408 @@ -103,7 +103,8 @@ static int add_cost[NUM_MACHINE_MODES];
45409 static int neg_cost[NUM_MACHINE_MODES];
45410 static int shift_cost[NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
45411 static int shiftadd_cost[NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
45412 -static int shiftsub_cost[NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
45413 +static int shiftsub0_cost[NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
45414 +static int shiftsub1_cost[NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
45415 static int mul_cost[NUM_MACHINE_MODES];
45416 static int sdiv_cost[NUM_MACHINE_MODES];
45417 static int udiv_cost[NUM_MACHINE_MODES];
45418 @@ -130,7 +131,8 @@ init_expmed (void)
45419 struct rtx_def shift; rtunion shift_fld1;
45420 struct rtx_def shift_mult; rtunion shift_mult_fld1;
45421 struct rtx_def shift_add; rtunion shift_add_fld1;
45422 - struct rtx_def shift_sub; rtunion shift_sub_fld1;
45423 + struct rtx_def shift_sub0; rtunion shift_sub0_fld1;
45424 + struct rtx_def shift_sub1; rtunion shift_sub1_fld1;
45425 } all;
45426
45427 rtx pow2[MAX_BITS_PER_WORD];
45428 @@ -202,9 +204,13 @@ init_expmed (void)
45429 XEXP (&all.shift_add, 0) = &all.shift_mult;
45430 XEXP (&all.shift_add, 1) = &all.reg;
45431
45432 - PUT_CODE (&all.shift_sub, MINUS);
45433 - XEXP (&all.shift_sub, 0) = &all.shift_mult;
45434 - XEXP (&all.shift_sub, 1) = &all.reg;
45435 + PUT_CODE (&all.shift_sub0, MINUS);
45436 + XEXP (&all.shift_sub0, 0) = &all.shift_mult;
45437 + XEXP (&all.shift_sub0, 1) = &all.reg;
45438 +
45439 + PUT_CODE (&all.shift_sub1, MINUS);
45440 + XEXP (&all.shift_sub1, 0) = &all.reg;
45441 + XEXP (&all.shift_sub1, 1) = &all.shift_mult;
45442
45443 for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT);
45444 mode != VOIDmode;
45445 @@ -222,7 +228,8 @@ init_expmed (void)
45446 PUT_MODE (&all.shift, mode);
45447 PUT_MODE (&all.shift_mult, mode);
45448 PUT_MODE (&all.shift_add, mode);
45449 - PUT_MODE (&all.shift_sub, mode);
45450 + PUT_MODE (&all.shift_sub0, mode);
45451 + PUT_MODE (&all.shift_sub1, mode);
45452
45453 add_cost[mode] = rtx_cost (&all.plus, SET);
45454 neg_cost[mode] = rtx_cost (&all.neg, SET);
45455 @@ -248,7 +255,7 @@ init_expmed (void)
45456 }
45457
45458 shift_cost[mode][0] = 0;
45459 - shiftadd_cost[mode][0] = shiftsub_cost[mode][0] = add_cost[mode];
45460 + shiftadd_cost[mode][0] = shiftsub0_cost[mode][0] = shiftsub1_cost[mode][0] = add_cost[mode];
45461
45462 n = MIN (MAX_BITS_PER_WORD, GET_MODE_BITSIZE (mode));
45463 for (m = 1; m < n; m++)
45464 @@ -258,7 +265,8 @@ init_expmed (void)
45465
45466 shift_cost[mode][m] = rtx_cost (&all.shift, SET);
45467 shiftadd_cost[mode][m] = rtx_cost (&all.shift_add, SET);
45468 - shiftsub_cost[mode][m] = rtx_cost (&all.shift_sub, SET);
45469 + shiftsub0_cost[mode][m] = rtx_cost (&all.shift_sub0, SET);
45470 + shiftsub1_cost[mode][m] = rtx_cost (&all.shift_sub1, SET);
45471 }
45472 }
45473 }
45474 @@ -976,7 +984,10 @@ store_fixed_bit_field (rtx op0, unsigned
45475 }
45476
45477 if (op0 != temp)
45478 - emit_move_insn (op0, temp);
45479 + {
45480 + op0 = copy_rtx (op0);
45481 + emit_move_insn (op0, temp);
45482 + }
45483 }
45484 \f
45485 /* Store a bit field that is split across multiple accessible memory objects.
45486 @@ -2426,6 +2437,7 @@ synth_mult (struct algorithm *alg_out, u
45487 struct mult_cost best_cost;
45488 struct mult_cost new_limit;
45489 int op_cost, op_latency;
45490 + unsigned HOST_WIDE_INT orig_t = t;
45491 unsigned HOST_WIDE_INT q;
45492 int maxm = MIN (BITS_PER_WORD, GET_MODE_BITSIZE (mode));
45493 int hash_index;
45494 @@ -2568,6 +2580,38 @@ synth_mult (struct algorithm *alg_out, u
45495 best_alg->log[best_alg->ops] = m;
45496 best_alg->op[best_alg->ops] = alg_shift;
45497 }
45498 +
45499 + /* See if treating ORIG_T as a signed number yields a better
45500 + sequence. Try this sequence only for a negative ORIG_T
45501 + as it would be useless for a non-negative ORIG_T. */
45502 + if ((HOST_WIDE_INT) orig_t < 0)
45503 + {
45504 + /* Shift ORIG_T as follows because a right shift of a
45505 + negative-valued signed type is implementation
45506 + defined. */
45507 + q = ~(~orig_t >> m);
45508 + /* The function expand_shift will choose between a shift
45509 + and a sequence of additions, so the observed cost is
45510 + given as MIN (m * add_cost[mode],
45511 + shift_cost[mode][m]). */
45512 + op_cost = m * add_cost[mode];
45513 + if (shift_cost[mode][m] < op_cost)
45514 + op_cost = shift_cost[mode][m];
45515 + new_limit.cost = best_cost.cost - op_cost;
45516 + new_limit.latency = best_cost.latency - op_cost;
45517 + synth_mult (alg_in, q, &new_limit, mode);
45518 +
45519 + alg_in->cost.cost += op_cost;
45520 + alg_in->cost.latency += op_cost;
45521 + if (CHEAPER_MULT_COST (&alg_in->cost, &best_cost))
45522 + {
45523 + struct algorithm *x;
45524 + best_cost = alg_in->cost;
45525 + x = alg_in, alg_in = best_alg, best_alg = x;
45526 + best_alg->log[best_alg->ops] = m;
45527 + best_alg->op[best_alg->ops] = alg_shift;
45528 + }
45529 + }
45530 }
45531 if (cache_hit)
45532 goto done;
45533 @@ -2630,6 +2674,29 @@ synth_mult (struct algorithm *alg_out, u
45534 best_alg->op[best_alg->ops] = alg_add_t_m2;
45535 }
45536 }
45537 +
45538 + /* We may be able to calculate a * -7, a * -15, a * -31, etc
45539 + quickly with a - a * n for some appropriate constant n. */
45540 + m = exact_log2 (-orig_t + 1);
45541 + if (m >= 0 && m < maxm)
45542 + {
45543 + op_cost = shiftsub1_cost[mode][m];
45544 + new_limit.cost = best_cost.cost - op_cost;
45545 + new_limit.latency = best_cost.latency - op_cost;
45546 + synth_mult (alg_in, (unsigned HOST_WIDE_INT) (-orig_t + 1) >> m, &new_limit, mode);
45547 +
45548 + alg_in->cost.cost += op_cost;
45549 + alg_in->cost.latency += op_cost;
45550 + if (CHEAPER_MULT_COST (&alg_in->cost, &best_cost))
45551 + {
45552 + struct algorithm *x;
45553 + best_cost = alg_in->cost;
45554 + x = alg_in, alg_in = best_alg, best_alg = x;
45555 + best_alg->log[best_alg->ops] = m;
45556 + best_alg->op[best_alg->ops] = alg_sub_t_m2;
45557 + }
45558 + }
45559 +
45560 if (cache_hit)
45561 goto done;
45562 }
45563 @@ -2699,9 +2766,9 @@ synth_mult (struct algorithm *alg_out, u
45564 hardware the shift may be executed concurrently with the
45565 earlier steps in the algorithm. */
45566 op_cost = add_cost[mode] + shift_cost[mode][m];
45567 - if (shiftsub_cost[mode][m] < op_cost)
45568 + if (shiftsub0_cost[mode][m] < op_cost)
45569 {
45570 - op_cost = shiftsub_cost[mode][m];
45571 + op_cost = shiftsub0_cost[mode][m];
45572 op_latency = op_cost;
45573 }
45574 else
45575 @@ -2764,7 +2831,7 @@ synth_mult (struct algorithm *alg_out, u
45576 m = exact_log2 (q);
45577 if (m >= 0 && m < maxm)
45578 {
45579 - op_cost = shiftsub_cost[mode][m];
45580 + op_cost = shiftsub0_cost[mode][m];
45581 new_limit.cost = best_cost.cost - op_cost;
45582 new_limit.latency = best_cost.latency - op_cost;
45583 synth_mult (alg_in, (t + 1) >> m, &new_limit, mode);
45584 --- a/gcc/expr.c
45585 +++ b/gcc/expr.c
45586 @@ -2038,10 +2038,55 @@ emit_group_store (rtx orig_dst, rtx src,
45587 HOST_WIDE_INT bytepos = INTVAL (XEXP (XVECEXP (src, 0, i), 1));
45588 enum machine_mode mode = GET_MODE (tmps[i]);
45589 unsigned int bytelen = GET_MODE_SIZE (mode);
45590 + unsigned int adj_bytelen = bytelen;
45591 rtx dest = dst;
45592
45593 /* Handle trailing fragments that run over the size of the struct. */
45594 if (ssize >= 0 && bytepos + (HOST_WIDE_INT) bytelen > ssize)
45595 + adj_bytelen = ssize - bytepos;
45596 +
45597 + if (GET_CODE (dst) == CONCAT)
45598 + {
45599 + if (bytepos + adj_bytelen
45600 + <= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0))))
45601 + dest = XEXP (dst, 0);
45602 + else if (bytepos >= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0))))
45603 + {
45604 + bytepos -= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0)));
45605 + dest = XEXP (dst, 1);
45606 + }
45607 + else
45608 + {
45609 + enum machine_mode dest_mode = GET_MODE (dest);
45610 + enum machine_mode tmp_mode = GET_MODE (tmps[i]);
45611 +
45612 + gcc_assert (bytepos == 0 && XVECLEN (src, 0));
45613 +
45614 + if (GET_MODE_ALIGNMENT (dest_mode)
45615 + >= GET_MODE_ALIGNMENT (tmp_mode))
45616 + {
45617 + dest = assign_stack_temp (dest_mode,
45618 + GET_MODE_SIZE (dest_mode),
45619 + 0);
45620 + emit_move_insn (adjust_address (dest,
45621 + tmp_mode,
45622 + bytepos),
45623 + tmps[i]);
45624 + dst = dest;
45625 + }
45626 + else
45627 + {
45628 + dest = assign_stack_temp (tmp_mode,
45629 + GET_MODE_SIZE (tmp_mode),
45630 + 0);
45631 + emit_move_insn (dest, tmps[i]);
45632 + dst = adjust_address (dest, dest_mode, bytepos);
45633 + }
45634 + break;
45635 + }
45636 + }
45637 +
45638 + if (ssize >= 0 && bytepos + (HOST_WIDE_INT) bytelen > ssize)
45639 {
45640 /* store_bit_field always takes its value from the lsb.
45641 Move the fragment to the lsb if it's not already there. */
45642 @@ -2059,28 +2104,7 @@ emit_group_store (rtx orig_dst, rtx src,
45643 build_int_cst (NULL_TREE, shift),
45644 tmps[i], 0);
45645 }
45646 - bytelen = ssize - bytepos;
45647 - }
45648 -
45649 - if (GET_CODE (dst) == CONCAT)
45650 - {
45651 - if (bytepos + bytelen <= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0))))
45652 - dest = XEXP (dst, 0);
45653 - else if (bytepos >= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0))))
45654 - {
45655 - bytepos -= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0)));
45656 - dest = XEXP (dst, 1);
45657 - }
45658 - else
45659 - {
45660 - gcc_assert (bytepos == 0 && XVECLEN (src, 0));
45661 - dest = assign_stack_temp (GET_MODE (dest),
45662 - GET_MODE_SIZE (GET_MODE (dest)), 0);
45663 - emit_move_insn (adjust_address (dest, GET_MODE (tmps[i]), bytepos),
45664 - tmps[i]);
45665 - dst = dest;
45666 - break;
45667 - }
45668 + bytelen = adj_bytelen;
45669 }
45670
45671 /* Optimize the access just a bit. */
45672 --- a/gcc/expr.h
45673 +++ b/gcc/expr.h
45674 @@ -729,7 +729,7 @@ extern void probe_stack_range (HOST_WIDE
45675
45676 /* Return an rtx that refers to the value returned by a library call
45677 in its original home. This becomes invalid if any more code is emitted. */
45678 -extern rtx hard_libcall_value (enum machine_mode);
45679 +extern rtx hard_libcall_value (enum machine_mode, rtx);
45680
45681 /* Return the mode desired by operand N of a particular bitfield
45682 insert/extract insn, or MAX_MACHINE_MODE if no such insn is
45683 --- a/gcc/final.c
45684 +++ b/gcc/final.c
45685 @@ -893,6 +893,7 @@ shorten_branches (rtx first ATTRIBUTE_UN
45686 if (LABEL_P (insn))
45687 {
45688 rtx next;
45689 + bool next_is_jumptable;
45690
45691 /* Merge in alignments computed by compute_alignments. */
45692 log = LABEL_TO_ALIGNMENT (insn);
45693 @@ -902,31 +903,30 @@ shorten_branches (rtx first ATTRIBUTE_UN
45694 max_skip = LABEL_TO_MAX_SKIP (insn);
45695 }
45696
45697 - log = LABEL_ALIGN (insn);
45698 - if (max_log < log)
45699 + next = next_nonnote_insn (insn);
45700 + next_is_jumptable = next && JUMP_TABLE_DATA_P (next);
45701 + if (!next_is_jumptable)
45702 {
45703 - max_log = log;
45704 - max_skip = LABEL_ALIGN_MAX_SKIP;
45705 + log = LABEL_ALIGN (insn);
45706 + if (max_log < log)
45707 + {
45708 + max_log = log;
45709 + max_skip = LABEL_ALIGN_MAX_SKIP;
45710 + }
45711 }
45712 - next = next_nonnote_insn (insn);
45713 /* ADDR_VECs only take room if read-only data goes into the text
45714 section. */
45715 - if (JUMP_TABLES_IN_TEXT_SECTION
45716 - || readonly_data_section == text_section)
45717 - if (next && JUMP_P (next))
45718 - {
45719 - rtx nextbody = PATTERN (next);
45720 - if (GET_CODE (nextbody) == ADDR_VEC
45721 - || GET_CODE (nextbody) == ADDR_DIFF_VEC)
45722 - {
45723 - log = ADDR_VEC_ALIGN (next);
45724 - if (max_log < log)
45725 - {
45726 - max_log = log;
45727 - max_skip = LABEL_ALIGN_MAX_SKIP;
45728 - }
45729 - }
45730 - }
45731 + if ((JUMP_TABLES_IN_TEXT_SECTION
45732 + || readonly_data_section == text_section)
45733 + && next_is_jumptable)
45734 + {
45735 + log = ADDR_VEC_ALIGN (next);
45736 + if (max_log < log)
45737 + {
45738 + max_log = log;
45739 + max_skip = LABEL_ALIGN_MAX_SKIP;
45740 + }
45741 + }
45742 LABEL_TO_ALIGNMENT (insn) = max_log;
45743 LABEL_TO_MAX_SKIP (insn) = max_skip;
45744 max_log = 0;
45745 @@ -1390,6 +1390,9 @@ asm_insn_count (rtx body)
45746 else
45747 template = decode_asm_operands (body, NULL, NULL, NULL, NULL, NULL);
45748
45749 + if (*template == '\0')
45750 + return 0;
45751 +
45752 for (; *template; template++)
45753 if (IS_ASM_LOGICAL_LINE_SEPARATOR (*template, template)
45754 || *template == '\n')
45755 @@ -2003,48 +2006,41 @@ final_scan_insn (rtx insn, FILE *file, i
45756 }
45757
45758 next = next_nonnote_insn (insn);
45759 - if (next != 0 && JUMP_P (next))
45760 + /* If this label is followed by a jump-table, make sure we put
45761 + the label in the read-only section. Also possibly write the
45762 + label and jump table together. */
45763 + if (next != 0 && JUMP_TABLE_DATA_P (next))
45764 {
45765 - rtx nextbody = PATTERN (next);
45766 -
45767 - /* If this label is followed by a jump-table,
45768 - make sure we put the label in the read-only section. Also
45769 - possibly write the label and jump table together. */
45770 -
45771 - if (GET_CODE (nextbody) == ADDR_VEC
45772 - || GET_CODE (nextbody) == ADDR_DIFF_VEC)
45773 - {
45774 #if defined(ASM_OUTPUT_ADDR_VEC) || defined(ASM_OUTPUT_ADDR_DIFF_VEC)
45775 - /* In this case, the case vector is being moved by the
45776 - target, so don't output the label at all. Leave that
45777 - to the back end macros. */
45778 + /* In this case, the case vector is being moved by the
45779 + target, so don't output the label at all. Leave that
45780 + to the back end macros. */
45781 #else
45782 - if (! JUMP_TABLES_IN_TEXT_SECTION)
45783 - {
45784 - int log_align;
45785 + if (! JUMP_TABLES_IN_TEXT_SECTION)
45786 + {
45787 + int log_align;
45788
45789 - switch_to_section (targetm.asm_out.function_rodata_section
45790 - (current_function_decl));
45791 + switch_to_section (targetm.asm_out.function_rodata_section
45792 + (current_function_decl));
45793
45794 #ifdef ADDR_VEC_ALIGN
45795 - log_align = ADDR_VEC_ALIGN (next);
45796 + log_align = ADDR_VEC_ALIGN (next);
45797 #else
45798 - log_align = exact_log2 (BIGGEST_ALIGNMENT / BITS_PER_UNIT);
45799 + log_align = exact_log2 (BIGGEST_ALIGNMENT / BITS_PER_UNIT);
45800 #endif
45801 - ASM_OUTPUT_ALIGN (file, log_align);
45802 - }
45803 - else
45804 - switch_to_section (current_function_section ());
45805 + ASM_OUTPUT_ALIGN (file, log_align);
45806 + }
45807 + else
45808 + switch_to_section (current_function_section ());
45809
45810 #ifdef ASM_OUTPUT_CASE_LABEL
45811 - ASM_OUTPUT_CASE_LABEL (file, "L", CODE_LABEL_NUMBER (insn),
45812 - next);
45813 + ASM_OUTPUT_CASE_LABEL (file, "L", CODE_LABEL_NUMBER (insn),
45814 + next);
45815 #else
45816 - targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (insn));
45817 + targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (insn));
45818 #endif
45819 #endif
45820 - break;
45821 - }
45822 + break;
45823 }
45824 if (LABEL_ALT_ENTRY_P (insn))
45825 output_alternate_entry_point (file, insn);
45826 --- a/gcc/fold-const.c
45827 +++ b/gcc/fold-const.c
45828 @@ -2290,7 +2290,24 @@ fold_convert_const_real_from_real (tree
45829 real_convert (&value, TYPE_MODE (type), &TREE_REAL_CST (arg1));
45830 t = build_real (type, value);
45831
45832 - TREE_OVERFLOW (t) = TREE_OVERFLOW (arg1);
45833 + /* If converting an infinity or NAN to a representation that doesn't
45834 + have one, set the overflow bit so that we can produce some kind of
45835 + error message at the appropriate point if necessary. It's not the
45836 + most user-friendly message, but it's better than nothing. */
45837 + if (REAL_VALUE_ISINF (TREE_REAL_CST (arg1))
45838 + && !MODE_HAS_INFINITIES (TYPE_MODE (type)))
45839 + TREE_OVERFLOW (t) = 1;
45840 + else if (REAL_VALUE_ISNAN (TREE_REAL_CST (arg1))
45841 + && !MODE_HAS_NANS (TYPE_MODE (type)))
45842 + TREE_OVERFLOW (t) = 1;
45843 + /* Regular overflow, conversion produced an infinity in a mode that
45844 + can't represent them. */
45845 + else if (!MODE_HAS_INFINITIES (TYPE_MODE (type))
45846 + && REAL_VALUE_ISINF (value)
45847 + && !REAL_VALUE_ISINF (TREE_REAL_CST (arg1)))
45848 + TREE_OVERFLOW (t) = 1;
45849 + else
45850 + TREE_OVERFLOW (t) = TREE_OVERFLOW (arg1);
45851 return t;
45852 }
45853
45854 --- a/gcc/function.c
45855 +++ b/gcc/function.c
45856 @@ -73,6 +73,10 @@ along with GCC; see the file COPYING3.
45857 #define LOCAL_ALIGNMENT(TYPE, ALIGNMENT) ALIGNMENT
45858 #endif
45859
45860 +#ifndef DATA_ALIGNMENT
45861 +#define DATA_ALIGNMENT(TYPE, ALIGNMENT) ALIGNMENT
45862 +#endif
45863 +
45864 #ifndef STACK_ALIGNMENT_NEEDED
45865 #define STACK_ALIGNMENT_NEEDED 1
45866 #endif
45867 @@ -419,7 +423,7 @@ assign_stack_local_1 (enum machine_mode
45868 stack slot. */
45869 type = lang_hooks.types.type_for_mode (mode, 0);
45870 if (type)
45871 - alignment = LOCAL_ALIGNMENT (type, alignment);
45872 + alignment = calculate_local_alignment (type, alignment);
45873
45874 alignment /= BITS_PER_UNIT;
45875 }
45876 @@ -625,7 +629,7 @@ assign_stack_temp_for_type (enum machine
45877 type = lang_hooks.types.type_for_mode (mode, 0);
45878
45879 if (type)
45880 - align = LOCAL_ALIGNMENT (type, align);
45881 + align = calculate_local_alignment (type, align);
45882
45883 /* Try to find an available, already-allocated temporary of the proper
45884 mode which meets the size and alignment requirements. Choose the
45885 @@ -1530,6 +1534,7 @@ instantiate_virtual_regs_in_insn (rtx in
45886 }
45887 x = simplify_gen_subreg (recog_data.operand_mode[i], new,
45888 GET_MODE (new), SUBREG_BYTE (x));
45889 + gcc_assert (x);
45890 break;
45891
45892 default:
45893 @@ -1845,6 +1850,9 @@ aggregate_value_p (const_tree exp, const
45894 bool
45895 use_register_for_decl (const_tree decl)
45896 {
45897 + if (!targetm.calls.allocate_stack_slots_for_args())
45898 + return true;
45899 +
45900 /* Honor volatile. */
45901 if (TREE_SIDE_EFFECTS (decl))
45902 return false;
45903 @@ -2425,6 +2433,30 @@ assign_parm_adjust_entry_rtl (struct ass
45904 data->entry_parm = entry_parm;
45905 }
45906
45907 +/* A subroutine of assign_parms. Reconstitute any values which were
45908 + passed in multiple registers and would fit in a single register. */
45909 +
45910 +static void
45911 +assign_parm_remove_parallels (struct assign_parm_data_one *data)
45912 +{
45913 + rtx entry_parm = data->entry_parm;
45914 +
45915 + /* Convert the PARALLEL to a REG of the same mode as the parallel.
45916 + This can be done with register operations rather than on the
45917 + stack, even if we will store the reconstituted parameter on the
45918 + stack later. */
45919 + if (GET_CODE (entry_parm) == PARALLEL
45920 + && data->passed_mode != BLKmode)
45921 + {
45922 + rtx parmreg = gen_reg_rtx (GET_MODE (entry_parm));
45923 + emit_group_store (parmreg, entry_parm, NULL_TREE,
45924 + GET_MODE_SIZE (GET_MODE (entry_parm)));
45925 + entry_parm = parmreg;
45926 + }
45927 +
45928 + data->entry_parm = entry_parm;
45929 +}
45930 +
45931 /* A subroutine of assign_parms. Adjust DATA->STACK_RTL such that it's
45932 always valid and properly aligned. */
45933
45934 @@ -2470,8 +2502,6 @@ assign_parm_setup_block_p (struct assign
45935 {
45936 if (data->nominal_mode == BLKmode)
45937 return true;
45938 - if (GET_CODE (data->entry_parm) == PARALLEL)
45939 - return true;
45940
45941 #ifdef BLOCK_REG_PADDING
45942 /* Only assign_parm_setup_block knows how to deal with register arguments
45943 @@ -2497,59 +2527,10 @@ assign_parm_setup_block (struct assign_p
45944 rtx stack_parm = data->stack_parm;
45945 HOST_WIDE_INT size;
45946 HOST_WIDE_INT size_stored;
45947 - rtx orig_entry_parm = entry_parm;
45948
45949 if (GET_CODE (entry_parm) == PARALLEL)
45950 entry_parm = emit_group_move_into_temps (entry_parm);
45951
45952 - /* If we've a non-block object that's nevertheless passed in parts,
45953 - reconstitute it in register operations rather than on the stack. */
45954 - if (GET_CODE (entry_parm) == PARALLEL
45955 - && data->nominal_mode != BLKmode)
45956 - {
45957 - rtx elt0 = XEXP (XVECEXP (orig_entry_parm, 0, 0), 0);
45958 -
45959 - if ((XVECLEN (entry_parm, 0) > 1
45960 - || hard_regno_nregs[REGNO (elt0)][GET_MODE (elt0)] > 1)
45961 - && use_register_for_decl (parm))
45962 - {
45963 - rtx parmreg = gen_reg_rtx (data->nominal_mode);
45964 -
45965 - push_to_sequence2 (all->first_conversion_insn,
45966 - all->last_conversion_insn);
45967 -
45968 - /* For values returned in multiple registers, handle possible
45969 - incompatible calls to emit_group_store.
45970 -
45971 - For example, the following would be invalid, and would have to
45972 - be fixed by the conditional below:
45973 -
45974 - emit_group_store ((reg:SF), (parallel:DF))
45975 - emit_group_store ((reg:SI), (parallel:DI))
45976 -
45977 - An example of this are doubles in e500 v2:
45978 - (parallel:DF (expr_list (reg:SI) (const_int 0))
45979 - (expr_list (reg:SI) (const_int 4))). */
45980 - if (data->nominal_mode != data->passed_mode)
45981 - {
45982 - rtx t = gen_reg_rtx (GET_MODE (entry_parm));
45983 - emit_group_store (t, entry_parm, NULL_TREE,
45984 - GET_MODE_SIZE (GET_MODE (entry_parm)));
45985 - convert_move (parmreg, t, 0);
45986 - }
45987 - else
45988 - emit_group_store (parmreg, entry_parm, data->nominal_type,
45989 - int_size_in_bytes (data->nominal_type));
45990 -
45991 - all->first_conversion_insn = get_insns ();
45992 - all->last_conversion_insn = get_last_insn ();
45993 - end_sequence ();
45994 -
45995 - SET_DECL_RTL (parm, parmreg);
45996 - return;
45997 - }
45998 - }
45999 -
46000 size = int_size_in_bytes (data->passed_type);
46001 size_stored = CEIL_ROUND (size, UNITS_PER_WORD);
46002 if (stack_parm == 0)
46003 @@ -2714,6 +2695,8 @@ assign_parm_setup_reg (struct assign_par
46004 else
46005 SET_DECL_RTL (parm, parmreg);
46006
46007 + assign_parm_remove_parallels (data);
46008 +
46009 /* Copy the value into the register. */
46010 if (data->nominal_mode != data->passed_mode
46011 || promoted_nominal_mode != data->promoted_mode)
46012 @@ -2876,6 +2859,8 @@ assign_parm_setup_stack (struct assign_p
46013 execution. */
46014 bool to_conversion = false;
46015
46016 + assign_parm_remove_parallels (data);
46017 +
46018 if (data->promoted_mode != data->nominal_mode)
46019 {
46020 /* Conversion is required. */
46021 @@ -5560,6 +5545,77 @@ current_function_assembler_name (void)
46022 {
46023 return IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (cfun->decl));
46024 }
46025 +
46026 +/* Helper function for below. This function adjusts alignments as
46027 + appropriate according to the setting of -falign-arrays. If that is
46028 + specified then the minimum alignment for array variables is set to be
46029 + the largest power of two less than or equal to their total storage size,
46030 + or the biggest alignment used on the machine, whichever is smaller. */
46031 +
46032 +static unsigned int
46033 +alignment_for_aligned_arrays (tree ty, unsigned int existing_alignment)
46034 +{
46035 + unsigned int min_alignment;
46036 + tree size;
46037 +
46038 + /* Return the existing alignment if not using -falign-arrays or if
46039 + the type is not an array type. */
46040 + if (!flag_align_arrays || TREE_CODE (ty) != ARRAY_TYPE)
46041 + return existing_alignment;
46042 +
46043 + /* Extract the total storage size of the array in bits. */
46044 + size = TYPE_SIZE (ty);
46045 + gcc_assert (size);
46046 +
46047 + /* At least for variable-length arrays, TREE_CODE (size) might not be an
46048 + integer constant; check it now. If it is not, give the array at
46049 + least BIGGEST_ALIGNMENT just to be safe. Furthermore, we assume that
46050 + alignments always fit into a host integer. So if we can't fit the
46051 + size of the array in bits into a host integer, it must also be large
46052 + enough to deserve at least BIGGEST_ALIGNMENT (see below). */
46053 + if (TREE_CODE (size) != INTEGER_CST || !host_integerp (size, 1))
46054 + min_alignment = BIGGEST_ALIGNMENT;
46055 + else
46056 + {
46057 + unsigned HOST_WIDE_INT bits = TREE_INT_CST_LOW (size);
46058 + bits = (bits ? bits : 1);
46059 +
46060 + /* An array with size greater than BIGGEST_ALIGNMENT is assigned
46061 + at least that alignment. In all other cases the minimum
46062 + alignment of the array is set to be the largest power of two
46063 + less than or equal to the total storage size of the array.
46064 + We assume that BIGGEST_ALIGNMENT fits in "unsigned int"; thus,
46065 + the shift below will not overflow. */
46066 + if (bits >= BIGGEST_ALIGNMENT)
46067 + min_alignment = BIGGEST_ALIGNMENT;
46068 + else
46069 + min_alignment = 1 << (floor_log2 (bits));
46070 + }
46071 +
46072 + /* Having computed the minimum permissible alignment, enlarge it
46073 + if EXISTING_ALIGNMENT is greater. */
46074 + return MAX (min_alignment, existing_alignment);
46075 +}
46076 +
46077 +/* Return the alignment in bits to be used for a local variable
46078 + of type TY whose usual alignment would be EXISTING_ALIGNMENT. */
46079 +
46080 +unsigned int
46081 +calculate_local_alignment (tree ty, unsigned int existing_alignment)
46082 +{
46083 + return alignment_for_aligned_arrays (ty,
46084 + LOCAL_ALIGNMENT (ty, existing_alignment));
46085 +}
46086 +
46087 +/* Return the alignment in bits to be used for a global variable
46088 + of type TY whose usual alignment would be EXISTING_ALIGNMENT. */
46089 +
46090 +unsigned int
46091 +calculate_global_alignment (tree ty, unsigned int existing_alignment)
46092 +{
46093 + return alignment_for_aligned_arrays (ty,
46094 + DATA_ALIGNMENT (ty, existing_alignment));
46095 +}
46096 \f
46097
46098 static unsigned int
46099 --- a/gcc/function.h
46100 +++ b/gcc/function.h
46101 @@ -594,4 +594,10 @@ extern bool reference_callee_copied (CUM
46102 extern void used_types_insert (tree);
46103
46104 extern int get_next_funcdef_no (void);
46105 +
46106 +extern unsigned int calculate_local_alignment (
46107 + tree ty, unsigned int existing_alignment);
46108 +extern unsigned int calculate_global_alignment (
46109 + tree ty, unsigned int existing_alignment);
46110 +
46111 #endif /* GCC_FUNCTION_H */
46112 --- a/gcc/gcc.c
46113 +++ b/gcc/gcc.c
46114 @@ -155,6 +155,8 @@ static const char *print_prog_name = NUL
46115
46116 static int print_multi_directory;
46117
46118 +static int print_sysroot;
46119 +
46120 /* Flag saying to print the relative path we'd use to
46121 find OS libraries given the current compiler flags. */
46122
46123 @@ -643,8 +645,32 @@ proper position among the other output f
46124
46125 /* config.h can define SWITCHES_NEED_SPACES to control which options
46126 require spaces between the option and the argument. */
46127 +/* GCC Bugzilla PR11810 indicates that GCC does not correctly handle
46128 + "-ofoo.o", in that it records "-ofoo.o" as a temporary file to
46129 + delete, rather than "foo.o".
46130 +
46131 + Unfortunately, Eclipse's makefile generators use the "-ofoo.o"
46132 + form. See also CS Issue #3433. So, although most users probably
46133 + use "-o foo.o", the "-ofoo.o" form is used in practice.
46134 +
46135 + See this email thread for additional information:
46136 +
46137 + http://gcc.gnu.org/ml/gcc/2008-07/msg00395.html
46138 +
46139 + Therefore, we define SWITCHES_NEED_SPACES to include "o" by
46140 + default. This causes "-ofoo.o" to be split into "-o foo.o" during
46141 + the initial processing of the command-line, before being seen by
46142 + the specs machinery.
46143 +
46144 + A risk of this change is that tools which *require* the "-ofoo.o"
46145 + form will no longer work. However, we know of no such tools, and
46146 + they would not have worked with the "-o foo.o" form anyhow.
46147 +
46148 + If this general strategy is acceptable upstream, the best approach
46149 + might be simply to eliminate this macro, since the only definitions
46150 + in target files are also to the value "o". */
46151 #ifndef SWITCHES_NEED_SPACES
46152 -#define SWITCHES_NEED_SPACES ""
46153 +#define SWITCHES_NEED_SPACES "o"
46154 #endif
46155
46156 /* config.h can define ENDFILE_SPEC to override the default crtn files. */
46157 @@ -720,6 +746,8 @@ proper position among the other output f
46158 %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
46159 %(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
46160 %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
46161 + %{Wno-poison-system-directories:--no-poison-system-directories}\
46162 + %{Werror=poison-system-directories:--error-poison-system-directories}\
46163 %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\
46164 %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)} %(mflib)\
46165 %{fprofile-arcs|fprofile-generate|coverage:-lgcov}\
46166 @@ -874,7 +902,7 @@ static const char *const multilib_defaul
46167 #endif
46168
46169 static const char *const driver_self_specs[] = {
46170 - DRIVER_SELF_SPECS, GOMP_SELF_SPECS
46171 + DRIVER_SELF_SPECS, CONFIGURE_SPECS, GOMP_SELF_SPECS
46172 };
46173
46174 #ifndef OPTION_DEFAULT_SPECS
46175 @@ -1150,6 +1178,7 @@ static const struct option_map option_ma
46176 {"--print-multi-directory", "-print-multi-directory", 0},
46177 {"--print-multi-os-directory", "-print-multi-os-directory", 0},
46178 {"--print-prog-name", "-print-prog-name=", "aj"},
46179 + {"--print-sysroot", "-print-sysroot", 0},
46180 {"--print-sysroot-headers-suffix", "-print-sysroot-headers-suffix", 0},
46181 {"--profile", "-p", 0},
46182 {"--profile-blocks", "-a", 0},
46183 @@ -3224,6 +3253,7 @@ display_help (void)
46184 -print-multi-lib Display the mapping between command line options and\n\
46185 multiple library search directories\n"), stdout);
46186 fputs (_(" -print-multi-os-directory Display the relative path to OS libraries\n"), stdout);
46187 + fputs (_(" -print-sysroot Display the target libraries directory\n"), stdout);
46188 fputs (_(" -print-sysroot-headers-suffix Display the sysroot suffix used to find headers\n"), stdout);
46189 fputs (_(" -Wa,<options> Pass comma-separated <options> on to the assembler\n"), stdout);
46190 fputs (_(" -Wp,<options> Pass comma-separated <options> on to the preprocessor\n"), stdout);
46191 @@ -3668,6 +3698,8 @@ warranty; not even for MERCHANTABILITY o
46192 print_multi_lib = 1;
46193 else if (! strcmp (argv[i], "-print-multi-directory"))
46194 print_multi_directory = 1;
46195 + else if (! strcmp (argv[i], "-print-sysroot"))
46196 + print_sysroot = 1;
46197 else if (! strcmp (argv[i], "-print-multi-os-directory"))
46198 print_multi_os_directory = 1;
46199 else if (! strcmp (argv[i], "-print-sysroot-headers-suffix"))
46200 @@ -4099,6 +4131,8 @@ warranty; not even for MERCHANTABILITY o
46201 ;
46202 else if (! strcmp (argv[i], "-print-multi-directory"))
46203 ;
46204 + else if (! strcmp (argv[i], "-print-sysroot"))
46205 + ;
46206 else if (! strcmp (argv[i], "-print-multi-os-directory"))
46207 ;
46208 else if (! strcmp (argv[i], "-print-sysroot-headers-suffix"))
46209 @@ -4518,28 +4552,51 @@ do_self_spec (const char *spec)
46210
46211 if (argbuf_index > 0)
46212 {
46213 - int i, first;
46214 + int i, first, n;
46215
46216 first = n_switches;
46217 - n_switches += argbuf_index;
46218 - switches = xrealloc (switches,
46219 - sizeof (struct switchstr) * (n_switches + 1));
46220 -
46221 - switches[n_switches] = switches[first];
46222 + n = n_switches + argbuf_index;
46223 + switches = xrealloc (switches, sizeof (struct switchstr) * (n + 1));
46224 + switches[n] = switches[first];
46225 for (i = 0; i < argbuf_index; i++)
46226 {
46227 struct switchstr *sw;
46228 + const char *p = &argbuf[i][1];
46229 + int c = *p;
46230
46231 /* Each switch should start with '-'. */
46232 if (argbuf[i][0] != '-')
46233 fatal ("switch '%s' does not start with '-'", argbuf[i]);
46234
46235 - sw = &switches[i + first];
46236 + sw = &switches[n_switches];
46237 sw->part1 = &argbuf[i][1];
46238 sw->args = 0;
46239 sw->live_cond = 0;
46240 sw->validated = 0;
46241 sw->ordering = 0;
46242 +
46243 + /* Deal with option arguments in separate argv elements. */
46244 + if ((SWITCH_TAKES_ARG (c) > (p[1] != 0))
46245 + || WORD_SWITCH_TAKES_ARG (p))
46246 + {
46247 + int j = 0;
46248 + int n_args = WORD_SWITCH_TAKES_ARG (p);
46249 +
46250 + if (n_args == 0)
46251 + {
46252 + /* Count only the option arguments in separate argv elements. */
46253 + n_args = SWITCH_TAKES_ARG (c) - (p[1] != 0);
46254 + }
46255 + if (i + n_args >= argbuf_index)
46256 + fatal ("argument to '-%s' is missing", p);
46257 + switches[n_switches].args
46258 + = XNEWVEC (const char *, n_args + 1);
46259 + while (j < n_args)
46260 + switches[n_switches].args[j++] = argbuf[++i];
46261 + /* Null-terminate the vector. */
46262 + switches[n_switches].args[j] = 0;
46263 + }
46264 + n_switches++;
46265 }
46266 }
46267 }
46268 @@ -6455,6 +6512,18 @@ main (int argc, char **argv)
46269 return (0);
46270 }
46271
46272 + if (print_sysroot)
46273 + {
46274 + if (target_system_root)
46275 + {
46276 + if (target_sysroot_suffix)
46277 + printf ("%s%s\n", target_system_root, target_sysroot_suffix);
46278 + else
46279 + printf ("%s\n", target_system_root);
46280 + }
46281 + return (0);
46282 + }
46283 +
46284 if (print_multi_os_directory)
46285 {
46286 if (multilib_os_dir == NULL)
46287 @@ -7949,7 +8018,7 @@ include_spec_function (int argc, const c
46288 if (argc != 1)
46289 abort ();
46290
46291 - file = find_a_file (&startfile_prefixes, argv[0], R_OK, 0);
46292 + file = find_a_file (&startfile_prefixes, argv[0], R_OK, true);
46293 read_specs (file ? file : argv[0], FALSE);
46294
46295 return NULL;
46296 --- a/gcc/gengtype-lex.c
46297 +++ /dev/null
46298 @@ -1,2636 +0,0 @@
46299 -#line 2 "gengtype-lex.c"
46300 -
46301 -#line 4 "gengtype-lex.c"
46302 -
46303 -#define YY_INT_ALIGNED short int
46304 -
46305 -/* A lexical scanner generated by flex */
46306 -
46307 -#define FLEX_SCANNER
46308 -#define YY_FLEX_MAJOR_VERSION 2
46309 -#define YY_FLEX_MINOR_VERSION 5
46310 -#define YY_FLEX_SUBMINOR_VERSION 35
46311 -#if YY_FLEX_SUBMINOR_VERSION > 0
46312 -#define FLEX_BETA
46313 -#endif
46314 -
46315 -/* First, we deal with platform-specific or compiler-specific issues. */
46316 -
46317 -/* begin standard C headers. */
46318 -#include <stdio.h>
46319 -#include <string.h>
46320 -#include <errno.h>
46321 -#include <stdlib.h>
46322 -
46323 -/* end standard C headers. */
46324 -
46325 -/* flex integer type definitions */
46326 -
46327 -#ifndef FLEXINT_H
46328 -#define FLEXINT_H
46329 -
46330 -/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
46331 -
46332 -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
46333 -
46334 -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
46335 - * if you want the limit (max/min) macros for int types.
46336 - */
46337 -#ifndef __STDC_LIMIT_MACROS
46338 -#define __STDC_LIMIT_MACROS 1
46339 -#endif
46340 -
46341 -#include <inttypes.h>
46342 -typedef int8_t flex_int8_t;
46343 -typedef uint8_t flex_uint8_t;
46344 -typedef int16_t flex_int16_t;
46345 -typedef uint16_t flex_uint16_t;
46346 -typedef int32_t flex_int32_t;
46347 -typedef uint32_t flex_uint32_t;
46348 -#else
46349 -typedef signed char flex_int8_t;
46350 -typedef short int flex_int16_t;
46351 -typedef int flex_int32_t;
46352 -typedef unsigned char flex_uint8_t;
46353 -typedef unsigned short int flex_uint16_t;
46354 -typedef unsigned int flex_uint32_t;
46355 -#endif /* ! C99 */
46356 -
46357 -/* Limits of integral types. */
46358 -#ifndef INT8_MIN
46359 -#define INT8_MIN (-128)
46360 -#endif
46361 -#ifndef INT16_MIN
46362 -#define INT16_MIN (-32767-1)
46363 -#endif
46364 -#ifndef INT32_MIN
46365 -#define INT32_MIN (-2147483647-1)
46366 -#endif
46367 -#ifndef INT8_MAX
46368 -#define INT8_MAX (127)
46369 -#endif
46370 -#ifndef INT16_MAX
46371 -#define INT16_MAX (32767)
46372 -#endif
46373 -#ifndef INT32_MAX
46374 -#define INT32_MAX (2147483647)
46375 -#endif
46376 -#ifndef UINT8_MAX
46377 -#define UINT8_MAX (255U)
46378 -#endif
46379 -#ifndef UINT16_MAX
46380 -#define UINT16_MAX (65535U)
46381 -#endif
46382 -#ifndef UINT32_MAX
46383 -#define UINT32_MAX (4294967295U)
46384 -#endif
46385 -
46386 -#endif /* ! FLEXINT_H */
46387 -
46388 -#ifdef __cplusplus
46389 -
46390 -/* The "const" storage-class-modifier is valid. */
46391 -#define YY_USE_CONST
46392 -
46393 -#else /* ! __cplusplus */
46394 -
46395 -/* C99 requires __STDC__ to be defined as 1. */
46396 -#if defined (__STDC__)
46397 -
46398 -#define YY_USE_CONST
46399 -
46400 -#endif /* defined (__STDC__) */
46401 -#endif /* ! __cplusplus */
46402 -
46403 -#ifdef YY_USE_CONST
46404 -#define yyconst const
46405 -#else
46406 -#define yyconst
46407 -#endif
46408 -
46409 -/* Returned upon end-of-file. */
46410 -#define YY_NULL 0
46411 -
46412 -/* Promotes a possibly negative, possibly signed char to an unsigned
46413 - * integer for use as an array index. If the signed char is negative,
46414 - * we want to instead treat it as an 8-bit unsigned char, hence the
46415 - * double cast.
46416 - */
46417 -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
46418 -
46419 -/* Enter a start condition. This macro really ought to take a parameter,
46420 - * but we do it the disgusting crufty way forced on us by the ()-less
46421 - * definition of BEGIN.
46422 - */
46423 -#define BEGIN (yy_start) = 1 + 2 *
46424 -
46425 -/* Translate the current start state into a value that can be later handed
46426 - * to BEGIN to return to the state. The YYSTATE alias is for lex
46427 - * compatibility.
46428 - */
46429 -#define YY_START (((yy_start) - 1) / 2)
46430 -#define YYSTATE YY_START
46431 -
46432 -/* Action number for EOF rule of a given start state. */
46433 -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
46434 -
46435 -/* Special action meaning "start processing a new file". */
46436 -#define YY_NEW_FILE yyrestart(yyin )
46437 -
46438 -#define YY_END_OF_BUFFER_CHAR 0
46439 -
46440 -/* Size of default input buffer. */
46441 -#ifndef YY_BUF_SIZE
46442 -#define YY_BUF_SIZE 16384
46443 -#endif
46444 -
46445 -/* The state buf must be large enough to hold one state per character in the main buffer.
46446 - */
46447 -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
46448 -
46449 -#ifndef YY_TYPEDEF_YY_BUFFER_STATE
46450 -#define YY_TYPEDEF_YY_BUFFER_STATE
46451 -typedef struct yy_buffer_state *YY_BUFFER_STATE;
46452 -#endif
46453 -
46454 -extern int yyleng;
46455 -
46456 -extern FILE *yyin, *yyout;
46457 -
46458 -#define EOB_ACT_CONTINUE_SCAN 0
46459 -#define EOB_ACT_END_OF_FILE 1
46460 -#define EOB_ACT_LAST_MATCH 2
46461 -
46462 - #define YY_LESS_LINENO(n)
46463 -
46464 -/* Return all but the first "n" matched characters back to the input stream. */
46465 -#define yyless(n) \
46466 - do \
46467 - { \
46468 - /* Undo effects of setting up yytext. */ \
46469 - int yyless_macro_arg = (n); \
46470 - YY_LESS_LINENO(yyless_macro_arg);\
46471 - *yy_cp = (yy_hold_char); \
46472 - YY_RESTORE_YY_MORE_OFFSET \
46473 - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
46474 - YY_DO_BEFORE_ACTION; /* set up yytext again */ \
46475 - } \
46476 - while ( 0 )
46477 -
46478 -#define unput(c) yyunput( c, (yytext_ptr) )
46479 -
46480 -#ifndef YY_TYPEDEF_YY_SIZE_T
46481 -#define YY_TYPEDEF_YY_SIZE_T
46482 -typedef size_t yy_size_t;
46483 -#endif
46484 -
46485 -#ifndef YY_STRUCT_YY_BUFFER_STATE
46486 -#define YY_STRUCT_YY_BUFFER_STATE
46487 -struct yy_buffer_state
46488 - {
46489 - FILE *yy_input_file;
46490 -
46491 - char *yy_ch_buf; /* input buffer */
46492 - char *yy_buf_pos; /* current position in input buffer */
46493 -
46494 - /* Size of input buffer in bytes, not including room for EOB
46495 - * characters.
46496 - */
46497 - yy_size_t yy_buf_size;
46498 -
46499 - /* Number of characters read into yy_ch_buf, not including EOB
46500 - * characters.
46501 - */
46502 - int yy_n_chars;
46503 -
46504 - /* Whether we "own" the buffer - i.e., we know we created it,
46505 - * and can realloc() it to grow it, and should free() it to
46506 - * delete it.
46507 - */
46508 - int yy_is_our_buffer;
46509 -
46510 - /* Whether this is an "interactive" input source; if so, and
46511 - * if we're using stdio for input, then we want to use getc()
46512 - * instead of fread(), to make sure we stop fetching input after
46513 - * each newline.
46514 - */
46515 - int yy_is_interactive;
46516 -
46517 - /* Whether we're considered to be at the beginning of a line.
46518 - * If so, '^' rules will be active on the next match, otherwise
46519 - * not.
46520 - */
46521 - int yy_at_bol;
46522 -
46523 - int yy_bs_lineno; /**< The line count. */
46524 - int yy_bs_column; /**< The column count. */
46525 -
46526 - /* Whether to try to fill the input buffer when we reach the
46527 - * end of it.
46528 - */
46529 - int yy_fill_buffer;
46530 -
46531 - int yy_buffer_status;
46532 -
46533 -#define YY_BUFFER_NEW 0
46534 -#define YY_BUFFER_NORMAL 1
46535 - /* When an EOF's been seen but there's still some text to process
46536 - * then we mark the buffer as YY_EOF_PENDING, to indicate that we
46537 - * shouldn't try reading from the input source any more. We might
46538 - * still have a bunch of tokens to match, though, because of
46539 - * possible backing-up.
46540 - *
46541 - * When we actually see the EOF, we change the status to "new"
46542 - * (via yyrestart()), so that the user can continue scanning by
46543 - * just pointing yyin at a new input file.
46544 - */
46545 -#define YY_BUFFER_EOF_PENDING 2
46546 -
46547 - };
46548 -#endif /* !YY_STRUCT_YY_BUFFER_STATE */
46549 -
46550 -/* Stack of input buffers. */
46551 -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
46552 -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
46553 -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
46554 -
46555 -/* We provide macros for accessing buffer states in case in the
46556 - * future we want to put the buffer states in a more general
46557 - * "scanner state".
46558 - *
46559 - * Returns the top of the stack, or NULL.
46560 - */
46561 -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
46562 - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
46563 - : NULL)
46564 -
46565 -/* Same as previous macro, but useful when we know that the buffer stack is not
46566 - * NULL or when we need an lvalue. For internal use only.
46567 - */
46568 -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
46569 -
46570 -/* yy_hold_char holds the character lost when yytext is formed. */
46571 -static char yy_hold_char;
46572 -static int yy_n_chars; /* number of characters read into yy_ch_buf */
46573 -int yyleng;
46574 -
46575 -/* Points to current character in buffer. */
46576 -static char *yy_c_buf_p = (char *) 0;
46577 -static int yy_init = 0; /* whether we need to initialize */
46578 -static int yy_start = 0; /* start state number */
46579 -
46580 -/* Flag which is used to allow yywrap()'s to do buffer switches
46581 - * instead of setting up a fresh yyin. A bit of a hack ...
46582 - */
46583 -static int yy_did_buffer_switch_on_eof;
46584 -
46585 -void yyrestart (FILE *input_file );
46586 -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
46587 -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
46588 -void yy_delete_buffer (YY_BUFFER_STATE b );
46589 -void yy_flush_buffer (YY_BUFFER_STATE b );
46590 -void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
46591 -void yypop_buffer_state (void );
46592 -
46593 -static void yyensure_buffer_stack (void );
46594 -static void yy_load_buffer_state (void );
46595 -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
46596 -
46597 -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
46598 -
46599 -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
46600 -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
46601 -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
46602 -
46603 -void *yyalloc (yy_size_t );
46604 -void *yyrealloc (void *,yy_size_t );
46605 -void yyfree (void * );
46606 -
46607 -#define yy_new_buffer yy_create_buffer
46608 -
46609 -#define yy_set_interactive(is_interactive) \
46610 - { \
46611 - if ( ! YY_CURRENT_BUFFER ){ \
46612 - yyensure_buffer_stack (); \
46613 - YY_CURRENT_BUFFER_LVALUE = \
46614 - yy_create_buffer(yyin,YY_BUF_SIZE ); \
46615 - } \
46616 - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
46617 - }
46618 -
46619 -#define yy_set_bol(at_bol) \
46620 - { \
46621 - if ( ! YY_CURRENT_BUFFER ){\
46622 - yyensure_buffer_stack (); \
46623 - YY_CURRENT_BUFFER_LVALUE = \
46624 - yy_create_buffer(yyin,YY_BUF_SIZE ); \
46625 - } \
46626 - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
46627 - }
46628 -
46629 -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
46630 -
46631 -/* Begin user sect3 */
46632 -
46633 -#define yywrap(n) 1
46634 -#define YY_SKIP_YYWRAP
46635 -
46636 -typedef unsigned char YY_CHAR;
46637 -
46638 -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
46639 -
46640 -typedef int yy_state_type;
46641 -
46642 -extern int yylineno;
46643 -
46644 -int yylineno = 1;
46645 -
46646 -extern char *yytext;
46647 -#define yytext_ptr yytext
46648 -
46649 -static yy_state_type yy_get_previous_state (void );
46650 -static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
46651 -static int yy_get_next_buffer (void );
46652 -static void yy_fatal_error (yyconst char msg[] );
46653 -
46654 -/* Done after the current pattern has been matched and before the
46655 - * corresponding action - sets up yytext.
46656 - */
46657 -#define YY_DO_BEFORE_ACTION \
46658 - (yytext_ptr) = yy_bp; \
46659 - yyleng = (size_t) (yy_cp - yy_bp); \
46660 - (yy_hold_char) = *yy_cp; \
46661 - *yy_cp = '\0'; \
46662 - (yy_c_buf_p) = yy_cp;
46663 -
46664 -#define YY_NUM_RULES 49
46665 -#define YY_END_OF_BUFFER 50
46666 -/* This struct is not used in this scanner,
46667 - but its presence is necessary. */
46668 -struct yy_trans_info
46669 - {
46670 - flex_int32_t yy_verify;
46671 - flex_int32_t yy_nxt;
46672 - };
46673 -static yyconst flex_int16_t yy_accept[445] =
46674 - { 0,
46675 - 0, 0, 0, 0, 0, 0, 0, 0, 50, 36,
46676 - 36, 33, 45, 36, 45, 34, 36, 36, 34, 34,
46677 - 34, 34, 34, 31, 10, 10, 31, 29, 31, 31,
46678 - 31, 20, 31, 31, 31, 31, 31, 31, 31, 31,
46679 - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
46680 - 31, 10, 31, 41, 39, 46, 46, 0, 0, 0,
46681 - 37, 0, 0, 0, 38, 32, 34, 0, 0, 0,
46682 - 0, 0, 0, 0, 0, 0, 34, 34, 34, 34,
46683 - 34, 10, 0, 25, 0, 0, 0, 0, 9, 20,
46684 - 24, 0, 0, 0, 0, 0, 0, 0, 0, 26,
46685 -
46686 - 11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
46687 - 0, 0, 0, 0, 0, 10, 0, 0, 0, 0,
46688 - 42, 44, 43, 0, 35, 0, 0, 0, 0, 0,
46689 - 0, 34, 34, 34, 34, 34, 34, 27, 28, 0,
46690 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
46691 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
46692 - 0, 0, 0, 30, 0, 0, 0, 0, 0, 0,
46693 - 0, 0, 0, 0, 34, 34, 34, 34, 34, 34,
46694 - 0, 0, 0, 13, 0, 14, 0, 0, 0, 0,
46695 - 22, 22, 0, 0, 0, 0, 0, 0, 0, 0,
46696 -
46697 - 0, 0, 0, 48, 0, 0, 0, 0, 0, 0,
46698 - 0, 34, 34, 34, 34, 34, 34, 0, 0, 0,
46699 - 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,
46700 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
46701 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,
46702 - 34, 34, 34, 34, 3, 0, 0, 0, 0, 12,
46703 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
46704 - 0, 0, 0, 0, 0, 0, 15, 0, 0, 0,
46705 - 0, 0, 0, 0, 34, 4, 5, 2, 34, 0,
46706 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
46707 -
46708 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,
46709 - 0, 0, 0, 0, 34, 1, 0, 0, 0, 0,
46710 - 0, 0, 0, 0, 0, 22, 22, 0, 0, 0,
46711 - 0, 0, 0, 0, 0, 0, 0, 34, 34, 34,
46712 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
46713 - 21, 0, 0, 0, 0, 0, 0, 34, 7, 6,
46714 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 18,
46715 - 0, 0, 0, 34, 0, 0, 0, 0, 0, 0,
46716 - 0, 0, 19, 0, 0, 47, 34, 0, 0, 0,
46717 - 0, 0, 0, 0, 0, 0, 0, 34, 0, 0,
46718 -
46719 - 0, 0, 0, 0, 0, 0, 34, 0, 24, 24,
46720 - 0, 0, 0, 0, 0, 0, 0, 34, 0, 0,
46721 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,
46722 - 0, 23, 0, 0, 0, 0, 0, 40, 0, 0,
46723 - 0, 0, 0, 0
46724 - } ;
46725 -
46726 -static yyconst flex_int32_t yy_ec[256] =
46727 - { 0,
46728 - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
46729 - 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
46730 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
46731 - 1, 2, 1, 4, 5, 1, 6, 1, 7, 8,
46732 - 9, 10, 1, 6, 6, 11, 12, 13, 13, 13,
46733 - 13, 13, 13, 13, 13, 13, 13, 6, 6, 6,
46734 - 6, 6, 1, 1, 14, 15, 16, 17, 18, 19,
46735 - 20, 21, 22, 23, 23, 24, 25, 26, 27, 28,
46736 - 23, 29, 30, 31, 32, 33, 34, 23, 35, 23,
46737 - 36, 37, 38, 1, 39, 1, 40, 41, 42, 43,
46738 -
46739 - 44, 45, 46, 47, 48, 49, 49, 50, 51, 52,
46740 - 53, 54, 49, 55, 56, 57, 58, 59, 49, 60,
46741 - 61, 62, 6, 6, 6, 1, 1, 1, 1, 1,
46742 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
46743 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
46744 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
46745 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
46746 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
46747 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
46748 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
46749 -
46750 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
46751 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
46752 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
46753 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
46754 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
46755 - 1, 1, 1, 1, 1
46756 - } ;
46757 -
46758 -static yyconst flex_int32_t yy_meta[63] =
46759 - { 0,
46760 - 1, 2, 3, 1, 1, 1, 1, 1, 4, 5,
46761 - 1, 1, 6, 7, 7, 7, 7, 7, 7, 7,
46762 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
46763 - 7, 7, 7, 7, 7, 8, 1, 1, 9, 9,
46764 - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
46765 - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
46766 - 9, 9
46767 - } ;
46768 -
46769 -static yyconst flex_int16_t yy_base[483] =
46770 - { 0,
46771 - 0, 38, 96, 12, 12, 13, 15, 16, 1028, 1444,
46772 - 32, 51, 20, 990, 1016, 0, 157, 18, 1007, 964,
46773 - 966, 961, 969, 1444, 25, 27, 27, 1444, 983, 1008,
46774 - 1008, 1004, 215, 253, 5, 32, 29, 974, 45, 962,
46775 - 996, 35, 38, 39, 40, 41, 134, 42, 136, 137,
46776 - 138, 75, 996, 0, 1444, 985, 984, 166, 964, 162,
46777 - 1444, 0, 987, 990, 1444, 1444, 0, 186, 165, 974,
46778 - 931, 933, 928, 936, 168, 943, 967, 928, 140, 930,
46779 - 935, 87, 167, 1444, 979, 974, 977, 968, 1444, 950,
46780 - 1444, 935, 934, 145, 52, 46, 148, 165, 922, 1444,
46781 -
46782 - 1444, 152, 156, 155, 170, 173, 175, 182, 183, 185,
46783 - 211, 214, 222, 218, 221, 269, 957, 956, 291, 0,
46784 - 1444, 1444, 1444, 922, 1444, 937, 898, 195, 900, 905,
46785 - 907, 912, 906, 892, 890, 903, 893, 1444, 1444, 209,
46786 - 254, 251, 353, 248, 391, 354, 350, 351, 340, 355,
46787 - 341, 429, 339, 356, 344, 347, 360, 390, 43, 361,
46788 - 391, 395, 429, 1444, 0, 0, 280, 906, 900, 886,
46789 - 884, 897, 872, 876, 890, 867, 873, 878, 876, 866,
46790 - 381, 348, 382, 1444, 384, 1444, 389, 397, 491, 398,
46791 - 1444, 528, 418, 399, 420, 477, 478, 422, 421, 480,
46792 -
46793 - 479, 0, 449, 1444, 884, 861, 867, 872, 870, 860,
46794 - 859, 892, 857, 866, 850, 862, 586, 493, 496, 494,
46795 - 484, 624, 1444, 0, 878, 876, 876, 834, 839, 841,
46796 - 832, 830, 199, 830, 490, 499, 486, 492, 488, 489,
46797 - 662, 0, 863, 828, 837, 821, 833, 0, 832, 859,
46798 - 700, 738, 776, 829, 1444, 431, 258, 437, 515, 1444,
46799 - 846, 844, 841, 817, 829, 809, 319, 815, 813, 478,
46800 - 809, 512, 528, 520, 525, 814, 1444, 0, 833, 0,
46801 - 0, 0, 803, 551, 808, 1444, 1444, 1444, 852, 383,
46802 - 521, 530, 539, 822, 829, 813, 793, 787, 802, 801,
46803 -
46804 - 556, 793, 783, 785, 792, 787, 523, 545, 535, 1444,
46805 - 0, 795, 0, 561, 585, 1444, 555, 343, 581, 584,
46806 - 794, 811, 792, 773, 772, 1444, 0, 771, 783, 772,
46807 - 764, 552, 890, 558, 0, 623, 778, 784, 928, 966,
46808 - 583, 593, 594, 613, 792, 792, 771, 761, 746, 591,
46809 - 1444, 1004, 0, 778, 0, 0, 766, 776, 1444, 1444,
46810 - 620, 621, 626, 627, 653, 777, 769, 775, 1042, 1444,
46811 - 0, 772, 787, 767, 556, 577, 615, 649, 629, 762,
46812 - 753, 774, 1444, 0, 763, 1444, 773, 632, 659, 662,
46813 - 656, 654, 754, 742, 753, 0, 754, 729, 665, 688,
46814 -
46815 - 667, 744, 742, 683, 0, 695, 692, 689, 715, 722,
46816 - 699, 711, 701, 666, 673, 0, 705, 1080, 704, 749,
46817 - 751, 753, 756, 663, 658, 618, 593, 0, 0, 1444,
46818 - 758, 1444, 760, 600, 588, 543, 483, 1444, 439, 386,
46819 - 247, 206, 167, 1444, 1118, 1127, 1136, 1145, 1154, 1158,
46820 - 1167, 1176, 1185, 1194, 1202, 1211, 1220, 1229, 1238, 1247,
46821 - 1256, 1265, 1273, 1282, 1290, 1298, 1306, 1314, 1323, 1331,
46822 - 1340, 1349, 1357, 1365, 1374, 1383, 1392, 1400, 1409, 1417,
46823 - 1426, 1435
46824 - } ;
46825 -
46826 -static yyconst flex_int16_t yy_def[483] =
46827 - { 0,
46828 - 445, 445, 444, 3, 446, 446, 446, 446, 444, 444,
46829 - 444, 444, 447, 448, 449, 450, 444, 444, 450, 450,
46830 - 450, 450, 450, 444, 444, 444, 451, 444, 452, 444,
46831 - 444, 444, 453, 453, 34, 34, 34, 34, 34, 454,
46832 - 444, 34, 34, 34, 34, 34, 34, 34, 34, 34,
46833 - 34, 444, 455, 456, 444, 457, 457, 444, 444, 447,
46834 - 444, 447, 444, 448, 444, 444, 450, 444, 444, 444,
46835 - 444, 444, 444, 444, 444, 444, 450, 450, 450, 450,
46836 - 450, 444, 451, 444, 451, 444, 452, 444, 444, 444,
46837 - 444, 34, 34, 34, 34, 34, 34, 34, 454, 444,
46838 -
46839 - 444, 34, 34, 34, 34, 34, 34, 34, 34, 34,
46840 - 34, 34, 34, 34, 34, 444, 455, 455, 444, 458,
46841 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
46842 - 444, 450, 450, 450, 450, 450, 450, 444, 444, 34,
46843 - 34, 34, 453, 34, 453, 34, 34, 34, 34, 34,
46844 - 34, 453, 34, 34, 34, 34, 34, 34, 34, 34,
46845 - 34, 34, 119, 444, 119, 459, 444, 444, 444, 444,
46846 - 444, 444, 444, 444, 450, 450, 450, 450, 450, 450,
46847 - 34, 34, 34, 444, 34, 444, 34, 34, 453, 34,
46848 - 444, 444, 34, 34, 34, 34, 34, 34, 34, 34,
46849 -
46850 - 34, 460, 444, 444, 444, 444, 444, 444, 444, 444,
46851 - 444, 450, 450, 450, 450, 450, 450, 34, 34, 34,
46852 - 34, 453, 444, 192, 444, 444, 444, 444, 444, 444,
46853 - 444, 444, 444, 444, 34, 34, 34, 34, 34, 34,
46854 - 453, 461, 444, 444, 444, 444, 444, 462, 444, 450,
46855 - 450, 450, 450, 450, 444, 34, 34, 34, 34, 444,
46856 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
46857 - 444, 34, 34, 34, 34, 453, 444, 463, 444, 464,
46858 - 465, 466, 444, 444, 450, 444, 444, 444, 450, 34,
46859 - 34, 34, 34, 444, 444, 444, 444, 444, 444, 444,
46860 -
46861 - 467, 444, 444, 444, 444, 444, 34, 34, 34, 444,
46862 - 468, 444, 469, 444, 450, 444, 34, 34, 34, 34,
46863 - 444, 444, 444, 444, 444, 444, 192, 444, 444, 444,
46864 - 444, 34, 453, 34, 470, 444, 444, 450, 450, 450,
46865 - 34, 34, 34, 34, 444, 444, 444, 444, 444, 34,
46866 - 444, 453, 471, 444, 472, 473, 444, 450, 444, 444,
46867 - 34, 34, 34, 34, 34, 444, 444, 444, 453, 444,
46868 - 474, 444, 444, 450, 34, 34, 34, 34, 34, 444,
46869 - 444, 444, 444, 475, 444, 444, 450, 34, 34, 34,
46870 - 34, 34, 444, 444, 444, 476, 444, 450, 34, 34,
46871 -
46872 - 34, 444, 444, 444, 477, 444, 450, 34, 444, 478,
46873 - 34, 444, 444, 444, 444, 479, 444, 450, 34, 444,
46874 - 478, 478, 480, 444, 444, 444, 444, 481, 482, 444,
46875 - 444, 444, 480, 444, 444, 444, 444, 444, 444, 444,
46876 - 444, 444, 444, 0, 444, 444, 444, 444, 444, 444,
46877 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
46878 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
46879 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
46880 - 444, 444
46881 - } ;
46882 -
46883 -static yyconst flex_int16_t yy_nxt[1507] =
46884 - { 0,
46885 - 10, 11, 12, 13, 10, 10, 14, 10, 10, 10,
46886 - 10, 15, 10, 52, 55, 55, 53, 55, 55, 75,
46887 - 444, 56, 56, 61, 57, 57, 82, 82, 82, 82,
46888 - 84, 92, 94, 58, 58, 10, 10, 10, 10, 17,
46889 - 12, 13, 18, 10, 14, 10, 10, 10, 10, 15,
46890 - 10, 59, 58, 58, 19, 92, 62, 95, 92, 96,
46891 - 76, 92, 98, 85, 92, 92, 92, 92, 92, 92,
46892 - 59, 92, 92, 10, 10, 10, 116, 82, 92, 117,
46893 - 143, 20, 105, 142, 103, 109, 198, 102, 82, 82,
46894 - 104, 106, 107, 21, 22, 23, 24, 25, 26, 27,
46895 -
46896 - 24, 28, 29, 28, 28, 28, 30, 31, 32, 33,
46897 - 34, 35, 33, 36, 33, 37, 38, 33, 33, 33,
46898 - 33, 33, 33, 33, 33, 33, 33, 33, 39, 33,
46899 - 33, 40, 41, 24, 33, 33, 42, 43, 44, 45,
46900 - 33, 33, 33, 46, 33, 47, 33, 48, 33, 49,
46901 - 33, 50, 33, 51, 33, 33, 33, 33, 68, 58,
46902 - 92, 69, 92, 92, 92, 61, 75, 58, 58, 75,
46903 - 84, 92, 141, 70, 92, 110, 59, 144, 92, 134,
46904 - 145, 92, 92, 112, 113, 59, 108, 68, 58, 115,
46905 - 69, 92, 111, 114, 135, 147, 92, 301, 62, 92,
46906 -
46907 - 71, 92, 70, 85, 146, 59, 148, 76, 92, 92,
46908 - 76, 92, 72, 73, 74, 91, 91, 91, 91, 91,
46909 - 91, 91, 91, 91, 91, 91, 91, 151, 149, 71,
46910 - 150, 152, 181, 153, 170, 92, 301, 92, 154, 155,
46911 - 92, 72, 73, 74, 92, 269, 270, 92, 92, 171,
46912 - 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
46913 - 91, 91, 91, 91, 91, 156, 157, 158, 161, 182,
46914 - 116, 82, 160, 117, 92, 183, 162, 92, 185, 93,
46915 - 92, 203, 203, 159, 92, 443, 291, 204, 91, 91,
46916 - 91, 163, 163, 164, 163, 163, 163, 163, 163, 163,
46917 -
46918 - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
46919 - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
46920 - 163, 163, 163, 163, 163, 163, 163, 163, 163, 165,
46921 - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
46922 - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
46923 - 165, 165, 165, 184, 184, 184, 184, 184, 184, 184,
46924 - 184, 184, 184, 184, 184, 92, 92, 92, 219, 92,
46925 - 92, 300, 342, 92, 92, 301, 92, 92, 188, 190,
46926 - 92, 92, 92, 194, 152, 195, 92, 92, 184, 184,
46927 - 184, 186, 186, 186, 186, 186, 186, 186, 186, 186,
46928 -
46929 - 186, 186, 186, 152, 152, 189, 187, 92, 92, 92,
46930 - 92, 442, 193, 317, 196, 92, 92, 92, 199, 218,
46931 - 220, 92, 221, 92, 92, 92, 186, 186, 186, 191,
46932 - 192, 192, 191, 191, 191, 191, 191, 191, 191, 191,
46933 - 191, 197, 201, 200, 92, 222, 92, 92, 92, 236,
46934 - 203, 203, 290, 152, 152, 441, 204, 92, 292, 237,
46935 - 239, 235, 240, 92, 191, 191, 191, 163, 163, 163,
46936 - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
46937 - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
46938 - 163, 223, 223, 223, 223, 223, 223, 223, 223, 223,
46939 -
46940 - 223, 223, 223, 92, 92, 92, 92, 256, 258, 257,
46941 - 92, 273, 92, 301, 92, 92, 92, 259, 92, 92,
46942 - 92, 238, 92, 304, 158, 92, 223, 223, 223, 224,
46943 - 224, 241, 272, 152, 152, 275, 293, 274, 92, 305,
46944 - 273, 92, 225, 226, 152, 276, 92, 92, 227, 92,
46945 - 307, 92, 314, 314, 92, 320, 92, 327, 327, 318,
46946 - 319, 92, 314, 314, 440, 92, 274, 308, 228, 229,
46947 - 230, 92, 309, 341, 334, 231, 332, 232, 92, 388,
46948 - 337, 92, 92, 233, 92, 234, 255, 255, 255, 255,
46949 - 255, 255, 255, 255, 255, 255, 255, 255, 338, 343,
46950 -
46951 - 333, 344, 389, 92, 361, 439, 339, 92, 350, 92,
46952 - 92, 340, 340, 352, 362, 363, 301, 92, 437, 92,
46953 - 92, 255, 255, 255, 260, 260, 260, 260, 260, 260,
46954 - 260, 260, 260, 260, 260, 260, 354, 375, 390, 92,
46955 - 376, 92, 364, 377, 355, 369, 92, 92, 152, 356,
46956 - 356, 365, 92, 92, 392, 92, 436, 378, 92, 260,
46957 - 260, 260, 277, 277, 277, 277, 277, 277, 277, 277,
46958 - 277, 277, 277, 277, 379, 92, 399, 401, 400, 92,
46959 - 92, 408, 92, 435, 152, 92, 434, 391, 92, 409,
46960 - 409, 92, 411, 92, 427, 410, 426, 277, 277, 277,
46961 -
46962 - 286, 286, 286, 286, 286, 286, 286, 286, 286, 286,
46963 - 286, 286, 414, 418, 92, 92, 420, 420, 418, 418,
46964 - 425, 415, 421, 422, 422, 92, 429, 419, 424, 152,
46965 - 92, 429, 429, 417, 152, 286, 286, 286, 287, 287,
46966 - 287, 287, 287, 287, 287, 287, 287, 287, 287, 287,
46967 - 420, 420, 422, 422, 422, 422, 421, 431, 431, 431,
46968 - 431, 431, 431, 413, 432, 412, 432, 407, 432, 406,
46969 - 404, 403, 402, 287, 287, 287, 288, 288, 288, 288,
46970 - 288, 288, 288, 288, 288, 288, 288, 288, 398, 397,
46971 - 395, 394, 393, 387, 386, 385, 382, 381, 380, 374,
46972 -
46973 - 373, 372, 301, 301, 368, 367, 366, 358, 357, 304,
46974 - 349, 288, 288, 288, 310, 310, 310, 310, 310, 310,
46975 - 310, 310, 310, 310, 310, 310, 348, 301, 301, 301,
46976 - 347, 346, 345, 336, 331, 330, 329, 328, 301, 325,
46977 - 324, 301, 301, 323, 322, 321, 315, 313, 312, 310,
46978 - 310, 310, 316, 316, 316, 316, 316, 316, 316, 316,
46979 - 316, 316, 316, 316, 306, 303, 302, 299, 298, 297,
46980 - 296, 295, 294, 289, 285, 284, 283, 282, 281, 280,
46981 - 279, 271, 268, 267, 266, 265, 264, 316, 316, 316,
46982 - 351, 351, 351, 351, 351, 351, 351, 351, 351, 351,
46983 -
46984 - 351, 351, 263, 262, 261, 254, 253, 252, 251, 250,
46985 - 249, 248, 247, 246, 245, 244, 243, 217, 216, 215,
46986 - 214, 213, 212, 211, 210, 351, 351, 351, 359, 359,
46987 - 359, 359, 359, 359, 359, 359, 359, 359, 359, 359,
46988 - 209, 208, 207, 206, 205, 180, 179, 178, 177, 176,
46989 - 175, 174, 173, 172, 169, 168, 167, 118, 118, 100,
46990 - 140, 92, 90, 359, 359, 359, 360, 360, 360, 360,
46991 - 360, 360, 360, 360, 360, 360, 360, 360, 139, 444,
46992 - 138, 444, 137, 136, 133, 132, 131, 130, 129, 128,
46993 - 127, 126, 444, 125, 124, 123, 122, 118, 101, 100,
46994 -
46995 - 97, 360, 360, 360, 370, 370, 370, 370, 370, 370,
46996 - 370, 370, 370, 370, 370, 370, 90, 89, 88, 87,
46997 - 81, 80, 79, 78, 77, 66, 64, 444, 444, 444,
46998 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 370,
46999 - 370, 370, 383, 383, 383, 383, 383, 383, 383, 383,
47000 - 383, 383, 383, 383, 444, 444, 444, 444, 444, 444,
47001 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
47002 - 444, 444, 444, 444, 444, 444, 444, 383, 383, 383,
47003 - 430, 430, 430, 430, 430, 430, 430, 430, 430, 430,
47004 - 430, 430, 444, 444, 444, 444, 444, 444, 444, 444,
47005 -
47006 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
47007 - 444, 444, 444, 444, 444, 430, 430, 430, 16, 16,
47008 - 16, 16, 16, 16, 16, 16, 16, 54, 54, 54,
47009 - 54, 54, 54, 54, 54, 54, 60, 60, 60, 60,
47010 - 60, 60, 60, 60, 60, 63, 63, 63, 63, 63,
47011 - 63, 63, 63, 63, 65, 65, 65, 65, 65, 65,
47012 - 65, 65, 65, 67, 67, 444, 67, 83, 83, 83,
47013 - 83, 83, 83, 83, 83, 83, 86, 86, 86, 86,
47014 - 86, 86, 86, 86, 86, 92, 92, 92, 92, 92,
47015 - 92, 92, 92, 92, 99, 99, 99, 99, 99, 99,
47016 -
47017 - 99, 444, 99, 119, 444, 444, 444, 444, 444, 444,
47018 - 119, 120, 120, 444, 120, 444, 120, 120, 120, 120,
47019 - 121, 121, 121, 121, 121, 121, 121, 121, 121, 166,
47020 - 166, 444, 166, 444, 166, 166, 166, 166, 202, 202,
47021 - 444, 202, 444, 202, 202, 202, 202, 242, 242, 444,
47022 - 242, 444, 242, 242, 242, 242, 278, 278, 444, 278,
47023 - 444, 278, 278, 278, 278, 255, 255, 255, 255, 255,
47024 - 444, 444, 255, 311, 311, 444, 311, 444, 311, 311,
47025 - 311, 311, 286, 286, 286, 286, 286, 444, 444, 286,
47026 - 287, 287, 287, 287, 287, 444, 444, 287, 288, 288,
47027 -
47028 - 288, 288, 288, 444, 444, 288, 326, 326, 326, 326,
47029 - 326, 444, 444, 326, 335, 335, 444, 335, 444, 335,
47030 - 335, 335, 335, 316, 316, 316, 316, 316, 444, 444,
47031 - 316, 353, 353, 444, 353, 444, 353, 353, 353, 353,
47032 - 371, 371, 444, 371, 444, 371, 371, 371, 371, 359,
47033 - 359, 359, 359, 359, 444, 444, 359, 360, 360, 360,
47034 - 360, 360, 444, 444, 360, 384, 384, 444, 384, 444,
47035 - 384, 384, 384, 384, 396, 396, 444, 396, 444, 396,
47036 - 396, 396, 396, 405, 405, 444, 405, 444, 405, 405,
47037 - 405, 405, 416, 416, 444, 416, 444, 416, 416, 416,
47038 -
47039 - 416, 423, 423, 444, 444, 444, 423, 444, 423, 428,
47040 - 428, 444, 428, 444, 428, 428, 428, 428, 433, 433,
47041 - 433, 444, 433, 433, 444, 433, 438, 438, 444, 438,
47042 - 444, 438, 438, 438, 438, 430, 430, 430, 430, 430,
47043 - 444, 444, 430, 9, 444, 444, 444, 444, 444, 444,
47044 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
47045 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
47046 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
47047 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
47048 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
47049 -
47050 - 444, 444, 444, 444, 444, 444
47051 - } ;
47052 -
47053 -static yyconst flex_int16_t yy_chk[1507] =
47054 - { 0,
47055 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
47056 - 1, 1, 1, 4, 5, 6, 4, 7, 8, 18,
47057 - 0, 5, 6, 13, 7, 8, 25, 25, 26, 26,
47058 - 27, 35, 35, 11, 11, 1, 1, 1, 2, 2,
47059 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
47060 - 2, 11, 12, 12, 2, 37, 13, 36, 36, 37,
47061 - 18, 42, 39, 27, 43, 44, 45, 46, 48, 159,
47062 - 12, 39, 96, 2, 2, 2, 52, 52, 95, 52,
47063 - 96, 2, 44, 95, 43, 48, 159, 42, 82, 82,
47064 - 43, 45, 46, 2, 2, 2, 3, 3, 3, 3,
47065 -
47066 - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
47067 - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
47068 - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
47069 - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
47070 - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
47071 - 3, 3, 3, 3, 3, 3, 3, 3, 17, 17,
47072 - 47, 17, 49, 50, 51, 60, 69, 58, 58, 75,
47073 - 83, 94, 94, 17, 97, 49, 17, 97, 102, 79,
47074 - 98, 104, 103, 50, 50, 58, 47, 68, 68, 51,
47075 - 68, 98, 49, 50, 79, 103, 105, 443, 60, 106,
47076 -
47077 - 17, 107, 68, 83, 102, 68, 104, 69, 108, 109,
47078 - 75, 110, 17, 17, 17, 33, 33, 33, 33, 33,
47079 - 33, 33, 33, 33, 33, 33, 33, 107, 105, 68,
47080 - 106, 107, 140, 108, 128, 140, 442, 111, 109, 110,
47081 - 112, 68, 68, 68, 114, 233, 233, 115, 113, 128,
47082 - 33, 33, 33, 34, 34, 34, 34, 34, 34, 34,
47083 - 34, 34, 34, 34, 34, 111, 112, 113, 115, 141,
47084 - 116, 116, 114, 116, 144, 142, 115, 142, 144, 34,
47085 - 141, 167, 167, 113, 257, 441, 257, 167, 34, 34,
47086 - 34, 119, 119, 119, 119, 119, 119, 119, 119, 119,
47087 -
47088 - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
47089 - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
47090 - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
47091 - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
47092 - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
47093 - 119, 119, 119, 143, 143, 143, 143, 143, 143, 143,
47094 - 143, 143, 143, 143, 143, 153, 149, 151, 182, 318,
47095 - 155, 267, 318, 156, 182, 267, 147, 148, 149, 151,
47096 - 146, 150, 154, 155, 153, 156, 157, 160, 143, 143,
47097 - 143, 145, 145, 145, 145, 145, 145, 145, 145, 145,
47098 -
47099 - 145, 145, 145, 146, 147, 150, 148, 181, 183, 290,
47100 - 185, 440, 154, 290, 157, 187, 158, 161, 160, 181,
47101 - 183, 162, 185, 188, 190, 194, 145, 145, 145, 152,
47102 - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
47103 - 152, 158, 162, 161, 193, 187, 195, 199, 198, 194,
47104 - 203, 203, 256, 188, 190, 439, 203, 256, 258, 195,
47105 - 198, 193, 199, 258, 152, 152, 152, 163, 163, 163,
47106 - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
47107 - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
47108 - 163, 189, 189, 189, 189, 189, 189, 189, 189, 189,
47109 -
47110 - 189, 189, 189, 196, 197, 201, 200, 218, 220, 219,
47111 - 221, 236, 237, 437, 239, 240, 235, 221, 238, 218,
47112 - 220, 197, 219, 270, 201, 236, 189, 189, 189, 192,
47113 - 192, 200, 235, 196, 238, 237, 259, 236, 272, 270,
47114 - 273, 259, 192, 192, 239, 240, 274, 291, 192, 307,
47115 - 272, 275, 284, 284, 273, 293, 292, 301, 301, 291,
47116 - 292, 309, 314, 314, 436, 293, 273, 274, 192, 192,
47117 - 192, 308, 275, 317, 309, 192, 307, 192, 332, 375,
47118 - 314, 317, 375, 192, 334, 192, 217, 217, 217, 217,
47119 - 217, 217, 217, 217, 217, 217, 217, 217, 315, 319,
47120 -
47121 - 308, 320, 376, 376, 341, 435, 315, 319, 332, 341,
47122 - 320, 315, 315, 334, 342, 343, 434, 350, 427, 342,
47123 - 343, 217, 217, 217, 222, 222, 222, 222, 222, 222,
47124 - 222, 222, 222, 222, 222, 222, 336, 361, 377, 344,
47125 - 362, 377, 344, 363, 336, 350, 361, 362, 388, 336,
47126 - 336, 344, 363, 364, 379, 379, 426, 364, 388, 222,
47127 - 222, 222, 241, 241, 241, 241, 241, 241, 241, 241,
47128 - 241, 241, 241, 241, 365, 378, 389, 391, 390, 365,
47129 - 392, 399, 391, 425, 392, 389, 424, 378, 390, 400,
47130 - 400, 399, 401, 401, 415, 400, 414, 241, 241, 241,
47131 -
47132 - 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
47133 - 251, 251, 404, 407, 400, 408, 409, 409, 407, 407,
47134 - 413, 404, 409, 410, 410, 411, 417, 408, 412, 411,
47135 - 419, 417, 417, 406, 419, 251, 251, 251, 252, 252,
47136 - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
47137 - 420, 420, 421, 421, 422, 422, 420, 423, 423, 431,
47138 - 431, 433, 433, 403, 423, 402, 431, 398, 433, 397,
47139 - 395, 394, 393, 252, 252, 252, 253, 253, 253, 253,
47140 - 253, 253, 253, 253, 253, 253, 253, 253, 387, 385,
47141 - 382, 381, 380, 374, 373, 372, 368, 367, 366, 358,
47142 -
47143 - 357, 354, 349, 348, 347, 346, 345, 338, 337, 331,
47144 - 330, 253, 253, 253, 276, 276, 276, 276, 276, 276,
47145 - 276, 276, 276, 276, 276, 276, 329, 328, 325, 324,
47146 - 323, 322, 321, 312, 306, 305, 304, 303, 302, 300,
47147 - 299, 298, 297, 296, 295, 294, 285, 283, 279, 276,
47148 - 276, 276, 289, 289, 289, 289, 289, 289, 289, 289,
47149 - 289, 289, 289, 289, 271, 269, 268, 266, 265, 264,
47150 - 263, 262, 261, 254, 250, 249, 247, 246, 245, 244,
47151 - 243, 234, 232, 231, 230, 229, 228, 289, 289, 289,
47152 - 333, 333, 333, 333, 333, 333, 333, 333, 333, 333,
47153 -
47154 - 333, 333, 227, 226, 225, 216, 215, 214, 213, 212,
47155 - 211, 210, 209, 208, 207, 206, 205, 180, 179, 178,
47156 - 177, 176, 175, 174, 173, 333, 333, 333, 339, 339,
47157 - 339, 339, 339, 339, 339, 339, 339, 339, 339, 339,
47158 - 172, 171, 170, 169, 168, 137, 136, 135, 134, 133,
47159 - 132, 131, 130, 129, 127, 126, 124, 118, 117, 99,
47160 - 93, 92, 90, 339, 339, 339, 340, 340, 340, 340,
47161 - 340, 340, 340, 340, 340, 340, 340, 340, 88, 87,
47162 - 86, 85, 81, 80, 78, 77, 76, 74, 73, 72,
47163 - 71, 70, 64, 63, 59, 57, 56, 53, 41, 40,
47164 -
47165 - 38, 340, 340, 340, 352, 352, 352, 352, 352, 352,
47166 - 352, 352, 352, 352, 352, 352, 32, 31, 30, 29,
47167 - 23, 22, 21, 20, 19, 15, 14, 9, 0, 0,
47168 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 352,
47169 - 352, 352, 369, 369, 369, 369, 369, 369, 369, 369,
47170 - 369, 369, 369, 369, 0, 0, 0, 0, 0, 0,
47171 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
47172 - 0, 0, 0, 0, 0, 0, 0, 369, 369, 369,
47173 - 418, 418, 418, 418, 418, 418, 418, 418, 418, 418,
47174 - 418, 418, 0, 0, 0, 0, 0, 0, 0, 0,
47175 -
47176 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
47177 - 0, 0, 0, 0, 0, 418, 418, 418, 445, 445,
47178 - 445, 445, 445, 445, 445, 445, 445, 446, 446, 446,
47179 - 446, 446, 446, 446, 446, 446, 447, 447, 447, 447,
47180 - 447, 447, 447, 447, 447, 448, 448, 448, 448, 448,
47181 - 448, 448, 448, 448, 449, 449, 449, 449, 449, 449,
47182 - 449, 449, 449, 450, 450, 0, 450, 451, 451, 451,
47183 - 451, 451, 451, 451, 451, 451, 452, 452, 452, 452,
47184 - 452, 452, 452, 452, 452, 453, 453, 453, 453, 453,
47185 - 453, 453, 453, 453, 454, 454, 454, 454, 454, 454,
47186 -
47187 - 454, 0, 454, 455, 0, 0, 0, 0, 0, 0,
47188 - 455, 456, 456, 0, 456, 0, 456, 456, 456, 456,
47189 - 457, 457, 457, 457, 457, 457, 457, 457, 457, 458,
47190 - 458, 0, 458, 0, 458, 458, 458, 458, 459, 459,
47191 - 0, 459, 0, 459, 459, 459, 459, 460, 460, 0,
47192 - 460, 0, 460, 460, 460, 460, 461, 461, 0, 461,
47193 - 0, 461, 461, 461, 461, 462, 462, 462, 462, 462,
47194 - 0, 0, 462, 463, 463, 0, 463, 0, 463, 463,
47195 - 463, 463, 464, 464, 464, 464, 464, 0, 0, 464,
47196 - 465, 465, 465, 465, 465, 0, 0, 465, 466, 466,
47197 -
47198 - 466, 466, 466, 0, 0, 466, 467, 467, 467, 467,
47199 - 467, 0, 0, 467, 468, 468, 0, 468, 0, 468,
47200 - 468, 468, 468, 469, 469, 469, 469, 469, 0, 0,
47201 - 469, 470, 470, 0, 470, 0, 470, 470, 470, 470,
47202 - 471, 471, 0, 471, 0, 471, 471, 471, 471, 472,
47203 - 472, 472, 472, 472, 0, 0, 472, 473, 473, 473,
47204 - 473, 473, 0, 0, 473, 474, 474, 0, 474, 0,
47205 - 474, 474, 474, 474, 475, 475, 0, 475, 0, 475,
47206 - 475, 475, 475, 476, 476, 0, 476, 0, 476, 476,
47207 - 476, 476, 477, 477, 0, 477, 0, 477, 477, 477,
47208 -
47209 - 477, 478, 478, 0, 0, 0, 478, 0, 478, 479,
47210 - 479, 0, 479, 0, 479, 479, 479, 479, 480, 480,
47211 - 480, 0, 480, 480, 0, 480, 481, 481, 0, 481,
47212 - 0, 481, 481, 481, 481, 482, 482, 482, 482, 482,
47213 - 0, 0, 482, 444, 444, 444, 444, 444, 444, 444,
47214 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
47215 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
47216 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
47217 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
47218 - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
47219 -
47220 - 444, 444, 444, 444, 444, 444
47221 - } ;
47222 -
47223 -static yy_state_type yy_last_accepting_state;
47224 -static char *yy_last_accepting_cpos;
47225 -
47226 -extern int yy_flex_debug;
47227 -int yy_flex_debug = 0;
47228 -
47229 -/* The intent behind this definition is that it'll catch
47230 - * any uses of REJECT which flex missed.
47231 - */
47232 -#define REJECT reject_used_but_not_detected
47233 -#define yymore() yymore_used_but_not_detected
47234 -#define YY_MORE_ADJ 0
47235 -#define YY_RESTORE_YY_MORE_OFFSET
47236 -char *yytext;
47237 -#line 1 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47238 -/* -*- indented-text -*- */
47239 -/* Process source files and output type information.
47240 - Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
47241 -
47242 -This file is part of GCC.
47243 -
47244 -GCC is free software; you can redistribute it and/or modify it under
47245 -the terms of the GNU General Public License as published by the Free
47246 -Software Foundation; either version 3, or (at your option) any later
47247 -version.
47248 -
47249 -GCC is distributed in the hope that it will be useful, but WITHOUT ANY
47250 -WARRANTY; without even the implied warranty of MERCHANTABILITY or
47251 -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
47252 -for more details.
47253 -
47254 -You should have received a copy of the GNU General Public License
47255 -along with GCC; see the file COPYING3. If not see
47256 -<http://www.gnu.org/licenses/>. */
47257 -#line 22 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47258 -#include "bconfig.h"
47259 -#include "system.h"
47260 -
47261 -#define malloc xmalloc
47262 -#define realloc xrealloc
47263 -
47264 -#include "gengtype.h"
47265 -
47266 -#define YY_DECL int yylex (const char **yylval)
47267 -#define yyterminate() return EOF_TOKEN
47268 -
47269 -struct fileloc lexer_line;
47270 -int lexer_toplevel_done;
47271 -
47272 -static void
47273 -update_lineno (const char *l, size_t len)
47274 -{
47275 - while (len-- > 0)
47276 - if (*l++ == '\n')
47277 - lexer_line.line++;
47278 -}
47279 -
47280 -
47281 -#line 984 "gengtype-lex.c"
47282 -
47283 -#define INITIAL 0
47284 -#define in_struct 1
47285 -#define in_struct_comment 2
47286 -#define in_comment 3
47287 -
47288 -#ifndef YY_NO_UNISTD_H
47289 -/* Special case for "unistd.h", since it is non-ANSI. We include it way
47290 - * down here because we want the user's section 1 to have been scanned first.
47291 - * The user has a chance to override it with an option.
47292 - */
47293 -#include <unistd.h>
47294 -#endif
47295 -
47296 -#ifndef YY_EXTRA_TYPE
47297 -#define YY_EXTRA_TYPE void *
47298 -#endif
47299 -
47300 -static int yy_init_globals (void );
47301 -
47302 -/* Accessor methods to globals.
47303 - These are made visible to non-reentrant scanners for convenience. */
47304 -
47305 -int yylex_destroy (void );
47306 -
47307 -int yyget_debug (void );
47308 -
47309 -void yyset_debug (int debug_flag );
47310 -
47311 -YY_EXTRA_TYPE yyget_extra (void );
47312 -
47313 -void yyset_extra (YY_EXTRA_TYPE user_defined );
47314 -
47315 -FILE *yyget_in (void );
47316 -
47317 -void yyset_in (FILE * in_str );
47318 -
47319 -FILE *yyget_out (void );
47320 -
47321 -void yyset_out (FILE * out_str );
47322 -
47323 -int yyget_leng (void );
47324 -
47325 -char *yyget_text (void );
47326 -
47327 -int yyget_lineno (void );
47328 -
47329 -void yyset_lineno (int line_number );
47330 -
47331 -/* Macros after this point can all be overridden by user definitions in
47332 - * section 1.
47333 - */
47334 -
47335 -#ifndef YY_SKIP_YYWRAP
47336 -#ifdef __cplusplus
47337 -extern "C" int yywrap (void );
47338 -#else
47339 -extern int yywrap (void );
47340 -#endif
47341 -#endif
47342 -
47343 -#ifndef yytext_ptr
47344 -static void yy_flex_strncpy (char *,yyconst char *,int );
47345 -#endif
47346 -
47347 -#ifdef YY_NEED_STRLEN
47348 -static int yy_flex_strlen (yyconst char * );
47349 -#endif
47350 -
47351 -#ifndef YY_NO_INPUT
47352 -
47353 -#ifdef __cplusplus
47354 -static int yyinput (void );
47355 -#else
47356 -static int input (void );
47357 -#endif
47358 -
47359 -#endif
47360 -
47361 -/* Amount of stuff to slurp up with each read. */
47362 -#ifndef YY_READ_BUF_SIZE
47363 -#define YY_READ_BUF_SIZE 8192
47364 -#endif
47365 -
47366 -/* Copy whatever the last rule matched to the standard output. */
47367 -#ifndef ECHO
47368 -/* This used to be an fputs(), but since the string might contain NUL's,
47369 - * we now use fwrite().
47370 - */
47371 -#define ECHO fwrite( yytext, yyleng, 1, yyout )
47372 -#endif
47373 -
47374 -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
47375 - * is returned in "result".
47376 - */
47377 -#ifndef YY_INPUT
47378 -#define YY_INPUT(buf,result,max_size) \
47379 - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
47380 - { \
47381 - int c = '*'; \
47382 - int n; \
47383 - for ( n = 0; n < max_size && \
47384 - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
47385 - buf[n] = (char) c; \
47386 - if ( c == '\n' ) \
47387 - buf[n++] = (char) c; \
47388 - if ( c == EOF && ferror( yyin ) ) \
47389 - YY_FATAL_ERROR( "input in flex scanner failed" ); \
47390 - result = n; \
47391 - } \
47392 - else \
47393 - { \
47394 - errno=0; \
47395 - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
47396 - { \
47397 - if( errno != EINTR) \
47398 - { \
47399 - YY_FATAL_ERROR( "input in flex scanner failed" ); \
47400 - break; \
47401 - } \
47402 - errno=0; \
47403 - clearerr(yyin); \
47404 - } \
47405 - }\
47406 -\
47407 -
47408 -#endif
47409 -
47410 -/* No semi-colon after return; correct usage is to write "yyterminate();" -
47411 - * we don't want an extra ';' after the "return" because that will cause
47412 - * some compilers to complain about unreachable statements.
47413 - */
47414 -#ifndef yyterminate
47415 -#define yyterminate() return YY_NULL
47416 -#endif
47417 -
47418 -/* Number of entries by which start-condition stack grows. */
47419 -#ifndef YY_START_STACK_INCR
47420 -#define YY_START_STACK_INCR 25
47421 -#endif
47422 -
47423 -/* Report a fatal error. */
47424 -#ifndef YY_FATAL_ERROR
47425 -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
47426 -#endif
47427 -
47428 -/* end tables serialization structures and prototypes */
47429 -
47430 -/* Default declaration of generated scanner - a define so the user can
47431 - * easily add parameters.
47432 - */
47433 -#ifndef YY_DECL
47434 -#define YY_DECL_IS_OURS 1
47435 -
47436 -extern int yylex (void);
47437 -
47438 -#define YY_DECL int yylex (void)
47439 -#endif /* !YY_DECL */
47440 -
47441 -/* Code executed at the beginning of each rule, after yytext and yyleng
47442 - * have been set up.
47443 - */
47444 -#ifndef YY_USER_ACTION
47445 -#define YY_USER_ACTION
47446 -#endif
47447 -
47448 -/* Code executed at the end of each rule. */
47449 -#ifndef YY_BREAK
47450 -#define YY_BREAK break;
47451 -#endif
47452 -
47453 -#define YY_RULE_SETUP \
47454 - if ( yyleng > 0 ) \
47455 - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
47456 - (yytext[yyleng - 1] == '\n'); \
47457 - YY_USER_ACTION
47458 -
47459 -/** The main scanner function which does all the work.
47460 - */
47461 -YY_DECL
47462 -{
47463 - register yy_state_type yy_current_state;
47464 - register char *yy_cp, *yy_bp;
47465 - register int yy_act;
47466 -
47467 -#line 56 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47468 -
47469 - /* Do this on entry to yylex(): */
47470 - *yylval = 0;
47471 - if (lexer_toplevel_done)
47472 - {
47473 - BEGIN(INITIAL);
47474 - lexer_toplevel_done = 0;
47475 - }
47476 -
47477 - /* Things we look for in skipping mode: */
47478 -#line 1181 "gengtype-lex.c"
47479 -
47480 - if ( !(yy_init) )
47481 - {
47482 - (yy_init) = 1;
47483 -
47484 -#ifdef YY_USER_INIT
47485 - YY_USER_INIT;
47486 -#endif
47487 -
47488 - if ( ! (yy_start) )
47489 - (yy_start) = 1; /* first start state */
47490 -
47491 - if ( ! yyin )
47492 - yyin = stdin;
47493 -
47494 - if ( ! yyout )
47495 - yyout = stdout;
47496 -
47497 - if ( ! YY_CURRENT_BUFFER ) {
47498 - yyensure_buffer_stack ();
47499 - YY_CURRENT_BUFFER_LVALUE =
47500 - yy_create_buffer(yyin,YY_BUF_SIZE );
47501 - }
47502 -
47503 - yy_load_buffer_state( );
47504 - }
47505 -
47506 - while ( 1 ) /* loops until end-of-file is reached */
47507 - {
47508 - yy_cp = (yy_c_buf_p);
47509 -
47510 - /* Support of yytext. */
47511 - *yy_cp = (yy_hold_char);
47512 -
47513 - /* yy_bp points to the position in yy_ch_buf of the start of
47514 - * the current run.
47515 - */
47516 - yy_bp = yy_cp;
47517 -
47518 - yy_current_state = (yy_start);
47519 - yy_current_state += YY_AT_BOL();
47520 -yy_match:
47521 - do
47522 - {
47523 - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
47524 - if ( yy_accept[yy_current_state] )
47525 - {
47526 - (yy_last_accepting_state) = yy_current_state;
47527 - (yy_last_accepting_cpos) = yy_cp;
47528 - }
47529 - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
47530 - {
47531 - yy_current_state = (int) yy_def[yy_current_state];
47532 - if ( yy_current_state >= 445 )
47533 - yy_c = yy_meta[(unsigned int) yy_c];
47534 - }
47535 - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
47536 - ++yy_cp;
47537 - }
47538 - while ( yy_current_state != 444 );
47539 - yy_cp = (yy_last_accepting_cpos);
47540 - yy_current_state = (yy_last_accepting_state);
47541 -
47542 -yy_find_action:
47543 - yy_act = yy_accept[yy_current_state];
47544 -
47545 - YY_DO_BEFORE_ACTION;
47546 -
47547 -do_action: /* This label is used only to access EOF actions. */
47548 -
47549 - switch ( yy_act )
47550 - { /* beginning of action switch */
47551 - case 0: /* must back up */
47552 - /* undo the effects of YY_DO_BEFORE_ACTION */
47553 - *yy_cp = (yy_hold_char);
47554 - yy_cp = (yy_last_accepting_cpos);
47555 - yy_current_state = (yy_last_accepting_state);
47556 - goto yy_find_action;
47557 -
47558 -case 1:
47559 -/* rule 1 can match eol */
47560 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47561 -(yy_c_buf_p) = yy_cp -= 1;
47562 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47563 -YY_RULE_SETUP
47564 -#line 67 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47565 -{
47566 - BEGIN(in_struct);
47567 - return TYPEDEF;
47568 -}
47569 - YY_BREAK
47570 -case 2:
47571 -/* rule 2 can match eol */
47572 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47573 -(yy_c_buf_p) = yy_cp -= 1;
47574 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47575 -YY_RULE_SETUP
47576 -#line 71 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47577 -{
47578 - BEGIN(in_struct);
47579 - return STRUCT;
47580 -}
47581 - YY_BREAK
47582 -case 3:
47583 -/* rule 3 can match eol */
47584 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47585 -(yy_c_buf_p) = yy_cp -= 1;
47586 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47587 -YY_RULE_SETUP
47588 -#line 75 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47589 -{
47590 - BEGIN(in_struct);
47591 - return UNION;
47592 -}
47593 - YY_BREAK
47594 -case 4:
47595 -/* rule 4 can match eol */
47596 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47597 -(yy_c_buf_p) = yy_cp -= 1;
47598 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47599 -YY_RULE_SETUP
47600 -#line 79 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47601 -{
47602 - BEGIN(in_struct);
47603 - return EXTERN;
47604 -}
47605 - YY_BREAK
47606 -case 5:
47607 -/* rule 5 can match eol */
47608 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47609 -(yy_c_buf_p) = yy_cp -= 1;
47610 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47611 -YY_RULE_SETUP
47612 -#line 83 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47613 -{
47614 - BEGIN(in_struct);
47615 - return STATIC;
47616 -}
47617 - YY_BREAK
47618 -case 6:
47619 -/* rule 6 can match eol */
47620 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47621 -(yy_c_buf_p) = yy_cp -= 1;
47622 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47623 -YY_RULE_SETUP
47624 -#line 88 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47625 -{
47626 - BEGIN(in_struct);
47627 - return DEFVEC_OP;
47628 -}
47629 - YY_BREAK
47630 -case 7:
47631 -/* rule 7 can match eol */
47632 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47633 -(yy_c_buf_p) = yy_cp -= 1;
47634 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47635 -YY_RULE_SETUP
47636 -#line 92 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47637 -{
47638 - BEGIN(in_struct);
47639 - return DEFVEC_I;
47640 -}
47641 - YY_BREAK
47642 -case 8:
47643 -/* rule 8 can match eol */
47644 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47645 -(yy_c_buf_p) = yy_cp -= 1;
47646 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47647 -YY_RULE_SETUP
47648 -#line 96 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47649 -{
47650 - BEGIN(in_struct);
47651 - return DEFVEC_ALLOC;
47652 -}
47653 - YY_BREAK
47654 -
47655 -
47656 -case 9:
47657 -YY_RULE_SETUP
47658 -#line 104 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47659 -{ BEGIN(in_struct_comment); }
47660 - YY_BREAK
47661 -case 10:
47662 -/* rule 10 can match eol */
47663 -YY_RULE_SETUP
47664 -#line 106 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47665 -{ update_lineno (yytext, yyleng); }
47666 - YY_BREAK
47667 -case 11:
47668 -/* rule 11 can match eol */
47669 -YY_RULE_SETUP
47670 -#line 107 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47671 -{ lexer_line.line++; }
47672 - YY_BREAK
47673 -case 12:
47674 -/* rule 12 can match eol */
47675 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47676 -(yy_c_buf_p) = yy_cp = yy_bp + 5;
47677 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47678 -YY_RULE_SETUP
47679 -#line 109 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47680 -/* don't care */
47681 - YY_BREAK
47682 -case 13:
47683 -/* rule 13 can match eol */
47684 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47685 -(yy_c_buf_p) = yy_cp = yy_bp + 3;
47686 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47687 -YY_RULE_SETUP
47688 -#line 110 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47689 -{ return GTY_TOKEN; }
47690 - YY_BREAK
47691 -case 14:
47692 -/* rule 14 can match eol */
47693 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47694 -(yy_c_buf_p) = yy_cp = yy_bp + 3;
47695 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47696 -YY_RULE_SETUP
47697 -#line 111 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47698 -{ return VEC_TOKEN; }
47699 - YY_BREAK
47700 -case 15:
47701 -/* rule 15 can match eol */
47702 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47703 -(yy_c_buf_p) = yy_cp = yy_bp + 5;
47704 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47705 -YY_RULE_SETUP
47706 -#line 112 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47707 -{ return UNION; }
47708 - YY_BREAK
47709 -case 16:
47710 -/* rule 16 can match eol */
47711 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47712 -(yy_c_buf_p) = yy_cp = yy_bp + 6;
47713 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47714 -YY_RULE_SETUP
47715 -#line 113 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47716 -{ return STRUCT; }
47717 - YY_BREAK
47718 -case 17:
47719 -/* rule 17 can match eol */
47720 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47721 -(yy_c_buf_p) = yy_cp = yy_bp + 4;
47722 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47723 -YY_RULE_SETUP
47724 -#line 114 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47725 -{ return ENUM; }
47726 - YY_BREAK
47727 -case 18:
47728 -/* rule 18 can match eol */
47729 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47730 -(yy_c_buf_p) = yy_cp = yy_bp + 9;
47731 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47732 -YY_RULE_SETUP
47733 -#line 115 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47734 -{ return PTR_ALIAS; }
47735 - YY_BREAK
47736 -case 19:
47737 -/* rule 19 can match eol */
47738 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47739 -(yy_c_buf_p) = yy_cp = yy_bp + 10;
47740 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47741 -YY_RULE_SETUP
47742 -#line 116 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47743 -{ return NESTED_PTR; }
47744 - YY_BREAK
47745 -case 20:
47746 -YY_RULE_SETUP
47747 -#line 117 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47748 -{ return NUM; }
47749 - YY_BREAK
47750 -case 21:
47751 -/* rule 21 can match eol */
47752 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47753 -(yy_c_buf_p) = yy_cp -= 1;
47754 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47755 -YY_RULE_SETUP
47756 -#line 118 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47757 -{
47758 - *yylval = xmemdup (yytext, yyleng, yyleng+1);
47759 - return PARAM_IS;
47760 -}
47761 - YY_BREAK
47762 -case 22:
47763 -/* rule 22 can match eol */
47764 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47765 -(yy_c_buf_p) = yy_cp -= 1;
47766 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47767 -#line 124 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47768 -case 23:
47769 -/* rule 23 can match eol */
47770 -YY_RULE_SETUP
47771 -#line 124 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47772 -{
47773 - size_t len;
47774 -
47775 - for (len = yyleng; ISSPACE (yytext[len-1]); len--)
47776 - ;
47777 -
47778 - *yylval = xmemdup (yytext, len, len+1);
47779 - update_lineno (yytext, yyleng);
47780 - return SCALAR;
47781 -}
47782 - YY_BREAK
47783 -case 24:
47784 -/* rule 24 can match eol */
47785 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47786 -(yy_c_buf_p) = yy_cp -= 1;
47787 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47788 -YY_RULE_SETUP
47789 -#line 136 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47790 -{
47791 - *yylval = xmemdup (yytext, yyleng, yyleng+1);
47792 - return ID;
47793 -}
47794 - YY_BREAK
47795 -case 25:
47796 -/* rule 25 can match eol */
47797 -YY_RULE_SETUP
47798 -#line 141 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47799 -{
47800 - *yylval = xmemdup (yytext+1, yyleng-2, yyleng-1);
47801 - return STRING;
47802 -}
47803 - YY_BREAK
47804 -/* This "terminal" avoids having to parse integer constant expressions. */
47805 -case 26:
47806 -/* rule 26 can match eol */
47807 -YY_RULE_SETUP
47808 -#line 146 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47809 -{
47810 - *yylval = xmemdup (yytext+1, yyleng-2, yyleng-1);
47811 - return ARRAY;
47812 -}
47813 - YY_BREAK
47814 -case 27:
47815 -/* rule 27 can match eol */
47816 -YY_RULE_SETUP
47817 -#line 150 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47818 -{
47819 - *yylval = xmemdup (yytext+1, yyleng-2, yyleng);
47820 - return CHAR;
47821 -}
47822 - YY_BREAK
47823 -case 28:
47824 -YY_RULE_SETUP
47825 -#line 155 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47826 -{ return ELLIPSIS; }
47827 - YY_BREAK
47828 -case 29:
47829 -YY_RULE_SETUP
47830 -#line 156 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47831 -{ return yytext[0]; }
47832 - YY_BREAK
47833 -/* ignore pp-directives */
47834 -case 30:
47835 -/* rule 30 can match eol */
47836 -YY_RULE_SETUP
47837 -#line 159 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47838 -{lexer_line.line++;}
47839 - YY_BREAK
47840 -case 31:
47841 -YY_RULE_SETUP
47842 -#line 161 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47843 -{
47844 - error_at_line (&lexer_line, "unexpected character `%s'", yytext);
47845 -}
47846 - YY_BREAK
47847 -
47848 -case 32:
47849 -YY_RULE_SETUP
47850 -#line 166 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47851 -{ BEGIN(in_comment); }
47852 - YY_BREAK
47853 -case 33:
47854 -/* rule 33 can match eol */
47855 -YY_RULE_SETUP
47856 -#line 167 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47857 -{ lexer_line.line++; }
47858 - YY_BREAK
47859 -case 34:
47860 -#line 169 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47861 -case 35:
47862 -/* rule 35 can match eol */
47863 -#line 170 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47864 -case 36:
47865 -/* rule 36 can match eol */
47866 -YY_RULE_SETUP
47867 -#line 170 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47868 -/* do nothing */
47869 - YY_BREAK
47870 -case 37:
47871 -/* rule 37 can match eol */
47872 -YY_RULE_SETUP
47873 -#line 171 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47874 -{ update_lineno (yytext, yyleng); }
47875 - YY_BREAK
47876 -case 38:
47877 -/* rule 38 can match eol */
47878 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47879 -(yy_c_buf_p) = yy_cp = yy_bp + 1;
47880 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47881 -YY_RULE_SETUP
47882 -#line 172 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47883 -/* do nothing */
47884 - YY_BREAK
47885 -
47886 -case 39:
47887 -/* rule 39 can match eol */
47888 -YY_RULE_SETUP
47889 -#line 175 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47890 -{ lexer_line.line++; }
47891 - YY_BREAK
47892 -case 40:
47893 -#line 177 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47894 -case 41:
47895 -YY_RULE_SETUP
47896 -#line 177 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47897 -/* do nothing */
47898 - YY_BREAK
47899 -case 42:
47900 -/* rule 42 can match eol */
47901 -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
47902 -(yy_c_buf_p) = yy_cp = yy_bp + 1;
47903 -YY_DO_BEFORE_ACTION; /* set up yytext again */
47904 -YY_RULE_SETUP
47905 -#line 178 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47906 -/* do nothing */
47907 - YY_BREAK
47908 -
47909 -case 43:
47910 -YY_RULE_SETUP
47911 -#line 180 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47912 -{ BEGIN(INITIAL); }
47913 - YY_BREAK
47914 -case 44:
47915 -YY_RULE_SETUP
47916 -#line 181 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47917 -{ BEGIN(in_struct); }
47918 - YY_BREAK
47919 -case 45:
47920 -#line 184 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47921 -case 46:
47922 -YY_RULE_SETUP
47923 -#line 184 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47924 -{
47925 - error_at_line (&lexer_line,
47926 - "unterminated comment or string; unexpected EOF");
47927 -}
47928 - YY_BREAK
47929 -case 47:
47930 -/* rule 47 can match eol */
47931 -YY_RULE_SETUP
47932 -#line 189 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47933 -/* do nothing */
47934 - YY_BREAK
47935 -case 48:
47936 -/* rule 48 can match eol */
47937 -YY_RULE_SETUP
47938 -#line 190 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47939 -{
47940 - error_at_line (&lexer_line, "stray GTY marker");
47941 -}
47942 - YY_BREAK
47943 -case 49:
47944 -YY_RULE_SETUP
47945 -#line 194 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
47946 -YY_FATAL_ERROR( "flex scanner jammed" );
47947 - YY_BREAK
47948 -#line 1651 "gengtype-lex.c"
47949 -case YY_STATE_EOF(INITIAL):
47950 -case YY_STATE_EOF(in_struct):
47951 -case YY_STATE_EOF(in_struct_comment):
47952 -case YY_STATE_EOF(in_comment):
47953 - yyterminate();
47954 -
47955 - case YY_END_OF_BUFFER:
47956 - {
47957 - /* Amount of text matched not including the EOB char. */
47958 - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
47959 -
47960 - /* Undo the effects of YY_DO_BEFORE_ACTION. */
47961 - *yy_cp = (yy_hold_char);
47962 - YY_RESTORE_YY_MORE_OFFSET
47963 -
47964 - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
47965 - {
47966 - /* We're scanning a new file or input source. It's
47967 - * possible that this happened because the user
47968 - * just pointed yyin at a new source and called
47969 - * yylex(). If so, then we have to assure
47970 - * consistency between YY_CURRENT_BUFFER and our
47971 - * globals. Here is the right place to do so, because
47972 - * this is the first action (other than possibly a
47973 - * back-up) that will match for the new input source.
47974 - */
47975 - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
47976 - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
47977 - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
47978 - }
47979 -
47980 - /* Note that here we test for yy_c_buf_p "<=" to the position
47981 - * of the first EOB in the buffer, since yy_c_buf_p will
47982 - * already have been incremented past the NUL character
47983 - * (since all states make transitions on EOB to the
47984 - * end-of-buffer state). Contrast this with the test
47985 - * in input().
47986 - */
47987 - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
47988 - { /* This was really a NUL. */
47989 - yy_state_type yy_next_state;
47990 -
47991 - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
47992 -
47993 - yy_current_state = yy_get_previous_state( );
47994 -
47995 - /* Okay, we're now positioned to make the NUL
47996 - * transition. We couldn't have
47997 - * yy_get_previous_state() go ahead and do it
47998 - * for us because it doesn't know how to deal
47999 - * with the possibility of jamming (and we don't
48000 - * want to build jamming into it because then it
48001 - * will run more slowly).
48002 - */
48003 -
48004 - yy_next_state = yy_try_NUL_trans( yy_current_state );
48005 -
48006 - yy_bp = (yytext_ptr) + YY_MORE_ADJ;
48007 -
48008 - if ( yy_next_state )
48009 - {
48010 - /* Consume the NUL. */
48011 - yy_cp = ++(yy_c_buf_p);
48012 - yy_current_state = yy_next_state;
48013 - goto yy_match;
48014 - }
48015 -
48016 - else
48017 - {
48018 - yy_cp = (yy_last_accepting_cpos);
48019 - yy_current_state = (yy_last_accepting_state);
48020 - goto yy_find_action;
48021 - }
48022 - }
48023 -
48024 - else switch ( yy_get_next_buffer( ) )
48025 - {
48026 - case EOB_ACT_END_OF_FILE:
48027 - {
48028 - (yy_did_buffer_switch_on_eof) = 0;
48029 -
48030 - if ( yywrap( ) )
48031 - {
48032 - /* Note: because we've taken care in
48033 - * yy_get_next_buffer() to have set up
48034 - * yytext, we can now set up
48035 - * yy_c_buf_p so that if some total
48036 - * hoser (like flex itself) wants to
48037 - * call the scanner after we return the
48038 - * YY_NULL, it'll still work - another
48039 - * YY_NULL will get returned.
48040 - */
48041 - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
48042 -
48043 - yy_act = YY_STATE_EOF(YY_START);
48044 - goto do_action;
48045 - }
48046 -
48047 - else
48048 - {
48049 - if ( ! (yy_did_buffer_switch_on_eof) )
48050 - YY_NEW_FILE;
48051 - }
48052 - break;
48053 - }
48054 -
48055 - case EOB_ACT_CONTINUE_SCAN:
48056 - (yy_c_buf_p) =
48057 - (yytext_ptr) + yy_amount_of_matched_text;
48058 -
48059 - yy_current_state = yy_get_previous_state( );
48060 -
48061 - yy_cp = (yy_c_buf_p);
48062 - yy_bp = (yytext_ptr) + YY_MORE_ADJ;
48063 - goto yy_match;
48064 -
48065 - case EOB_ACT_LAST_MATCH:
48066 - (yy_c_buf_p) =
48067 - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
48068 -
48069 - yy_current_state = yy_get_previous_state( );
48070 -
48071 - yy_cp = (yy_c_buf_p);
48072 - yy_bp = (yytext_ptr) + YY_MORE_ADJ;
48073 - goto yy_find_action;
48074 - }
48075 - break;
48076 - }
48077 -
48078 - default:
48079 - YY_FATAL_ERROR(
48080 - "fatal flex scanner internal error--no action found" );
48081 - } /* end of action switch */
48082 - } /* end of scanning one token */
48083 -} /* end of yylex */
48084 -
48085 -/* yy_get_next_buffer - try to read in a new buffer
48086 - *
48087 - * Returns a code representing an action:
48088 - * EOB_ACT_LAST_MATCH -
48089 - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
48090 - * EOB_ACT_END_OF_FILE - end of file
48091 - */
48092 -static int yy_get_next_buffer (void)
48093 -{
48094 - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
48095 - register char *source = (yytext_ptr);
48096 - register int number_to_move, i;
48097 - int ret_val;
48098 -
48099 - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
48100 - YY_FATAL_ERROR(
48101 - "fatal flex scanner internal error--end of buffer missed" );
48102 -
48103 - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
48104 - { /* Don't try to fill the buffer, so this is an EOF. */
48105 - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
48106 - {
48107 - /* We matched a single character, the EOB, so
48108 - * treat this as a final EOF.
48109 - */
48110 - return EOB_ACT_END_OF_FILE;
48111 - }
48112 -
48113 - else
48114 - {
48115 - /* We matched some text prior to the EOB, first
48116 - * process it.
48117 - */
48118 - return EOB_ACT_LAST_MATCH;
48119 - }
48120 - }
48121 -
48122 - /* Try to read more data. */
48123 -
48124 - /* First move last chars to start of buffer. */
48125 - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
48126 -
48127 - for ( i = 0; i < number_to_move; ++i )
48128 - *(dest++) = *(source++);
48129 -
48130 - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
48131 - /* don't do the read, it's not guaranteed to return an EOF,
48132 - * just force an EOF
48133 - */
48134 - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
48135 -
48136 - else
48137 - {
48138 - int num_to_read =
48139 - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
48140 -
48141 - while ( num_to_read <= 0 )
48142 - { /* Not enough room in the buffer - grow it. */
48143 -
48144 - /* just a shorter name for the current buffer */
48145 - YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
48146 -
48147 - int yy_c_buf_p_offset =
48148 - (int) ((yy_c_buf_p) - b->yy_ch_buf);
48149 -
48150 - if ( b->yy_is_our_buffer )
48151 - {
48152 - int new_size = b->yy_buf_size * 2;
48153 -
48154 - if ( new_size <= 0 )
48155 - b->yy_buf_size += b->yy_buf_size / 8;
48156 - else
48157 - b->yy_buf_size *= 2;
48158 -
48159 - b->yy_ch_buf = (char *)
48160 - /* Include room in for 2 EOB chars. */
48161 - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
48162 - }
48163 - else
48164 - /* Can't grow it, we don't own it. */
48165 - b->yy_ch_buf = 0;
48166 -
48167 - if ( ! b->yy_ch_buf )
48168 - YY_FATAL_ERROR(
48169 - "fatal error - scanner input buffer overflow" );
48170 -
48171 - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
48172 -
48173 - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
48174 - number_to_move - 1;
48175 -
48176 - }
48177 -
48178 - if ( num_to_read > YY_READ_BUF_SIZE )
48179 - num_to_read = YY_READ_BUF_SIZE;
48180 -
48181 - /* Read in more data. */
48182 - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
48183 - (yy_n_chars), (size_t) num_to_read );
48184 -
48185 - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
48186 - }
48187 -
48188 - if ( (yy_n_chars) == 0 )
48189 - {
48190 - if ( number_to_move == YY_MORE_ADJ )
48191 - {
48192 - ret_val = EOB_ACT_END_OF_FILE;
48193 - yyrestart(yyin );
48194 - }
48195 -
48196 - else
48197 - {
48198 - ret_val = EOB_ACT_LAST_MATCH;
48199 - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
48200 - YY_BUFFER_EOF_PENDING;
48201 - }
48202 - }
48203 -
48204 - else
48205 - ret_val = EOB_ACT_CONTINUE_SCAN;
48206 -
48207 - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
48208 - /* Extend the array by 50%, plus the number we really need. */
48209 - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
48210 - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
48211 - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
48212 - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
48213 - }
48214 -
48215 - (yy_n_chars) += number_to_move;
48216 - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
48217 - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
48218 -
48219 - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
48220 -
48221 - return ret_val;
48222 -}
48223 -
48224 -/* yy_get_previous_state - get the state just before the EOB char was reached */
48225 -
48226 - static yy_state_type yy_get_previous_state (void)
48227 -{
48228 - register yy_state_type yy_current_state;
48229 - register char *yy_cp;
48230 -
48231 - yy_current_state = (yy_start);
48232 - yy_current_state += YY_AT_BOL();
48233 -
48234 - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
48235 - {
48236 - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
48237 - if ( yy_accept[yy_current_state] )
48238 - {
48239 - (yy_last_accepting_state) = yy_current_state;
48240 - (yy_last_accepting_cpos) = yy_cp;
48241 - }
48242 - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
48243 - {
48244 - yy_current_state = (int) yy_def[yy_current_state];
48245 - if ( yy_current_state >= 445 )
48246 - yy_c = yy_meta[(unsigned int) yy_c];
48247 - }
48248 - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
48249 - }
48250 -
48251 - return yy_current_state;
48252 -}
48253 -
48254 -/* yy_try_NUL_trans - try to make a transition on the NUL character
48255 - *
48256 - * synopsis
48257 - * next_state = yy_try_NUL_trans( current_state );
48258 - */
48259 - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
48260 -{
48261 - register int yy_is_jam;
48262 - register char *yy_cp = (yy_c_buf_p);
48263 -
48264 - register YY_CHAR yy_c = 1;
48265 - if ( yy_accept[yy_current_state] )
48266 - {
48267 - (yy_last_accepting_state) = yy_current_state;
48268 - (yy_last_accepting_cpos) = yy_cp;
48269 - }
48270 - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
48271 - {
48272 - yy_current_state = (int) yy_def[yy_current_state];
48273 - if ( yy_current_state >= 445 )
48274 - yy_c = yy_meta[(unsigned int) yy_c];
48275 - }
48276 - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
48277 - yy_is_jam = (yy_current_state == 444);
48278 -
48279 - return yy_is_jam ? 0 : yy_current_state;
48280 -}
48281 -
48282 -#ifndef YY_NO_INPUT
48283 -#ifdef __cplusplus
48284 - static int yyinput (void)
48285 -#else
48286 - static int input (void)
48287 -#endif
48288 -
48289 -{
48290 - int c;
48291 -
48292 - *(yy_c_buf_p) = (yy_hold_char);
48293 -
48294 - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
48295 - {
48296 - /* yy_c_buf_p now points to the character we want to return.
48297 - * If this occurs *before* the EOB characters, then it's a
48298 - * valid NUL; if not, then we've hit the end of the buffer.
48299 - */
48300 - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
48301 - /* This was really a NUL. */
48302 - *(yy_c_buf_p) = '\0';
48303 -
48304 - else
48305 - { /* need more input */
48306 - int offset = (yy_c_buf_p) - (yytext_ptr);
48307 - ++(yy_c_buf_p);
48308 -
48309 - switch ( yy_get_next_buffer( ) )
48310 - {
48311 - case EOB_ACT_LAST_MATCH:
48312 - /* This happens because yy_g_n_b()
48313 - * sees that we've accumulated a
48314 - * token and flags that we need to
48315 - * try matching the token before
48316 - * proceeding. But for input(),
48317 - * there's no matching to consider.
48318 - * So convert the EOB_ACT_LAST_MATCH
48319 - * to EOB_ACT_END_OF_FILE.
48320 - */
48321 -
48322 - /* Reset buffer status. */
48323 - yyrestart(yyin );
48324 -
48325 - /*FALLTHROUGH*/
48326 -
48327 - case EOB_ACT_END_OF_FILE:
48328 - {
48329 - if ( yywrap( ) )
48330 - return EOF;
48331 -
48332 - if ( ! (yy_did_buffer_switch_on_eof) )
48333 - YY_NEW_FILE;
48334 -#ifdef __cplusplus
48335 - return yyinput();
48336 -#else
48337 - return input();
48338 -#endif
48339 - }
48340 -
48341 - case EOB_ACT_CONTINUE_SCAN:
48342 - (yy_c_buf_p) = (yytext_ptr) + offset;
48343 - break;
48344 - }
48345 - }
48346 - }
48347 -
48348 - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
48349 - *(yy_c_buf_p) = '\0'; /* preserve yytext */
48350 - (yy_hold_char) = *++(yy_c_buf_p);
48351 -
48352 - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
48353 -
48354 - return c;
48355 -}
48356 -#endif /* ifndef YY_NO_INPUT */
48357 -
48358 -/** Immediately switch to a different input stream.
48359 - * @param input_file A readable stream.
48360 - *
48361 - * @note This function does not reset the start condition to @c INITIAL .
48362 - */
48363 - void yyrestart (FILE * input_file )
48364 -{
48365 -
48366 - if ( ! YY_CURRENT_BUFFER ){
48367 - yyensure_buffer_stack ();
48368 - YY_CURRENT_BUFFER_LVALUE =
48369 - yy_create_buffer(yyin,YY_BUF_SIZE );
48370 - }
48371 -
48372 - yy_init_buffer(YY_CURRENT_BUFFER,input_file );
48373 - yy_load_buffer_state( );
48374 -}
48375 -
48376 -/** Switch to a different input buffer.
48377 - * @param new_buffer The new input buffer.
48378 - *
48379 - */
48380 - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
48381 -{
48382 -
48383 - /* TODO. We should be able to replace this entire function body
48384 - * with
48385 - * yypop_buffer_state();
48386 - * yypush_buffer_state(new_buffer);
48387 - */
48388 - yyensure_buffer_stack ();
48389 - if ( YY_CURRENT_BUFFER == new_buffer )
48390 - return;
48391 -
48392 - if ( YY_CURRENT_BUFFER )
48393 - {
48394 - /* Flush out information for old buffer. */
48395 - *(yy_c_buf_p) = (yy_hold_char);
48396 - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
48397 - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
48398 - }
48399 -
48400 - YY_CURRENT_BUFFER_LVALUE = new_buffer;
48401 - yy_load_buffer_state( );
48402 -
48403 - /* We don't actually know whether we did this switch during
48404 - * EOF (yywrap()) processing, but the only time this flag
48405 - * is looked at is after yywrap() is called, so it's safe
48406 - * to go ahead and always set it.
48407 - */
48408 - (yy_did_buffer_switch_on_eof) = 1;
48409 -}
48410 -
48411 -static void yy_load_buffer_state (void)
48412 -{
48413 - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
48414 - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
48415 - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
48416 - (yy_hold_char) = *(yy_c_buf_p);
48417 -}
48418 -
48419 -/** Allocate and initialize an input buffer state.
48420 - * @param file A readable stream.
48421 - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
48422 - *
48423 - * @return the allocated buffer state.
48424 - */
48425 - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
48426 -{
48427 - YY_BUFFER_STATE b;
48428 -
48429 - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
48430 - if ( ! b )
48431 - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
48432 -
48433 - b->yy_buf_size = size;
48434 -
48435 - /* yy_ch_buf has to be 2 characters longer than the size given because
48436 - * we need to put in 2 end-of-buffer characters.
48437 - */
48438 - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
48439 - if ( ! b->yy_ch_buf )
48440 - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
48441 -
48442 - b->yy_is_our_buffer = 1;
48443 -
48444 - yy_init_buffer(b,file );
48445 -
48446 - return b;
48447 -}
48448 -
48449 -/** Destroy the buffer.
48450 - * @param b a buffer created with yy_create_buffer()
48451 - *
48452 - */
48453 - void yy_delete_buffer (YY_BUFFER_STATE b )
48454 -{
48455 -
48456 - if ( ! b )
48457 - return;
48458 -
48459 - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
48460 - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
48461 -
48462 - if ( b->yy_is_our_buffer )
48463 - yyfree((void *) b->yy_ch_buf );
48464 -
48465 - yyfree((void *) b );
48466 -}
48467 -
48468 -/* Initializes or reinitializes a buffer.
48469 - * This function is sometimes called more than once on the same buffer,
48470 - * such as during a yyrestart() or at EOF.
48471 - */
48472 - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
48473 -
48474 -{
48475 - int oerrno = errno;
48476 -
48477 - yy_flush_buffer(b );
48478 -
48479 - b->yy_input_file = file;
48480 - b->yy_fill_buffer = 1;
48481 -
48482 - /* If b is the current buffer, then yy_init_buffer was _probably_
48483 - * called from yyrestart() or through yy_get_next_buffer.
48484 - * In that case, we don't want to reset the lineno or column.
48485 - */
48486 - if (b != YY_CURRENT_BUFFER){
48487 - b->yy_bs_lineno = 1;
48488 - b->yy_bs_column = 0;
48489 - }
48490 -
48491 - b->yy_is_interactive = 0;
48492 -
48493 - errno = oerrno;
48494 -}
48495 -
48496 -/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
48497 - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
48498 - *
48499 - */
48500 - void yy_flush_buffer (YY_BUFFER_STATE b )
48501 -{
48502 - if ( ! b )
48503 - return;
48504 -
48505 - b->yy_n_chars = 0;
48506 -
48507 - /* We always need two end-of-buffer characters. The first causes
48508 - * a transition to the end-of-buffer state. The second causes
48509 - * a jam in that state.
48510 - */
48511 - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
48512 - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
48513 -
48514 - b->yy_buf_pos = &b->yy_ch_buf[0];
48515 -
48516 - b->yy_at_bol = 1;
48517 - b->yy_buffer_status = YY_BUFFER_NEW;
48518 -
48519 - if ( b == YY_CURRENT_BUFFER )
48520 - yy_load_buffer_state( );
48521 -}
48522 -
48523 -/** Pushes the new state onto the stack. The new state becomes
48524 - * the current state. This function will allocate the stack
48525 - * if necessary.
48526 - * @param new_buffer The new state.
48527 - *
48528 - */
48529 -void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
48530 -{
48531 - if (new_buffer == NULL)
48532 - return;
48533 -
48534 - yyensure_buffer_stack();
48535 -
48536 - /* This block is copied from yy_switch_to_buffer. */
48537 - if ( YY_CURRENT_BUFFER )
48538 - {
48539 - /* Flush out information for old buffer. */
48540 - *(yy_c_buf_p) = (yy_hold_char);
48541 - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
48542 - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
48543 - }
48544 -
48545 - /* Only push if top exists. Otherwise, replace top. */
48546 - if (YY_CURRENT_BUFFER)
48547 - (yy_buffer_stack_top)++;
48548 - YY_CURRENT_BUFFER_LVALUE = new_buffer;
48549 -
48550 - /* copied from yy_switch_to_buffer. */
48551 - yy_load_buffer_state( );
48552 - (yy_did_buffer_switch_on_eof) = 1;
48553 -}
48554 -
48555 -/** Removes and deletes the top of the stack, if present.
48556 - * The next element becomes the new top.
48557 - *
48558 - */
48559 -void yypop_buffer_state (void)
48560 -{
48561 - if (!YY_CURRENT_BUFFER)
48562 - return;
48563 -
48564 - yy_delete_buffer(YY_CURRENT_BUFFER );
48565 - YY_CURRENT_BUFFER_LVALUE = NULL;
48566 - if ((yy_buffer_stack_top) > 0)
48567 - --(yy_buffer_stack_top);
48568 -
48569 - if (YY_CURRENT_BUFFER) {
48570 - yy_load_buffer_state( );
48571 - (yy_did_buffer_switch_on_eof) = 1;
48572 - }
48573 -}
48574 -
48575 -/* Allocates the stack if it does not exist.
48576 - * Guarantees space for at least one push.
48577 - */
48578 -static void yyensure_buffer_stack (void)
48579 -{
48580 - int num_to_alloc;
48581 -
48582 - if (!(yy_buffer_stack)) {
48583 -
48584 - /* First allocation is just for 2 elements, since we don't know if this
48585 - * scanner will even need a stack. We use 2 instead of 1 to avoid an
48586 - * immediate realloc on the next call.
48587 - */
48588 - num_to_alloc = 1;
48589 - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
48590 - (num_to_alloc * sizeof(struct yy_buffer_state*)
48591 - );
48592 - if ( ! (yy_buffer_stack) )
48593 - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
48594 -
48595 - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
48596 -
48597 - (yy_buffer_stack_max) = num_to_alloc;
48598 - (yy_buffer_stack_top) = 0;
48599 - return;
48600 - }
48601 -
48602 - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
48603 -
48604 - /* Increase the buffer to prepare for a possible push. */
48605 - int grow_size = 8 /* arbitrary grow size */;
48606 -
48607 - num_to_alloc = (yy_buffer_stack_max) + grow_size;
48608 - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
48609 - ((yy_buffer_stack),
48610 - num_to_alloc * sizeof(struct yy_buffer_state*)
48611 - );
48612 - if ( ! (yy_buffer_stack) )
48613 - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
48614 -
48615 - /* zero only the new slots.*/
48616 - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
48617 - (yy_buffer_stack_max) = num_to_alloc;
48618 - }
48619 -}
48620 -
48621 -/** Setup the input buffer state to scan directly from a user-specified character buffer.
48622 - * @param base the character buffer
48623 - * @param size the size in bytes of the character buffer
48624 - *
48625 - * @return the newly allocated buffer state object.
48626 - */
48627 -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
48628 -{
48629 - YY_BUFFER_STATE b;
48630 -
48631 - if ( size < 2 ||
48632 - base[size-2] != YY_END_OF_BUFFER_CHAR ||
48633 - base[size-1] != YY_END_OF_BUFFER_CHAR )
48634 - /* They forgot to leave room for the EOB's. */
48635 - return 0;
48636 -
48637 - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
48638 - if ( ! b )
48639 - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
48640 -
48641 - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
48642 - b->yy_buf_pos = b->yy_ch_buf = base;
48643 - b->yy_is_our_buffer = 0;
48644 - b->yy_input_file = 0;
48645 - b->yy_n_chars = b->yy_buf_size;
48646 - b->yy_is_interactive = 0;
48647 - b->yy_at_bol = 1;
48648 - b->yy_fill_buffer = 0;
48649 - b->yy_buffer_status = YY_BUFFER_NEW;
48650 -
48651 - yy_switch_to_buffer(b );
48652 -
48653 - return b;
48654 -}
48655 -
48656 -/** Setup the input buffer state to scan a string. The next call to yylex() will
48657 - * scan from a @e copy of @a str.
48658 - * @param yystr a NUL-terminated string to scan
48659 - *
48660 - * @return the newly allocated buffer state object.
48661 - * @note If you want to scan bytes that may contain NUL values, then use
48662 - * yy_scan_bytes() instead.
48663 - */
48664 -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
48665 -{
48666 -
48667 - return yy_scan_bytes(yystr,strlen(yystr) );
48668 -}
48669 -
48670 -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
48671 - * scan from a @e copy of @a bytes.
48672 - * @param bytes the byte buffer to scan
48673 - * @param len the number of bytes in the buffer pointed to by @a bytes.
48674 - *
48675 - * @return the newly allocated buffer state object.
48676 - */
48677 -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
48678 -{
48679 - YY_BUFFER_STATE b;
48680 - char *buf;
48681 - yy_size_t n;
48682 - int i;
48683 -
48684 - /* Get memory for full buffer, including space for trailing EOB's. */
48685 - n = _yybytes_len + 2;
48686 - buf = (char *) yyalloc(n );
48687 - if ( ! buf )
48688 - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
48689 -
48690 - for ( i = 0; i < _yybytes_len; ++i )
48691 - buf[i] = yybytes[i];
48692 -
48693 - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
48694 -
48695 - b = yy_scan_buffer(buf,n );
48696 - if ( ! b )
48697 - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
48698 -
48699 - /* It's okay to grow etc. this buffer, and we should throw it
48700 - * away when we're done.
48701 - */
48702 - b->yy_is_our_buffer = 1;
48703 -
48704 - return b;
48705 -}
48706 -
48707 -#ifndef YY_EXIT_FAILURE
48708 -#define YY_EXIT_FAILURE 2
48709 -#endif
48710 -
48711 -static void yy_fatal_error (yyconst char* msg )
48712 -{
48713 - (void) fprintf( stderr, "%s\n", msg );
48714 - exit( YY_EXIT_FAILURE );
48715 -}
48716 -
48717 -/* Redefine yyless() so it works in section 3 code. */
48718 -
48719 -#undef yyless
48720 -#define yyless(n) \
48721 - do \
48722 - { \
48723 - /* Undo effects of setting up yytext. */ \
48724 - int yyless_macro_arg = (n); \
48725 - YY_LESS_LINENO(yyless_macro_arg);\
48726 - yytext[yyleng] = (yy_hold_char); \
48727 - (yy_c_buf_p) = yytext + yyless_macro_arg; \
48728 - (yy_hold_char) = *(yy_c_buf_p); \
48729 - *(yy_c_buf_p) = '\0'; \
48730 - yyleng = yyless_macro_arg; \
48731 - } \
48732 - while ( 0 )
48733 -
48734 -/* Accessor methods (get/set functions) to struct members. */
48735 -
48736 -/** Get the current line number.
48737 - *
48738 - */
48739 -int yyget_lineno (void)
48740 -{
48741 -
48742 - return yylineno;
48743 -}
48744 -
48745 -/** Get the input stream.
48746 - *
48747 - */
48748 -FILE *yyget_in (void)
48749 -{
48750 - return yyin;
48751 -}
48752 -
48753 -/** Get the output stream.
48754 - *
48755 - */
48756 -FILE *yyget_out (void)
48757 -{
48758 - return yyout;
48759 -}
48760 -
48761 -/** Get the length of the current token.
48762 - *
48763 - */
48764 -int yyget_leng (void)
48765 -{
48766 - return yyleng;
48767 -}
48768 -
48769 -/** Get the current token.
48770 - *
48771 - */
48772 -
48773 -char *yyget_text (void)
48774 -{
48775 - return yytext;
48776 -}
48777 -
48778 -/** Set the current line number.
48779 - * @param line_number
48780 - *
48781 - */
48782 -void yyset_lineno (int line_number )
48783 -{
48784 -
48785 - yylineno = line_number;
48786 -}
48787 -
48788 -/** Set the input stream. This does not discard the current
48789 - * input buffer.
48790 - * @param in_str A readable stream.
48791 - *
48792 - * @see yy_switch_to_buffer
48793 - */
48794 -void yyset_in (FILE * in_str )
48795 -{
48796 - yyin = in_str ;
48797 -}
48798 -
48799 -void yyset_out (FILE * out_str )
48800 -{
48801 - yyout = out_str ;
48802 -}
48803 -
48804 -int yyget_debug (void)
48805 -{
48806 - return yy_flex_debug;
48807 -}
48808 -
48809 -void yyset_debug (int bdebug )
48810 -{
48811 - yy_flex_debug = bdebug ;
48812 -}
48813 -
48814 -static int yy_init_globals (void)
48815 -{
48816 - /* Initialization is the same as for the non-reentrant scanner.
48817 - * This function is called from yylex_destroy(), so don't allocate here.
48818 - */
48819 -
48820 - (yy_buffer_stack) = 0;
48821 - (yy_buffer_stack_top) = 0;
48822 - (yy_buffer_stack_max) = 0;
48823 - (yy_c_buf_p) = (char *) 0;
48824 - (yy_init) = 0;
48825 - (yy_start) = 0;
48826 -
48827 -/* Defined in main.c */
48828 -#ifdef YY_STDINIT
48829 - yyin = stdin;
48830 - yyout = stdout;
48831 -#else
48832 - yyin = (FILE *) 0;
48833 - yyout = (FILE *) 0;
48834 -#endif
48835 -
48836 - /* For future reference: Set errno on error, since we are called by
48837 - * yylex_init()
48838 - */
48839 - return 0;
48840 -}
48841 -
48842 -/* yylex_destroy is for both reentrant and non-reentrant scanners. */
48843 -int yylex_destroy (void)
48844 -{
48845 -
48846 - /* Pop the buffer stack, destroying each element. */
48847 - while(YY_CURRENT_BUFFER){
48848 - yy_delete_buffer(YY_CURRENT_BUFFER );
48849 - YY_CURRENT_BUFFER_LVALUE = NULL;
48850 - yypop_buffer_state();
48851 - }
48852 -
48853 - /* Destroy the stack itself. */
48854 - yyfree((yy_buffer_stack) );
48855 - (yy_buffer_stack) = NULL;
48856 -
48857 - /* Reset the globals. This is important in a non-reentrant scanner so the next time
48858 - * yylex() is called, initialization will occur. */
48859 - yy_init_globals( );
48860 -
48861 - return 0;
48862 -}
48863 -
48864 -/*
48865 - * Internal utility routines.
48866 - */
48867 -
48868 -#ifndef yytext_ptr
48869 -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
48870 -{
48871 - register int i;
48872 - for ( i = 0; i < n; ++i )
48873 - s1[i] = s2[i];
48874 -}
48875 -#endif
48876 -
48877 -#ifdef YY_NEED_STRLEN
48878 -static int yy_flex_strlen (yyconst char * s )
48879 -{
48880 - register int n;
48881 - for ( n = 0; s[n]; ++n )
48882 - ;
48883 -
48884 - return n;
48885 -}
48886 -#endif
48887 -
48888 -void *yyalloc (yy_size_t size )
48889 -{
48890 - return (void *) malloc( size );
48891 -}
48892 -
48893 -void *yyrealloc (void * ptr, yy_size_t size )
48894 -{
48895 - /* The cast to (char *) in the following accommodates both
48896 - * implementations that use char* generic pointers, and those
48897 - * that use void* generic pointers. It works with the latter
48898 - * because both ANSI C and C++ allow castless assignment from
48899 - * any pointer type to void*, and deal with argument conversions
48900 - * as though doing an assignment.
48901 - */
48902 - return (void *) realloc( (char *) ptr, size );
48903 -}
48904 -
48905 -void yyfree (void * ptr )
48906 -{
48907 - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
48908 -}
48909 -
48910 -#define YYTABLES_NAME "yytables"
48911 -
48912 -#line 194 "/abuild/rguenther/tmp/gcc-4.3.3/gcc-4.3.3/gcc/gengtype-lex.l"
48913 -
48914 -
48915 -
48916 -void
48917 -yybegin (const char *fname)
48918 -{
48919 - yyin = fopen (fname, "r");
48920 - if (yyin == NULL)
48921 - {
48922 - perror (fname);
48923 - exit (1);
48924 - }
48925 - lexer_line.file = fname;
48926 - lexer_line.line = 1;
48927 -}
48928 -
48929 -void
48930 -yyend (void)
48931 -{
48932 - fclose (yyin);
48933 -}
48934 -
48935 --- a/gcc/genmultilib
48936 +++ b/gcc/genmultilib
48937 @@ -73,6 +73,20 @@
48938 # the os directory names are used exclusively. Use the mapping when
48939 # there is no one-to-one equivalence between GCC levels and the OS.
48940
48941 +# The optional eighth option is a list of multilib aliases. This takes the
48942 +# same form as the third argument. It specifies that the second multilib is
48943 +# a synonym for the first. This allows a suitable multilib to be selected
48944 +# for all option combinations while only building a subset of all possible
48945 +# multilibs.
48946 +# For example:
48947 +# genmultilib "mbig-endian mthumb" "eb thumb" "" "" "" "" "" \
48948 +# "mbig-endian=mbig-endian/mthumb" yes
48949 +# This produces:
48950 +# ". !mbig-endian !mthumb;",
48951 +# "be mbig-endian !mthumb;",
48952 +# "be mbig-endian mthumb;",
48953 +# "thumb !mbig-endian mthumb;",
48954 +
48955 # The last option should be "yes" if multilibs are enabled. If it is not
48956 # "yes", all GCC multilib dir names will be ".".
48957
48958 @@ -121,7 +135,8 @@ exceptions=$4
48959 extra=$5
48960 exclusions=$6
48961 osdirnames=$7
48962 -enable_multilib=$8
48963 +aliases=$8
48964 +enable_multilib=$9
48965
48966 echo "static const char *const multilib_raw[] = {"
48967
48968 @@ -129,6 +144,23 @@ mkdir tmpmultilib.$$ || exit 1
48969 # Use cd ./foo to avoid CDPATH output.
48970 cd ./tmpmultilib.$$ || exit 1
48971
48972 +# Handle aliases
48973 +cat >tmpmultilib3 <<\EOF
48974 +#!/bin/sh
48975 +# Output a list of aliases (including the original name) for a multilib.
48976 +
48977 +echo $1
48978 +EOF
48979 +for a in ${aliases}; do
48980 + l=`echo $a | sed -e 's/=.*$//' -e 's/?/=/g'`
48981 + r=`echo $a | sed -e 's/^.*=//' -e 's/?/=/g'`
48982 + echo "[ \$1 == /$l/ ] && echo /$r/" >>tmpmultilib3
48983 +
48984 + # Also add the alias to the exclusion list
48985 + exceptions="${exceptions} $r"
48986 +done
48987 +chmod +x tmpmultilib3
48988 +
48989 # What we want to do is select all combinations of the sets in
48990 # options. Each combination which includes a set of mutually
48991 # exclusive options must then be output multiple times, once for each
48992 @@ -195,6 +227,21 @@ EOF
48993 combinations=`./tmpmultilib2 ${combinations}`
48994 fi
48995
48996 +# Check that all the aliases actually exist
48997 +for a in ${aliases}; do
48998 + l=`echo $a | sed -e 's/=.*$//' -e 's/?/=/g'`
48999 + for c in ${combinations}; do
49000 + if [ "/$l/" = "$c" ]; then
49001 + l=""
49002 + break;
49003 + fi
49004 + done
49005 + if [ -n "$l" ] ;then
49006 + echo "Missing multilib $l for alias $a" 1>&2
49007 + exit 1
49008 + fi
49009 +done
49010 +
49011 # Construct a sed pattern which will convert option names to directory
49012 # names.
49013 todirnames=
49014 @@ -343,23 +390,25 @@ for combo in ${combinations}; do
49015 fi
49016 fi
49017
49018 - # Look through the options. We must output each option that is
49019 - # present, and negate each option that is not present.
49020 - optout=
49021 - for set in ${options}; do
49022 - setopts=`echo ${set} | sed -e 's_[/|]_ _g'`
49023 - for opt in ${setopts}; do
49024 - if expr "${combo} " : ".*/${opt}/.*" > /dev/null; then
49025 - optout="${optout} ${opt}"
49026 - else
49027 - optout="${optout} !${opt}"
49028 - fi
49029 + for optcombo in `./tmpmultilib3 ${combo}`; do
49030 + # Look through the options. We must output each option that is
49031 + # present, and negate each option that is not present.
49032 + optout=
49033 + for set in ${options}; do
49034 + setopts=`echo ${set} | sed -e 's_[/|]_ _g'`
49035 + for opt in ${setopts}; do
49036 + if expr "${optcombo} " : ".*/${opt}/.*" > /dev/null; then
49037 + optout="${optout} ${opt}"
49038 + else
49039 + optout="${optout} !${opt}"
49040 + fi
49041 + done
49042 done
49043 - done
49044 - optout=`echo ${optout} | sed -e 's/^ //'`
49045 + optout=`echo ${optout} | sed -e 's/^ //'`
49046
49047 - # Output the line with all appropriate matches.
49048 - dirout="${dirout}" optout="${optout}" ./tmpmultilib2
49049 + # Output the line with all appropriate matches.
49050 + dirout="${dirout}" optout="${optout}" ./tmpmultilib2
49051 + done
49052 done
49053
49054 # Terminate the list of string.
49055 --- a/gcc/haifa-sched.c
49056 +++ b/gcc/haifa-sched.c
49057 @@ -1846,6 +1846,23 @@ move_insn (rtx insn)
49058 SCHED_GROUP_P (insn) = 0;
49059 }
49060
49061 +/* Return true if scheduling INSN will finish current clock cycle. */
49062 +static bool
49063 +insn_finishes_cycle_p (rtx insn)
49064 +{
49065 + if (SCHED_GROUP_P (insn))
49066 + /* After issuing INSN, rest of the sched_group will be forced to issue
49067 + in order. Don't make any plans for the rest of cycle. */
49068 + return true;
49069 +
49070 + /* Finishing the block will, apparently, finish the cycle. */
49071 + if (current_sched_info->insn_finishes_block_p
49072 + && current_sched_info->insn_finishes_block_p (insn))
49073 + return true;
49074 +
49075 + return false;
49076 +}
49077 +
49078 /* The following structure describe an entry of the stack of choices. */
49079 struct choice_entry
49080 {
49081 @@ -1902,13 +1919,15 @@ static int
49082 max_issue (struct ready_list *ready, int *index, int max_points)
49083 {
49084 int n, i, all, n_ready, best, delay, tries_num, points = -1;
49085 + int rest;
49086 struct choice_entry *top;
49087 rtx insn;
49088
49089 best = 0;
49090 memcpy (choice_stack->state, curr_state, dfa_state_size);
49091 top = choice_stack;
49092 - top->rest = cached_first_cycle_multipass_dfa_lookahead;
49093 + /* Add +1 to account the empty initial state. */
49094 + top->rest = cached_first_cycle_multipass_dfa_lookahead + 1;
49095 top->n = 0;
49096 n_ready = ready->n_ready;
49097 for (all = i = 0; i < n_ready; i++)
49098 @@ -1918,7 +1937,10 @@ max_issue (struct ready_list *ready, int
49099 tries_num = 0;
49100 for (;;)
49101 {
49102 - if (top->rest == 0 || i >= n_ready)
49103 + if (/* Enough instructions are issued (or we won't issue more). */
49104 + top->rest == 0
49105 + /* Or there's nothing left to try. */
49106 + || i >= n_ready)
49107 {
49108 if (top == choice_stack)
49109 break;
49110 @@ -1942,17 +1964,27 @@ max_issue (struct ready_list *ready, int
49111 break;
49112 insn = ready_element (ready, i);
49113 delay = state_transition (curr_state, insn);
49114 +
49115 if (delay < 0)
49116 {
49117 - if (state_dead_lock_p (curr_state))
49118 - top->rest = 0;
49119 + rest = top->rest;
49120 + if (state_dead_lock_p (curr_state)
49121 + || insn_finishes_cycle_p (insn))
49122 + /* We won't issue any more instructions in the next
49123 + choice_state. */
49124 + rest = 0;
49125 else
49126 - top->rest--;
49127 + rest--;
49128 +
49129 n = top->n;
49130 if (memcmp (top->state, curr_state, dfa_state_size) != 0)
49131 n += ISSUE_POINTS (insn);
49132 +
49133 + /* Go to next choice_state. */
49134 top++;
49135 - top->rest = cached_first_cycle_multipass_dfa_lookahead;
49136 +
49137 + /* Initialize it. */
49138 + top->rest = rest;
49139 top->index = i;
49140 top->n = n;
49141 memcpy (top->state, curr_state, dfa_state_size);
49142 --- a/gcc/hooks.c
49143 +++ b/gcc/hooks.c
49144 @@ -34,6 +34,12 @@ hook_void_void (void)
49145 {
49146 }
49147
49148 +/* Generic hook that receives an int * and does nothing. */
49149 +void
49150 +hook_intp_void (int *p ATTRIBUTE_UNUSED)
49151 +{
49152 +}
49153 +
49154 /* Generic hook that takes no arguments and returns false. */
49155 bool
49156 hook_bool_void_false (void)
49157 @@ -319,3 +325,10 @@ hook_constcharptr_int_const_tree_const_t
49158 {
49159 return NULL;
49160 }
49161 +
49162 +/* Generic hook that takes a const_tree and returns NULL_TREE. */
49163 +tree
49164 +hook_tree_const_tree_null (const_tree t ATTRIBUTE_UNUSED)
49165 +{
49166 + return NULL;
49167 +}
49168 --- a/gcc/hooks.h
49169 +++ b/gcc/hooks.h
49170 @@ -51,6 +51,7 @@ extern bool hook_bool_tree_tree_false (t
49171 extern bool hook_bool_tree_bool_false (tree, bool);
49172
49173 extern void hook_void_void (void);
49174 +extern void hook_intp_void (int *);
49175 extern void hook_void_constcharptr (const char *);
49176 extern void hook_void_FILEptr_constcharptr (FILE *, const char *);
49177 extern void hook_void_tree (tree);
49178 @@ -62,6 +63,8 @@ extern int hook_int_rtx_0 (rtx);
49179 extern int hook_int_size_t_constcharptr_int_0 (size_t, const char *, int);
49180 extern int hook_int_void_no_regs (void);
49181
49182 +extern tree hook_tree_const_tree_null (const_tree);
49183 +
49184 extern tree hook_tree_tree_tree_null (tree, tree);
49185 extern tree hook_tree_tree_tree_tree_3rd_identity (tree, tree, tree);
49186 extern tree hook_tree_tree_tree_bool_null (tree, tree, bool);
49187 --- a/gcc/integrate.c
49188 +++ b/gcc/integrate.c
49189 @@ -81,8 +81,9 @@ function_attribute_inlinable_p (const_tr
49190 int i;
49191
49192 for (i = 0; targetm.attribute_table[i].name != NULL; i++)
49193 - if (is_attribute_p (targetm.attribute_table[i].name, name))
49194 - return targetm.function_attribute_inlinable_p (fndecl);
49195 + if (is_attribute_p (targetm.attribute_table[i].name, name)
49196 + && !targetm.function_attribute_inlinable_p (fndecl))
49197 + return false;
49198 }
49199 }
49200
49201 --- a/gcc/java/Make-lang.in
49202 +++ b/gcc/java/Make-lang.in
49203 @@ -303,11 +303,13 @@ java/jcf-io.o: java/jcf-io.c $(CONFIG_H)
49204 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ZLIBINC) \
49205 $(srcdir)/java/jcf-io.c $(OUTPUT_OPTION)
49206
49207 +# This must match the setting in libjava/Makefile.am.
49208 +jardir = $(prefix)/$(target_noncanonical)/share/java
49209 # jcf-path.o needs a -D.
49210 java/jcf-path.o: java/jcf-path.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
49211 java/jcf.h
49212 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
49213 - -DLIBGCJ_ZIP_FILE='"$(datadir)/java/libgcj-$(version).jar"' \
49214 + -DLIBGCJ_ZIP_FILE='"$(jardir)/libgcj-$(version).jar"' \
49215 -DDEFAULT_TARGET_VERSION=\"$(version)\" \
49216 $(srcdir)/java/jcf-path.c $(OUTPUT_OPTION)
49217
49218 --- a/gcc/jump.c
49219 +++ b/gcc/jump.c
49220 @@ -1551,12 +1551,22 @@ rtx_renumbered_equal_p (const_rtx x, con
49221
49222 if (reg_renumber[reg_x] >= 0)
49223 {
49224 + if (!subreg_offset_representable_p (reg_renumber[reg_x],
49225 + GET_MODE (SUBREG_REG (x)),
49226 + byte_x,
49227 + GET_MODE (x)))
49228 + return 0;
49229 reg_x = subreg_regno_offset (reg_renumber[reg_x],
49230 GET_MODE (SUBREG_REG (x)),
49231 byte_x,
49232 GET_MODE (x));
49233 byte_x = 0;
49234 }
49235 + else if (!subreg_offset_representable_p (reg_x,
49236 + GET_MODE (SUBREG_REG (x)),
49237 + byte_x,
49238 + GET_MODE (x)))
49239 + return 0;
49240 }
49241 else
49242 {
49243 @@ -1572,12 +1582,22 @@ rtx_renumbered_equal_p (const_rtx x, con
49244
49245 if (reg_renumber[reg_y] >= 0)
49246 {
49247 + if (!subreg_offset_representable_p (reg_renumber[reg_y],
49248 + GET_MODE (SUBREG_REG (y)),
49249 + byte_y,
49250 + GET_MODE (y)))
49251 + return 0;
49252 reg_y = subreg_regno_offset (reg_renumber[reg_y],
49253 GET_MODE (SUBREG_REG (y)),
49254 byte_y,
49255 GET_MODE (y));
49256 byte_y = 0;
49257 }
49258 + else if (!subreg_offset_representable_p (reg_y,
49259 + GET_MODE (SUBREG_REG (y)),
49260 + byte_y,
49261 + GET_MODE (y)))
49262 + return 0;
49263 }
49264 else
49265 {
49266 --- a/gcc/libgcc2.c
49267 +++ b/gcc/libgcc2.c
49268 @@ -1830,6 +1830,7 @@ CTYPE
49269 CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
49270 {
49271 MTYPE ac, bd, ad, bc, x, y;
49272 + CTYPE res;
49273
49274 ac = a * c;
49275 bd = b * d;
49276 @@ -1886,7 +1887,9 @@ CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b,
49277 }
49278 }
49279
49280 - return x + I * y;
49281 + __real__ res = x;
49282 + __imag__ res = y;
49283 + return res;
49284 }
49285 #endif /* complex multiply */
49286
49287 @@ -1897,6 +1900,7 @@ CTYPE
49288 CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
49289 {
49290 MTYPE denom, ratio, x, y;
49291 + CTYPE res;
49292
49293 /* ??? We can get better behavior from logarithmic scaling instead of
49294 the division. But that would mean starting to link libgcc against
49295 @@ -1942,7 +1946,9 @@ CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b,
49296 }
49297 }
49298
49299 - return x + I * y;
49300 + __real__ res = x;
49301 + __imag__ res = y;
49302 + return res;
49303 }
49304 #endif /* complex divide */
49305
49306 @@ -2137,7 +2143,8 @@ __do_global_dtors (void)
49307 (*(p-1)) ();
49308 }
49309 #endif
49310 -#if defined (EH_FRAME_SECTION_NAME) && !defined (HAS_INIT_SECTION)
49311 +#if defined (EH_FRAME_SECTION_NAME) && !defined (HAS_INIT_SECTION) \
49312 + && !defined (__MINGW32__)
49313 {
49314 static int completed = 0;
49315 if (! completed)
49316 @@ -2156,14 +2163,14 @@ __do_global_dtors (void)
49317 void
49318 __do_global_ctors (void)
49319 {
49320 -#ifdef EH_FRAME_SECTION_NAME
49321 + atexit (__do_global_dtors);
49322 +#if defined (EH_FRAME_SECTION_NAME) && !defined (__MINGW32__)
49323 {
49324 static struct object object;
49325 __register_frame_info (__EH_FRAME_BEGIN__, &object);
49326 }
49327 #endif
49328 DO_GLOBAL_CTORS_BODY;
49329 - atexit (__do_global_dtors);
49330 }
49331 #endif /* no HAS_INIT_SECTION */
49332
49333 --- a/gcc/modulo-sched.c
49334 +++ b/gcc/modulo-sched.c
49335 @@ -268,6 +268,7 @@ static struct sched_info sms_sched_info
49336 sms_print_insn,
49337 NULL,
49338 compute_jump_reg_dependencies,
49339 + NULL, /* insn_finishes_block_p */
49340 NULL, NULL,
49341 NULL, NULL,
49342 0, 0, 0,
49343 --- a/gcc/optabs.c
49344 +++ b/gcc/optabs.c
49345 @@ -2140,6 +2140,10 @@ expand_binop (enum machine_mode mode, op
49346 && GET_MODE (op0) != mode)
49347 op0 = convert_to_mode (mode, op0, unsignedp);
49348
49349 + /* Force things into registers so subreg handling comes out right. */
49350 + op0 = force_reg (mode, op0);
49351 + op1x = force_reg (op1_mode, op1x);
49352 +
49353 /* Pass 1 for NO_QUEUE so we don't lose any increments
49354 if the libcall is cse'd or moved. */
49355 value = emit_library_call_value (libfunc,
49356 @@ -3281,7 +3285,8 @@ expand_unop (enum machine_mode mode, opt
49357 if (unoptab == ffs_optab || unoptab == clz_optab || unoptab == ctz_optab
49358 || unoptab == popcount_optab || unoptab == parity_optab)
49359 outmode
49360 - = GET_MODE (hard_libcall_value (TYPE_MODE (integer_type_node)));
49361 + = GET_MODE (hard_libcall_value (TYPE_MODE (integer_type_node),
49362 + optab_libfunc (unoptab, mode)));
49363
49364 start_sequence ();
49365
49366 @@ -4508,10 +4513,12 @@ prepare_float_lib_cmp (rtx *px, rtx *py,
49367 mode != VOIDmode;
49368 mode = GET_MODE_WIDER_MODE (mode))
49369 {
49370 - if ((libfunc = optab_libfunc (code_to_optab[comparison], mode)))
49371 + if (code_to_optab[comparison]
49372 + && (libfunc = optab_libfunc (code_to_optab[comparison], mode)))
49373 break;
49374
49375 - if ((libfunc = optab_libfunc (code_to_optab[swapped] , mode)))
49376 + if (code_to_optab[swapped]
49377 + && (libfunc = optab_libfunc (code_to_optab[swapped], mode)))
49378 {
49379 rtx tmp;
49380 tmp = x; x = y; y = tmp;
49381 @@ -4519,7 +4526,8 @@ prepare_float_lib_cmp (rtx *px, rtx *py,
49382 break;
49383 }
49384
49385 - if ((libfunc = optab_libfunc (code_to_optab[reversed], mode))
49386 + if (code_to_optab[reversed]
49387 + && (libfunc = optab_libfunc (code_to_optab[reversed], mode))
49388 && FLOAT_LIB_COMPARE_RETURNS_BOOL (mode, reversed))
49389 {
49390 comparison = reversed;
49391 --- a/gcc/opts.c
49392 +++ b/gcc/opts.c
49393 @@ -1787,6 +1787,10 @@ common_handle_option (size_t scode, cons
49394 /* These are no-ops, preserved for backward compatibility. */
49395 break;
49396
49397 + case OPT_feglibc_:
49398 + /* This is a no-op at the moment. */
49399 + break;
49400 +
49401 default:
49402 /* If the flag was handled in a standard way, assume the lack of
49403 processing here is intentional. */
49404 --- a/gcc/passes.c
49405 +++ b/gcc/passes.c
49406 @@ -522,6 +522,7 @@ init_optimization_passes (void)
49407 NEXT_PASS (pass_cleanup_cfg);
49408 NEXT_PASS (pass_rename_ssa_copies);
49409 NEXT_PASS (pass_ccp);
49410 + NEXT_PASS (pass_promote_short_indices);
49411 NEXT_PASS (pass_forwprop);
49412 NEXT_PASS (pass_update_address_taken);
49413 NEXT_PASS (pass_simple_dse);
49414 @@ -561,6 +562,7 @@ init_optimization_passes (void)
49415 execute TODO_rebuild_alias at this point even if
49416 pass_create_structure_vars was disabled. */
49417 NEXT_PASS (pass_build_alias);
49418 + NEXT_PASS (pass_remove_local_statics);
49419 NEXT_PASS (pass_return_slot);
49420 NEXT_PASS (pass_rename_ssa_copies);
49421
49422 --- a/gcc/pointer-set.c
49423 +++ b/gcc/pointer-set.c
49424 @@ -181,6 +181,23 @@ void pointer_set_traverse (const struct
49425 break;
49426 }
49427
49428 +/* Return the number of elements in PSET. */
49429 +
49430 +size_t
49431 +pointer_set_n_elements (struct pointer_set_t *pset)
49432 +{
49433 + return pset->n_elements;
49434 +}
49435 +
49436 +/* Remove all entries from PSET. */
49437 +
49438 +void
49439 +pointer_set_clear (struct pointer_set_t *pset)
49440 +{
49441 + pset->n_elements = 0;
49442 + memset (pset->slots, 0, sizeof (pset->slots[0]) * pset->n_slots);
49443 +}
49444 +
49445 \f
49446 /* A pointer map is represented the same way as a pointer_set, so
49447 the hash code is based on the address of the key, rather than
49448 @@ -301,3 +318,20 @@ void pointer_map_traverse (const struct
49449 if (pmap->keys[i] && !fn (pmap->keys[i], &pmap->values[i], data))
49450 break;
49451 }
49452 +
49453 +/* Return the number of elements in PMAP. */
49454 +
49455 +size_t
49456 +pointer_map_n_elements (struct pointer_map_t *pmap)
49457 +{
49458 + return pmap->n_elements;
49459 +}
49460 +
49461 +/* Remove all entries from PMAP. */
49462 +
49463 +void pointer_map_clear (struct pointer_map_t *pmap)
49464 +{
49465 + pmap->n_elements = 0;
49466 + memset (pmap->keys, 0, sizeof (pmap->keys[0]) * pmap->n_slots);
49467 + memset (pmap->values, 0, sizeof (pmap->values[0]) * pmap->n_slots);
49468 +}
49469 --- a/gcc/pointer-set.h
49470 +++ b/gcc/pointer-set.h
49471 @@ -29,6 +29,8 @@ int pointer_set_insert (struct pointer_s
49472 void pointer_set_traverse (const struct pointer_set_t *,
49473 bool (*) (const void *, void *),
49474 void *);
49475 +size_t pointer_set_n_elements (struct pointer_set_t *);
49476 +void pointer_set_clear (struct pointer_set_t *);
49477
49478 struct pointer_map_t;
49479 struct pointer_map_t *pointer_map_create (void);
49480 @@ -38,5 +40,7 @@ void **pointer_map_contains (const struc
49481 void **pointer_map_insert (struct pointer_map_t *pmap, const void *p);
49482 void pointer_map_traverse (const struct pointer_map_t *,
49483 bool (*) (const void *, void **, void *), void *);
49484 +size_t pointer_map_n_elements (struct pointer_map_t *);
49485 +void pointer_map_clear (struct pointer_map_t *);
49486
49487 #endif /* POINTER_SET_H */
49488 --- a/gcc/postreload.c
49489 +++ b/gcc/postreload.c
49490 @@ -46,6 +46,7 @@ along with GCC; see the file COPYING3.
49491 #include "tree.h"
49492 #include "timevar.h"
49493 #include "tree-pass.h"
49494 +#include "addresses.h"
49495 #include "df.h"
49496 #include "dbgcnt.h"
49497
49498 @@ -705,17 +706,19 @@ reload_combine (void)
49499 int last_label_ruid;
49500 int min_labelno, n_labels;
49501 HARD_REG_SET ever_live_at_start, *label_live;
49502 + enum reg_class index_regs;
49503
49504 /* If reg+reg can be used in offsetable memory addresses, the main chunk of
49505 reload has already used it where appropriate, so there is no use in
49506 trying to generate it now. */
49507 - if (double_reg_address_ok && INDEX_REG_CLASS != NO_REGS)
49508 + index_regs = index_reg_class (VOIDmode);
49509 + if (double_reg_address_ok && index_regs != NO_REGS)
49510 return;
49511
49512 /* To avoid wasting too much time later searching for an index register,
49513 determine the minimum and maximum index register numbers. */
49514 for (r = 0; r < FIRST_PSEUDO_REGISTER; r++)
49515 - if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], r))
49516 + if (TEST_HARD_REG_BIT (reg_class_contents[index_regs], r))
49517 {
49518 if (first_index_reg == -1)
49519 first_index_reg = r;
49520 @@ -823,8 +826,8 @@ reload_combine (void)
49521 substitute uses of REG (typically in MEMs) with.
49522 First check REG and BASE for being index registers;
49523 we can use them even if they are not dead. */
49524 - if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], regno)
49525 - || TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS],
49526 + if (TEST_HARD_REG_BIT (reg_class_contents[index_regs], regno)
49527 + || TEST_HARD_REG_BIT (reg_class_contents[index_regs],
49528 REGNO (base)))
49529 {
49530 const_reg = reg;
49531 @@ -838,8 +841,7 @@ reload_combine (void)
49532 two registers. */
49533 for (i = first_index_reg; i <= last_index_reg; i++)
49534 {
49535 - if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS],
49536 - i)
49537 + if (TEST_HARD_REG_BIT (reg_class_contents[index_regs], i)
49538 && reg_state[i].use_index == RELOAD_COMBINE_MAX_USES
49539 && reg_state[i].store_ruid <= reg_state[regno].use_ruid
49540 && hard_regno_nregs[i][GET_MODE (reg)] == 1)
49541 --- a/gcc/real.c
49542 +++ b/gcc/real.c
49543 @@ -4379,6 +4379,165 @@ const struct real_format decimal_quad_fo
49544 false
49545 };
49546 \f
49547 +/* Encode half-precision floats. This routine is used both for the IEEE
49548 + ARM alternative encodings. */
49549 +static void
49550 +encode_ieee_half (const struct real_format *fmt, long *buf,
49551 + const REAL_VALUE_TYPE *r)
49552 +{
49553 + unsigned long image, sig, exp;
49554 + unsigned long sign = r->sign;
49555 + bool denormal = (r->sig[SIGSZ-1] & SIG_MSB) == 0;
49556 +
49557 + image = sign << 15;
49558 + sig = (r->sig[SIGSZ-1] >> (HOST_BITS_PER_LONG - 11)) & 0x3ff;
49559 +
49560 + switch (r->cl)
49561 + {
49562 + case rvc_zero:
49563 + break;
49564 +
49565 + case rvc_inf:
49566 + if (fmt->has_inf)
49567 + image |= 31 << 10;
49568 + else
49569 + image |= 0x7fff;
49570 + break;
49571 +
49572 + case rvc_nan:
49573 + if (fmt->has_nans)
49574 + {
49575 + if (r->canonical)
49576 + sig = (fmt->canonical_nan_lsbs_set ? (1 << 9) - 1 : 0);
49577 + if (r->signalling == fmt->qnan_msb_set)
49578 + sig &= ~(1 << 9);
49579 + else
49580 + sig |= 1 << 9;
49581 + if (sig == 0)
49582 + sig = 1 << 8;
49583 +
49584 + image |= 31 << 10;
49585 + image |= sig;
49586 + }
49587 + else
49588 + image |= 0x3ff;
49589 + break;
49590 +
49591 + case rvc_normal:
49592 + /* Recall that IEEE numbers are interpreted as 1.F x 2**exp,
49593 + whereas the intermediate representation is 0.F x 2**exp.
49594 + Which means we're off by one. */
49595 + if (denormal)
49596 + exp = 0;
49597 + else
49598 + exp = REAL_EXP (r) + 15 - 1;
49599 + image |= exp << 10;
49600 + image |= sig;
49601 + break;
49602 +
49603 + default:
49604 + gcc_unreachable ();
49605 + }
49606 +
49607 + buf[0] = image;
49608 +}
49609 +
49610 +/* Decode half-precision floats. This routine is used both for the IEEE
49611 + ARM alternative encodings. */
49612 +static void
49613 +decode_ieee_half (const struct real_format *fmt, REAL_VALUE_TYPE *r,
49614 + const long *buf)
49615 +{
49616 + unsigned long image = buf[0] & 0xffff;
49617 + bool sign = (image >> 15) & 1;
49618 + int exp = (image >> 10) & 0x1f;
49619 +
49620 + memset (r, 0, sizeof (*r));
49621 + image <<= HOST_BITS_PER_LONG - 11;
49622 + image &= ~SIG_MSB;
49623 +
49624 + if (exp == 0)
49625 + {
49626 + if (image && fmt->has_denorm)
49627 + {
49628 + r->cl = rvc_normal;
49629 + r->sign = sign;
49630 + SET_REAL_EXP (r, -14);
49631 + r->sig[SIGSZ-1] = image << 1;
49632 + normalize (r);
49633 + }
49634 + else if (fmt->has_signed_zero)
49635 + r->sign = sign;
49636 + }
49637 + else if (exp == 31 && (fmt->has_nans || fmt->has_inf))
49638 + {
49639 + if (image)
49640 + {
49641 + r->cl = rvc_nan;
49642 + r->sign = sign;
49643 + r->signalling = (((image >> (HOST_BITS_PER_LONG - 2)) & 1)
49644 + ^ fmt->qnan_msb_set);
49645 + r->sig[SIGSZ-1] = image;
49646 + }
49647 + else
49648 + {
49649 + r->cl = rvc_inf;
49650 + r->sign = sign;
49651 + }
49652 + }
49653 + else
49654 + {
49655 + r->cl = rvc_normal;
49656 + r->sign = sign;
49657 + SET_REAL_EXP (r, exp - 15 + 1);
49658 + r->sig[SIGSZ-1] = image | SIG_MSB;
49659 + }
49660 +}
49661 +
49662 +/* Half-precision format, as specified in IEEE 754R. */
49663 +const struct real_format ieee_half_format =
49664 + {
49665 + encode_ieee_half,
49666 + decode_ieee_half,
49667 + 2,
49668 + 11,
49669 + 11,
49670 + -13,
49671 + 16,
49672 + 15,
49673 + 15,
49674 + false,
49675 + true,
49676 + true,
49677 + true,
49678 + true,
49679 + true,
49680 + false
49681 + };
49682 +
49683 +/* ARM's alternative half-precision format, similar to IEEE but with
49684 + no reserved exponent value for NaNs and infinities; rather, it just
49685 + extends the range of exponents by one. */
49686 +const struct real_format arm_half_format =
49687 + {
49688 + encode_ieee_half,
49689 + decode_ieee_half,
49690 + 2,
49691 + 11,
49692 + 11,
49693 + -13,
49694 + 17,
49695 + 15,
49696 + 15,
49697 + false,
49698 + false,
49699 + false,
49700 + true,
49701 + true,
49702 + false,
49703 + false
49704 + };
49705 +\f
49706 /* A synthetic "format" for internal arithmetic. It's the size of the
49707 internal significand minus the two bits needed for proper rounding.
49708 The encode and decode routines exist only to satisfy our paranoia
49709 --- a/gcc/real.h
49710 +++ b/gcc/real.h
49711 @@ -286,6 +286,8 @@ extern const struct real_format real_int
49712 extern const struct real_format decimal_single_format;
49713 extern const struct real_format decimal_double_format;
49714 extern const struct real_format decimal_quad_format;
49715 +extern const struct real_format ieee_half_format;
49716 +extern const struct real_format arm_half_format;
49717
49718
49719 /* ====================================================================== */
49720 --- a/gcc/recog.c
49721 +++ b/gcc/recog.c
49722 @@ -587,6 +587,7 @@ validate_replace_rtx_1 (rtx *loc, rtx fr
49723 simplifications, as it is not our job. */
49724
49725 if (SWAPPABLE_OPERANDS_P (x)
49726 + && !reload_in_progress
49727 && swap_commutative_operands_p (XEXP (x, 0), XEXP (x, 1)))
49728 {
49729 validate_unshare_change (object, loc,
49730 --- a/gcc/regclass.c
49731 +++ b/gcc/regclass.c
49732 @@ -468,6 +468,24 @@ init_reg_sets_1 (void)
49733 inv_reg_alloc_order[reg_alloc_order[i]] = i;
49734 #endif
49735
49736 +#ifdef REG_ALLOC_ORDER
49737 + /* Allow the target to change the allocation order based on
49738 + supplied flags. */
49739 + targetm.adjust_reg_alloc_order (reg_alloc_order);
49740 +
49741 + /* Now the contents of reg_alloc_order are fixed, calculate the
49742 + inverse map. */
49743 + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
49744 + inv_reg_alloc_order[reg_alloc_order[i]] = i;
49745 +#endif
49746 +
49747 + restore_register_info ();
49748 +
49749 +#ifdef REG_ALLOC_ORDER
49750 + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
49751 + inv_reg_alloc_order[reg_alloc_order[i]] = i;
49752 +#endif
49753 +
49754 /* This macro allows the fixed or call-used registers
49755 and the register classes to depend on target flags. */
49756
49757 @@ -995,10 +1013,10 @@ static void reg_scan_mark_refs (rtx, rtx
49758 /* Wrapper around REGNO_OK_FOR_INDEX_P, to allow pseudo registers. */
49759
49760 static inline bool
49761 -ok_for_index_p_nonstrict (rtx reg)
49762 +ok_for_index_p_nonstrict (rtx reg, enum machine_mode mode)
49763 {
49764 unsigned regno = REGNO (reg);
49765 - return regno >= FIRST_PSEUDO_REGISTER || REGNO_OK_FOR_INDEX_P (regno);
49766 + return regno >= FIRST_PSEUDO_REGISTER || ok_for_index_p_1 (regno, mode);
49767 }
49768
49769 /* A version of regno_ok_for_base_p for use during regclass, when all pseudos
49770 @@ -2073,7 +2091,7 @@ record_address_regs (enum machine_mode m
49771 enum reg_class class;
49772
49773 if (context == 1)
49774 - class = INDEX_REG_CLASS;
49775 + class = index_reg_class (mode);
49776 else
49777 class = base_reg_class (mode, outer_code, index_code);
49778
49779 @@ -2123,7 +2141,8 @@ record_address_regs (enum machine_mode m
49780 as well as in the tests below, that all addresses are in
49781 canonical form. */
49782
49783 - else if (INDEX_REG_CLASS == base_reg_class (VOIDmode, PLUS, SCRATCH))
49784 + else if (index_reg_class (mode)
49785 + == base_reg_class (mode, PLUS, SCRATCH))
49786 {
49787 record_address_regs (mode, arg0, context, PLUS, code1, scale);
49788 if (! CONSTANT_P (arg1))
49789 @@ -2149,7 +2168,7 @@ record_address_regs (enum machine_mode m
49790 else if (code0 == REG && code1 == REG
49791 && REGNO (arg0) < FIRST_PSEUDO_REGISTER
49792 && (ok_for_base_p_nonstrict (arg0, mode, PLUS, REG)
49793 - || ok_for_index_p_nonstrict (arg0)))
49794 + || ok_for_index_p_nonstrict (arg0, mode)))
49795 record_address_regs (mode, arg1,
49796 ok_for_base_p_nonstrict (arg0, mode, PLUS, REG)
49797 ? 1 : 0,
49798 @@ -2157,7 +2176,7 @@ record_address_regs (enum machine_mode m
49799 else if (code0 == REG && code1 == REG
49800 && REGNO (arg1) < FIRST_PSEUDO_REGISTER
49801 && (ok_for_base_p_nonstrict (arg1, mode, PLUS, REG)
49802 - || ok_for_index_p_nonstrict (arg1)))
49803 + || ok_for_index_p_nonstrict (arg1, mode)))
49804 record_address_regs (mode, arg0,
49805 ok_for_base_p_nonstrict (arg1, mode, PLUS, REG)
49806 ? 1 : 0,
49807 --- a/gcc/regrename.c
49808 +++ b/gcc/regrename.c
49809 @@ -566,14 +566,14 @@ scan_rtx_address (rtx insn, rtx *loc, en
49810 int index_op;
49811 unsigned regno0 = REGNO (op0), regno1 = REGNO (op1);
49812
49813 - if (REGNO_OK_FOR_INDEX_P (regno1)
49814 + if (regno_ok_for_index_p (regno1, mode)
49815 && regno_ok_for_base_p (regno0, mode, PLUS, REG))
49816 index_op = 1;
49817 - else if (REGNO_OK_FOR_INDEX_P (regno0)
49818 + else if (regno_ok_for_index_p (regno0, mode)
49819 && regno_ok_for_base_p (regno1, mode, PLUS, REG))
49820 index_op = 0;
49821 else if (regno_ok_for_base_p (regno0, mode, PLUS, REG)
49822 - || REGNO_OK_FOR_INDEX_P (regno1))
49823 + || regno_ok_for_index_p (regno1, mode))
49824 index_op = 1;
49825 else if (regno_ok_for_base_p (regno1, mode, PLUS, REG))
49826 index_op = 0;
49827 @@ -598,7 +598,7 @@ scan_rtx_address (rtx insn, rtx *loc, en
49828 }
49829
49830 if (locI)
49831 - scan_rtx_address (insn, locI, INDEX_REG_CLASS, action, mode);
49832 + scan_rtx_address (insn, locI, index_reg_class (mode), action, mode);
49833 if (locB)
49834 scan_rtx_address (insn, locB, base_reg_class (mode, PLUS, index_code),
49835 action, mode);
49836 @@ -820,7 +820,7 @@ build_def_use (basic_block bb)
49837 OP_IN, 0);
49838
49839 for (i = 0; i < recog_data.n_dups; i++)
49840 - *recog_data.dup_loc[i] = copy_rtx (old_dups[i]);
49841 + *recog_data.dup_loc[i] = old_dups[i];
49842 for (i = 0; i < n_ops; i++)
49843 *recog_data.operand_loc[i] = old_operands[i];
49844 if (recog_data.n_dups)
49845 @@ -1486,14 +1486,14 @@ replace_oldest_value_addr (rtx *loc, enu
49846 int index_op;
49847 unsigned regno0 = REGNO (op0), regno1 = REGNO (op1);
49848
49849 - if (REGNO_OK_FOR_INDEX_P (regno1)
49850 + if (regno_ok_for_index_p (regno1, mode)
49851 && regno_ok_for_base_p (regno0, mode, PLUS, REG))
49852 index_op = 1;
49853 - else if (REGNO_OK_FOR_INDEX_P (regno0)
49854 + else if (regno_ok_for_index_p (regno0, mode)
49855 && regno_ok_for_base_p (regno1, mode, PLUS, REG))
49856 index_op = 0;
49857 else if (regno_ok_for_base_p (regno0, mode, PLUS, REG)
49858 - || REGNO_OK_FOR_INDEX_P (regno1))
49859 + || regno_ok_for_index_p (regno1, mode))
49860 index_op = 1;
49861 else if (regno_ok_for_base_p (regno1, mode, PLUS, REG))
49862 index_op = 0;
49863 @@ -1518,8 +1518,8 @@ replace_oldest_value_addr (rtx *loc, enu
49864 }
49865
49866 if (locI)
49867 - changed |= replace_oldest_value_addr (locI, INDEX_REG_CLASS, mode,
49868 - insn, vd);
49869 + changed |= replace_oldest_value_addr (locI, index_reg_class (mode),
49870 + mode, insn, vd);
49871 if (locB)
49872 changed |= replace_oldest_value_addr (locB,
49873 base_reg_class (mode, PLUS,
49874 --- a/gcc/reload.c
49875 +++ b/gcc/reload.c
49876 @@ -5034,7 +5034,7 @@ find_reloads_address (enum machine_mode
49877 loc = &XEXP (*loc, 0);
49878 }
49879
49880 - if (double_reg_address_ok)
49881 + if (double_reg_address_ok && index_reg_class (mode) != NO_REGS)
49882 {
49883 /* Unshare the sum as well. */
49884 *loc = ad = copy_rtx (ad);
49885 @@ -5042,8 +5042,8 @@ find_reloads_address (enum machine_mode
49886 /* Reload the displacement into an index reg.
49887 We assume the frame pointer or arg pointer is a base reg. */
49888 find_reloads_address_part (XEXP (ad, 1), &XEXP (ad, 1),
49889 - INDEX_REG_CLASS, GET_MODE (ad), opnum,
49890 - type, ind_levels);
49891 + index_reg_class (mode), GET_MODE (ad),
49892 + opnum, type, ind_levels);
49893 return 0;
49894 }
49895 else
49896 @@ -5436,13 +5436,13 @@ find_reloads_address_1 (enum machine_mod
49897 #define REG_OK_FOR_CONTEXT(CONTEXT, REGNO, MODE, OUTER, INDEX) \
49898 ((CONTEXT) == 0 \
49899 ? regno_ok_for_base_p (REGNO, MODE, OUTER, INDEX) \
49900 - : REGNO_OK_FOR_INDEX_P (REGNO))
49901 + : regno_ok_for_index_p (REGNO, MODE))
49902
49903 enum reg_class context_reg_class;
49904 RTX_CODE code = GET_CODE (x);
49905
49906 if (context == 1)
49907 - context_reg_class = INDEX_REG_CLASS;
49908 + context_reg_class = index_reg_class (mode);
49909 else
49910 context_reg_class = base_reg_class (mode, outer_code, index_code);
49911
49912 @@ -5534,17 +5534,17 @@ find_reloads_address_1 (enum machine_mod
49913
49914 else if (code0 == REG && code1 == REG)
49915 {
49916 - if (REGNO_OK_FOR_INDEX_P (REGNO (op1))
49917 + if (regno_ok_for_index_p (REGNO (op1), mode)
49918 && regno_ok_for_base_p (REGNO (op0), mode, PLUS, REG))
49919 return 0;
49920 - else if (REGNO_OK_FOR_INDEX_P (REGNO (op0))
49921 + else if (regno_ok_for_index_p (REGNO (op0), mode)
49922 && regno_ok_for_base_p (REGNO (op1), mode, PLUS, REG))
49923 return 0;
49924 else if (regno_ok_for_base_p (REGNO (op0), mode, PLUS, REG))
49925 find_reloads_address_1 (mode, orig_op1, 1, PLUS, SCRATCH,
49926 &XEXP (x, 1), opnum, type, ind_levels,
49927 insn);
49928 - else if (REGNO_OK_FOR_INDEX_P (REGNO (op1)))
49929 + else if (regno_ok_for_index_p (REGNO (op1), mode))
49930 find_reloads_address_1 (mode, orig_op0, 0, PLUS, REG,
49931 &XEXP (x, 0), opnum, type, ind_levels,
49932 insn);
49933 @@ -5552,7 +5552,7 @@ find_reloads_address_1 (enum machine_mod
49934 find_reloads_address_1 (mode, orig_op0, 1, PLUS, SCRATCH,
49935 &XEXP (x, 0), opnum, type, ind_levels,
49936 insn);
49937 - else if (REGNO_OK_FOR_INDEX_P (REGNO (op0)))
49938 + else if (regno_ok_for_index_p (REGNO (op0), mode))
49939 find_reloads_address_1 (mode, orig_op1, 0, PLUS, REG,
49940 &XEXP (x, 1), opnum, type, ind_levels,
49941 insn);
49942 @@ -5622,7 +5622,7 @@ find_reloads_address_1 (enum machine_mod
49943 need to live longer than a TYPE reload normally would, so be
49944 conservative and class it as RELOAD_OTHER. */
49945 if ((REG_P (XEXP (op1, 1))
49946 - && !REGNO_OK_FOR_INDEX_P (REGNO (XEXP (op1, 1))))
49947 + && !regno_ok_for_index_p (REGNO (XEXP (op1, 1)), mode))
49948 || GET_CODE (XEXP (op1, 1)) == PLUS)
49949 find_reloads_address_1 (mode, XEXP (op1, 1), 1, code, SCRATCH,
49950 &XEXP (op1, 1), opnum, RELOAD_OTHER,
49951 --- a/gcc/reload1.c
49952 +++ b/gcc/reload1.c
49953 @@ -7677,6 +7677,9 @@ emit_reload_insns (struct insn_chain *ch
49954 }
49955 }
49956
49957 + if (i < 0 && rld[r].in != NULL_RTX && rld[r].reg_rtx != NULL_RTX)
49958 + forget_old_reloads_1 (rld[r].reg_rtx, NULL_RTX, NULL);
49959 +
49960 /* The following if-statement was #if 0'd in 1.34 (or before...).
49961 It's reenabled in 1.35 because supposedly nothing else
49962 deals with this problem. */
49963 --- a/gcc/rtl-factoring.c
49964 +++ b/gcc/rtl-factoring.c
49965 @@ -444,15 +444,17 @@ collect_pattern_seqs (void)
49966 htab_iterator hti0, hti1, hti2;
49967 p_hash_bucket hash_bucket;
49968 p_hash_elem e0, e1;
49969 -#ifdef STACK_REGS
49970 +#if defined STACK_REGS || defined HAVE_cc0
49971 basic_block bb;
49972 - bitmap_head stack_reg_live;
49973 + bitmap_head dont_collect;
49974
49975 /* Extra initialization step to ensure that no stack registers (if present)
49976 - are live across abnormal edges. Set a flag in STACK_REG_LIVE for an insn
49977 - if a stack register is live after the insn. */
49978 - bitmap_initialize (&stack_reg_live, NULL);
49979 + or cc0 code (if present) are live across abnormal edges.
49980 + Set a flag in DONT_COLLECT for an insn if a stack register is live
49981 + after the insn or the insn is cc0 setter or user. */
49982 + bitmap_initialize (&dont_collect, NULL);
49983
49984 +#ifdef STACK_REGS
49985 FOR_EACH_BB (bb)
49986 {
49987 regset_head live;
49988 @@ -476,7 +478,7 @@ collect_pattern_seqs (void)
49989 {
49990 if (REGNO_REG_SET_P (&live, reg))
49991 {
49992 - bitmap_set_bit (&stack_reg_live, INSN_UID (insn));
49993 + bitmap_set_bit (&dont_collect, INSN_UID (insn));
49994 break;
49995 }
49996 }
49997 @@ -493,6 +495,28 @@ collect_pattern_seqs (void)
49998 }
49999 #endif
50000
50001 +#ifdef HAVE_cc0
50002 + /* Mark CC0 setters and users as ineligible for collection into sequences.
50003 + This is an over-conservative fix, since it is OK to include
50004 + a cc0_setter, but only if we also include the corresponding cc0_user,
50005 + and vice versa. */
50006 + FOR_EACH_BB (bb)
50007 + {
50008 + rtx insn;
50009 + rtx next_tail;
50010 +
50011 + next_tail = NEXT_INSN (BB_END (bb));
50012 +
50013 + for (insn = BB_HEAD (bb); insn != next_tail; insn = NEXT_INSN (insn))
50014 + {
50015 + if (INSN_P (insn) && reg_mentioned_p (cc0_rtx, PATTERN (insn)))
50016 + bitmap_set_bit (&dont_collect, INSN_UID (insn));
50017 + }
50018 + }
50019 +#endif
50020 +
50021 +#endif /* defined STACK_REGS || defined HAVE_cc0 */
50022 +
50023 /* Initialize PATTERN_SEQS to empty. */
50024 pattern_seqs = 0;
50025
50026 @@ -505,15 +529,15 @@ collect_pattern_seqs (void)
50027 FOR_EACH_HTAB_ELEMENT (hash_bucket->seq_candidates, e1, p_hash_elem,
50028 hti2)
50029 if (e0 != e1
50030 -#ifdef STACK_REGS
50031 - && !bitmap_bit_p (&stack_reg_live, INSN_UID (e0->insn))
50032 - && !bitmap_bit_p (&stack_reg_live, INSN_UID (e1->insn))
50033 +#if defined STACK_REGS || defined HAVE_cc0
50034 + && !bitmap_bit_p (&dont_collect, INSN_UID (e0->insn))
50035 + && !bitmap_bit_p (&dont_collect, INSN_UID (e1->insn))
50036 #endif
50037 )
50038 match_seqs (e0, e1);
50039 -#ifdef STACK_REGS
50040 +#if defined STACK_REGS || defined HAVE_cc0
50041 /* Free unused data. */
50042 - bitmap_clear (&stack_reg_live);
50043 + bitmap_clear (&dont_collect);
50044 #endif
50045 }
50046
50047 --- a/gcc/sched-ebb.c
50048 +++ b/gcc/sched-ebb.c
50049 @@ -271,6 +271,7 @@ static struct sched_info ebb_sched_info
50050 ebb_print_insn,
50051 contributes_to_priority,
50052 compute_jump_reg_dependencies,
50053 + NULL, /* insn_finishes_block_p */
50054
50055 NULL, NULL,
50056 NULL, NULL,
50057 --- a/gcc/sched-int.h
50058 +++ b/gcc/sched-int.h
50059 @@ -376,6 +376,10 @@ struct sched_info
50060 the jump in the regset. */
50061 void (*compute_jump_reg_dependencies) (rtx, regset, regset, regset);
50062
50063 + /* Return true if scheduling insn (passed as the parameter) will trigger
50064 + finish of scheduling current block. */
50065 + bool (*insn_finishes_block_p) (rtx);
50066 +
50067 /* The boundaries of the set of insns to be scheduled. */
50068 rtx prev_head, next_tail;
50069
50070 --- a/gcc/sched-rgn.c
50071 +++ b/gcc/sched-rgn.c
50072 @@ -2210,6 +2210,19 @@ compute_jump_reg_dependencies (rtx insn
50073 add_branch_dependences. */
50074 }
50075
50076 +/* Return true if scheduling INSN will trigger finish of scheduling
50077 + current block. */
50078 +static bool
50079 +rgn_insn_finishes_block_p (rtx insn)
50080 +{
50081 + if (INSN_BB (insn) == target_bb
50082 + && sched_target_n_insns + 1 == target_n_insns)
50083 + /* INSN is the last not-scheduled instruction in the current block. */
50084 + return true;
50085 +
50086 + return false;
50087 +}
50088 +
50089 /* Used in schedule_insns to initialize current_sched_info for scheduling
50090 regions (or single basic blocks). */
50091
50092 @@ -2223,6 +2236,7 @@ static struct sched_info region_sched_in
50093 rgn_print_insn,
50094 contributes_to_priority,
50095 compute_jump_reg_dependencies,
50096 + rgn_insn_finishes_block_p,
50097
50098 NULL, NULL,
50099 NULL, NULL,
50100 --- a/gcc/sdbout.c
50101 +++ b/gcc/sdbout.c
50102 @@ -336,6 +336,7 @@ const struct gcc_debug_hooks sdb_debug_h
50103 debug_nothing_int, /* handle_pch */
50104 debug_nothing_rtx, /* var_location */
50105 debug_nothing_void, /* switch_text_section */
50106 + debug_nothing_tree_tree, /* set_name */
50107 0 /* start_end_main_source_file */
50108 };
50109
50110 --- a/gcc/target-def.h
50111 +++ b/gcc/target-def.h
50112 @@ -461,6 +461,7 @@
50113 #define TARGET_CANNOT_MODIFY_JUMPS_P hook_bool_void_false
50114 #define TARGET_BRANCH_TARGET_REGISTER_CLASS hook_int_void_no_regs
50115 #define TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED hook_bool_bool_false
50116 +#define TARGET_ADJUST_REG_ALLOC_ORDER hook_intp_void
50117 #define TARGET_CANNOT_FORCE_CONST_MEM hook_bool_rtx_false
50118 #define TARGET_CANNOT_COPY_INSN_P NULL
50119 #define TARGET_COMMUTATIVE_P hook_bool_const_rtx_commutative_p
50120 @@ -512,6 +513,10 @@
50121 #define TARGET_INVALID_CONVERSION hook_constcharptr_const_tree_const_tree_null
50122 #define TARGET_INVALID_UNARY_OP hook_constcharptr_int_const_tree_null
50123 #define TARGET_INVALID_BINARY_OP hook_constcharptr_int_const_tree_const_tree_null
50124 +#define TARGET_INVALID_PARAMETER_TYPE hook_constcharptr_const_tree_null
50125 +#define TARGET_INVALID_RETURN_TYPE hook_constcharptr_const_tree_null
50126 +#define TARGET_PROMOTED_TYPE hook_tree_const_tree_null
50127 +#define TARGET_CONVERT_TO_TYPE hook_tree_tree_tree_null
50128
50129 #define TARGET_FIXED_CONDITION_CODE_REGS hook_bool_uintp_uintp_false
50130
50131 @@ -568,7 +573,9 @@
50132 #define TARGET_ARG_PARTIAL_BYTES hook_int_CUMULATIVE_ARGS_mode_tree_bool_0
50133
50134 #define TARGET_FUNCTION_VALUE default_function_value
50135 +#define TARGET_LIBCALL_VALUE default_libcall_value
50136 #define TARGET_INTERNAL_ARG_POINTER default_internal_arg_pointer
50137 +#define TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS hook_bool_void_true
50138
50139 #define TARGET_CALLS { \
50140 TARGET_PROMOTE_FUNCTION_ARGS, \
50141 @@ -588,7 +595,9 @@
50142 TARGET_ARG_PARTIAL_BYTES, \
50143 TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN, \
50144 TARGET_FUNCTION_VALUE, \
50145 - TARGET_INTERNAL_ARG_POINTER \
50146 + TARGET_LIBCALL_VALUE, \
50147 + TARGET_INTERNAL_ARG_POINTER, \
50148 + TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS \
50149 }
50150
50151 #ifndef TARGET_UNWIND_TABLES_DEFAULT
50152 @@ -731,6 +740,7 @@
50153 TARGET_CANNOT_MODIFY_JUMPS_P, \
50154 TARGET_BRANCH_TARGET_REGISTER_CLASS, \
50155 TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED, \
50156 + TARGET_ADJUST_REG_ALLOC_ORDER, \
50157 TARGET_CANNOT_FORCE_CONST_MEM, \
50158 TARGET_CANNOT_COPY_INSN_P, \
50159 TARGET_COMMUTATIVE_P, \
50160 @@ -782,6 +792,10 @@
50161 TARGET_INVALID_CONVERSION, \
50162 TARGET_INVALID_UNARY_OP, \
50163 TARGET_INVALID_BINARY_OP, \
50164 + TARGET_INVALID_PARAMETER_TYPE, \
50165 + TARGET_INVALID_RETURN_TYPE, \
50166 + TARGET_PROMOTED_TYPE, \
50167 + TARGET_CONVERT_TO_TYPE, \
50168 TARGET_SECONDARY_RELOAD, \
50169 TARGET_EXPAND_TO_RTL_HOOK, \
50170 TARGET_INSTANTIATE_DECLS, \
50171 --- a/gcc/target.h
50172 +++ b/gcc/target.h
50173 @@ -555,6 +555,11 @@ struct gcc_target
50174 already been generated. */
50175 bool (* branch_target_register_callee_saved) (bool after_pe_gen);
50176
50177 + /* Called only if REG_ALLOC_ORDER is defined. Given an array that has
50178 + been initialized from REG_ALLOC_ORDER, make any target-specific
50179 + adjustments that cannot be expressed in the definition of that macro. */
50180 + void (* adjust_reg_alloc_order) (int *);
50181 +
50182 /* True if the constant X cannot be placed in the constant pool. */
50183 bool (* cannot_force_const_mem) (rtx);
50184
50185 @@ -830,9 +835,18 @@ struct gcc_target
50186 rtx (*function_value) (const_tree ret_type, const_tree fn_decl_or_type,
50187 bool outgoing);
50188
50189 + /* Return the rtx for the result of a libcall of mode MODE,
50190 + calling the function FN_NAME. */
50191 + rtx (*libcall_value) (enum machine_mode, rtx);
50192 +
50193 /* Return an rtx for the argument pointer incoming to the
50194 current function. */
50195 rtx (*internal_arg_pointer) (void);
50196 +
50197 + /* Return true if all function parameters should be spilled to the
50198 + stack. */
50199 + bool (*allocate_stack_slots_for_args) (void);
50200 +
50201 } calls;
50202
50203 /* Return the diagnostic message string if conversion from FROMTYPE
50204 @@ -847,6 +861,24 @@ struct gcc_target
50205 is not permitted on TYPE1 and TYPE2, NULL otherwise. */
50206 const char *(*invalid_binary_op) (int op, const_tree type1, const_tree type2);
50207
50208 + /* Return the diagnostic message string if TYPE is not valid as a
50209 + function parameter type, NULL otherwise. */
50210 + const char *(*invalid_parameter_type) (const_tree type);
50211 +
50212 + /* Return the diagnostic message string if TYPE is not valid as a
50213 + function return type, NULL otherwise. */
50214 + const char *(*invalid_return_type) (const_tree type);
50215 +
50216 + /* If values of TYPE are promoted to some other type when used in
50217 + expressions (analogous to the integer promotions), return that type,
50218 + or NULL_TREE otherwise. */
50219 + tree (*promoted_type) (const_tree type);
50220 +
50221 + /* Convert EXPR to TYPE, if target-specific types with special conversion
50222 + rules are involved. Return the converted expression, or NULL to apply
50223 + the standard conversion rules. */
50224 + tree (*convert_to_type) (tree type, tree expr);
50225 +
50226 /* Return the class for a secondary reload, and fill in extra information. */
50227 enum reg_class (*secondary_reload) (bool, rtx, enum reg_class,
50228 enum machine_mode,
50229 --- a/gcc/targhooks.c
50230 +++ b/gcc/targhooks.c
50231 @@ -565,6 +565,12 @@ default_function_value (const_tree ret_t
50232 }
50233
50234 rtx
50235 +default_libcall_value (enum machine_mode mode, rtx fun ATTRIBUTE_UNUSED)
50236 +{
50237 + return LIBCALL_VALUE (mode);
50238 +}
50239 +
50240 +rtx
50241 default_internal_arg_pointer (void)
50242 {
50243 /* If the reg that the virtual arg pointer will be translated into is
50244 --- a/gcc/targhooks.h
50245 +++ b/gcc/targhooks.h
50246 @@ -87,6 +87,7 @@ extern const char *hook_invalid_arg_for_
50247 (const_tree, const_tree, const_tree);
50248 extern bool hook_bool_const_rtx_commutative_p (const_rtx, int);
50249 extern rtx default_function_value (const_tree, const_tree, bool);
50250 +extern rtx default_libcall_value (enum machine_mode, rtx);
50251 extern rtx default_internal_arg_pointer (void);
50252 extern enum reg_class default_secondary_reload (bool, rtx, enum reg_class,
50253 enum machine_mode,
50254 --- a/gcc/timevar.def
50255 +++ b/gcc/timevar.def
50256 @@ -129,6 +129,7 @@ DEFTIMEVAR (TV_TREE_LOOP_IVOPTS , "
50257 DEFTIMEVAR (TV_PREDCOM , "predictive commoning")
50258 DEFTIMEVAR (TV_TREE_LOOP_INIT , "tree loop init")
50259 DEFTIMEVAR (TV_TREE_LOOP_FINI , "tree loop fini")
50260 +DEFTIMEVAR (TV_TREE_LOOP_PROMOTE , "tree loop index promotion")
50261 DEFTIMEVAR (TV_TREE_CH , "tree copy headers")
50262 DEFTIMEVAR (TV_TREE_SSA_UNCPROP , "tree SSA uncprop")
50263 DEFTIMEVAR (TV_TREE_SSA_TO_NORMAL , "tree SSA to normal")
50264 @@ -136,6 +137,7 @@ DEFTIMEVAR (TV_TREE_NRV , "tree NR
50265 DEFTIMEVAR (TV_TREE_COPY_RENAME , "tree rename SSA copies")
50266 DEFTIMEVAR (TV_TREE_SSA_VERIFY , "tree SSA verifier")
50267 DEFTIMEVAR (TV_TREE_STMT_VERIFY , "tree STMT verifier")
50268 +DEFTIMEVAR (TV_TREE_RLS , "tree local static removal")
50269 DEFTIMEVAR (TV_CGRAPH_VERIFY , "callgraph verifier")
50270 DEFTIMEVAR (TV_DOM_FRONTIERS , "dominance frontiers")
50271 DEFTIMEVAR (TV_DOMINANCE , "dominance computation")
50272 --- a/gcc/toplev.h
50273 +++ b/gcc/toplev.h
50274 @@ -131,6 +131,7 @@ extern int flag_unroll_loops;
50275 extern int flag_unroll_all_loops;
50276 extern int flag_unswitch_loops;
50277 extern int flag_cprop_registers;
50278 +extern int flag_remove_local_statics;
50279 extern int time_report;
50280
50281 /* Things to do with target switches. */
50282 --- a/gcc/tree-pass.h
50283 +++ b/gcc/tree-pass.h
50284 @@ -264,6 +264,7 @@ extern struct tree_opt_pass pass_iv_cano
50285 extern struct tree_opt_pass pass_scev_cprop;
50286 extern struct tree_opt_pass pass_empty_loop;
50287 extern struct tree_opt_pass pass_record_bounds;
50288 +extern struct tree_opt_pass pass_promote_short_indices;
50289 extern struct tree_opt_pass pass_if_conversion;
50290 extern struct tree_opt_pass pass_vectorize;
50291 extern struct tree_opt_pass pass_complete_unroll;
50292 @@ -328,6 +329,7 @@ extern struct tree_opt_pass pass_reassoc
50293 extern struct tree_opt_pass pass_rebuild_cgraph_edges;
50294 extern struct tree_opt_pass pass_build_cgraph_edges;
50295 extern struct tree_opt_pass pass_reset_cc_flags;
50296 +extern struct tree_opt_pass pass_remove_local_statics;
50297
50298 /* IPA Passes */
50299 extern struct tree_opt_pass pass_ipa_matrix_reorg;
50300 --- a/gcc/tree-predcom.c
50301 +++ b/gcc/tree-predcom.c
50302 @@ -1294,6 +1294,7 @@ ref_at_iteration (struct loop *loop, tre
50303 {
50304 tree idx, *idx_p, type, val, op0 = NULL_TREE, ret;
50305 affine_iv iv;
50306 + tree fs;
50307 bool ok;
50308
50309 if (handled_component_p (ref))
50310 @@ -1341,7 +1342,10 @@ ref_at_iteration (struct loop *loop, tre
50311 else
50312 return NULL_TREE;
50313
50314 - ok = simple_iv (loop, first_stmt (loop->header), idx, &iv, true);
50315 + fs = first_stmt (loop->header);
50316 + if (!fs)
50317 + return NULL_TREE;
50318 + ok = simple_iv (loop, fs, idx, &iv, true);
50319 if (!ok)
50320 return NULL_TREE;
50321 iv.base = expand_simple_operations (iv.base);
50322 --- a/gcc/tree-ssa-loop-ivopts.c
50323 +++ b/gcc/tree-ssa-loop-ivopts.c
50324 @@ -1391,10 +1391,75 @@ idx_record_use (tree base, tree *idx,
50325 return true;
50326 }
50327
50328 -/* Returns true if memory reference REF may be unaligned. */
50329 +/* If we can prove that TOP = cst * BOT for some constant cst,
50330 + store cst to MUL and return true. Otherwise return false.
50331 + The returned value is always sign-extended, regardless of the
50332 + signedness of TOP and BOT. */
50333
50334 static bool
50335 -may_be_unaligned_p (tree ref)
50336 +constant_multiple_of (tree top, tree bot, double_int *mul)
50337 +{
50338 + tree mby;
50339 + enum tree_code code;
50340 + double_int res, p0, p1;
50341 + unsigned precision = TYPE_PRECISION (TREE_TYPE (top));
50342 +
50343 + STRIP_NOPS (top);
50344 + STRIP_NOPS (bot);
50345 +
50346 + if (operand_equal_p (top, bot, 0))
50347 + {
50348 + *mul = double_int_one;
50349 + return true;
50350 + }
50351 +
50352 + code = TREE_CODE (top);
50353 + switch (code)
50354 + {
50355 + case MULT_EXPR:
50356 + mby = TREE_OPERAND (top, 1);
50357 + if (TREE_CODE (mby) != INTEGER_CST)
50358 + return false;
50359 +
50360 + if (!constant_multiple_of (TREE_OPERAND (top, 0), bot, &res))
50361 + return false;
50362 +
50363 + *mul = double_int_sext (double_int_mul (res, tree_to_double_int (mby)),
50364 + precision);
50365 + return true;
50366 +
50367 + case PLUS_EXPR:
50368 + case MINUS_EXPR:
50369 + if (!constant_multiple_of (TREE_OPERAND (top, 0), bot, &p0)
50370 + || !constant_multiple_of (TREE_OPERAND (top, 1), bot, &p1))
50371 + return false;
50372 +
50373 + if (code == MINUS_EXPR)
50374 + p1 = double_int_neg (p1);
50375 + *mul = double_int_sext (double_int_add (p0, p1), precision);
50376 + return true;
50377 +
50378 + case INTEGER_CST:
50379 + if (TREE_CODE (bot) != INTEGER_CST)
50380 + return false;
50381 +
50382 + p0 = double_int_sext (tree_to_double_int (top), precision);
50383 + p1 = double_int_sext (tree_to_double_int (bot), precision);
50384 + if (double_int_zero_p (p1))
50385 + return false;
50386 + *mul = double_int_sext (double_int_sdivmod (p0, p1, FLOOR_DIV_EXPR, &res),
50387 + precision);
50388 + return double_int_zero_p (res);
50389 +
50390 + default:
50391 + return false;
50392 + }
50393 +}
50394 +
50395 +/* Returns true if memory reference REF with step STEP may be unaligned. */
50396 +
50397 +static bool
50398 +may_be_unaligned_p (tree ref, tree step)
50399 {
50400 tree base;
50401 tree base_type;
50402 @@ -1418,11 +1483,20 @@ may_be_unaligned_p (tree ref)
50403 base_type = TREE_TYPE (base);
50404 base_align = TYPE_ALIGN (base_type);
50405
50406 - if (mode != BLKmode
50407 - && (base_align < GET_MODE_ALIGNMENT (mode)
50408 + if (mode != BLKmode)
50409 + {
50410 + double_int mul;
50411 + tree al = build_int_cst (TREE_TYPE (step),
50412 + GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT);
50413 +
50414 + if (base_align < GET_MODE_ALIGNMENT (mode)
50415 || bitpos % GET_MODE_ALIGNMENT (mode) != 0
50416 - || bitpos % BITS_PER_UNIT != 0))
50417 - return true;
50418 + || bitpos % BITS_PER_UNIT != 0)
50419 + return true;
50420 +
50421 + if (! constant_multiple_of (step, al, &mul))
50422 + return true;
50423 + }
50424
50425 return false;
50426 }
50427 @@ -1549,7 +1623,7 @@ find_interesting_uses_address (struct iv
50428
50429 /* Moreover, on strict alignment platforms, check that it is
50430 sufficiently aligned. */
50431 - if (STRICT_ALIGNMENT && may_be_unaligned_p (base))
50432 + if (STRICT_ALIGNMENT && may_be_unaligned_p (base, step))
50433 goto fail;
50434
50435 base = build_fold_addr_expr (base);
50436 @@ -2585,71 +2659,6 @@ tree_int_cst_sign_bit (const_tree t)
50437 return (w >> bitno) & 1;
50438 }
50439
50440 -/* If we can prove that TOP = cst * BOT for some constant cst,
50441 - store cst to MUL and return true. Otherwise return false.
50442 - The returned value is always sign-extended, regardless of the
50443 - signedness of TOP and BOT. */
50444 -
50445 -static bool
50446 -constant_multiple_of (tree top, tree bot, double_int *mul)
50447 -{
50448 - tree mby;
50449 - enum tree_code code;
50450 - double_int res, p0, p1;
50451 - unsigned precision = TYPE_PRECISION (TREE_TYPE (top));
50452 -
50453 - STRIP_NOPS (top);
50454 - STRIP_NOPS (bot);
50455 -
50456 - if (operand_equal_p (top, bot, 0))
50457 - {
50458 - *mul = double_int_one;
50459 - return true;
50460 - }
50461 -
50462 - code = TREE_CODE (top);
50463 - switch (code)
50464 - {
50465 - case MULT_EXPR:
50466 - mby = TREE_OPERAND (top, 1);
50467 - if (TREE_CODE (mby) != INTEGER_CST)
50468 - return false;
50469 -
50470 - if (!constant_multiple_of (TREE_OPERAND (top, 0), bot, &res))
50471 - return false;
50472 -
50473 - *mul = double_int_sext (double_int_mul (res, tree_to_double_int (mby)),
50474 - precision);
50475 - return true;
50476 -
50477 - case PLUS_EXPR:
50478 - case MINUS_EXPR:
50479 - if (!constant_multiple_of (TREE_OPERAND (top, 0), bot, &p0)
50480 - || !constant_multiple_of (TREE_OPERAND (top, 1), bot, &p1))
50481 - return false;
50482 -
50483 - if (code == MINUS_EXPR)
50484 - p1 = double_int_neg (p1);
50485 - *mul = double_int_sext (double_int_add (p0, p1), precision);
50486 - return true;
50487 -
50488 - case INTEGER_CST:
50489 - if (TREE_CODE (bot) != INTEGER_CST)
50490 - return false;
50491 -
50492 - p0 = double_int_sext (tree_to_double_int (top), precision);
50493 - p1 = double_int_sext (tree_to_double_int (bot), precision);
50494 - if (double_int_zero_p (p1))
50495 - return false;
50496 - *mul = double_int_sext (double_int_sdivmod (p0, p1, FLOOR_DIV_EXPR, &res),
50497 - precision);
50498 - return double_int_zero_p (res);
50499 -
50500 - default:
50501 - return false;
50502 - }
50503 -}
50504 -
50505 /* If A is (TYPE) BA and B is (TYPE) BB, and the types of BA and BB have the
50506 same precision that is at least as wide as the precision of TYPE, stores
50507 BA to A and BB to B, and returns the type of BA. Otherwise, returns the
50508 --- /dev/null
50509 +++ b/gcc/tree-ssa-loop-promote.c
50510 @@ -0,0 +1,1555 @@
50511 +/* Promotion of shorter-than-word-size loop indices.
50512 + Copyright (C) 2009 Free Software Foundation, Inc.
50513 +
50514 +This file is part of GCC.
50515 +
50516 +GCC is free software; you can redistribute it and/or modify it
50517 +under the terms of the GNU General Public License as published by the
50518 +Free Software Foundation; either version 3, or (at your option) any
50519 +later version.
50520 +
50521 +GCC is distributed in the hope that it will be useful, but WITHOUT
50522 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
50523 +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
50524 +for more details.
50525 +
50526 +You should have received a copy of the GNU General Public License
50527 +along with GCC; see the file COPYING3. If not see
50528 +<http://www.gnu.org/licenses/>. */
50529 +
50530 +/* This pass finds loop indices that are declared as
50531 + shorter-than-word-size and replaces them with word-sized loop
50532 + indices. (It assumes that word-sized quantities are the most
50533 + efficient type on which to do arithmetic.) The loop optimization
50534 + machinery has a difficult time seeing through the casts required to
50535 + promote such indices to word-sized quantities for memory addressing
50536 + and/or preserving the semantics of the source language (such as C).
50537 + The transformation also helps eliminate unnecessary
50538 + {sign,zero}-extensions required for the same.
50539 +
50540 + Although this is most naturally expressed as a loop optimization
50541 + pass, we choose to place this pass some ways before the loop
50542 + optimization passes proper, so that other scalar optimizations will
50543 + run on our "cleaned-up" code. This decision has the negative of
50544 + requiring us to build and destroy all the loop optimization
50545 + infrastructure.
50546 +
50547 + The algorithm is relatively simple. For each single-exit loop, we
50548 + identify the loop index variable. If the loop index variable is
50549 + shorter than the word size, then we have a candidate for promotion.
50550 + We determine whether the scalar evolution of the loop index fits a
50551 + particular pattern (incremented by 1, compared against a
50552 + similarly-typed loop bound, and only modified by a single increment
50553 + within the loop), as well as examining the uses of the loop index to
50554 + ensure we are able to safely promote those uses (e.g. the loop index
50555 + must not be stored to memory or passed to function calls). If these
50556 + conditions are satisfied, we create an appropriate word-sized type
50557 + and replace all uses and defs of the loop index variable with the new
50558 + variable. */
50559 +
50560 +#include "config.h"
50561 +#include "system.h"
50562 +#include "coretypes.h"
50563 +#include "tm.h"
50564 +
50565 +#include "toplev.h"
50566 +#include "rtl.h"
50567 +#include "tm_p.h"
50568 +#include "hard-reg-set.h"
50569 +#include "obstack.h"
50570 +#include "basic-block.h"
50571 +#include "pointer-set.h"
50572 +#include "intl.h"
50573 +
50574 +#include "tree.h"
50575 +#include "tree-gimple.h"
50576 +#include "hashtab.h"
50577 +#include "diagnostic.h"
50578 +#include "tree-flow.h"
50579 +#include "tree-dump.h"
50580 +#include "cfgloop.h"
50581 +#include "flags.h"
50582 +#include "timevar.h"
50583 +#include "tree-pass.h"
50584 +#include "tree-chrec.h"
50585 +#include "tree-scalar-evolution.h"
50586 +#include "tree-inline.h"
50587 +
50588 +struct promote_info {
50589 + /* The loop being analyzed. */
50590 + struct loop *loop;
50591 +
50592 + /* The COND_EXPR controlling exit from the loop. */
50593 + tree exit_expr;
50594 +
50595 + /* The loop index variable's SSA_NAME that is defined in a phi node in
50596 + LOOP->HEADER. Note that this SSA_NAME may be different than the
50597 + one appearing in EXIT_EXPR. */
50598 + tree loop_index_name;
50599 +
50600 + /* The bound of the loop. */
50601 + tree loop_limit;
50602 +
50603 + /* Whether we've warned about things with
50604 + warn_unsafe_loop_optimizations. */
50605 + bool warned;
50606 +
50607 + /* LOOP_INDEX_NAME's underlying VAR_DECL. */
50608 + tree var_decl;
50609 +
50610 + /* The types to which defs/uses of LOOP_INDEX_NAME are cast via
50611 + NOP_EXPRs. */
50612 + VEC(tree, heap) *cast_types;
50613 +
50614 + /* The number of times we have seen a cast to the corresponding type
50615 + (as determined by types_compatible_p) in CAST_TYPES. */
50616 + VEC(int, heap) *cast_counts;
50617 +
50618 + /* Whether LOOP_INDEX_NAME is suitable for promotion. */
50619 + bool can_be_promoted_p;
50620 +
50621 + /* If CAN_BE_PROMOTED_P, the promoted type. */
50622 + tree promoted_type;
50623 +
50624 + /* If CAN_BE_PROMOTED_P, the promoted VAR_DECL. */
50625 + tree promoted_var;
50626 +};
50627 +
50628 +/* A set of `struct promote_info'. */
50629 +
50630 +static struct pointer_set_t *promotion_info;
50631 +
50632 +/* A set of all potentially promotable SSA_NAMEs, used for quick
50633 +decision-making during analysis. */
50634 +
50635 +static struct pointer_set_t *promotable_names;
50636 +
50637 +/* A map from SSA_NAMEs to the VAR_DECL to which they will be
50638 + promoted. */
50639 +
50640 +static struct pointer_map_t *variable_map;
50641 +
50642 +/* A set of the stmts that we have already rebuilt with promoted variables. */
50643 +
50644 +static struct pointer_set_t *promoted_stmts;
50645 +
50646 +\f
50647 +/* Add CASTED to PI->CAST_TYPES if we haven't seen CASTED before. */
50648 +
50649 +static void
50650 +add_casted_type (struct promote_info *pi, tree casted)
50651 +{
50652 + int i;
50653 + tree type;
50654 +
50655 + /* For this information to be useful later, CASTED must be wider than
50656 + the type of the variable. */
50657 + if (TYPE_PRECISION (casted) <= TYPE_PRECISION (TREE_TYPE (pi->var_decl)))
50658 + return;
50659 +
50660 + for (i = 0; VEC_iterate (tree, pi->cast_types, i, type); i++)
50661 + if (types_compatible_p (casted, type))
50662 + {
50663 + int c = VEC_index(int, pi->cast_counts, i);
50664 + VEC_replace(int, pi->cast_counts, i, ++c);
50665 + return;
50666 + }
50667 +
50668 + /* Haven't see the type before. */
50669 + VEC_safe_push (tree, heap, pi->cast_types, casted);
50670 + VEC_safe_push (int, heap, pi->cast_counts, 1);
50671 +}
50672 +
50673 +/* Return the most-casted-to type in PI->CAST_TYPES. Return an
50674 + appropriately signed variant of size_type_node if the variable wasn't
50675 + cast in some fashion. */
50676 +
50677 +static tree
50678 +choose_profitable_promoted_type (struct promote_info *pi)
50679 +{
50680 + int i;
50681 + int count;
50682 + tree type = NULL_TREE;
50683 + int maxuse = -1;
50684 +
50685 + for (i = 0; VEC_iterate (int, pi->cast_counts, i, count); i++)
50686 + if (count > maxuse)
50687 + {
50688 + maxuse = count;
50689 + type = VEC_index (tree, pi->cast_types, i);
50690 + }
50691 +
50692 + if (type == NULL_TREE)
50693 + {
50694 + if (dump_file)
50695 + {
50696 + fprintf (dump_file, "Warning, failed to find upcast type for ");
50697 + print_generic_expr (dump_file, pi->loop_index_name, 0);
50698 + fprintf (dump_file, "\n");
50699 + }
50700 + return (TYPE_UNSIGNED (TREE_TYPE (pi->var_decl))
50701 + ? size_type_node
50702 + : signed_type_for (size_type_node));
50703 + }
50704 + else
50705 + return signed_type_for (type);
50706 +}
50707 +
50708 +/* Intuit the loop index for LOOP from PHI. There must be a path that
50709 + only goes through NOP_EXPRs or CONVERT_EXPRs from the result of PHI
50710 + to one of the operands of COND. If such a path cannot be found,
50711 + return NULL_TREE. If LIMIT is not NULL and a path can be found,
50712 + store the other operand of COND into LIMIT. */
50713 +
50714 +static tree
50715 +find_promotion_candidate_from_phi (struct loop *loop, tree cond,
50716 + tree phi, tree *limit)
50717 +{
50718 + tree op0, op1;
50719 + tree result, candidate;
50720 +
50721 + result = candidate = PHI_RESULT (phi);
50722 + /* Must be an integer variable. */
50723 + if (TREE_CODE (TREE_TYPE (candidate)) != INTEGER_TYPE)
50724 + return NULL_TREE;
50725 +
50726 + op0 = TREE_OPERAND (cond, 0);
50727 + op1 = TREE_OPERAND (cond, 1);
50728 +
50729 + /* See if there's a path from CANDIDATE to an operand of COND. */
50730 + while (true)
50731 + {
50732 + use_operand_p use;
50733 + imm_use_iterator iui;
50734 + tree use_stmt = NULL_TREE;
50735 +
50736 + if (candidate == op0)
50737 + {
50738 + if (limit) *limit = op1;
50739 + break;
50740 + }
50741 + if (candidate == op1)
50742 + {
50743 + if (limit) *limit = op0;
50744 + break;
50745 + }
50746 +
50747 + /* Find a single use in the loop header. Give up if there's
50748 + multiple ones. */
50749 + FOR_EACH_IMM_USE_FAST (use, iui, candidate)
50750 + {
50751 + tree stmt = USE_STMT (use);
50752 +
50753 + if (bb_for_stmt (stmt) == loop->header)
50754 + {
50755 + if (use_stmt)
50756 + {
50757 + if (dump_file)
50758 + {
50759 + fprintf (dump_file, "Rejecting ");
50760 + print_generic_expr (dump_file, candidate, 0);
50761 + fprintf (dump_file, " because it has multiple uses in the loop header (bb #%d).\n",
50762 + loop->header->index);
50763 + fprintf (dump_file, "first use: ");
50764 + print_generic_expr (dump_file, use_stmt, 0);
50765 + fprintf (dump_file, "\nsecond use: ");
50766 + print_generic_expr (dump_file, stmt, 0);
50767 + fprintf (dump_file, "\n(possibly more, but unanalyzed)\n");
50768 + }
50769 + return NULL_TREE;
50770 + }
50771 + else
50772 + use_stmt = stmt;
50773 + }
50774 + }
50775 +
50776 + /* No uses in the loop header, bail. */
50777 + if (use_stmt == NULL_TREE)
50778 + return NULL_TREE;
50779 +
50780 + if (TREE_CODE (use_stmt) != GIMPLE_MODIFY_STMT
50781 + || TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 0)) != SSA_NAME
50782 + || (TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) != NOP_EXPR
50783 + && TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) != CONVERT_EXPR))
50784 + {
50785 + if (dump_file)
50786 + {
50787 + fprintf (dump_file, "Rejecting ");
50788 + print_generic_expr (dump_file, candidate, 0);
50789 + fprintf (dump_file, " because of use in ");
50790 + print_generic_expr (dump_file, use_stmt, 0);
50791 + fprintf (dump_file, "\n");
50792 + }
50793 + return NULL_TREE;
50794 + }
50795 +
50796 + candidate = GIMPLE_STMT_OPERAND (use_stmt, 0);
50797 + }
50798 +
50799 + /* CANDIDATE is now what we believe to be the loop index variable. There
50800 + are two possibilities:
50801 +
50802 + - CANDIDATE is not the "true" loop index variable, but rather is a
50803 + promoted version of RESULT, done for purposes of satisfying a
50804 + language's semantics;
50805 +
50806 + - CANDIDATE is the "true" loop index variable. */
50807 + if (!types_compatible_p (TREE_TYPE (result), TREE_TYPE (candidate)))
50808 + candidate = result;
50809 +
50810 + /* The type of candidate must be "short" to consider promoting it. */
50811 + if (TREE_CODE (TREE_TYPE (candidate)) != INTEGER_TYPE
50812 + || TYPE_PRECISION (TREE_TYPE (candidate)) >= TYPE_PRECISION (size_type_node))
50813 + return NULL_TREE;
50814 +
50815 + return candidate;
50816 +}
50817 +
50818 +/* Find the loop index variable of LOOP. LOOP's exit is controlled by
50819 + the COND_EXPR EXPR. IF we can't determine what the loop index
50820 + variable is, or EXPR does not appear to be analyzable, then return
50821 + NULL_TREE. */
50822 +
50823 +static tree
50824 +find_promotion_candidate (struct loop *loop, tree expr, tree *limit)
50825 +{
50826 + tree cond = COND_EXPR_COND (expr);
50827 + tree phi;
50828 + tree candidate = NULL_TREE;
50829 +
50830 + switch (TREE_CODE (cond))
50831 + {
50832 + case GT_EXPR:
50833 + case GE_EXPR:
50834 + case NE_EXPR:
50835 + case LT_EXPR:
50836 + case LE_EXPR:
50837 + break;
50838 +
50839 + default:
50840 + return NULL_TREE;
50841 + }
50842 +
50843 + /* We'd like to examine COND and intuit the loop index variable from
50844 + there. Instead, we're going to start from the phi nodes in BB and
50845 + attempt to work our way forwards to one of the operands of COND,
50846 + since starting from COND might yield an upcast loop index. If we
50847 + find multiple phi nodes whose results reach COND, then give up. */
50848 + for (phi = phi_nodes (loop->header); phi != NULL_TREE; phi = PHI_CHAIN (phi))
50849 + {
50850 + tree t = find_promotion_candidate_from_phi (loop, cond, phi, limit);
50851 +
50852 + if (t == NULL_TREE)
50853 + continue;
50854 + else if (candidate == NULL_TREE)
50855 + candidate = t;
50856 + else
50857 + {
50858 + if (dump_file)
50859 + {
50860 + fprintf (dump_file, "Can't find a candidate from ");
50861 + print_generic_expr (dump_file, expr, 0);
50862 + fprintf (dump_file, "\n because too many phi node results reach the condition.\n");
50863 + }
50864 + return NULL_TREE;
50865 + }
50866 + }
50867 +
50868 + return candidate;
50869 +}
50870 +
50871 +/* Return true if X is something that could be promoted. */
50872 +
50873 +static bool
50874 +could_be_promoted (tree x)
50875 +{
50876 + return (TREE_CODE (x) == INTEGER_CST
50877 + || (TREE_CODE (x) == SSA_NAME
50878 + && pointer_set_contains (promotable_names, x)));
50879 +}
50880 +
50881 +/* Examine EXPR's suitability with respect to being able to promote VAR.
50882 + ASSIGNED_TO is true if EXPR is being assigned to VAR; otherwise, EXPR
50883 + contains a use of VAR. */
50884 +
50885 +static bool
50886 +check_expr_for_promotability (struct promote_info *pi, tree var,
50887 + tree expr, bool assigning_to)
50888 +{
50889 + tree type = TREE_TYPE (expr);
50890 + bool ok = true;
50891 +
50892 + switch (TREE_CODE (expr))
50893 + {
50894 + case PLUS_EXPR:
50895 + case MINUS_EXPR:
50896 + case MULT_EXPR:
50897 + case EQ_EXPR:
50898 + case NE_EXPR:
50899 + case LT_EXPR:
50900 + case LE_EXPR:
50901 + case GT_EXPR:
50902 + case GE_EXPR:
50903 + {
50904 + tree op0 = TREE_OPERAND (expr, 0);
50905 + tree op1 = TREE_OPERAND (expr, 1);
50906 +
50907 + ok = ((op0 == var && could_be_promoted (op1))
50908 + || (op1 == var && could_be_promoted (op0)));
50909 + break;
50910 + }
50911 + case COND_EXPR:
50912 + if (TREE_TYPE (expr) == NULL
50913 + || TREE_TYPE (expr) == void_type_node)
50914 + ok = true;
50915 + else
50916 + /* This is conservative; it's possible that these sorts of nodes
50917 + could be promoted, but we'd have to be very careful about
50918 + checking in which parts of the COND_EXPR the promotable
50919 + variable(s) are. */
50920 + ok = false;
50921 + break;
50922 + case SSA_NAME:
50923 + ok = (expr == var || could_be_promoted (expr));
50924 + break;
50925 + case NOP_EXPR:
50926 + case CONVERT_EXPR:
50927 + if (!assigning_to)
50928 + {
50929 + add_casted_type (pi, type);
50930 + break;
50931 + }
50932 + /* Fallthrough. */
50933 + default:
50934 + ok = false;
50935 + }
50936 +
50937 + return ok;
50938 +}
50939 +
50940 +/* Analyze the loop index VAR for promotability. The rules for
50941 + promotability are:
50942 +
50943 + For uses:
50944 +
50945 + - The underlying variable may be used in NOP_EXPRs.
50946 +
50947 + - The underlying variable may be used in simple arithmmetic
50948 + expressions so long as the other parts are potentially promotable
50949 + variables or constants (so we don't go willy-nilly on promoting
50950 + things).
50951 +
50952 + - The underlying variable may not be stored to memory.
50953 +
50954 + - All uses must occur inside the loop.
50955 +
50956 + For defs:
50957 +
50958 + - The underlying variable may not be loaded from memory; and
50959 +
50960 + - The underlying variable may only be formed from expressions
50961 + involving potentially promotable varibles or constants.
50962 +
50963 + Note that defs may occur outside of the loop; we do this to handle
50964 + initial conditions before entering the loop. */
50965 +
50966 +static void
50967 +analyze_loop_index_uses (tree var, struct promote_info *pi)
50968 +{
50969 + imm_use_iterator iui;
50970 + use_operand_p use;
50971 + tree rhs;
50972 + tree bad_stmt = NULL_TREE;
50973 + const char *reason = NULL;
50974 +
50975 + FOR_EACH_IMM_USE_FAST (use, iui, var)
50976 + {
50977 + basic_block bb;
50978 + tree use_stmt = USE_STMT (use);
50979 +
50980 + /* Uses must exist only within the loop. */
50981 + bb = bb_for_stmt (use_stmt);
50982 +
50983 + if (dump_file)
50984 + {
50985 + fprintf (dump_file, "Checking ");
50986 + print_generic_expr (dump_file, use_stmt, 0);
50987 + fprintf (dump_file, "\n");
50988 + }
50989 +
50990 + if (!flow_bb_inside_loop_p (pi->loop, bb))
50991 + {
50992 + bad_stmt = use_stmt;
50993 + reason = " is involved in stmt outside loop ";
50994 + break;
50995 + }
50996 +
50997 + /* We cannot store the index to memory. */
50998 + if (stmt_references_memory_p (use_stmt))
50999 + {
51000 + bad_stmt = use_stmt;
51001 + reason = " is stored to memory in ";
51002 + break;
51003 + }
51004 +
51005 + /* We cannot pass the variable to a function. */
51006 + if (get_call_expr_in (use_stmt))
51007 + {
51008 + bad_stmt = use_stmt;
51009 + reason = " is passed to function in ";
51010 + break;
51011 + }
51012 +
51013 + if (TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT)
51014 + {
51015 + tree lhs = GIMPLE_STMT_OPERAND (use_stmt, 0);
51016 + rhs = GIMPLE_STMT_OPERAND (use_stmt, 1);
51017 +
51018 + if (!check_expr_for_promotability (pi, var, rhs,
51019 + /*is_assign=*/false))
51020 + {
51021 + bad_stmt = rhs;
51022 + reason = " is involved in non-promotable expression ";
51023 + break;
51024 + }
51025 + else if ((TREE_CODE_CLASS (TREE_CODE (rhs)) == tcc_binary
51026 + || TREE_CODE (rhs) == SSA_NAME)
51027 + && !check_expr_for_promotability (pi, var, lhs,
51028 + /*is_assign=*/true))
51029 + {
51030 + bad_stmt = lhs;
51031 + reason = " is being assigned to non-promotable variable ";
51032 + break;
51033 + }
51034 + }
51035 + else if (TREE_CODE (use_stmt) != COND_EXPR
51036 + && TREE_CODE (use_stmt) != PHI_NODE)
51037 + {
51038 + /* Use of the variable in some statement we don't know how to
51039 + analyze. */
51040 + bad_stmt = use_stmt;
51041 + reason = " is used in unanalyzable expression in ";
51042 + break;
51043 + }
51044 + }
51045 +
51046 + if (bad_stmt && reason)
51047 + {
51048 + if (dump_file)
51049 + {
51050 + fprintf (dump_file, "Loop index ");
51051 + print_generic_expr (dump_file, var, 0);
51052 + fprintf (dump_file, "%s", reason);
51053 + print_generic_expr (dump_file, bad_stmt, 0);
51054 + fprintf (dump_file, "\n");
51055 + }
51056 + pi->can_be_promoted_p = false;
51057 + }
51058 +}
51059 +
51060 +/* Check that the uses and def of VAR, defined in STMT, conform to the
51061 + rules given above. */
51062 +
51063 +static bool
51064 +analyze_loop_index (tree var, tree stmt, void *data)
51065 +{
51066 + struct promote_info *pi = data;
51067 + tree t;
51068 +
51069 + if (dump_file)
51070 + {
51071 + fprintf (dump_file, "Analyzing loop index ");
51072 + print_generic_expr (dump_file, var, 0);
51073 + fprintf (dump_file, " defined in ");
51074 + print_generic_expr (dump_file, stmt, 0);
51075 + fprintf (dump_file, "\n");
51076 + }
51077 +
51078 + /* Check the definition. */
51079 + switch (TREE_CODE (stmt))
51080 + {
51081 + case PHI_NODE:
51082 + /* Phi nodes are OK. */
51083 + break;
51084 +
51085 + case GIMPLE_MODIFY_STMT:
51086 + t = GIMPLE_STMT_OPERAND (stmt, 1);
51087 + if (!check_expr_for_promotability (pi, var, t,
51088 + /*is_assign=*/true))
51089 + break;
51090 + /* Fallthrough. */
51091 +
51092 + default:
51093 + /* Something we can't handle or the variable is being loaded from
51094 + memory. */
51095 + pi->can_be_promoted_p = false;
51096 + goto done;
51097 + }
51098 +
51099 + if (TREE_CODE (stmt) == PHI_NODE)
51100 + {
51101 + int i;
51102 +
51103 + for (i = 0; i < PHI_NUM_ARGS (stmt); i++)
51104 + {
51105 + tree arg = PHI_ARG_DEF (stmt, i);
51106 +
51107 + if (TREE_CODE (arg) == SSA_NAME)
51108 + pointer_set_insert (promotable_names, arg);
51109 + }
51110 +
51111 + analyze_loop_index_uses (PHI_RESULT (stmt), pi);
51112 + }
51113 + else
51114 + analyze_loop_index_uses (var, pi);
51115 +
51116 + /* Only worth continuing if we think the loop index can be
51117 + promoted. */
51118 + done:
51119 + if (dump_file)
51120 + {
51121 + fprintf (dump_file, "Done analyzing ");
51122 + print_generic_expr (dump_file, var, 0);
51123 + fprintf (dump_file, " defined in ");
51124 + print_generic_expr (dump_file, stmt, 0);
51125 + fprintf (dump_file, "...%s to analyze\n\n",
51126 + pi->can_be_promoted_p ? "continuing" : "not continuing");
51127 + }
51128 + return !pi->can_be_promoted_p;
51129 +}
51130 +
51131 +/* Check for the idiom:
51132 +
51133 + short x, y;
51134 + unsigned short x.2, y.2, tmp;
51135 + ...
51136 + x.2 = (unsigned short) x;
51137 + y.2 = (unsigned short) y;
51138 + tmp = x.2 + y.2;
51139 + x = (short) tmp;
51140 +
51141 + which is generated by convert for avoiding signed arithmetic
51142 + overflow. RHS is "(short) tmp" in the above statement. If RHS is
51143 + defined via such an idiom, store x and y into OP0 and OP1,
51144 + respectively. We permit y.2 to be a constant if necessary. */
51145 +
51146 +static tree
51147 +upcast_operand_p (tree t)
51148 +{
51149 + tree def, nop;
51150 +
51151 + if (TREE_CODE (t) == INTEGER_CST)
51152 + return t;
51153 +
51154 + if (TREE_CODE (t) != SSA_NAME
51155 + || !has_single_use (t))
51156 + return NULL_TREE;
51157 +
51158 + def = SSA_NAME_DEF_STMT (t);
51159 + if (TREE_CODE (def) != GIMPLE_MODIFY_STMT)
51160 + return NULL_TREE;
51161 +
51162 + nop = GIMPLE_STMT_OPERAND (def, 1);
51163 + if (TREE_CODE (nop) != CONVERT_EXPR
51164 + && TREE_CODE (nop) != NOP_EXPR)
51165 + return NULL_TREE;
51166 +
51167 + return TREE_OPERAND (nop, 0);
51168 +}
51169 +
51170 +static bool
51171 +signed_arithmetic_overflow_idiom_p (tree rhs, tree *op0, tree *op1)
51172 +{
51173 + tree tmp = TREE_OPERAND (rhs, 0);
51174 + tree op_stmt = SSA_NAME_DEF_STMT (tmp);
51175 + tree expr, x2, y2;
51176 + bool yes = false;
51177 + enum tree_code code;
51178 +
51179 + if (!has_single_use (tmp)
51180 + || TREE_CODE (op_stmt) != GIMPLE_MODIFY_STMT)
51181 + goto done;
51182 + expr = GIMPLE_STMT_OPERAND (op_stmt, 1);
51183 +
51184 + /* This could probably profitably be expanded to consider
51185 + MINUS_EXPR, MULT_EXPR, etc. */
51186 + code = TREE_CODE (expr);
51187 + if (code != PLUS_EXPR)
51188 + goto done;
51189 + x2 = TREE_OPERAND (expr, 0);
51190 + y2 = TREE_OPERAND (expr, 1);
51191 +
51192 + x2 = upcast_operand_p (x2);
51193 + if (x2 == NULL_TREE)
51194 + goto done;
51195 + y2 = upcast_operand_p (y2);
51196 + if (y2 == NULL_TREE)
51197 + goto done;
51198 +
51199 + *op0 = x2;
51200 + *op1 = y2;
51201 + yes = true;
51202 +
51203 + done:
51204 + return yes;
51205 +}
51206 +
51207 +/* The loop index should have a specific usage pattern:
51208 +
51209 + - It should be defined in a phi node with two incoming values:
51210 +
51211 + LI_phi = PHI (LI_out, LI_in)
51212 +
51213 + - One incoming value, LI_out, should be from outside the loop.
51214 +
51215 + - The other incoming value, LI_in, should be defined thusly:
51216 +
51217 + LI_in = LI_phi + increment
51218 +
51219 + - increment should be 1. We permit other increments with
51220 + -funsafe-loop-optimizations.
51221 +
51222 + - Finally, in the comparison to exit the loop, the loop index must be
51223 + compared against a variable that has a type at least as precise as
51224 + the loop index's type. For instance, something like:
51225 +
51226 + char limit;
51227 + short i;
51228 +
51229 + for (i = 0; i < limit; i++) ...
51230 +
51231 + would not be permitted. */
51232 +
51233 +static bool
51234 +stmt_in_loop_p (tree t, struct loop *loop)
51235 +{
51236 + basic_block bb;
51237 +
51238 + if (t == NULL_TREE)
51239 + return false;
51240 +
51241 + bb = bb_for_stmt (t);
51242 + if (bb == NULL)
51243 + return false;
51244 +
51245 + return flow_bb_inside_loop_p (loop, bb);
51246 +}
51247 +
51248 +static bool
51249 +analyze_loop_index_definition_pattern (struct promote_info *pi)
51250 +{
51251 + tree phi = SSA_NAME_DEF_STMT (pi->loop_index_name);
51252 + bool ok = false, warn = false;
51253 + tree in0, in1;
51254 + bool inside0, inside1;
51255 + tree def0, def1, rhs, op0, op1, increment = NULL_TREE;
51256 +
51257 + if (TREE_CODE (phi) != PHI_NODE
51258 + || PHI_NUM_ARGS (phi) != 2)
51259 + goto done;
51260 +
51261 + in0 = PHI_ARG_DEF (phi, 0);
51262 + in1 = PHI_ARG_DEF (phi, 1);
51263 +
51264 + /* Figure out which value comes from outside the loop. */
51265 + def0 = SSA_NAME_DEF_STMT (in0);
51266 + def1 = SSA_NAME_DEF_STMT (in1);
51267 +
51268 + inside0 = stmt_in_loop_p (def0, pi->loop);
51269 + inside1 = stmt_in_loop_p (def1, pi->loop);
51270 +
51271 + if (inside0 && inside1)
51272 + goto done;
51273 + else if (inside0)
51274 + {
51275 + tree t = in0;
51276 + in0 = in1;
51277 + in1 = t;
51278 + t = def0;
51279 + def0 = def1;
51280 + def1 = t;
51281 + }
51282 + else if (!inside1)
51283 + goto done;
51284 +
51285 + /* IN0 comes from outside the loop, IN1 from inside. Analyze IN1. */
51286 + if (TREE_CODE (def1) != GIMPLE_MODIFY_STMT)
51287 + goto done;
51288 +
51289 + rhs = GIMPLE_STMT_OPERAND (def1, 1);
51290 +
51291 + switch (TREE_CODE (rhs))
51292 + {
51293 + case CONVERT_EXPR:
51294 + case NOP_EXPR:
51295 + if (!signed_arithmetic_overflow_idiom_p (rhs, &op0, &op1))
51296 + goto done;
51297 + goto plus;
51298 + case PLUS_EXPR:
51299 + op0 = TREE_OPERAND (rhs, 0);
51300 + op1 = TREE_OPERAND (rhs, 1);
51301 + plus:
51302 + {
51303 + bool op0_li = op0 == PHI_RESULT (phi);
51304 + bool op1_li = op1 == PHI_RESULT (phi);
51305 + if (op0_li && op1_li)
51306 + /* This is weird, and definitely is not a case we can support
51307 + for promotion. */
51308 + goto done;
51309 + else if (op0_li)
51310 + increment = op1;
51311 + else if (op1_li)
51312 + increment = op0;
51313 + else
51314 + goto done;
51315 + break;
51316 + }
51317 + default:
51318 + break;
51319 + }
51320 +
51321 +
51322 + /* Check that the exit condition for the loop is OK. */
51323 + {
51324 + tree cond = COND_EXPR_COND (pi->exit_expr);
51325 + enum tree_code code = TREE_CODE (cond);
51326 +
51327 + op0 = TREE_OPERAND (cond, 0);
51328 + op1 = TREE_OPERAND (cond, 1);
51329 +
51330 + if (op0 == pi->loop_limit)
51331 + {
51332 + tree t = op0;
51333 + op0 = op1;
51334 + op1 = t;
51335 + code = swap_tree_comparison (code);
51336 + }
51337 +
51338 + if (code != LT_EXPR && code != LE_EXPR)
51339 + goto done;
51340 +
51341 + if (!types_compatible_p (TREE_TYPE (pi->loop_index_name),
51342 + TREE_TYPE (pi->loop_limit)))
51343 + {
51344 + switch (TREE_CODE (pi->loop_limit))
51345 + {
51346 + case INTEGER_CST:
51347 + if (!int_fits_type_p (pi->loop_limit,
51348 + TREE_TYPE (pi->loop_index_name)))
51349 + goto done;
51350 + break;
51351 + case SSA_NAME:
51352 + {
51353 + tree v = pi->loop_limit;
51354 + tree def = SSA_NAME_DEF_STMT (v);
51355 +
51356 + /* Backtrack through CONVERT_EXPRs and/or NOP_EXPRs to
51357 + determine if the variables "started out" as the same
51358 + type. */
51359 + while (TREE_CODE (def) == GIMPLE_MODIFY_STMT)
51360 + {
51361 + tree rhs = GIMPLE_STMT_OPERAND (def, 1);
51362 +
51363 + if (TREE_CODE (rhs) != NOP_EXPR
51364 + && TREE_CODE (rhs) != CONVERT_EXPR)
51365 + break;
51366 +
51367 + v = TREE_OPERAND (rhs, 0);
51368 + def = SSA_NAME_DEF_STMT (v);
51369 + }
51370 + /* Permit comparisons between non-compatible types with
51371 + flag_unsafe_loop_optimizations, since we can assume the
51372 + loop index does not overflow. */
51373 + if (types_compatible_p (TREE_TYPE (pi->loop_index_name),
51374 + TREE_TYPE (v))
51375 + || flag_unsafe_loop_optimizations)
51376 + break;
51377 + /* Fallthrough. */
51378 + default:
51379 + goto done;
51380 + }
51381 + }
51382 + }
51383 + }
51384 +
51385 + if (increment == NULL_TREE)
51386 + goto done;
51387 + if (TREE_CODE (increment) != INTEGER_CST
51388 + || compare_tree_int (increment, 1) != 0)
51389 + {
51390 + warn = true;
51391 + if (!flag_unsafe_loop_optimizations)
51392 + goto done;
51393 + }
51394 +
51395 + ok = true;
51396 + done:
51397 + if (warn && !pi->warned)
51398 + {
51399 + pi->warned = true;
51400 + /* We can promote unsigned indices only if -funsafe-loop-optimizations
51401 + is in effect, since the user might be depending on the modulo
51402 + wraparound behavior of unsigned types. */
51403 + if (warn_unsafe_loop_optimizations)
51404 + {
51405 + const char *wording;
51406 +
51407 + wording = (flag_unsafe_loop_optimizations
51408 + ? N_("assuming that the loop counter does not overflow")
51409 + : N_("cannot optimize loop, the loop counter may overflow"));
51410 + warning (OPT_Wunsafe_loop_optimizations, "%s", gettext (wording));
51411 + }
51412 + }
51413 +
51414 + return ok;
51415 +}
51416 +
51417 +/* Analyze the loop associated with PI_ to see if its loop index can be
51418 + promoted. */
51419 +
51420 +static bool
51421 +analyze_loop (const void *pi_, void *data)
51422 +{
51423 + struct promote_info *pi = CONST_CAST (struct promote_info *,
51424 + (const struct promote_info *) pi_);
51425 + bool *changed = data;
51426 +
51427 + /* We previously determined we can't promote this; go ahead and
51428 + continue iterating. */
51429 + if (pi->loop_index_name == NULL_TREE)
51430 + return true;
51431 +
51432 + /* Assume we can always promote the loop index, even if it doesn't
51433 + exist. */
51434 + pi->can_be_promoted_p = true;
51435 +
51436 + if (dump_file)
51437 + {
51438 + fprintf (dump_file, "Analyzing ");
51439 + print_generic_expr (dump_file, pi->loop_index_name, 0);
51440 + fprintf (dump_file, "\n");
51441 + }
51442 +
51443 + if (pi->loop_index_name
51444 + && analyze_loop_index_definition_pattern (pi))
51445 + {
51446 + /* Clear any previously gathered information. */
51447 + VEC_truncate (tree, pi->cast_types, 0);
51448 + VEC_truncate (int, pi->cast_counts, 0);
51449 +
51450 + walk_use_def_chains (pi->loop_index_name, analyze_loop_index, pi, false);
51451 + }
51452 + else
51453 + pi->can_be_promoted_p = false;
51454 +
51455 + /* If we determined the loop index is used in strange ways, clear it
51456 + so we don't examine it again. */
51457 + if (!pi->can_be_promoted_p)
51458 + pi->loop_index_name = NULL_TREE;
51459 +
51460 + /* Let our caller know whether to re-do the analysis. */
51461 + *changed = *changed || !pi->can_be_promoted_p;
51462 + /* Continue if PI is promotable. */
51463 + return pi->can_be_promoted_p;
51464 +}
51465 +
51466 +/* Add PI_->LOOP_INDEX_NAME to the set of variables, DATA, that we are
51467 + considering for promotion. */
51468 +
51469 +static bool
51470 +add_variable (const void *pi_, void *data ATTRIBUTE_UNUSED)
51471 +{
51472 + const struct promote_info *pi = (const struct promote_info *) pi_;
51473 + struct pointer_set_t *pset = (struct pointer_set_t *) data;
51474 + int presentp;
51475 +
51476 + if (pi->loop_index_name != NULL_TREE)
51477 + {
51478 + presentp = pointer_set_insert (pset, pi->loop_index_name);
51479 + gcc_assert (!presentp);
51480 + }
51481 +
51482 + /* Continue traversal. */
51483 + return true;
51484 +}
51485 +
51486 +/* For each promotable variable:
51487 +
51488 + - create a new, promoted VAR_DECL;
51489 +
51490 + - walk through all the uses and defs and create new statements using
51491 + the promoted variables. We don't create new phi nodes; post-pass
51492 + SSA update will handle those for us. */
51493 +
51494 +/* Make dump files readable. */
51495 +#define PROMOTED_VAR_SUFFIX ".promoted"
51496 +
51497 +/* Create a variable NAME with TYPE and do the necessary work to inform
51498 + the SSA machinery about it. */
51499 +
51500 +static tree
51501 +create_pli_var (tree type, char *name)
51502 +{
51503 + tree var = create_tmp_var (type, name);
51504 + create_var_ann (var);
51505 + mark_sym_for_renaming (var);
51506 + add_referenced_var (var);
51507 + return var;
51508 +}
51509 +
51510 +/* Associate the SSA_NAME VAR with the promoted variable DATA. */
51511 +
51512 +static bool
51513 +associate_name_with_var (tree var, tree def_stmt, void *data)
51514 +{
51515 + tree promoted_var = (tree) data;
51516 + void **p;
51517 +
51518 + gcc_assert (promoted_var != NULL_TREE);
51519 +
51520 + if (TREE_CODE (def_stmt) == PHI_NODE)
51521 + var = PHI_RESULT (def_stmt);
51522 +
51523 + p = pointer_map_insert (variable_map, var);
51524 +
51525 + if (!*p)
51526 + {
51527 + if (dump_file)
51528 + {
51529 + fprintf (dump_file, "Associating ");
51530 + print_generic_expr (dump_file, var, 0);
51531 + fprintf (dump_file, " with ");
51532 + print_generic_expr (dump_file, promoted_var, 0);
51533 + fprintf (dump_file, "\n\n");
51534 + }
51535 + *(tree *)p = promoted_var;
51536 + }
51537 +
51538 + /* Continue traversal. */
51539 + return false;
51540 +}
51541 +
51542 +/* Create a promoted variable for the variable from PI_. */
51543 +
51544 +static bool
51545 +create_promoted_variable (const void *pi_, void *data ATTRIBUTE_UNUSED)
51546 +{
51547 + struct promote_info *pi = CONST_CAST (struct promote_info *,
51548 + (const struct promote_info *) pi_);
51549 +
51550 + if (pi->can_be_promoted_p)
51551 + {
51552 + tree type = choose_profitable_promoted_type (pi);
51553 + tree orig_name = DECL_NAME (pi->var_decl);
51554 + size_t id_len = IDENTIFIER_LENGTH (orig_name);
51555 + size_t name_len = id_len + strlen (PROMOTED_VAR_SUFFIX) + 1;
51556 + char *name;
51557 +
51558 + name = alloca (name_len);
51559 + strcpy (name, IDENTIFIER_POINTER (orig_name));
51560 + strcpy (name + id_len, PROMOTED_VAR_SUFFIX);
51561 +
51562 + pi->promoted_type = type;
51563 + pi->promoted_var = create_pli_var (type, name);
51564 +
51565 + if (dump_file)
51566 + {
51567 + fprintf (dump_file, "Created new variable ");
51568 + print_generic_expr (dump_file, pi->promoted_var, 0);
51569 + fprintf (dump_file, " to stand in for ");
51570 + print_generic_expr (dump_file, pi->loop_index_name, 0);
51571 + fprintf (dump_file, "\n\n");
51572 + }
51573 +
51574 + walk_use_def_chains (pi->loop_index_name,
51575 + associate_name_with_var,
51576 + pi->promoted_var, false);
51577 + }
51578 +
51579 + /* Continue traversal. */
51580 + return true;
51581 +}
51582 +
51583 +/* Rebuild T with newly promoted variables; STMT is the original
51584 + statement in which T appeared and may be equivalent to T. TYPE is
51585 + non-null when rebuilding the rhs of a GIMPLE_MODIFY_STMT and
51586 + indicates the type of the lhs. */
51587 +
51588 +static tree
51589 +rebuild_with_promotion_1 (tree t, tree stmt, tree type,
51590 + block_stmt_iterator bsi,
51591 + struct promote_info *pi)
51592 +{
51593 + tree op0, op1;
51594 +
51595 + switch (TREE_CODE (t))
51596 + {
51597 + case GIMPLE_MODIFY_STMT:
51598 + {
51599 + tree orig_op0 = GIMPLE_STMT_OPERAND (t, 0);
51600 + tree orig_op1 = GIMPLE_STMT_OPERAND (t, 1);
51601 + tree x, y;
51602 + void **v;
51603 +
51604 + /* If we are defining a promotable variable, check for special
51605 + idioms. */
51606 + v = pointer_map_contains (variable_map, orig_op0);
51607 + if (v != NULL
51608 + && *(tree *)v == pi->promoted_var
51609 + && (TREE_CODE (orig_op1) == NOP_EXPR
51610 + || TREE_CODE (orig_op1) == CONVERT_EXPR)
51611 + && signed_arithmetic_overflow_idiom_p (orig_op1, &x, &y))
51612 + {
51613 + tree tmp = TREE_OPERAND (orig_op1, 0);
51614 + void **xp;
51615 + void **yp;
51616 +
51617 + if (TYPE_PRECISION (TREE_TYPE (tmp))
51618 + >= TYPE_PRECISION (pi->promoted_type))
51619 + goto done;
51620 +
51621 + /* It's possible that we've already promoted the operands of
51622 + one or both of the NOP_EXPRs. In that case, we can
51623 + bypass the logic below and go straight to rebuilding the
51624 + rhs that we really want to transform. */
51625 + if (TREE_CODE (x) == VAR_DECL
51626 + || TREE_CODE (y) == VAR_DECL)
51627 + goto build_fake;
51628 + xp = pointer_map_contains (variable_map, x);
51629 + yp = pointer_map_contains (variable_map, y);
51630 +
51631 + /* Nothing to see here. */
51632 + if (!types_compatible_p (TREE_TYPE (x),
51633 + TREE_TYPE (y))
51634 + || (xp == NULL && yp == NULL))
51635 + goto done;
51636 + x = (xp == NULL ? NULL_TREE : *(tree *)xp);
51637 + y = (yp == NULL ? NULL_TREE : *(tree *)yp);
51638 +
51639 + if (x != pi->promoted_var && y != pi->promoted_var)
51640 + goto done;
51641 +
51642 +
51643 + build_fake:
51644 + orig_op1 = build2 (PLUS_EXPR, TREE_TYPE (x), x, y);
51645 + if (dump_file)
51646 + {
51647 + fprintf (dump_file, "Substituting ");
51648 + print_generic_expr (dump_file, orig_op1, 0);
51649 + fprintf (dump_file, " for rhs of original statement\n");
51650 + }
51651 + done:
51652 + ;
51653 + }
51654 +
51655 + op0 = rebuild_with_promotion_1 (orig_op0, stmt, type, bsi, pi);
51656 + op1 = rebuild_with_promotion_1 (orig_op1, stmt, TREE_TYPE (op0), bsi, pi);
51657 + /* Something must have been rebuilt. */
51658 + gcc_assert ((op0 != orig_op0) || (op1 != orig_op1));
51659 + if (op0 != orig_op0)
51660 + GIMPLE_STMT_OPERAND (t, 0) = op0;
51661 + if (op1 != orig_op1)
51662 + GIMPLE_STMT_OPERAND (t, 1) = op1;
51663 + return t;
51664 + }
51665 + case NOP_EXPR:
51666 + case CONVERT_EXPR:
51667 + {
51668 + tree pvar = rebuild_with_promotion_1 (TREE_OPERAND (t, 0), stmt, type, bsi, pi);
51669 +
51670 + if (types_compatible_p (type, TREE_TYPE (pvar)))
51671 + return pvar;
51672 + else
51673 + return build1 (TREE_CODE (t), type, pvar);
51674 + }
51675 + case INTEGER_CST:
51676 + {
51677 + return build_int_cst_wide (pi->promoted_type,
51678 + TREE_INT_CST_LOW (t),
51679 + TREE_INT_CST_HIGH (t));
51680 + }
51681 + case COND_EXPR:
51682 + {
51683 + tree orig_op0 = TREE_OPERAND (t, 0);
51684 + op0 = rebuild_with_promotion_1 (orig_op0, stmt, type, bsi, pi);
51685 + gcc_assert (orig_op0 != op0);
51686 + TREE_OPERAND (t, 0) = op0;
51687 + return t;
51688 + }
51689 + case PLUS_EXPR:
51690 + case MINUS_EXPR:
51691 + case MULT_EXPR:
51692 + type = pi->promoted_type;
51693 + goto binary_expr;
51694 + case EQ_EXPR:
51695 + case NE_EXPR:
51696 + case LT_EXPR:
51697 + case LE_EXPR:
51698 + case GT_EXPR:
51699 + case GE_EXPR:
51700 + type = TREE_TYPE (t);
51701 + binary_expr:
51702 + op0 = TREE_OPERAND (t, 0);
51703 + op1 = TREE_OPERAND (t, 1);
51704 + op0 = rebuild_with_promotion_1 (op0, stmt, type, bsi, pi);
51705 + op1 = rebuild_with_promotion_1 (op1, stmt, type, bsi, pi);
51706 + return build2 (TREE_CODE (t), type, op0, op1);
51707 + case SSA_NAME:
51708 + {
51709 + void **p = pointer_map_contains (variable_map, t);
51710 +
51711 + if (p == NULL)
51712 + {
51713 + /* This is unexpected, but it does happen if we were dealing
51714 + with COND_EXPRs and such. Just go ahead and create a
51715 + temporary for it. */
51716 + if (types_compatible_p (TREE_TYPE (t), pi->promoted_type)
51717 + || SSA_NAME_DEF_STMT (t) == stmt)
51718 + return t;
51719 + else
51720 + goto insert_cast;
51721 + }
51722 + else
51723 + return *(tree *)p;
51724 + }
51725 + case VAR_DECL:
51726 + return t;
51727 + default:
51728 + insert_cast:
51729 + {
51730 + tree tmp, nop, cast;
51731 + tree to_upcast = t;
51732 +
51733 + /* If we are dealing with a memory reference, then we can't have
51734 + wrap it in a NOP_EXPR; we need to load the value from memory
51735 + first, then convert it. */
51736 + if (!is_gimple_reg (to_upcast))
51737 + {
51738 + tree tmp = create_pli_var (TREE_TYPE (to_upcast),
51739 + CONST_CAST (char *, "loadtmp"));
51740 + tree stmt = build_gimple_modify_stmt (tmp, to_upcast);
51741 + bsi_insert_before (&bsi, stmt, BSI_SAME_STMT);
51742 + to_upcast = tmp;
51743 + }
51744 +
51745 + tmp = create_pli_var (pi->promoted_type,
51746 + CONST_CAST (char *, "promotetmp"));
51747 + nop = build1 (NOP_EXPR, pi->promoted_type, to_upcast);
51748 + cast = build_gimple_modify_stmt (tmp, nop);
51749 + if (dump_file)
51750 + {
51751 + fprintf (dump_file, "Inserting cast ");
51752 + print_generic_expr (dump_file, cast, 0);
51753 + fprintf (dump_file, " prior to ");
51754 + print_generic_expr (dump_file, stmt, 0);
51755 + fprintf (dump_file, "\n");
51756 + }
51757 + bsi_insert_before (&bsi, cast, BSI_SAME_STMT);
51758 + return tmp;
51759 + }
51760 + }
51761 +}
51762 +
51763 +/* Rebuild STMT, which contains uses or a def of the promotable variable
51764 + associated with PI. */
51765 +
51766 +static void
51767 +rebuild_with_promotion (tree stmt, struct promote_info *pi)
51768 +{
51769 + tree rebuilt;
51770 + block_stmt_iterator bsi;
51771 +
51772 + if (pointer_set_insert (promoted_stmts, stmt))
51773 + return;
51774 +
51775 + if (dump_file)
51776 + {
51777 + fprintf (dump_file, "Rebuilding stmt ");
51778 + print_generic_expr (dump_file, stmt, 0);
51779 + fprintf (dump_file, "\n");
51780 + }
51781 +
51782 + bsi = bsi_for_stmt (stmt);
51783 + rebuilt = rebuild_with_promotion_1 (stmt, stmt, NULL, bsi, pi);
51784 + if (dump_file)
51785 + {
51786 + fprintf (dump_file, "Converted stmt ");
51787 + print_generic_expr (dump_file, rebuilt, 0);
51788 + fprintf (dump_file, "\n\n");
51789 + }
51790 + update_stmt (rebuilt);
51791 +}
51792 +
51793 +/* Helper function for promote_variable that walks over use/def
51794 + chains. */
51795 +
51796 +static bool
51797 +promote_variable_1 (tree var, tree stmt, void *data)
51798 +{
51799 + struct promote_info *pi = (struct promote_info *) data;
51800 + imm_use_iterator imi;
51801 + tree use_stmt;
51802 +
51803 + /* Due to the way walk_use_def_chains works, when STMT is a PHI_NODE,
51804 + VAR is actually an argument to the phi node, not the result of it.
51805 + Rebuild uses of the phi node's result after handle integer constant
51806 + inputs to the phi node. */
51807 + if (TREE_CODE (stmt) == PHI_NODE)
51808 + {
51809 + if (TREE_CODE (var) == INTEGER_CST)
51810 + {
51811 + edge e = loop_preheader_edge (pi->loop);
51812 + basic_block preheader = e->src;
51813 + block_stmt_iterator bsi = bsi_last (preheader);
51814 + tree cst = build_int_cst_wide (pi->promoted_type,
51815 + TREE_INT_CST_LOW (var),
51816 + TREE_INT_CST_HIGH (var));
51817 + tree assign = build_gimple_modify_stmt (pi->promoted_var, cst);
51818 + bsi_insert_after (&bsi, assign, BSI_NEW_STMT);
51819 + }
51820 + var = PHI_RESULT (stmt);
51821 + }
51822 + else
51823 + rebuild_with_promotion (stmt, pi);
51824 +
51825 + FOR_EACH_IMM_USE_STMT (use_stmt, imi, var)
51826 + {
51827 + if (TREE_CODE (use_stmt) != PHI_NODE)
51828 + rebuild_with_promotion (use_stmt, pi);
51829 + }
51830 +
51831 + return false;
51832 +}
51833 +
51834 +/* Convert all uses and defs of PI_->LOOP_INDEX_NAME as linked by
51835 + use-def chains to uses and defs of PI_->PROMOTED_VAR. */
51836 +
51837 +static bool
51838 +promote_variable (const void *pi_, void *data ATTRIBUTE_UNUSED)
51839 +{
51840 + const struct promote_info *pi = (const struct promote_info *) pi_;
51841 +
51842 + if (pi->can_be_promoted_p)
51843 + {
51844 + walk_use_def_chains (pi->loop_index_name, promote_variable_1,
51845 + CONST_CAST (struct promote_info *, pi), false);
51846 + }
51847 +
51848 + /* Continue traversal. */
51849 + return true;
51850 +}
51851 +
51852 +/* Free PI_ and its associated data. */
51853 +
51854 +static bool
51855 +free_pi_entries (const void *pi_, void *data ATTRIBUTE_UNUSED)
51856 +{
51857 + struct promote_info *pi = CONST_CAST (struct promote_info *,
51858 + (const struct promote_info *) pi_);
51859 +
51860 + VEC_free (tree, heap, pi->cast_types);
51861 + VEC_free (int, heap, pi->cast_counts);
51862 + free (pi);
51863 +
51864 + /* Continue traversal. */
51865 + return true;
51866 +}
51867 +
51868 +/* Collect information about variables that we believe to be loop
51869 + indices in PROMOTION_INFO. */
51870 +
51871 +static void
51872 +collect_promotion_candidates (void)
51873 +{
51874 + loop_iterator li;
51875 + struct loop *loop;
51876 +
51877 + FOR_EACH_LOOP (li, loop, 0)
51878 + {
51879 + basic_block header = loop->header;
51880 + tree exit_cond = last_stmt (header);
51881 +
51882 + if (exit_cond && TREE_CODE (exit_cond) == COND_EXPR)
51883 + {
51884 + tree loop_index;
51885 + tree limit;
51886 + struct promote_info *pi;
51887 +
51888 + loop_index = find_promotion_candidate (loop, exit_cond, &limit);
51889 + if (loop_index == NULL_TREE)
51890 + continue;
51891 +
51892 + if (dump_file)
51893 + {
51894 + fprintf (dump_file, "Found loop index ");
51895 + print_generic_expr (dump_file, loop_index, 0);
51896 + fprintf (dump_file, " involved in ");
51897 + print_generic_expr (dump_file, exit_cond, 0);
51898 + fprintf (dump_file, "\n\n");
51899 + }
51900 +
51901 + pi = XCNEW (struct promote_info);
51902 + pi->loop = loop;
51903 + pi->exit_expr = exit_cond;
51904 + pi->loop_index_name = loop_index;
51905 + pi->loop_limit = limit;
51906 + pi->var_decl = SSA_NAME_VAR (loop_index);
51907 + /* We think so, anyway... */
51908 + pi->can_be_promoted_p = true;
51909 + pointer_set_insert (promotion_info, pi);
51910 + }
51911 + else if (dump_file)
51912 + {
51913 + fprintf (dump_file, "\nSkipping analysis of loop %d (header bb #%d)\n",
51914 + loop->num, loop->header->index);
51915 + if (exit_cond)
51916 + {
51917 + fprintf (dump_file, "Exit condition was ");
51918 + print_generic_expr (dump_file, exit_cond, 0);
51919 + fprintf (dump_file, "\n");
51920 + }
51921 + }
51922 + }
51923 +}
51924 +
51925 +/* Free memory associated with global variables that we used. */
51926 +
51927 +static void
51928 +pli_cleanup (void)
51929 +{
51930 + if (promoted_stmts)
51931 + {
51932 + pointer_set_destroy (promoted_stmts);
51933 + promoted_stmts = NULL;
51934 + }
51935 + if (variable_map)
51936 + {
51937 + pointer_map_destroy (variable_map);
51938 + variable_map = NULL;
51939 + }
51940 + if (promotable_names)
51941 + {
51942 + pointer_set_destroy (promotable_names);
51943 + promotable_names = NULL;
51944 + }
51945 + if (promotion_info)
51946 + {
51947 + pointer_set_traverse (promotion_info, free_pi_entries, NULL);
51948 + pointer_set_destroy (promotion_info);
51949 + promotion_info = NULL;
51950 + }
51951 +}
51952 +
51953 +/* The guts of the pass. */
51954 +
51955 +static unsigned int
51956 +promote_short_indices (void)
51957 +{
51958 + bool did_something = false;
51959 + bool changed;
51960 + size_t max_iterations, i, n_promoted;
51961 +
51962 + promotion_info = pointer_set_create ();
51963 + collect_promotion_candidates ();
51964 +
51965 + if (dump_file)
51966 + fprintf (dump_file, "Found %d candidates for promotion\n",
51967 + (int) pointer_set_n_elements (promotion_info));
51968 +
51969 + /* Nothing to do. */
51970 + if (pointer_set_n_elements (promotion_info) == 0)
51971 + goto cleanup;
51972 +
51973 + /* We have information about which variables are loop index variables.
51974 + We now need to determine the promotability of the loop indices.
51975 + Since the promotability of loop indices may depend on other loop
51976 + indices, we need to repeat this until we reach a fixed point. */
51977 + changed = true;
51978 + max_iterations = pointer_set_n_elements (promotion_info);
51979 + i = 0;
51980 +
51981 + promotable_names = pointer_set_create ();
51982 +
51983 + while (changed)
51984 + {
51985 + changed = false;
51986 + pointer_set_clear (promotable_names);
51987 + pointer_set_traverse (promotion_info, add_variable,
51988 + promotable_names);
51989 + n_promoted = pointer_set_n_elements (promotable_names);
51990 +
51991 + if (dump_file)
51992 + fprintf (dump_file, "\nIteration %d, have %d variables to consider\n",
51993 + (int) i, (int) n_promoted);
51994 +
51995 + if (n_promoted == 0)
51996 + break;
51997 + gcc_assert (i < max_iterations);
51998 + pointer_set_traverse (promotion_info, analyze_loop, &changed);
51999 + i++;
52000 + }
52001 +
52002 + if (dump_file)
52003 + fprintf (dump_file, "Promoting %d variables\n",
52004 + (int) n_promoted);
52005 +
52006 + if (n_promoted != 0)
52007 + {
52008 + did_something = true;
52009 + variable_map = pointer_map_create ();
52010 + promoted_stmts = pointer_set_create ();
52011 + pointer_set_traverse (promotion_info, create_promoted_variable, NULL);
52012 + pointer_set_traverse (promotion_info, promote_variable, NULL);
52013 + }
52014 +
52015 + cleanup:
52016 + pli_cleanup ();
52017 + return did_something ? TODO_update_ssa : 0;
52018 +}
52019 +
52020 +/* Entry point for the short loop index promotion pass. */
52021 +
52022 +static unsigned int
52023 +tree_short_index_promotion (void)
52024 +{
52025 + unsigned int changed = 0;
52026 +
52027 + /* Initialize all the necessary loop infrastructure. */
52028 + loop_optimizer_init (LOOPS_HAVE_PREHEADERS | LOOPS_HAVE_SIMPLE_LATCHES | LOOPS_HAVE_RECORDED_EXITS);
52029 + add_noreturn_fake_exit_edges ();
52030 + connect_infinite_loops_to_exit ();
52031 +
52032 + if (number_of_loops () > 1)
52033 + changed = promote_short_indices ();
52034 +
52035 + /* Tear down loop optimization infrastructure. */
52036 + remove_fake_exit_edges ();
52037 + free_numbers_of_iterations_estimates ();
52038 + loop_optimizer_finalize ();
52039 +
52040 + return changed;
52041 +}
52042 +
52043 +static bool
52044 +gate_short_index_promotion (void)
52045 +{
52046 + return flag_promote_loop_indices;
52047 +}
52048 +
52049 +struct tree_opt_pass pass_promote_short_indices =
52050 +{
52051 + "promoteshort", /* name */
52052 + gate_short_index_promotion, /* gate */
52053 + tree_short_index_promotion, /* execute */
52054 + NULL, /* sub */
52055 + NULL, /* next */
52056 + 0, /* static_pass_number */
52057 + TV_TREE_LOOP_PROMOTE, /* tv_id */
52058 + PROP_cfg | PROP_ssa, /* properties_required */
52059 + 0, /* properties_provided */
52060 + 0, /* properties_destroyed */
52061 + 0, /* todo_flags_start */
52062 + TODO_dump_func | TODO_verify_loops
52063 + | TODO_ggc_collect, /* todo_flags_finish */
52064 + 0 /* letter */
52065 +};
52066 --- a/gcc/tree-ssa-pre.c
52067 +++ b/gcc/tree-ssa-pre.c
52068 @@ -2006,7 +2006,7 @@ compute_antic (void)
52069 fprintf (dump_file, "Starting iteration %d\n", num_iterations);
52070 num_iterations++;
52071 changed = false;
52072 - for (i = 0; i < last_basic_block - NUM_FIXED_BLOCKS; i++)
52073 + for (i = 0; i < n_basic_blocks - NUM_FIXED_BLOCKS; i++)
52074 {
52075 if (TEST_BIT (changed_blocks, postorder[i]))
52076 {
52077 @@ -2038,7 +2038,7 @@ compute_antic (void)
52078 fprintf (dump_file, "Starting iteration %d\n", num_iterations);
52079 num_iterations++;
52080 changed = false;
52081 - for (i = 0; i < last_basic_block - NUM_FIXED_BLOCKS; i++)
52082 + for (i = 0; i < n_basic_blocks - NUM_FIXED_BLOCKS; i++)
52083 {
52084 if (TEST_BIT (changed_blocks, postorder[i]))
52085 {
52086 @@ -2345,6 +2345,10 @@ create_expression_by_pieces (basic_block
52087 tree op2 = TREE_OPERAND (expr, 1);
52088 tree genop1 = find_or_generate_expression (block, op1, stmts);
52089 tree genop2 = find_or_generate_expression (block, op2, stmts);
52090 + /* Ensure op2 is a sizetype for POINTER_PLUS_EXPR. It
52091 + may be a constant with the wrong type. */
52092 + if (TREE_CODE(expr) == POINTER_PLUS_EXPR)
52093 + genop2 = fold_convert (sizetype, genop2);
52094 folded = fold_build2 (TREE_CODE (expr), TREE_TYPE (expr),
52095 genop1, genop2);
52096 break;
52097 --- /dev/null
52098 +++ b/gcc/tree-ssa-remove-local-statics.c
52099 @@ -0,0 +1,813 @@
52100 +/* Local static variable elimination pass.
52101 + Copyright (C) 2007 Free Software Foundation, Inc.
52102 + Contributed by Nathan Froyd <froydnj@codesourcery.com>
52103 +
52104 +This file is part of GCC.
52105 +
52106 +GCC is free software; you can redistribute it and/or modify it
52107 +under the terms of the GNU General Public License as published by the
52108 +Free Software Foundation; either version 3, or (at your option) any
52109 +later version.
52110 +
52111 +GCC is distributed in the hope that it will be useful, but WITHOUT
52112 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
52113 +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
52114 +for more details.
52115 +
52116 +You should have received a copy of the GNU General Public License
52117 +along with GCC; see the file COPYING3. If not see
52118 +<http://www.gnu.org/licenses/>. */
52119 +
52120 +/* Converting static function-local variables to automatic variables.
52121 +
52122 + The motivating example is a function like:
52123 +
52124 + void
52125 + foo (unsigned n)
52126 + {
52127 + static int var;
52128 + unsigned i;
52129 +
52130 + for (i = 0; i != n; i++)
52131 + {
52132 + var = ...
52133 +
52134 + do other things with var...
52135 + }
52136 + }
52137 +
52138 + Because VAR is static, doing things like code motion to loads and
52139 + stores of VAR is difficult. Furthermore, accesses to VAR are
52140 + inefficient. This pass aims to recognize the cases where it is not
52141 + necessary for VAR to be static and modify the code so that later
52142 + passes will do the appropriate optimizations.
52143 +
52144 + The criteria for a static function-local variable V in a function F
52145 + being converted to an automatic variable are:
52146 +
52147 + 1. F does not call setjmp; and
52148 + 2. V's address is never taken; and
52149 + 3. V is not declared volatile; and
52150 + 4. V is not used in any nested function;
52151 + 5. V is not an aggregate value (union, struct, array, etc.); and
52152 + 6. Every use of V is defined along all paths leading to the use.
52153 +
52154 + NOTE: For ease of implementation, we currently treat a function call
52155 + as killing all previous definitions of static variables, since we
52156 + could have:
52157 +
52158 + static void
52159 + foo (...)
52160 + {
52161 + static int x;
52162 +
52163 + x = ...; (1)
52164 +
52165 + f (...); (2)
52166 +
52167 + ... = x; (3)
52168 + }
52169 +
52170 + The use at (3) needs to pick up a possible definition made by the
52171 + call at (2). If the call at (2) does not call back into 'foo',
52172 + then the call is not a killing call. We currently treat it as
52173 + though it is. */
52174 +
52175 +#include "config.h"
52176 +#include "system.h"
52177 +#include "coretypes.h"
52178 +#include "tm.h"
52179 +
52180 +#include "rtl.h"
52181 +#include "tm_p.h"
52182 +#include "hard-reg-set.h"
52183 +#include "obstack.h"
52184 +#include "basic-block.h"
52185 +
52186 +#include "tree.h"
52187 +#include "tree-gimple.h"
52188 +#include "hashtab.h"
52189 +#include "diagnostic.h"
52190 +#include "tree-flow.h"
52191 +#include "tree-dump.h"
52192 +#include "flags.h"
52193 +#include "timevar.h"
52194 +#include "tree-pass.h"
52195 +
52196 +struct rls_decl_info
52197 +{
52198 + /* The variable declaration. */
52199 + tree orig_var;
52200 +
52201 + /* Its index in rls_block_local_data. */
52202 + int index;
52203 +
52204 + /* Whether we can optimize this variable. */
52205 + bool optimizable_p;
52206 +
52207 + /* The new variable declaration, if we can optimize away the staticness
52208 + of 'orig_var'. */
52209 + tree new_var;
52210 +};
52211 +
52212 +/* Filled with 'struct rls_decl_info'; keyed off ORIG_VAR. */
52213 +static htab_t static_variables;
52214 +
52215 +struct rls_stmt_info
52216 +{
52217 + /* The variable declaration. */
52218 + tree var;
52219 +
52220 + /* The statement in which we found a def or a use of the variable. */
52221 + tree stmt;
52222 +
52223 + /* Whether STMT represents a use of VAR. */
52224 + bool use_p;
52225 +
52226 + /* A bitmap whose entries denote what variables have been defined
52227 + when execution arrives at STMT. This field is only used when
52228 + USE_P is true. */
52229 + sbitmap defined;
52230 +};
52231 +
52232 +/* Filled with 'struct rls_stmt_info'; keyed off STMT. */
52233 +static htab_t defuse_statements;
52234 +
52235 +static struct
52236 +{
52237 + /* The number of static variables we found. */
52238 + size_t n_statics;
52239 +
52240 + /* The number of optimizable variables we found. */
52241 + size_t n_optimizable;
52242 +} stats;
52243 +
52244 +struct rls_block_dataflow_data {
52245 + /* A bitmap whose entries denote what variables have been defined on
52246 + entry to this block. */
52247 + sbitmap defined_in;
52248 +
52249 + /* A bitmap whose entries denote what variables have been defined on
52250 + exit from this block. */
52251 + sbitmap defined_out;
52252 +};
52253 +
52254 +/* Parameters for the 'static_variables' hash table. */
52255 +
52256 +static hashval_t
52257 +rls_hash_decl_info (const void *x)
52258 +{
52259 + return htab_hash_pointer
52260 + ((const void *) ((const struct rls_decl_info *) x)->orig_var);
52261 +}
52262 +
52263 +static int
52264 +rls_eq_decl_info (const void *x, const void *y)
52265 +{
52266 + const struct rls_decl_info *a = x;
52267 + const struct rls_decl_info *b = y;
52268 +
52269 + return a->orig_var == b->orig_var;
52270 +}
52271 +
52272 +static void
52273 +rls_free_decl_info (void *info)
52274 +{
52275 + free (info);
52276 +}
52277 +
52278 +/* Parameters for the 'defuse_statements' hash table. */
52279 +
52280 +static hashval_t
52281 +rls_hash_use_info (const void *x)
52282 +{
52283 + return htab_hash_pointer
52284 + ((const void *) ((const struct rls_stmt_info *) x)->stmt);
52285 +}
52286 +
52287 +static int
52288 +rls_eq_use_info (const void *x, const void *y)
52289 +{
52290 + const struct rls_stmt_info *a = x;
52291 + const struct rls_stmt_info *b = y;
52292 +
52293 + return a->stmt == b->stmt;
52294 +}
52295 +
52296 +static void
52297 +rls_free_use_info (void *info)
52298 +{
52299 + struct rls_stmt_info *stmt_info = info;
52300 +
52301 + if (stmt_info->defined)
52302 + sbitmap_free (stmt_info->defined);
52303 +
52304 + free (stmt_info);
52305 +}
52306 +
52307 +/* Initialize data structures and statistics. */
52308 +
52309 +static void
52310 +rls_init (void)
52311 +{
52312 + basic_block bb;
52313 +
52314 + /* We expect relatively few static variables, hence the small
52315 + initial size for the hash table. */
52316 + static_variables = htab_create (8, rls_hash_decl_info,
52317 + rls_eq_decl_info, rls_free_decl_info);
52318 +
52319 + /* We expect quite a few statements. */
52320 + defuse_statements = htab_create (128, rls_hash_use_info,
52321 + rls_eq_use_info, rls_free_use_info);
52322 +
52323 + FOR_ALL_BB (bb)
52324 + {
52325 + struct rls_block_dataflow_data *data;
52326 +
52327 + data = XNEW (struct rls_block_dataflow_data);
52328 + memset (data, 0, sizeof (*data));
52329 + bb->aux = data;
52330 + }
52331 +
52332 + stats.n_statics = 0;
52333 + stats.n_optimizable = 0;
52334 +}
52335 +
52336 +/* Free data structures. */
52337 +
52338 +static void
52339 +rls_done (void)
52340 +{
52341 + basic_block bb;
52342 +
52343 + htab_delete (static_variables);
52344 + htab_delete (defuse_statements);
52345 +
52346 + FOR_ALL_BB (bb)
52347 + {
52348 + struct rls_block_dataflow_data *data = bb->aux;
52349 +
52350 + gcc_assert (data);
52351 +
52352 + if (data->defined_in)
52353 + sbitmap_free (data->defined_in);
52354 + if (data->defined_out)
52355 + sbitmap_free (data->defined_out);
52356 + free (data);
52357 + bb->aux = NULL;
52358 + }
52359 +}
52360 +
52361 +\f
52362 +/* Doing the initial work to find static variables. */
52363 +
52364 +/* Examine the defining statement for VAR and determine whether it is a
52365 + static variable we could potentially optimize. If so, stick in it
52366 + in the 'static_variables' hashtable.
52367 +
52368 + STMT is the statement in which a definition or use of VAR occurs.
52369 + USE_P indicates whether VAR is used or defined in STMT. Enter STMT
52370 + into 'defuse_statements' as well for use during dataflow
52371 + analysis. */
52372 +
52373 +static void
52374 +maybe_discover_new_declaration (tree var, tree stmt, bool use_p)
52375 +{
52376 + tree def_stmt = SSA_NAME_VAR (var);
52377 +
52378 + if (TREE_CODE (def_stmt) == VAR_DECL
52379 + && DECL_CONTEXT (def_stmt) != NULL_TREE
52380 + && TREE_CODE (DECL_CONTEXT (def_stmt)) == FUNCTION_DECL
52381 + && TREE_STATIC (def_stmt)
52382 + /* We cannot optimize away aggregate statics, as we would have to
52383 + prove that definitions of every field of the aggregate dominate
52384 + uses. */
52385 + && !AGGREGATE_TYPE_P (TREE_TYPE (def_stmt))
52386 + /* GCC doesn't normally treat vectors as aggregates; we need to,
52387 + though, since a user could use intrinsics to read/write
52388 + particular fields of the vector, thereby treating it as an
52389 + array. */
52390 + && TREE_CODE (TREE_TYPE (def_stmt)) != VECTOR_TYPE
52391 + && !TREE_ADDRESSABLE (def_stmt)
52392 + && !TREE_THIS_VOLATILE (def_stmt))
52393 + {
52394 + struct rls_decl_info dummy;
52395 + void **slot;
52396 +
52397 + dummy.orig_var = def_stmt;
52398 + slot = htab_find_slot (static_variables, &dummy, INSERT);
52399 +
52400 + if (*slot == NULL)
52401 + {
52402 + /* Found a use or a def of a new declaration. */
52403 + struct rls_decl_info *info = XNEW (struct rls_decl_info);
52404 +
52405 + info->orig_var = def_stmt;
52406 + info->index = stats.n_statics++;
52407 + /* Optimistically assume that we can optimize. */
52408 + info->optimizable_p = true;
52409 + info->new_var = NULL_TREE;
52410 + *slot = (void *) info;
52411 + }
52412 +
52413 + /* Enter the statement into DEFUSE_STATEMENTS. */
52414 + {
52415 + struct rls_stmt_info dummy;
52416 + struct rls_stmt_info *info;
52417 +
52418 + dummy.stmt = stmt;
52419 + slot = htab_find_slot (defuse_statements, &dummy, INSERT);
52420 +
52421 + /* We should never insert the same statement into the
52422 + hashtable twice. */
52423 + gcc_assert (*slot == NULL);
52424 +
52425 + info = XNEW (struct rls_stmt_info);
52426 + info->var = def_stmt;
52427 + info->stmt = stmt;
52428 + if (dump_file)
52429 + {
52430 + fprintf (dump_file, "entering as %s ", use_p ? "use" : "def");
52431 + print_generic_stmt (dump_file, stmt, TDF_DETAILS);
52432 + }
52433 + info->use_p = use_p;
52434 + /* We don't know how big to make the bitmap yet. */
52435 + info->defined = NULL;
52436 + *slot = (void *) info;
52437 + }
52438 + }
52439 +}
52440 +
52441 +/* Grovel through all the statements in the program, looking for
52442 + SSA_NAMEs whose SSA_NAME_VAR is a VAR_DECL. We look at both use and
52443 + def SSA_NAMEs. */
52444 +
52445 +static void
52446 +find_static_nonvolatile_declarations (void)
52447 +{
52448 + basic_block bb;
52449 +
52450 + FOR_EACH_BB (bb)
52451 + {
52452 + block_stmt_iterator i;
52453 +
52454 + for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
52455 + {
52456 + tree var;
52457 + ssa_op_iter iter;
52458 + tree stmt = bsi_stmt (i);
52459 +
52460 + /* If there's a call expression in STMT, then previous passes
52461 + will have determined if the call transitively defines some
52462 + static variable. However, we need more precise
52463 + information--we need to know whether static variables are
52464 + live out after the call.
52465 +
52466 + Since we'll never see something like:
52467 +
52468 + staticvar = foo (bar, baz);
52469 +
52470 + in GIMPLE (the result of the call will be assigned to a
52471 + normal, non-static local variable which is then assigned to
52472 + STATICVAR in a subsequent statement), don't bother finding
52473 + new declarations if we see a CALL_EXPR. */
52474 + if (get_call_expr_in (stmt) == NULL_TREE)
52475 + FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_VDEF)
52476 + {
52477 + maybe_discover_new_declaration (var, stmt, false);
52478 + }
52479 +
52480 + FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_VUSE)
52481 + {
52482 + maybe_discover_new_declaration (var, stmt, true);
52483 + }
52484 + }
52485 + }
52486 +}
52487 +
52488 +\f
52489 +/* Determining if we have anything to optimize. */
52490 +
52491 +/* Examine *SLOT (which is a 'struct rls_decl_info *') to see whether
52492 + the associated variable is optimizable. If it is, create a new,
52493 + non-static declaration for the variable; this new variable will be
52494 + used during a subsequent rewrite of the function. */
52495 +
52496 +#define NEW_VAR_PREFIX ".unstatic"
52497 +
52498 +static int
52499 +maybe_create_new_variable (void **slot, void *data ATTRIBUTE_UNUSED)
52500 +{
52501 + struct rls_decl_info *info = *slot;
52502 + tree id_node = DECL_NAME (info->orig_var);
52503 + size_t id_len = IDENTIFIER_LENGTH (id_node);
52504 + size_t name_len = id_len + strlen (NEW_VAR_PREFIX) + 1;
52505 + char *name;
52506 +
52507 + /* Don't create a new variable multiple times. */
52508 + gcc_assert (!info->new_var);
52509 +
52510 + /* Tie the new name to the old one to aid debugging dumps. */
52511 + name = alloca (name_len);
52512 + strcpy (name, IDENTIFIER_POINTER (id_node));
52513 + strcpy (name + id_len, NEW_VAR_PREFIX);
52514 + info->new_var = create_tmp_var (TREE_TYPE (info->orig_var), name);
52515 +
52516 + if (dump_file)
52517 + {
52518 + fprintf (dump_file, "new variable ");
52519 + print_generic_stmt (dump_file, info->new_var, TDF_DETAILS);
52520 + }
52521 +
52522 + /* Inform SSA about this new variable. */
52523 + create_var_ann (info->new_var);
52524 + mark_sym_for_renaming (info->new_var);
52525 + add_referenced_var (info->new_var);
52526 +
52527 + /* Always continue scanning. */
52528 + return 1;
52529 +}
52530 +
52531 +#undef NEW_VAR_PREFIX
52532 +
52533 +/* Traverse the 'defuse_statements' hash table. For every use,
52534 + determine if the associated variable is defined along all paths
52535 + leading to said use. Remove the associated variable from
52536 + 'static_variables' if it is not. */
52537 +
52538 +static int
52539 +check_definedness (void **slot, void *data ATTRIBUTE_UNUSED)
52540 +{
52541 + struct rls_stmt_info *info = *slot;
52542 + struct rls_decl_info dummy;
52543 +
52544 + /* We don't need to look at definitions. Continue scanning. */
52545 + if (!info->use_p)
52546 + return 1;
52547 +
52548 + dummy.orig_var = info->var;
52549 + slot = htab_find_slot (static_variables, &dummy, INSERT);
52550 +
52551 + /* Might not be there because we deleted it already. */
52552 + if (*slot)
52553 + {
52554 + struct rls_decl_info *decl = *slot;
52555 +
52556 + if (!TEST_BIT (info->defined, decl->index))
52557 + {
52558 + if (dump_file)
52559 + {
52560 + fprintf (dump_file, "not optimizing ");
52561 + print_generic_stmt (dump_file, decl->orig_var, TDF_DETAILS);
52562 + fprintf (dump_file, "due to uncovered use in ");
52563 + print_generic_stmt (dump_file, info->stmt, TDF_DETAILS);
52564 + fprintf (dump_file, "\n");
52565 + }
52566 +
52567 + htab_clear_slot (static_variables, slot);
52568 + stats.n_optimizable--;
52569 + }
52570 + }
52571 +
52572 + /* Continue scan. */
52573 + return 1;
52574 +}
52575 +
52576 +/* Check all statements in 'defuse_statements' to see if all the
52577 + statements that use a static variable have that variable defined
52578 + along all paths leading to the statement. Once that's done, go
52579 + through and create new, non-static variables for any static variables
52580 + that can be optimized. */
52581 +
52582 +static size_t
52583 +determine_optimizable_statics (void)
52584 +{
52585 + htab_traverse (defuse_statements, check_definedness, NULL);
52586 +
52587 + htab_traverse (static_variables, maybe_create_new_variable, NULL);
52588 +
52589 + return stats.n_optimizable;
52590 +}
52591 +
52592 +/* Look at STMT to see if we have uses or defs of a static variable.
52593 + STMT is passed in DATA. Definitions of a static variable are found
52594 + by the presence of a V_MUST_DEF, while uses are found by the presence
52595 + of a VUSE. */
52596 +
52597 +static int
52598 +unstaticize_variable (void **slot, void *data)
52599 +{
52600 + struct rls_decl_info *info = *slot;
52601 + tree stmt = (tree) data;
52602 + tree vdef;
52603 + tree vuse;
52604 +
52605 + /* We should have removed unoptimizable variables during an earlier
52606 + traversal. */
52607 + gcc_assert (info->optimizable_p);
52608 +
52609 + /* Check for virtual definitions first. */
52610 + vdef = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_VDEF);
52611 +
52612 + if (vdef != NULL
52613 + && ZERO_SSA_OPERANDS (stmt, SSA_OP_DEF)
52614 + && TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
52615 + && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == VAR_DECL
52616 + && GIMPLE_STMT_OPERAND (stmt, 0) == info->orig_var)
52617 + {
52618 + /* Make the statement define the new name. The new name has
52619 + already been marked for renaming, so no need to do that
52620 + here. */
52621 + GIMPLE_STMT_OPERAND (stmt, 0) = info->new_var;
52622 +
52623 + update_stmt (stmt);
52624 +
52625 + /* None of the other optimizable static variables can occur
52626 + in this statement. Stop the scan. */
52627 + return 0;
52628 + }
52629 +
52630 + /* Check for virtual uses. */
52631 + vuse = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_VUSE);
52632 +
52633 + if (vuse != NULL
52634 + && TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
52635 + && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == VAR_DECL
52636 + && GIMPLE_STMT_OPERAND (stmt, 1) == info->orig_var)
52637 + {
52638 + /* Make the statement use the new name. */
52639 + GIMPLE_STMT_OPERAND (stmt, 1) = info->new_var;
52640 +
52641 + update_stmt (stmt);
52642 +
52643 + /* None of the other optimizable static variables can occur
52644 + in this statement. Stop the scan. */
52645 + return 0;
52646 + }
52647 +
52648 + /* Continue scanning. */
52649 + return 1;
52650 +}
52651 +
52652 +/* Determine if we have any static variables we can optimize. If so,
52653 + replace any defs or uses of those variables in their defining/using
52654 + statements. */
52655 +
52656 +static void
52657 +maybe_remove_static_from_declarations (void)
52658 +{
52659 + size_t n_optimizable = determine_optimizable_statics ();
52660 + basic_block bb;
52661 +
52662 + if (n_optimizable)
52663 + /* Replace any optimizable variables with new, non-static variables. */
52664 + FOR_EACH_BB (bb)
52665 + {
52666 + block_stmt_iterator bsi;
52667 +
52668 + for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
52669 + {
52670 + tree stmt = bsi_stmt (bsi);
52671 +
52672 + htab_traverse (static_variables, unstaticize_variable, stmt);
52673 + }
52674 + }
52675 +}
52676 +
52677 +/* Callback for htab_traverse to initialize the bitmap for *SLOT, which
52678 + is a 'struct rls_stmt_info'. */
52679 +
52680 +static int
52681 +initialize_statement_dataflow (void **slot, void *data ATTRIBUTE_UNUSED)
52682 +{
52683 + struct rls_stmt_info *info = *slot;
52684 +
52685 + gcc_assert (!info->defined);
52686 +
52687 + if (info->use_p)
52688 + {
52689 + info->defined = sbitmap_alloc (stats.n_statics);
52690 + /* Assume defined along all paths until otherwise informed. */
52691 + sbitmap_ones (info->defined);
52692 + }
52693 +
52694 + /* Continue traversal. */
52695 + return 1;
52696 +}
52697 +
52698 +/* We have N_STATICS static variables to consider. Go through all the
52699 + blocks and all the use statements to initialize their bitmaps. */
52700 +
52701 +static void
52702 +initialize_block_and_statement_dataflow (size_t n_statics)
52703 +{
52704 + basic_block bb;
52705 +
52706 + FOR_ALL_BB (bb)
52707 + {
52708 + struct rls_block_dataflow_data *data = bb->aux;
52709 +
52710 + gcc_assert (data);
52711 +
52712 + data->defined_in = sbitmap_alloc (n_statics);
52713 + sbitmap_zero (data->defined_in);
52714 + data->defined_out = sbitmap_alloc (n_statics);
52715 + sbitmap_zero (data->defined_out);
52716 + }
52717 +
52718 + htab_traverse (defuse_statements, initialize_statement_dataflow, NULL);
52719 +}
52720 +
52721 +/* Apply the individual effects of the stmts in BB to update the
52722 + dataflow analysis information for BB. */
52723 +
52724 +static void
52725 +compute_definedness_for_block (basic_block bb)
52726 +{
52727 + bool changed_p = false;
52728 + struct rls_block_dataflow_data *data = bb->aux;
52729 + block_stmt_iterator bsi;
52730 +
52731 + sbitmap_copy (data->defined_out, data->defined_in);
52732 +
52733 + for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
52734 + {
52735 + tree stmt = bsi_stmt (bsi);
52736 + struct rls_stmt_info dummy;
52737 + void **slot;
52738 +
52739 + /* First see if this statement uses or defines a static variable. */
52740 + dummy.stmt = stmt;
52741 + slot = htab_find_slot (defuse_statements, &dummy, INSERT);
52742 +
52743 + /* Check for uses. */
52744 + if (*slot != NULL)
52745 + {
52746 + struct rls_stmt_info *info = *slot;
52747 +
52748 + gcc_assert (get_call_expr_in (stmt) == NULL_TREE);
52749 +
52750 + if (info->use_p)
52751 + {
52752 + gcc_assert (info->defined);
52753 +
52754 + /* Found a statement that uses a function-local static
52755 + variable. Copy the current state of definedness. */
52756 + sbitmap_copy (info->defined, data->defined_out);
52757 + }
52758 + else
52759 + {
52760 + struct rls_decl_info dummy;
52761 + struct rls_decl_info *decl;
52762 +
52763 + gcc_assert (!info->defined);
52764 +
52765 + /* Found a statement that defines a function-local static
52766 + variable. Look up the associated variable's information
52767 + and mark it as defined in the block. */
52768 + dummy.orig_var = info->var;
52769 + slot = htab_find_slot (static_variables, &dummy, INSERT);
52770 +
52771 + gcc_assert (*slot);
52772 +
52773 + decl = (struct rls_decl_info *) *slot;
52774 +
52775 + SET_BIT (data->defined_out, decl->index);
52776 + changed_p |= true;
52777 + }
52778 + }
52779 + else if (get_call_expr_in (stmt) != NULL_TREE)
52780 + /* If there's a call expression in STMT, then previous passes
52781 + will have determined if the call transitively defines some
52782 + static variable. However, we need more precise
52783 + information--we need to know whether static variables are
52784 + live out after the call. In the absence of such information,
52785 + simply declare that all static variables are clobbered by the
52786 + call. A better analysis would be interprocedural and compute
52787 + the liveness information we require, but for now, we're being
52788 + pessimistic. */
52789 + sbitmap_zero (data->defined_out);
52790 + }
52791 +}
52792 +
52793 +/* Solve the dataflow equations:
52794 +
52795 + DEFINED_IN(b) = intersect DEFINED_OUT(p) for p in preds(b)
52796 + DEFINED_OUT(b) = VARIABLES_DEFINED (b, DEFINED_IN (b))
52797 +
52798 + via a simple iterative solver. VARIABLES_DEFINED is computed by
52799 + 'compute_definedness_for_block'. */
52800 +
52801 +static void
52802 +compute_definedness (void)
52803 +{
52804 + basic_block bb;
52805 + bool changed_p;
52806 + sbitmap tmp_bitmap = sbitmap_alloc (stats.n_statics);
52807 +
52808 + /* Compute initial sets. */
52809 + FOR_EACH_BB (bb)
52810 + {
52811 + compute_definedness_for_block (bb);
52812 + }
52813 +
52814 + /* Iterate. */
52815 + do {
52816 + changed_p = false;
52817 +
52818 + FOR_EACH_BB (bb)
52819 + {
52820 + edge e;
52821 + edge_iterator ei;
52822 + struct rls_block_dataflow_data *data = bb->aux;
52823 + bool bitmap_changed_p = false;
52824 +
52825 + sbitmap_ones (tmp_bitmap);
52826 +
52827 + gcc_assert (data);
52828 +
52829 + /* We require information about whether a variable was defined
52830 + over all paths leading to a particular use. Therefore, we
52831 + intersect the DEFINED sets of all predecessors. */
52832 + FOR_EACH_EDGE (e, ei, bb->preds)
52833 + {
52834 + struct rls_block_dataflow_data *pred_data = e->src->aux;
52835 +
52836 + gcc_assert (pred_data);
52837 +
52838 + sbitmap_a_and_b (tmp_bitmap, tmp_bitmap, pred_data->defined_out);
52839 + }
52840 +
52841 + bitmap_changed_p = !sbitmap_equal (tmp_bitmap, data->defined_in);
52842 +
52843 + if (bitmap_changed_p)
52844 + {
52845 + sbitmap_copy (data->defined_in, tmp_bitmap);
52846 + compute_definedness_for_block (bb);
52847 + }
52848 +
52849 + changed_p |= bitmap_changed_p;
52850 + }
52851 + } while (changed_p);
52852 +
52853 + sbitmap_free (tmp_bitmap);
52854 +}
52855 +
52856 +static unsigned int
52857 +execute_rls (void)
52858 +{
52859 + rls_init ();
52860 +
52861 + find_static_nonvolatile_declarations ();
52862 +
52863 + /* Can we optimize anything? */
52864 + if (stats.n_statics != 0)
52865 + {
52866 + stats.n_optimizable = stats.n_statics;
52867 +
52868 + if (dump_file)
52869 + fprintf (dump_file, "found %d static variables to consider\n",
52870 + stats.n_statics);
52871 +
52872 + initialize_block_and_statement_dataflow (stats.n_statics);
52873 +
52874 + compute_definedness ();
52875 +
52876 + maybe_remove_static_from_declarations ();
52877 +
52878 + if (dump_file)
52879 + fprintf (dump_file, "removed %d static variables\n",
52880 + stats.n_optimizable);
52881 + }
52882 +
52883 + rls_done ();
52884 +
52885 + return 0;
52886 +}
52887 +
52888 +static bool
52889 +gate_rls (void)
52890 +{
52891 + return (flag_remove_local_statics != 0
52892 + && !current_function_calls_setjmp
52893 + && !cgraph_node (current_function_decl)->ever_was_nested);
52894 +}
52895 +
52896 +struct tree_opt_pass pass_remove_local_statics =
52897 +{
52898 + "remlocstatic", /* name */
52899 + gate_rls, /* gate */
52900 + execute_rls, /* execute */
52901 + NULL, /* sub */
52902 + NULL, /* next */
52903 + 0, /* static_pass_number */
52904 + TV_TREE_RLS, /* tv_id */
52905 + PROP_cfg | PROP_ssa, /* properties_required */
52906 + 0, /* properties_provided */
52907 + 0, /* properties_destroyed */
52908 + 0, /* todo_flags_start */
52909 + TODO_dump_func | TODO_verify_ssa | TODO_verify_stmts
52910 + | TODO_update_ssa, /* todo_flags_finish */
52911 + 0 /* letter */
52912 +};
52913 --- a/gcc/tree-ssa-sink.c
52914 +++ b/gcc/tree-ssa-sink.c
52915 @@ -458,6 +458,46 @@ sink_code_in_bb (basic_block bb)
52916 last = false;
52917 continue;
52918 }
52919 +
52920 + /* We cannot move statements that contain references to block-scope
52921 + variables out of that block, as this may lead to incorrect aliasing
52922 + when we lay out the stack frame in cfgexpand.c.
52923 + In lieu of more sophisticated analysis, be very conservative here
52924 + and prohibit moving any statement that references memory out of a
52925 + block with variables. */
52926 + if (stmt_references_memory_p (stmt))
52927 + {
52928 + tree fromblock = TREE_BLOCK (stmt);
52929 + while (fromblock
52930 + && fromblock != current_function_decl
52931 + && !BLOCK_VARS (fromblock))
52932 + fromblock = BLOCK_SUPERCONTEXT (fromblock);
52933 + if (fromblock && fromblock != current_function_decl)
52934 + {
52935 + tree tostmt;
52936 + tree toblock;
52937 + if (bsi_end_p (tobsi))
52938 + tostmt = last_stmt (tobb);
52939 + else
52940 + tostmt = bsi_stmt (tobsi);
52941 + if (tostmt)
52942 + toblock = TREE_BLOCK (tostmt);
52943 + else
52944 + toblock = NULL;
52945 + while (toblock
52946 + && toblock != current_function_decl
52947 + && toblock != fromblock)
52948 + toblock = BLOCK_SUPERCONTEXT (toblock);
52949 + if (!toblock || toblock != fromblock)
52950 + {
52951 + if (!bsi_end_p (bsi))
52952 + bsi_prev (&bsi);
52953 + last = false;
52954 + continue;
52955 + }
52956 + }
52957 + }
52958 +
52959 if (dump_file)
52960 {
52961 fprintf (dump_file, "Sinking ");
52962 --- a/gcc/tree-vect-transform.c
52963 +++ b/gcc/tree-vect-transform.c
52964 @@ -1366,22 +1366,41 @@ vect_get_constant_vectors (slp_tree slp_
52965 tree stmt = VEC_index (tree, stmts, 0);
52966 stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
52967 tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
52968 - int nunits = TYPE_VECTOR_SUBPARTS (vectype);
52969 + int nunits;
52970 tree vec_cst;
52971 tree t = NULL_TREE;
52972 int j, number_of_places_left_in_vector;
52973 tree vector_type;
52974 - tree op, vop, operation;
52975 + tree op, vop;
52976 int group_size = VEC_length (tree, stmts);
52977 unsigned int vec_num, i;
52978 int number_of_copies = 1;
52979 - bool is_store = false;
52980 unsigned int number_of_vectors = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
52981 VEC (tree, heap) *voprnds = VEC_alloc (tree, heap, number_of_vectors);
52982 - bool constant_p;
52983 + bool constant_p, is_store;
52984
52985 + op = GIMPLE_STMT_OPERAND (stmt, 1);
52986 if (STMT_VINFO_DATA_REF (stmt_vinfo))
52987 is_store = true;
52988 + else
52989 + {
52990 + is_store = false;
52991 + op = TREE_OPERAND (op, op_num);
52992 + }
52993 +
52994 + if (CONSTANT_CLASS_P (op))
52995 + {
52996 + vector_type = vectype;
52997 + constant_p = true;
52998 + }
52999 + else
53000 + {
53001 + vector_type = get_vectype_for_scalar_type (TREE_TYPE (op));
53002 + gcc_assert (vector_type);
53003 + constant_p = false;
53004 + }
53005 +
53006 + nunits = TYPE_VECTOR_SUBPARTS (vector_type);
53007
53008 /* NUMBER_OF_COPIES is the number of times we need to use the same values in
53009 created vectors. It is greater than 1 if unrolling is performed.
53010 @@ -1402,18 +1421,13 @@ vect_get_constant_vectors (slp_tree slp_
53011 number_of_copies = least_common_multiple (nunits, group_size) / group_size;
53012
53013 number_of_places_left_in_vector = nunits;
53014 - constant_p = true;
53015 for (j = 0; j < number_of_copies; j++)
53016 {
53017 for (i = group_size - 1; VEC_iterate (tree, stmts, i, stmt); i--)
53018 {
53019 - operation = GIMPLE_STMT_OPERAND (stmt, 1);
53020 - if (is_store)
53021 - op = operation;
53022 - else
53023 - op = TREE_OPERAND (operation, op_num);
53024 - if (!CONSTANT_CLASS_P (op))
53025 - constant_p = false;
53026 + op = GIMPLE_STMT_OPERAND (stmt, 1);
53027 + if (!STMT_VINFO_DATA_REF (stmt_vinfo))
53028 + op = TREE_OPERAND (op, op_num);
53029
53030 /* Create 'vect_ = {op0,op1,...,opn}'. */
53031 t = tree_cons (NULL_TREE, op, t);
53032 @@ -1424,16 +1438,12 @@ vect_get_constant_vectors (slp_tree slp_
53033 {
53034 number_of_places_left_in_vector = nunits;
53035
53036 - vector_type = get_vectype_for_scalar_type (TREE_TYPE (op));
53037 - gcc_assert (vector_type);
53038 if (constant_p)
53039 vec_cst = build_vector (vector_type, t);
53040 else
53041 vec_cst = build_constructor_from_list (vector_type, t);
53042 - constant_p = true;
53043 VEC_quick_push (tree, voprnds,
53044 - vect_init_vector (stmt, vec_cst, vector_type,
53045 - NULL));
53046 + vect_init_vector (stmt, vec_cst, vector_type, NULL));
53047 t = NULL_TREE;
53048 }
53049 }
53050 @@ -1829,7 +1839,7 @@ vect_get_vec_def_for_operand (tree op, t
53051 stmt_vec_info def_stmt_info = NULL;
53052 stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
53053 tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
53054 - int nunits = TYPE_VECTOR_SUBPARTS (vectype);
53055 + unsigned int nunits = TYPE_VECTOR_SUBPARTS (vectype);
53056 loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
53057 tree vec_inv;
53058 tree vec_cst;
53059 @@ -1878,16 +1888,17 @@ vect_get_vec_def_for_operand (tree op, t
53060 {
53061 t = tree_cons (NULL_TREE, op, t);
53062 }
53063 - vector_type = get_vectype_for_scalar_type (TREE_TYPE (op));
53064 - gcc_assert (vector_type);
53065 - vec_cst = build_vector (vector_type, t);
53066 -
53067 - return vect_init_vector (stmt, vec_cst, vector_type, NULL);
53068 + vec_cst = build_vector (vectype, t);
53069 + return vect_init_vector (stmt, vec_cst, vectype, NULL);
53070 }
53071
53072 /* Case 2: operand is defined outside the loop - loop invariant. */
53073 case vect_invariant_def:
53074 {
53075 + vector_type = get_vectype_for_scalar_type (TREE_TYPE (def));
53076 + gcc_assert (vector_type);
53077 + nunits = TYPE_VECTOR_SUBPARTS (vector_type);
53078 +
53079 if (scalar_def)
53080 *scalar_def = def;
53081
53082 @@ -1901,8 +1912,6 @@ vect_get_vec_def_for_operand (tree op, t
53083 }
53084
53085 /* FIXME: use build_constructor directly. */
53086 - vector_type = get_vectype_for_scalar_type (TREE_TYPE (def));
53087 - gcc_assert (vector_type);
53088 vec_inv = build_constructor_from_list (vector_type, t);
53089 return vect_init_vector (stmt, vec_inv, vector_type, NULL);
53090 }
53091 @@ -2167,6 +2176,7 @@ get_initial_def_for_reduction (tree stmt
53092 struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
53093 tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
53094 int nunits = TYPE_VECTOR_SUBPARTS (vectype);
53095 + tree scalar_type = TREE_TYPE (vectype);
53096 enum tree_code code = TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1));
53097 tree type = TREE_TYPE (init_val);
53098 tree vecdef;
53099 @@ -2174,7 +2184,6 @@ get_initial_def_for_reduction (tree stmt
53100 tree init_def;
53101 tree t = NULL_TREE;
53102 int i;
53103 - tree vector_type;
53104 bool nested_in_vect_loop = false;
53105
53106 gcc_assert (POINTER_TYPE_P (type) || INTEGRAL_TYPE_P (type) || SCALAR_FLOAT_TYPE_P (type));
53107 @@ -2195,15 +2204,14 @@ get_initial_def_for_reduction (tree stmt
53108 else
53109 *adjustment_def = init_val;
53110 /* Create a vector of zeros for init_def. */
53111 - if (SCALAR_FLOAT_TYPE_P (type))
53112 - def_for_init = build_real (type, dconst0);
53113 + if (SCALAR_FLOAT_TYPE_P (scalar_type))
53114 + def_for_init = build_real (scalar_type, dconst0);
53115 else
53116 - def_for_init = build_int_cst (type, 0);
53117 + def_for_init = build_int_cst (scalar_type, 0);
53118 +
53119 for (i = nunits - 1; i >= 0; --i)
53120 t = tree_cons (NULL_TREE, def_for_init, t);
53121 - vector_type = get_vectype_for_scalar_type (TREE_TYPE (def_for_init));
53122 - gcc_assert (vector_type);
53123 - init_def = build_vector (vector_type, t);
53124 + init_def = build_vector (vectype, t);
53125 break;
53126
53127 case MIN_EXPR:
53128 --- a/gcc/tree.c
53129 +++ b/gcc/tree.c
53130 @@ -4031,6 +4031,7 @@ handle_dll_attribute (tree * pnode, tree
53131 bool *no_add_attrs)
53132 {
53133 tree node = *pnode;
53134 + bool is_dllimport;
53135
53136 /* These attributes may apply to structure and union types being created,
53137 but otherwise should pass to the declaration involved. */
53138 @@ -4078,9 +4079,11 @@ handle_dll_attribute (tree * pnode, tree
53139 return NULL_TREE;
53140 }
53141
53142 + is_dllimport = is_attribute_p ("dllimport", name);
53143 +
53144 /* Report error on dllimport ambiguities seen now before they cause
53145 any damage. */
53146 - else if (is_attribute_p ("dllimport", name))
53147 + if (is_dllimport)
53148 {
53149 /* Honor any target-specific overrides. */
53150 if (!targetm.valid_dllimport_attribute_p (node))
53151 @@ -4122,6 +4125,9 @@ handle_dll_attribute (tree * pnode, tree
53152 if (*no_add_attrs == false)
53153 DECL_DLLIMPORT_P (node) = 1;
53154 }
53155 + else if (DECL_DECLARED_INLINE_P (node))
53156 + /* An exported function, even if inline, must be emitted. */
53157 + DECL_EXTERNAL (node) = 0;
53158
53159 /* Report error if symbol is not accessible at global scope. */
53160 if (!TREE_PUBLIC (node)
53161 --- a/gcc/tree.h
53162 +++ b/gcc/tree.h
53163 @@ -399,7 +399,10 @@ struct tree_base GTY(())
53164 unsigned lang_flag_6 : 1;
53165 unsigned visited : 1;
53166
53167 - unsigned spare : 23;
53168 + /* For tree_type. */
53169 + unsigned packed_flag : 1;
53170 +
53171 + unsigned spare : 22;
53172
53173 /* FIXME tuples: Eventually, we need to move this somewhere external to
53174 the trees. */
53175 @@ -2287,7 +2290,7 @@ struct tree_block GTY(())
53176
53177 /* Indicated that objects of this type should be laid out in as
53178 compact a way as possible. */
53179 -#define TYPE_PACKED(NODE) (TYPE_CHECK (NODE)->type.packed_flag)
53180 +#define TYPE_PACKED(NODE) (TYPE_CHECK (NODE)->common.base.packed_flag)
53181
53182 /* Used by type_contains_placeholder_p to avoid recomputation.
53183 Values are: 0 (unknown), 1 (false), 2 (true). Never access
53184 @@ -2306,17 +2309,16 @@ struct tree_type GTY(())
53185 tree attributes;
53186 unsigned int uid;
53187
53188 - unsigned int precision : 9;
53189 - ENUM_BITFIELD(machine_mode) mode : 7;
53190 -
53191 - unsigned string_flag : 1;
53192 + unsigned int precision : 10;
53193 unsigned no_force_blk_flag : 1;
53194 unsigned needs_constructing_flag : 1;
53195 unsigned transparent_union_flag : 1;
53196 - unsigned packed_flag : 1;
53197 unsigned restrict_flag : 1;
53198 unsigned contains_placeholder_bits : 2;
53199
53200 + ENUM_BITFIELD(machine_mode) mode : 7;
53201 + unsigned string_flag : 1;
53202 +
53203 unsigned lang_flag_0 : 1;
53204 unsigned lang_flag_1 : 1;
53205 unsigned lang_flag_2 : 1;
53206 --- a/gcc/unwind-dw2.c
53207 +++ b/gcc/unwind-dw2.c
53208 @@ -1402,16 +1402,12 @@ uw_advance_context (struct _Unwind_Conte
53209 /* Fill in CONTEXT for top-of-stack. The only valid registers at this
53210 level will be the return address and the CFA. */
53211
53212 -#define uw_init_context(CONTEXT) \
53213 - do \
53214 - { \
53215 - /* Do any necessary initialization to access arbitrary stack frames. \
53216 - On the SPARC, this means flushing the register windows. */ \
53217 - __builtin_unwind_init (); \
53218 - uw_init_context_1 (CONTEXT, __builtin_dwarf_cfa (), \
53219 - __builtin_return_address (0)); \
53220 - } \
53221 - while (0)
53222 +#define uw_init_context(CONTEXT) \
53223 + /* Do any necessary initialization to access arbitrary stack frames. \
53224 + On the SPARC, this means flushing the register windows. */ \
53225 + (__builtin_unwind_init (), \
53226 + uw_init_context_1 ((CONTEXT), __builtin_dwarf_cfa (), \
53227 + __builtin_return_address (0)))
53228
53229 static inline void
53230 init_dwarf_reg_size_table (void)
53231 @@ -1419,7 +1415,7 @@ init_dwarf_reg_size_table (void)
53232 __builtin_init_dwarf_reg_size_table (dwarf_reg_size_table);
53233 }
53234
53235 -static void
53236 +static _Unwind_Reason_Code
53237 uw_init_context_1 (struct _Unwind_Context *context,
53238 void *outer_cfa, void *outer_ra)
53239 {
53240 @@ -1433,7 +1429,8 @@ uw_init_context_1 (struct _Unwind_Contex
53241 context->flags = EXTENDED_CONTEXT_BIT;
53242
53243 code = uw_frame_state_for (context, &fs);
53244 - gcc_assert (code == _URC_NO_REASON);
53245 + if (code != _URC_NO_REASON)
53246 + return code;
53247
53248 #if __GTHREADS
53249 {
53250 @@ -1459,6 +1456,8 @@ uw_init_context_1 (struct _Unwind_Contex
53251 initialization context, then we can't see it in the given
53252 call frame data. So have the initialization context tell us. */
53253 context->ra = __builtin_extract_return_addr (outer_ra);
53254 +
53255 + return _URC_NO_REASON;
53256 }
53257
53258
53259 --- a/gcc/unwind-sjlj.c
53260 +++ b/gcc/unwind-sjlj.c
53261 @@ -297,10 +297,11 @@ uw_advance_context (struct _Unwind_Conte
53262 uw_update_context (context, fs);
53263 }
53264
53265 -static inline void
53266 +static inline _Unwind_Reason_Code
53267 uw_init_context (struct _Unwind_Context *context)
53268 {
53269 context->fc = _Unwind_SjLj_GetContext ();
53270 + return _URC_NO_REASON;
53271 }
53272
53273 static void __attribute__((noreturn))
53274 --- a/gcc/unwind.inc
53275 +++ b/gcc/unwind.inc
53276 @@ -90,7 +90,8 @@ _Unwind_RaiseException(struct _Unwind_Ex
53277 _Unwind_Reason_Code code;
53278
53279 /* Set up this_context to describe the current stack frame. */
53280 - uw_init_context (&this_context);
53281 + code = uw_init_context (&this_context);
53282 + gcc_assert (code == _URC_NO_REASON);
53283 cur_context = this_context;
53284
53285 /* Phase 1: Search. Unwind the stack, calling the personality routine
53286 @@ -203,7 +204,8 @@ _Unwind_ForcedUnwind (struct _Unwind_Exc
53287 struct _Unwind_Context this_context, cur_context;
53288 _Unwind_Reason_Code code;
53289
53290 - uw_init_context (&this_context);
53291 + code = uw_init_context (&this_context);
53292 + gcc_assert (code == _URC_NO_REASON);
53293 cur_context = this_context;
53294
53295 exc->private_1 = (_Unwind_Ptr) stop;
53296 @@ -226,7 +228,8 @@ _Unwind_Resume (struct _Unwind_Exception
53297 struct _Unwind_Context this_context, cur_context;
53298 _Unwind_Reason_Code code;
53299
53300 - uw_init_context (&this_context);
53301 + code = uw_init_context (&this_context);
53302 + gcc_assert (code == _URC_NO_REASON);
53303 cur_context = this_context;
53304
53305 /* Choose between continuing to process _Unwind_RaiseException
53306 @@ -256,7 +259,8 @@ _Unwind_Resume_or_Rethrow (struct _Unwin
53307 if (exc->private_1 == 0)
53308 return _Unwind_RaiseException (exc);
53309
53310 - uw_init_context (&this_context);
53311 + code = uw_init_context (&this_context);
53312 + gcc_assert (code == _URC_NO_REASON);
53313 cur_context = this_context;
53314
53315 code = _Unwind_ForcedUnwind_Phase2 (exc, &cur_context);
53316 @@ -285,7 +289,9 @@ _Unwind_Backtrace(_Unwind_Trace_Fn trace
53317 struct _Unwind_Context context;
53318 _Unwind_Reason_Code code;
53319
53320 - uw_init_context (&context);
53321 + code = uw_init_context (&context);
53322 + if (code != _URC_NO_REASON)
53323 + return _URC_FATAL_PHASE1_ERROR;
53324
53325 while (1)
53326 {
53327 --- a/gcc/varasm.c
53328 +++ b/gcc/varasm.c
53329 @@ -555,7 +555,7 @@ get_section (const char *name, unsigned
53330 static bool
53331 use_object_blocks_p (void)
53332 {
53333 - return flag_section_anchors;
53334 + return flag_section_anchors && flag_toplevel_reorder;
53335 }
53336
53337 /* Return the object_block structure for section SECT. Create a new
53338 @@ -1095,13 +1095,12 @@ align_variable (tree decl, bool dont_out
53339 /* On some machines, it is good to increase alignment sometimes. */
53340 if (! DECL_USER_ALIGN (decl))
53341 {
53342 -#ifdef DATA_ALIGNMENT
53343 - unsigned int data_align = DATA_ALIGNMENT (TREE_TYPE (decl), align);
53344 + unsigned int data_align =
53345 + calculate_global_alignment (TREE_TYPE (decl), align);
53346 /* Don't increase alignment too much for TLS variables - TLS space
53347 is too precious. */
53348 if (! DECL_THREAD_LOCAL_P (decl) || data_align <= BITS_PER_WORD)
53349 align = data_align;
53350 -#endif
53351 #ifdef CONSTANT_ALIGNMENT
53352 if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) != error_mark_node)
53353 {
53354 --- a/gcc/vmsdbgout.c
53355 +++ b/gcc/vmsdbgout.c
53356 @@ -211,6 +211,7 @@ const struct gcc_debug_hooks vmsdbg_debu
53357 debug_nothing_int, /* handle_pch */
53358 debug_nothing_rtx, /* var_location */
53359 debug_nothing_void, /* switch_text_section */
53360 + debug_nothing_tree_tree, /* set_name */
53361 0 /* start_end_main_source_file */
53362 };
53363
53364 --- a/include/libiberty.h
53365 +++ b/include/libiberty.h
53366 @@ -583,6 +583,10 @@ extern int pexecute (const char *, char
53367
53368 extern int pwait (int, int *, int);
53369
53370 +/* Convert a Cygwin path to a Windows path. */
53371 +
53372 +extern int cygpath (const char *, char []);
53373 +
53374 #if !HAVE_DECL_ASPRINTF
53375 /* Like sprintf but provides a pointer to malloc'd storage, which must
53376 be freed by the caller. */
53377 --- a/libcpp/Makefile.in
53378 +++ b/libcpp/Makefile.in
53379 @@ -119,7 +119,7 @@ stamp-h1: $(srcdir)/config.in config.sta
53380 -rm -f stamp-h1
53381 $(SHELL) ./config.status config.h
53382
53383 -$(srcdir)/config.in: @MAINT@ $(srcdir)/configure
53384 +$(srcdir)/config.in: @MAINT@ $(srcdir)/configure.ac
53385 cd $(srcdir) && $(AUTOHEADER)
53386 -rm -f stamp-h1
53387
53388 --- a/libcpp/configure
53389 +++ b/libcpp/configure
53390 @@ -8311,6 +8311,7 @@ case $target in
53391 sparc64*-*-* | ultrasparc-*-freebsd* | \
53392 sparcv9-*-solaris2* | \
53393 sparc-*-solaris2.[789] | sparc-*-solaris2.1[0-9]* | \
53394 + sparc-wrs-linux-gnu | \
53395 spu-*-* | \
53396 sh[123456789l]*-*-*)
53397 need_64bit_hwint=yes ;;
53398 --- a/libcpp/configure.ac
53399 +++ b/libcpp/configure.ac
53400 @@ -129,6 +129,7 @@ case $target in
53401 sparc64*-*-* | ultrasparc-*-freebsd* | \
53402 sparcv9-*-solaris2* | \
53403 sparc-*-solaris2.[789] | sparc-*-solaris2.1[0-9]* | \
53404 + sparc-wrs-linux-gnu | \
53405 spu-*-* | \
53406 sh[123456789l]*-*-*)
53407 need_64bit_hwint=yes ;;
53408 --- a/libcpp/lex.c
53409 +++ b/libcpp/lex.c
53410 @@ -1240,7 +1240,7 @@ cpp_token_len (const cpp_token *token)
53411
53412 switch (TOKEN_SPELL (token))
53413 {
53414 - default: len = 4; break;
53415 + default: len = 6; break;
53416 case SPELL_LITERAL: len = token->val.str.len; break;
53417 case SPELL_IDENT: len = NODE_LEN (token->val.node) * 10; break;
53418 }
53419 --- a/libffi/Makefile.am
53420 +++ b/libffi/Makefile.am
53421 @@ -156,7 +156,9 @@ nodist_libffi_convenience_la_SOURCES = $
53422
53423 AM_CFLAGS = -Wall -g -fexceptions
53424
53425 -libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
53426 +LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
53427 +
53428 +libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS)
53429
53430 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
53431 AM_CCASFLAGS = $(AM_CPPFLAGS)
53432 --- a/libffi/Makefile.in
53433 +++ b/libffi/Makefile.in
53434 @@ -439,7 +439,8 @@ nodist_libffi_la_SOURCES = $(am__append_
53435 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
53436 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
53437 AM_CFLAGS = -Wall -g -fexceptions
53438 -libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
53439 +LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
53440 +libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS)
53441 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
53442 AM_CCASFLAGS = $(AM_CPPFLAGS)
53443 all: fficonfig.h
53444 --- a/libgcc/Makefile.in
53445 +++ b/libgcc/Makefile.in
53446 @@ -388,18 +388,24 @@ libgcc-s-objects += $(patsubst %,%_s$(ob
53447 endif
53448 endif
53449
53450 +ifeq ($(LIB2_DIVMOD_EXCEPTION_FLAGS),)
53451 +# Provide default flags for compiling divmod functions, if they haven't been
53452 +# set already by a target-specific Makefile fragment.
53453 +LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions -fnon-call-exceptions
53454 +endif
53455 +
53456 # Build LIB2_DIVMOD_FUNCS.
53457 lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS))
53458 $(lib2-divmod-o): %$(objext): $(gcc_srcdir)/libgcc2.c
53459 $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
53460 - -fexceptions -fnon-call-exceptions $(vis_hide)
53461 + $(LIB2_DIVMOD_EXCEPTION_FLAGS) $(vis_hide)
53462 libgcc-objects += $(lib2-divmod-o)
53463
53464 ifeq ($(enable_shared),yes)
53465 lib2-divmod-s-o = $(patsubst %,%_s$(objext),$(LIB2_DIVMOD_FUNCS))
53466 $(lib2-divmod-s-o): %_s$(objext): $(gcc_srcdir)/libgcc2.c
53467 $(gcc_s_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
53468 - -fexceptions -fnon-call-exceptions
53469 + $(LIB2_DIVMOD_EXCEPTION_FLAGS)
53470 libgcc-s-objects += $(lib2-divmod-s-o)
53471 endif
53472
53473 --- a/libgcc/config.host
53474 +++ b/libgcc/config.host
53475 @@ -223,12 +223,15 @@ arm*-*-netbsdelf*)
53476 arm*-*-netbsd*)
53477 ;;
53478 arm*-*-linux*) # ARM GNU/Linux with ELF
53479 + tmake_file="${tmake_file} arm/t-divmod-ef"
53480 ;;
53481 arm*-*-uclinux*) # ARM ucLinux
53482 + tmake_file="${tmake_file} arm/t-divmod-ef"
53483 ;;
53484 arm*-*-ecos-elf)
53485 ;;
53486 arm*-*-eabi* | arm*-*-symbianelf* )
53487 + tmake_file="${tmake_file} arm/t-divmod-ef"
53488 ;;
53489 arm*-*-rtems*)
53490 ;;
53491 @@ -438,8 +441,12 @@ mips-sgi-irix[56]*)
53492 mips*-*-netbsd*) # NetBSD/mips, either endian.
53493 ;;
53494 mips64*-*-linux*)
53495 + extra_parts="$extra_parts crtfastmath.o"
53496 + tmake_file="{$tmake_file} mips/t-crtfm"
53497 ;;
53498 mips*-*-linux*) # Linux MIPS, either endian.
53499 + extra_parts="$extra_parts crtfastmath.o"
53500 + tmake_file="{$tmake_file} mips/t-crtfm"
53501 ;;
53502 mips*-*-openbsd*)
53503 ;;
53504 @@ -461,6 +468,10 @@ mips64vr-*-elf* | mips64vrel-*-elf*)
53505 ;;
53506 mips64orion-*-elf* | mips64orionel-*-elf*)
53507 ;;
53508 +mips64octeon-wrs-elf* | mips64octeonel-wrs-elf*)
53509 + ;;
53510 +mips64octeon-montavista-elf*)
53511 + ;;
53512 mips*-*-rtems*)
53513 ;;
53514 mips-wrs-vxworks)
53515 --- /dev/null
53516 +++ b/libgcc/config/arm/t-divmod-ef
53517 @@ -0,0 +1,4 @@
53518 +# On ARM, specifying -fnon-call-exceptions will needlessly pull in
53519 +# the unwinder in simple programs which use 64-bit division. Omitting
53520 +# the option is safe.
53521 +LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions
53522 --- /dev/null
53523 +++ b/libgcc/config/mips/t-crtfm
53524 @@ -0,0 +1,3 @@
53525 +crtfastmath.o: $(gcc_srcdir)/config/mips/crtfastmath.c
53526 + $(gcc_compile) -c $(gcc_srcdir)/config/mips/crtfastmath.c
53527 +
53528 --- a/libgcc/config/rs6000/t-ppccomm
53529 +++ b/libgcc/config/rs6000/t-ppccomm
53530 @@ -1,5 +1,21 @@
53531 -EXTRA_PARTS += ecrti$(objext) ecrtn$(objext) ncrti$(objext) ncrtn$(objext) \
53532 - crtsavres$(objext)
53533 +LIB2ADD_ST += crtsavfpr.S crtresfpr.S \
53534 + crtsavgpr.S crtresgpr.S \
53535 + crtresxfpr.S crtresxgpr.S \
53536 + e500crtres32gpr.S \
53537 + e500crtres64gpr.S \
53538 + e500crtres64gprctr.S \
53539 + e500crtrest32gpr.S \
53540 + e500crtrest64gpr.S \
53541 + e500crtresx32gpr.S \
53542 + e500crtresx64gpr.S \
53543 + e500crtsav32gpr.S \
53544 + e500crtsav64gpr.S \
53545 + e500crtsav64gprctr.S \
53546 + e500crtsavg32gpr.S \
53547 + e500crtsavg64gpr.S \
53548 + e500crtsavg64gprctr.S
53549 +
53550 +EXTRA_PARTS += ecrti$(objext) ecrtn$(objext) ncrti$(objext) ncrtn$(objext)
53551
53552 # We build {e,n}crti.o and {e,n}crtn.o, which serve to add begin and
53553 # end labels to all of the special sections used when we link using gcc.
53554 @@ -17,8 +33,62 @@ ncrti.S: $(gcc_srcdir)/config/rs6000/sol
53555 ncrtn.S: $(gcc_srcdir)/config/rs6000/sol-cn.asm
53556 cat $(gcc_srcdir)/config/rs6000/sol-cn.asm >ncrtn.S
53557
53558 -crtsavres.S: $(gcc_srcdir)/config/rs6000/crtsavres.asm
53559 - cat $(gcc_srcdir)/config/rs6000/crtsavres.asm >crtsavres.S
53560 +crtsavfpr.S: $(gcc_srcdir)/config/rs6000/crtsavfpr.asm
53561 + cat $(gcc_srcdir)/config/rs6000/crtsavfpr.asm >crtsavfpr.S
53562 +
53563 +crtresfpr.S: $(gcc_srcdir)/config/rs6000/crtresfpr.asm
53564 + cat $(gcc_srcdir)/config/rs6000/crtresfpr.asm >crtresfpr.S
53565 +
53566 +crtsavgpr.S: $(gcc_srcdir)/config/rs6000/crtsavgpr.asm
53567 + cat $(gcc_srcdir)/config/rs6000/crtsavgpr.asm >crtsavgpr.S
53568 +
53569 +crtresgpr.S: $(gcc_srcdir)/config/rs6000/crtresgpr.asm
53570 + cat $(gcc_srcdir)/config/rs6000/crtresgpr.asm >crtresgpr.S
53571 +
53572 +crtresxfpr.S: $(gcc_srcdir)/config/rs6000/crtresxfpr.asm
53573 + cat $(gcc_srcdir)/config/rs6000/crtresxfpr.asm >crtresxfpr.S
53574 +
53575 +crtresxgpr.S: $(gcc_srcdir)/config/rs6000/crtresxgpr.asm
53576 + cat $(gcc_srcdir)/config/rs6000/crtresxgpr.asm >crtresxgpr.S
53577 +
53578 +e500crtres32gpr.S: $(gcc_srcdir)/config/rs6000/e500crtres32gpr.asm
53579 + cat $(gcc_srcdir)/config/rs6000/e500crtres32gpr.asm >e500crtres32gpr.S
53580 +
53581 +e500crtres64gpr.S: $(gcc_srcdir)/config/rs6000/e500crtres64gpr.asm
53582 + cat $(gcc_srcdir)/config/rs6000/e500crtres64gpr.asm >e500crtres64gpr.S
53583 +
53584 +e500crtres64gprctr.S: $(gcc_srcdir)/config/rs6000/e500crtres64gprctr.asm
53585 + cat $(gcc_srcdir)/config/rs6000/e500crtres64gprctr.asm >e500crtres64gprctr.S
53586 +
53587 +e500crtrest32gpr.S: $(gcc_srcdir)/config/rs6000/e500crtrest32gpr.asm
53588 + cat $(gcc_srcdir)/config/rs6000/e500crtrest32gpr.asm >e500crtrest32gpr.S
53589 +
53590 +e500crtrest64gpr.S: $(gcc_srcdir)/config/rs6000/e500crtrest64gpr.asm
53591 + cat $(gcc_srcdir)/config/rs6000/e500crtrest64gpr.asm >e500crtrest64gpr.S
53592 +
53593 +e500crtresx32gpr.S: $(gcc_srcdir)/config/rs6000/e500crtresx32gpr.asm
53594 + cat $(gcc_srcdir)/config/rs6000/e500crtresx32gpr.asm >e500crtresx32gpr.S
53595 +
53596 +e500crtresx64gpr.S: $(gcc_srcdir)/config/rs6000/e500crtresx64gpr.asm
53597 + cat $(gcc_srcdir)/config/rs6000/e500crtresx64gpr.asm >e500crtresx64gpr.S
53598 +
53599 +e500crtsav32gpr.S: $(gcc_srcdir)/config/rs6000/e500crtsav32gpr.asm
53600 + cat $(gcc_srcdir)/config/rs6000/e500crtsav32gpr.asm >e500crtsav32gpr.S
53601 +
53602 +e500crtsav64gpr.S: $(gcc_srcdir)/config/rs6000/e500crtsav64gpr.asm
53603 + cat $(gcc_srcdir)/config/rs6000/e500crtsav64gpr.asm >e500crtsav64gpr.S
53604 +
53605 +e500crtsav64gprctr.S: $(gcc_srcdir)/config/rs6000/e500crtsav64gprctr.asm
53606 + cat $(gcc_srcdir)/config/rs6000/e500crtsav64gprctr.asm >e500crtsav64gprctr.S
53607 +
53608 +e500crtsavg32gpr.S: $(gcc_srcdir)/config/rs6000/e500crtsavg32gpr.asm
53609 + cat $(gcc_srcdir)/config/rs6000/e500crtsavg32gpr.asm >e500crtsavg32gpr.S
53610 +
53611 +e500crtsavg64gpr.S: $(gcc_srcdir)/config/rs6000/e500crtsavg64gpr.asm
53612 + cat $(gcc_srcdir)/config/rs6000/e500crtsavg64gpr.asm >e500crtsavg64gpr.S
53613 +
53614 +e500crtsavg64gprctr.S: $(gcc_srcdir)/config/rs6000/e500crtsavg64gprctr.asm
53615 + cat $(gcc_srcdir)/config/rs6000/e500crtsavg64gprctr.asm >e500crtsavg64gprctr.S
53616
53617 ecrti$(objext): ecrti.S
53618 $(crt_compile) -c ecrti.S
53619 @@ -34,3 +104,60 @@ ncrtn$(objext): ncrtn.S
53620
53621 crtsavres$(objext): crtsavres.S
53622 $(crt_compile) -c crtsavres.S
53623 +
53624 +crtsavfpr$(objext): crtsavfpr.S
53625 + $(crt_compile) -c crtsavfpr.S
53626 +
53627 +crtresfpr$(objext): crtresfpr.S
53628 + $(crt_compile) -c crtresfpr.S
53629 +
53630 +crtsavgpr$(objext): crtsavgpr.S
53631 + $(crt_compile) -c crtsavgpr.S
53632 +
53633 +crtresgpr$(objext): crtresgpr.S
53634 + $(crt_compile) -c crtresgpr.S
53635 +
53636 +crtresxfpr$(objext): crtresxfpr.S
53637 + $(crt_compile) -c crtresxfpr.S
53638 +
53639 +crtresxgpr$(objext): crtresxgpr.S
53640 + $(crt_compile) -c crtresxgpr.S
53641 +
53642 +e500crtres32gpr$(objext): e500crtres32gpr.S
53643 + $(crt_compile) -c e500crtres32gpr.S
53644 +
53645 +e500crtres64gpr$(objext): e500crtres64gpr.S
53646 + $(crt_compile) -c e500crtres64gpr.S
53647 +
53648 +e500crtres64gprctr$(objext): e500crtres64gprctr.S
53649 + $(crt_compile) -c e500crtres64gprctr.S
53650 +
53651 +e500crtrest32gpr$(objext): e500crtrest32gpr.S
53652 + $(crt_compile) -c e500crtrest32gpr.S
53653 +
53654 +e500crtrest64gpr$(objext): e500crtrest64gpr.S
53655 + $(crt_compile) -c e500crtrest64gpr.S
53656 +
53657 +e500crtresx32gpr$(objext): e500crtresx32gpr.S
53658 + $(crt_compile) -c e500crtresx32gpr.S
53659 +
53660 +e500crtresx64gpr$(objext): e500crtresx64gpr.S
53661 + $(crt_compile) -c e500crtresx64gpr.S
53662 +
53663 +e500crtsav32gpr$(objext): e500crtsav32gpr.S
53664 + $(crt_compile) -c e500crtsav32gpr.S
53665 +
53666 +e500crtsav64gpr$(objext): e500crtsav64gpr.S
53667 + $(crt_compile) -c e500crtsav64gpr.S
53668 +
53669 +e500crtsav64gprctr$(objext): e500crtsav64gprctr.S
53670 + $(crt_compile) -c e500crtsav64gprctr.S
53671 +
53672 +e500crtsavg32gpr$(objext): e500crtsavg32gpr.S
53673 + $(crt_compile) -c e500crtsavg32gpr.S
53674 +
53675 +e500crtsavg64gpr$(objext): e500crtsavg64gpr.S
53676 + $(crt_compile) -c e500crtsavg64gpr.S
53677 +
53678 +e500crtsavg64gprctr$(objext): e500crtsavg64gprctr.S
53679 + $(crt_compile) -c e500crtsavg64gprctr.S
53680 --- a/libgcc/shared-object.mk
53681 +++ b/libgcc/shared-object.mk
53682 @@ -8,11 +8,13 @@ base := $(basename $(notdir $o))
53683
53684 ifeq ($(suffix $o),.c)
53685
53686 +c_flags-$(base)$(objext) := $(c_flags)
53687 $(base)$(objext): $o
53688 - $(gcc_compile) $(c_flags) -c $< $(vis_hide)
53689 + $(gcc_compile) $(c_flags-$@) -c $< $(vis_hide)
53690
53691 +c_flags-$(base)_s$(objext) := $(c_flags)
53692 $(base)_s$(objext): $o
53693 - $(gcc_s_compile) $(c_flags) -c $<
53694 + $(gcc_s_compile) $(c_flags-$@) -c $<
53695
53696 else
53697
53698 --- a/libgcc/static-object.mk
53699 +++ b/libgcc/static-object.mk
53700 @@ -8,8 +8,9 @@ base := $(basename $(notdir $o))
53701
53702 ifeq ($(suffix $o),.c)
53703
53704 +c_flags-$(base)$(objext) := $(c_flags)
53705 $(base)$(objext): $o
53706 - $(gcc_compile) $(c_flags) -c $< $(vis_hide)
53707 + $(gcc_compile) $(c_flags-$@) -c $< $(vis_hide)
53708
53709 else
53710
53711 --- a/libgomp/Makefile.am
53712 +++ b/libgomp/Makefile.am
53713 @@ -1,5 +1,10 @@
53714 ## Process this file with automake to produce Makefile.in
53715
53716 +datarootdir = @datarootdir@
53717 +docdir = @docdir@
53718 +htmldir = @htmldir@
53719 +pdfdir = @pdfdir@
53720 +
53721 ACLOCAL_AMFLAGS = -I .. -I ../config
53722 SUBDIRS = testsuite
53723
53724 @@ -39,6 +44,12 @@ if USE_FORTRAN
53725 nodist_finclude_HEADERS = omp_lib.h omp_lib.f90 omp_lib.mod omp_lib_kinds.mod
53726 endif
53727
53728 +LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
53729 +
53730 +LINK = $(LIBTOOL) --tag CC --mode=link $(CCLD) $(AM_CCFLAGS) $(CFLAGS) \
53731 + $(AM_LDFLAGS) $(LTLDFLAGS) -o $@
53732 +
53733 +
53734 omp_lib_kinds.mod: omp_lib.mod
53735 :
53736 omp_lib.mod: omp_lib.f90
53737 @@ -48,10 +59,31 @@ fortran.o: libgomp_f.h
53738 env.lo: libgomp_f.h
53739 env.o: libgomp_f.h
53740
53741 +HTMLS_INSTALL=libgomp
53742 +HTMLS_BUILD=libgomp/index.html
53743
53744 -# No install-html or install-pdf support in automake yet
53745 -.PHONY: install-html install-pdf
53746 -install-html:
53747 +$(HTMLS_BUILD): $(info_TEXINFOS)
53748 + $(TEXI2HTML) $(MAKEINFOFLAGS) -I$(srcdir) -o $(@D) $<
53749 +
53750 +html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
53751 +
53752 +install-data-local: install-html
53753 +install-html: $(HTMLS_BUILD)
53754 + @$(NORMAL_INSTALL)
53755 + test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)"
53756 + @list='$(HTMLS_INSTALL)'; for p in $$list; do \
53757 + if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
53758 + f=$(html__strip_dir) \
53759 + if test -d "$$d$$p"; then \
53760 + echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
53761 + $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
53762 + echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
53763 + $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
53764 + else \
53765 + echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
53766 + $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
53767 + fi; \
53768 + done
53769
53770 install-pdf: $(PDFS)
53771 @$(NORMAL_INSTALL)
53772 @@ -69,6 +101,7 @@ install-pdf: $(PDFS)
53773 # `texinfo.tex' for your package. The value of this variable should be
53774 # the relative path from the current `Makefile.am' to `texinfo.tex'.
53775 TEXINFO_TEX = ../gcc/doc/include/texinfo.tex
53776 +TEXI2HTML = $(MAKEINFO) --html
53777
53778 # Defines info, dvi, pdf and html targets
53779 MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include
53780 --- a/libgomp/Makefile.in
53781 +++ b/libgomp/Makefile.in
53782 @@ -94,8 +94,6 @@ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=c
53783 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
53784 $(AM_CFLAGS) $(CFLAGS)
53785 CCLD = $(CC)
53786 -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
53787 - $(AM_LDFLAGS) $(LDFLAGS) -o $@
53788 SOURCES = $(libgomp_la_SOURCES)
53789 DIST_SOURCES = $(libgomp_la_SOURCES)
53790 MULTISRCTOP =
53791 @@ -217,9 +215,12 @@ USE_FORTRAN_TRUE = @USE_FORTRAN_TRUE@
53792 VERSION = @VERSION@
53793 XCFLAGS = @XCFLAGS@
53794 XLDFLAGS = @XLDFLAGS@
53795 +ac_ct_AR = @ac_ct_AR@
53796 ac_ct_CC = @ac_ct_CC@
53797 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
53798 ac_ct_FC = @ac_ct_FC@
53799 +ac_ct_RANLIB = @ac_ct_RANLIB@
53800 +ac_ct_STRIP = @ac_ct_STRIP@
53801 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
53802 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
53803 am__include = @am__include@
53804 @@ -237,7 +238,6 @@ config_path = @config_path@
53805 datadir = @datadir@
53806 datarootdir = @datarootdir@
53807 docdir = @docdir@
53808 -dvidir = @dvidir@
53809 enable_shared = @enable_shared@
53810 enable_static = @enable_static@
53811 exec_prefix = @exec_prefix@
53812 @@ -254,7 +254,6 @@ libdir = @libdir@
53813 libexecdir = @libexecdir@
53814 libtool_VERSION = @libtool_VERSION@
53815 link_gomp = @link_gomp@
53816 -localedir = @localedir@
53817 localstatedir = @localstatedir@
53818 lt_ECHO = @lt_ECHO@
53819 mandir = @mandir@
53820 @@ -264,7 +263,6 @@ oldincludedir = @oldincludedir@
53821 pdfdir = @pdfdir@
53822 prefix = @prefix@
53823 program_transform_name = @program_transform_name@
53824 -psdir = @psdir@
53825 sbindir = @sbindir@
53826 sharedstatedir = @sharedstatedir@
53827 sysconfdir = @sysconfdir@
53828 @@ -297,6 +295,13 @@ libgomp_la_SOURCES = alloc.c barrier.c c
53829 nodist_noinst_HEADERS = libgomp_f.h
53830 nodist_libsubinclude_HEADERS = omp.h
53831 @USE_FORTRAN_TRUE@nodist_finclude_HEADERS = omp_lib.h omp_lib.f90 omp_lib.mod omp_lib_kinds.mod
53832 +LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
53833 +LINK = $(LIBTOOL) --tag CC --mode=link $(CCLD) $(AM_CCFLAGS) $(CFLAGS) \
53834 + $(AM_LDFLAGS) $(LTLDFLAGS) -o $@
53835 +
53836 +HTMLS_INSTALL = libgomp
53837 +HTMLS_BUILD = libgomp/index.html
53838 +html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
53839
53840 # Automake Documentation:
53841 # If your package has Texinfo files in many directories, you can use the
53842 @@ -304,6 +309,7 @@ nodist_libsubinclude_HEADERS = omp.h
53843 # `texinfo.tex' for your package. The value of this variable should be
53844 # the relative path from the current `Makefile.am' to `texinfo.tex'.
53845 TEXINFO_TEX = ../gcc/doc/include/texinfo.tex
53846 +TEXI2HTML = $(MAKEINFO) --html
53847
53848 # Defines info, dvi, pdf and html targets
53849 MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include
53850 @@ -545,13 +551,10 @@ dist-info: $(INFO_DEPS)
53851 $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
53852 esac; \
53853 if test -f $$base; then d=.; else d=$(srcdir); fi; \
53854 - base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \
53855 - for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \
53856 - if test -f $$file; then \
53857 - relfile=`expr "$$file" : "$$d/\(.*\)"`; \
53858 - test -f $(distdir)/$$relfile || \
53859 - cp -p $$file $(distdir)/$$relfile; \
53860 - else :; fi; \
53861 + for file in $$d/$$base*; do \
53862 + relfile=`expr "$$file" : "$$d/\(.*\)"`; \
53863 + test -f $(distdir)/$$relfile || \
53864 + cp -p $$file $(distdir)/$$relfile; \
53865 done; \
53866 done
53867
53868 @@ -955,7 +958,8 @@ info: info-recursive
53869
53870 info-am: $(INFO_DEPS)
53871
53872 -install-data-am: install-info-am install-nodist_fincludeHEADERS \
53873 +install-data-am: install-data-local install-info-am \
53874 + install-nodist_fincludeHEADERS \
53875 install-nodist_libsubincludeHEADERS
53876
53877 install-exec-am: install-multi install-nodist_toolexeclibHEADERS \
53878 @@ -1035,9 +1039,9 @@ uninstall-info: uninstall-info-recursive
53879 distclean-multi distclean-recursive distclean-tags \
53880 distcleancheck distdir distuninstallcheck dvi dvi-am html \
53881 html-am info info-am install install-am install-data \
53882 - install-data-am install-exec install-exec-am install-info \
53883 - install-info-am install-man install-multi \
53884 - install-nodist_fincludeHEADERS \
53885 + install-data-am install-data-local install-exec \
53886 + install-exec-am install-info install-info-am install-man \
53887 + install-multi install-nodist_fincludeHEADERS \
53888 install-nodist_libsubincludeHEADERS \
53889 install-nodist_toolexeclibHEADERS install-strip \
53890 install-toolexeclibLTLIBRARIES installcheck installcheck-am \
53891 @@ -1064,9 +1068,26 @@ fortran.o: libgomp_f.h
53892 env.lo: libgomp_f.h
53893 env.o: libgomp_f.h
53894
53895 -# No install-html or install-pdf support in automake yet
53896 -.PHONY: install-html install-pdf
53897 -install-html:
53898 +$(HTMLS_BUILD): $(info_TEXINFOS)
53899 + $(TEXI2HTML) $(MAKEINFOFLAGS) -I$(srcdir) -o $(@D) $<
53900 +
53901 +install-data-local: install-html
53902 +install-html: $(HTMLS_BUILD)
53903 + @$(NORMAL_INSTALL)
53904 + test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)"
53905 + @list='$(HTMLS_INSTALL)'; for p in $$list; do \
53906 + if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
53907 + f=$(html__strip_dir) \
53908 + if test -d "$$d$$p"; then \
53909 + echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
53910 + $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
53911 + echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
53912 + $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
53913 + else \
53914 + echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
53915 + $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
53916 + fi; \
53917 + done
53918
53919 install-pdf: $(PDFS)
53920 @$(NORMAL_INSTALL)
53921 --- /dev/null
53922 +++ b/libgomp/config/linux/mips/futex.h
53923 @@ -0,0 +1,75 @@
53924 +/* Copyright (C) 2005, 2008 Free Software Foundation, Inc.
53925 + Contributed by Ilie Garbacea <ilie@mips.com>, Chao-ying Fu <fu@mips.com>.
53926 +
53927 + This file is part of the GNU OpenMP Library (libgomp).
53928 +
53929 + Libgomp is free software; you can redistribute it and/or modify it
53930 + under the terms of the GNU Lesser General Public License as published by
53931 + the Free Software Foundation; either version 2.1 of the License, or
53932 + (at your option) any later version.
53933 +
53934 + Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
53935 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
53936 + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
53937 + more details.
53938 +
53939 + You should have received a copy of the GNU Lesser General Public License
53940 + along with libgomp; see the file COPYING.LIB. If not, write to the
53941 + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
53942 + MA 02110-1301, USA. */
53943 +
53944 +/* As a special exception, if you link this library with other files, some
53945 + of which are compiled with GCC, to produce an executable, this library
53946 + does not by itself cause the resulting executable to be covered by the
53947 + GNU General Public License. This exception does not however invalidate
53948 + any other reasons why the executable file might be covered by the GNU
53949 + General Public License. */
53950 +
53951 +/* Provide target-specific access to the futex system call. */
53952 +
53953 +#include <sys/syscall.h>
53954 +#define FUTEX_WAIT 0
53955 +#define FUTEX_WAKE 1
53956 +
53957 +static inline void
53958 +sys_futex0 (int *addr, int op, int val)
53959 +{
53960 + register unsigned long __v0 asm("$2") = (unsigned long) SYS_futex;
53961 + register unsigned long __a0 asm("$4") = (unsigned long) addr;
53962 + register unsigned long __a1 asm("$5") = (unsigned long) op;
53963 + register unsigned long __a2 asm("$6") = (unsigned long) val;
53964 + register unsigned long __a3 asm("$7") = 0;
53965 +
53966 + __asm volatile ("syscall"
53967 + /* returns $a3 (errno), $v0 (return value) */
53968 + : "=r" (__v0), "=r" (__a3)
53969 + /* arguments in v0 (syscall) a0-a3 */
53970 + : "r" (__v0), "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a3)
53971 + /* clobbers at, v1, t0-t9, memory */
53972 + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", "$14",
53973 + "$15", "$24", "$25", "memory");
53974 +}
53975 +
53976 +static inline void
53977 +futex_wait (int *addr, int val)
53978 +{
53979 + sys_futex0 (addr, FUTEX_WAIT, val);
53980 +}
53981 +
53982 +static inline void
53983 +futex_wake (int *addr, int count)
53984 +{
53985 + sys_futex0 (addr, FUTEX_WAKE, count);
53986 +}
53987 +
53988 +static inline void
53989 +cpu_relax (void)
53990 +{
53991 + __asm volatile ("" : : : "memory");
53992 +}
53993 +
53994 +static inline void
53995 +atomic_write_barrier (void)
53996 +{
53997 + __sync_synchronize ();
53998 +}
53999 --- a/libgomp/configure
54000 +++ b/libgomp/configure
54001 @@ -457,7 +457,7 @@ ac_includes_default="\
54002 # include <unistd.h>
54003 #endif"
54004
54005 -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS GENINSRC_TRUE GENINSRC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar multi_basedir toolexecdir toolexeclibdir CC ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CFLAGS AR ac_ct_AR RANLIB ac_ct_RANLIB PERL BUILD_INFO_TRUE BUILD_INFO_FALSE LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S lt_ECHO CPP CPPFLAGS enable_shared enable_static MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT FC FCFLAGS LDFLAGS ac_ct_FC libtool_VERSION SECTION_LDFLAGS OPT_LDFLAGS LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE config_path XCFLAGS XLDFLAGS link_gomp USE_FORTRAN_TRUE USE_FORTRAN_FALSE OMP_LOCK_SIZE OMP_LOCK_ALIGN OMP_NEST_LOCK_SIZE OMP_NEST_LOCK_ALIGN OMP_LOCK_KIND OMP_NEST_LOCK_KIND LIBOBJS LTLIBOBJS'
54006 +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS GENINSRC_TRUE GENINSRC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar multi_basedir toolexecdir toolexeclibdir datarootdir docdir pdfdir htmldir CC ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CFLAGS AR ac_ct_AR RANLIB ac_ct_RANLIB PERL BUILD_INFO_TRUE BUILD_INFO_FALSE LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S lt_ECHO CPP CPPFLAGS enable_shared enable_static MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT FC FCFLAGS LDFLAGS ac_ct_FC libtool_VERSION SECTION_LDFLAGS OPT_LDFLAGS LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE config_path XCFLAGS XLDFLAGS link_gomp USE_FORTRAN_TRUE USE_FORTRAN_FALSE OMP_LOCK_SIZE OMP_LOCK_ALIGN OMP_NEST_LOCK_SIZE OMP_NEST_LOCK_ALIGN OMP_LOCK_KIND OMP_NEST_LOCK_KIND LIBOBJS LTLIBOBJS'
54007 ac_subst_files=''
54008
54009 # Initialize some variables set by options.
54010 @@ -1028,6 +1028,10 @@ Optional Features:
54011 Optional Packages:
54012 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
54013 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
54014 + --with-datarootdir=DIR Use DIR as the data root [PREFIX/share]
54015 + --with-docdir=DIR Install documentation in DIR [DATAROOTDIR]
54016 + --with-pdfdir install pdf in this directory.
54017 + --with-htmldir=DIR html documentation in in DIR [DOCDIR]
54018 --with-pic try to use only PIC/non-PIC objects [default=use
54019 both]
54020 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
54021 @@ -2174,6 +2178,46 @@ esac
54022
54023
54024
54025 +
54026 +# Check whether --with-datarootdir or --without-datarootdir was given.
54027 +if test "${with_datarootdir+set}" = set; then
54028 + withval="$with_datarootdir"
54029 + datarootdir="\${prefix}/$with_datarootdir"
54030 +else
54031 + datarootdir='$(prefix)/share'
54032 +fi;
54033 +
54034 +
54035 +
54036 +# Check whether --with-docdir or --without-docdir was given.
54037 +if test "${with_docdir+set}" = set; then
54038 + withval="$with_docdir"
54039 + docdir="\${prefix}/$with_docdir"
54040 +else
54041 + docdir='$(datarootdir)'
54042 +fi;
54043 +
54044 +
54045 +
54046 +# Check whether --with-pdfdir or --without-pdfdir was given.
54047 +if test "${with_pdfdir+set}" = set; then
54048 + withval="$with_pdfdir"
54049 + pdfdir="\${prefix}/${withval}"
54050 +else
54051 + pdfdir="\${docdir}"
54052 +fi;
54053 +
54054 +
54055 +
54056 +# Check whether --with-htmldir or --without-htmldir was given.
54057 +if test "${with_htmldir+set}" = set; then
54058 + withval="$with_htmldir"
54059 + htmldir="\${prefix}/$with_htmldir"
54060 +else
54061 + htmldir='$(docdir)'
54062 +fi;
54063 +
54064 +
54065 # Check the compiler.
54066 # The same as in boehm-gc and libstdc++. Have to borrow it from there.
54067 # We must force CC to /not/ be precious variables; otherwise
54068 @@ -4219,13 +4263,13 @@ if test "${lt_cv_nm_interface+set}" = se
54069 else
54070 lt_cv_nm_interface="BSD nm"
54071 echo "int some_variable = 0;" > conftest.$ac_ext
54072 - (eval echo "\"\$as_me:4242: $ac_compile\"" >&5)
54073 + (eval echo "\"\$as_me:4266: $ac_compile\"" >&5)
54074 (eval "$ac_compile" 2>conftest.err)
54075 cat conftest.err >&5
54076 - (eval echo "\"\$as_me:4245: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
54077 + (eval echo "\"\$as_me:4269: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
54078 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
54079 cat conftest.err >&5
54080 - (eval echo "\"\$as_me:4248: output\"" >&5)
54081 + (eval echo "\"\$as_me:4272: output\"" >&5)
54082 cat conftest.out >&5
54083 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
54084 lt_cv_nm_interface="MS dumpbin"
54085 @@ -5281,7 +5325,7 @@ ia64-*-hpux*)
54086 ;;
54087 *-*-irix6*)
54088 # Find out which ABI we are using.
54089 - echo '#line 5304 "configure"' > conftest.$ac_ext
54090 + echo '#line 5328 "configure"' > conftest.$ac_ext
54091 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
54092 (eval $ac_compile) 2>&5
54093 ac_status=$?
54094 @@ -6381,11 +6425,11 @@ else
54095 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
54096 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
54097 -e 's:$: $lt_compiler_flag:'`
54098 - (eval echo "\"\$as_me:6404: $lt_compile\"" >&5)
54099 + (eval echo "\"\$as_me:6428: $lt_compile\"" >&5)
54100 (eval "$lt_compile" 2>conftest.err)
54101 ac_status=$?
54102 cat conftest.err >&5
54103 - echo "$as_me:6408: \$? = $ac_status" >&5
54104 + echo "$as_me:6432: \$? = $ac_status" >&5
54105 if (exit $ac_status) && test -s "$ac_outfile"; then
54106 # The compiler can only warn and ignore the option if not recognized
54107 # So say no if there are warnings other than the usual output.
54108 @@ -6703,11 +6747,11 @@ else
54109 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
54110 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
54111 -e 's:$: $lt_compiler_flag:'`
54112 - (eval echo "\"\$as_me:6726: $lt_compile\"" >&5)
54113 + (eval echo "\"\$as_me:6750: $lt_compile\"" >&5)
54114 (eval "$lt_compile" 2>conftest.err)
54115 ac_status=$?
54116 cat conftest.err >&5
54117 - echo "$as_me:6730: \$? = $ac_status" >&5
54118 + echo "$as_me:6754: \$? = $ac_status" >&5
54119 if (exit $ac_status) && test -s "$ac_outfile"; then
54120 # The compiler can only warn and ignore the option if not recognized
54121 # So say no if there are warnings other than the usual output.
54122 @@ -6808,11 +6852,11 @@ else
54123 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
54124 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
54125 -e 's:$: $lt_compiler_flag:'`
54126 - (eval echo "\"\$as_me:6831: $lt_compile\"" >&5)
54127 + (eval echo "\"\$as_me:6855: $lt_compile\"" >&5)
54128 (eval "$lt_compile" 2>out/conftest.err)
54129 ac_status=$?
54130 cat out/conftest.err >&5
54131 - echo "$as_me:6835: \$? = $ac_status" >&5
54132 + echo "$as_me:6859: \$? = $ac_status" >&5
54133 if (exit $ac_status) && test -s out/conftest2.$ac_objext
54134 then
54135 # The compiler can only warn and ignore the option if not recognized
54136 @@ -6863,11 +6907,11 @@ else
54137 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
54138 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
54139 -e 's:$: $lt_compiler_flag:'`
54140 - (eval echo "\"\$as_me:6886: $lt_compile\"" >&5)
54141 + (eval echo "\"\$as_me:6910: $lt_compile\"" >&5)
54142 (eval "$lt_compile" 2>out/conftest.err)
54143 ac_status=$?
54144 cat out/conftest.err >&5
54145 - echo "$as_me:6890: \$? = $ac_status" >&5
54146 + echo "$as_me:6914: \$? = $ac_status" >&5
54147 if (exit $ac_status) && test -s out/conftest2.$ac_objext
54148 then
54149 # The compiler can only warn and ignore the option if not recognized
54150 @@ -9660,7 +9704,7 @@ else
54151 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
54152 lt_status=$lt_dlunknown
54153 cat > conftest.$ac_ext <<_LT_EOF
54154 -#line 9683 "configure"
54155 +#line 9707 "configure"
54156 #include "confdefs.h"
54157
54158 #if HAVE_DLFCN_H
54159 @@ -9760,7 +9804,7 @@ else
54160 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
54161 lt_status=$lt_dlunknown
54162 cat > conftest.$ac_ext <<_LT_EOF
54163 -#line 9783 "configure"
54164 +#line 9807 "configure"
54165 #include "confdefs.h"
54166
54167 #if HAVE_DLFCN_H
54168 @@ -10115,7 +10159,7 @@ fi
54169
54170
54171 # Provide some information about the compiler.
54172 -echo "$as_me:10138:" \
54173 +echo "$as_me:10162:" \
54174 "checking for Fortran compiler version" >&5
54175 ac_compiler=`set X $ac_compile; echo $2`
54176 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
54177 @@ -10351,7 +10395,7 @@ fi
54178
54179
54180 # Provide some information about the compiler.
54181 -echo "$as_me:10374:" \
54182 +echo "$as_me:10398:" \
54183 "checking for Fortran compiler version" >&5
54184 ac_compiler=`set X $ac_compile; echo $2`
54185 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
54186 @@ -11067,11 +11111,11 @@ else
54187 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
54188 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
54189 -e 's:$: $lt_compiler_flag:'`
54190 - (eval echo "\"\$as_me:11090: $lt_compile\"" >&5)
54191 + (eval echo "\"\$as_me:11114: $lt_compile\"" >&5)
54192 (eval "$lt_compile" 2>conftest.err)
54193 ac_status=$?
54194 cat conftest.err >&5
54195 - echo "$as_me:11094: \$? = $ac_status" >&5
54196 + echo "$as_me:11118: \$? = $ac_status" >&5
54197 if (exit $ac_status) && test -s "$ac_outfile"; then
54198 # The compiler can only warn and ignore the option if not recognized
54199 # So say no if there are warnings other than the usual output.
54200 @@ -11166,11 +11210,11 @@ else
54201 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
54202 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
54203 -e 's:$: $lt_compiler_flag:'`
54204 - (eval echo "\"\$as_me:11189: $lt_compile\"" >&5)
54205 + (eval echo "\"\$as_me:11213: $lt_compile\"" >&5)
54206 (eval "$lt_compile" 2>out/conftest.err)
54207 ac_status=$?
54208 cat out/conftest.err >&5
54209 - echo "$as_me:11193: \$? = $ac_status" >&5
54210 + echo "$as_me:11217: \$? = $ac_status" >&5
54211 if (exit $ac_status) && test -s out/conftest2.$ac_objext
54212 then
54213 # The compiler can only warn and ignore the option if not recognized
54214 @@ -11218,11 +11262,11 @@ else
54215 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
54216 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
54217 -e 's:$: $lt_compiler_flag:'`
54218 - (eval echo "\"\$as_me:11241: $lt_compile\"" >&5)
54219 + (eval echo "\"\$as_me:11265: $lt_compile\"" >&5)
54220 (eval "$lt_compile" 2>out/conftest.err)
54221 ac_status=$?
54222 cat out/conftest.err >&5
54223 - echo "$as_me:11245: \$? = $ac_status" >&5
54224 + echo "$as_me:11269: \$? = $ac_status" >&5
54225 if (exit $ac_status) && test -s out/conftest2.$ac_objext
54226 then
54227 # The compiler can only warn and ignore the option if not recognized
54228 @@ -16777,7 +16821,7 @@ fi
54229 rm -f conftest.err conftest.$ac_objext \
54230 conftest$ac_exeext conftest.$ac_ext
54231 ;;
54232 - yes)
54233 + yes)
54234 cat >conftest.$ac_ext <<_ACEOF
54235 /* confdefs.h. */
54236 _ACEOF
54237 @@ -20485,6 +20529,10 @@ s,@am__untar@,$am__untar,;t t
54238 s,@multi_basedir@,$multi_basedir,;t t
54239 s,@toolexecdir@,$toolexecdir,;t t
54240 s,@toolexeclibdir@,$toolexeclibdir,;t t
54241 +s,@datarootdir@,$datarootdir,;t t
54242 +s,@docdir@,$docdir,;t t
54243 +s,@pdfdir@,$pdfdir,;t t
54244 +s,@htmldir@,$htmldir,;t t
54245 s,@CC@,$CC,;t t
54246 s,@ac_ct_CC@,$ac_ct_CC,;t t
54247 s,@EXEEXT@,$EXEEXT,;t t
54248 --- a/libgomp/configure.ac
54249 +++ b/libgomp/configure.ac
54250 @@ -94,6 +94,30 @@ esac
54251 AC_SUBST(toolexecdir)
54252 AC_SUBST(toolexeclibdir)
54253
54254 +AC_ARG_WITH(datarootdir,
54255 +[ --with-datarootdir=DIR Use DIR as the data root [[PREFIX/share]]],
54256 +datarootdir="\${prefix}/$with_datarootdir",
54257 +datarootdir='$(prefix)/share')
54258 +AC_SUBST(datarootdir)
54259 +
54260 +AC_ARG_WITH(docdir,
54261 +[ --with-docdir=DIR Install documentation in DIR [[DATAROOTDIR]]],
54262 +docdir="\${prefix}/$with_docdir",
54263 +docdir='$(datarootdir)')
54264 +AC_SUBST(docdir)
54265 +
54266 +AC_ARG_WITH(pdfdir,
54267 +[ --with-pdfdir install pdf in this directory.],
54268 +[pdfdir="\${prefix}/${withval}"],
54269 +[pdfdir="\${docdir}"])
54270 +AC_SUBST(pdfdir)
54271 +
54272 +AC_ARG_WITH(htmldir,
54273 +[ --with-htmldir=DIR html documentation in in DIR [[DOCDIR]]],
54274 +htmldir="\${prefix}/$with_htmldir",
54275 +htmldir='$(docdir)')
54276 +AC_SUBST(htmldir)
54277 +
54278 # Check the compiler.
54279 # The same as in boehm-gc and libstdc++. Have to borrow it from there.
54280 # We must force CC to /not/ be precious variables; otherwise
54281 --- a/libgomp/configure.tgt
54282 +++ b/libgomp/configure.tgt
54283 @@ -35,6 +35,10 @@ if test $enable_linux_futex = yes; then
54284 config_path="linux/ia64 linux posix"
54285 ;;
54286
54287 + mips*-*-linux*)
54288 + config_path="linux/mips linux posix"
54289 + ;;
54290 +
54291 powerpc*-*-linux*)
54292 config_path="linux/powerpc linux posix"
54293 ;;
54294 --- a/libgomp/libgomp.texi
54295 +++ b/libgomp/libgomp.texi
54296 @@ -95,7 +95,7 @@ for multi-platform shared-memory paralle
54297 How you can copy and share this manual.
54298 * Funding:: How to help assure continued work for free
54299 software.
54300 -* Index:: Index of this documentation.
54301 +* Library Index:: Index of this documentation.
54302 @end menu
54303
54304
54305 @@ -1367,8 +1367,8 @@ Bugs in the GNU OpenMP implementation sh
54306 @c Index
54307 @c ---------------------------------------------------------------------
54308
54309 -@node Index
54310 -@unnumbered Index
54311 +@node Library Index
54312 +@unnumbered Library Index
54313
54314 @printindex cp
54315
54316 --- a/libiberty/Makefile.in
54317 +++ b/libiberty/Makefile.in
54318 @@ -124,7 +124,7 @@ COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS)
54319 CFILES = alloca.c argv.c asprintf.c atexit.c \
54320 basename.c bcmp.c bcopy.c bsearch.c bzero.c \
54321 calloc.c choose-temp.c clock.c concat.c cp-demangle.c \
54322 - cp-demint.c cplus-dem.c \
54323 + cp-demint.c cplus-dem.c cygpath.c \
54324 dyn-string.c \
54325 fdmatch.c ffs.c fibheap.c filename_cmp.c floatformat.c \
54326 fnmatch.c fopen_unlocked.c \
54327 @@ -180,7 +180,7 @@ REQUIRED_OFILES = ./regex.o ./cplus-dem.
54328 # maint-missing" and "make check".
54329 CONFIGURED_OFILES = ./asprintf.o ./atexit.o \
54330 ./basename.o ./bcmp.o ./bcopy.o ./bsearch.o ./bzero.o \
54331 - ./calloc.o ./clock.o ./copysign.o \
54332 + ./calloc.o ./clock.o ./copysign.o ./cygpath.o \
54333 ./_doprnt.o \
54334 ./ffs.o \
54335 ./getcwd.o ./getpagesize.o ./gettimeofday.o \
54336 @@ -615,6 +615,13 @@ $(CONFIGURED_OFILES): stamp-picdir
54337 else true; fi
54338 $(COMPILE.c) $(srcdir)/cplus-dem.c $(OUTPUT_OPTION)
54339
54340 +./cygpath.o: $(srcdir)/cygpath.c stamp-h $(INCDIR)/ansidecl.h \
54341 + $(INCDIR)/libiberty.h
54342 + if [ x"$(PICFLAG)" != x ]; then \
54343 + $(COMPILE.c) $(PICFLAG) $(srcdir)/cygpath.c -o pic/$@; \
54344 + else true; fi
54345 + $(COMPILE.c) $(srcdir)/cygpath.c $(OUTPUT_OPTION)
54346 +
54347 ./dyn-string.o: $(srcdir)/dyn-string.c stamp-h $(INCDIR)/ansidecl.h \
54348 $(INCDIR)/dyn-string.h $(INCDIR)/libiberty.h
54349 if [ x"$(PICFLAG)" != x ]; then \
54350 --- a/libiberty/configure
54351 +++ b/libiberty/configure
54352 @@ -8524,6 +8524,20 @@ case "${host}" in
54353 esac
54354
54355
54356 +# On MinGW, add support for Cygwin paths.
54357 +case "${host}" in
54358 + *-*-mingw*)
54359 + case $LIBOBJS in
54360 + "cygpath.$ac_objext" | \
54361 + *" cygpath.$ac_objext" | \
54362 + "cygpath.$ac_objext "* | \
54363 + *" cygpath.$ac_objext "* ) ;;
54364 + *) LIBOBJS="$LIBOBJS cygpath.$ac_objext" ;;
54365 +esac
54366 +
54367 + ;;
54368 +esac
54369 +
54370 if test x$gcc_no_link = xyes; then
54371 if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
54372 ac_cv_func_mmap_fixed_mapped=no
54373 --- a/libiberty/configure.ac
54374 +++ b/libiberty/configure.ac
54375 @@ -686,6 +686,13 @@ case "${host}" in
54376 esac
54377 AC_SUBST(pexecute)
54378
54379 +# On MinGW, add support for Cygwin paths.
54380 +case "${host}" in
54381 + *-*-mingw*)
54382 + AC_LIBOBJ([cygpath])
54383 + ;;
54384 +esac
54385 +
54386 libiberty_AC_FUNC_STRNCMP
54387
54388 # Install a library built with a cross compiler in $(tooldir) rather
54389 --- a/libiberty/cp-demangle.c
54390 +++ b/libiberty/cp-demangle.c
54391 @@ -1885,6 +1885,11 @@ cplus_demangle_builtin_types[D_BUILTIN_T
54392 };
54393
54394 CP_STATIC_IF_GLIBCPP_V3
54395 +const struct demangle_builtin_type_info
54396 +cplus_demangle_builtin_Dh_type =
54397 + { NL ("__fp16"), NL ("__fp16"), D_PRINT_DEFAULT };
54398 +
54399 +CP_STATIC_IF_GLIBCPP_V3
54400 struct demangle_component *
54401 cplus_demangle_type (struct d_info *di)
54402 {
54403 @@ -1936,6 +1941,21 @@ cplus_demangle_type (struct d_info *di)
54404 d_advance (di, 1);
54405 break;
54406
54407 + case 'D':
54408 + d_advance (di, 1);
54409 + switch (d_peek_char (di))
54410 + {
54411 + case 'h':
54412 + ret = d_make_builtin_type (di, &cplus_demangle_builtin_Dh_type);
54413 + di->expansion += ret->u.s_builtin.type->len;
54414 + can_subst = 0;
54415 + d_advance (di, 1);
54416 + break;
54417 + default:
54418 + return NULL;
54419 + }
54420 + break;
54421 +
54422 case 'u':
54423 d_advance (di, 1);
54424 ret = d_make_comp (di, DEMANGLE_COMPONENT_VENDOR_TYPE,
54425 --- /dev/null
54426 +++ b/libiberty/cygpath.c
54427 @@ -0,0 +1,591 @@
54428 +/* Support Cygwin paths under MinGW.
54429 + Copyright (C) 2006 Free Software Foundation, Inc.
54430 + Written by CodeSourcery.
54431 +
54432 +This file is part of the libiberty library.
54433 +Libiberty is free software; you can redistribute it and/or modify it
54434 +under the terms of the GNU Library General Public License as published
54435 +by the Free Software Foundation; either version 2 of the License, or
54436 +(at your option) any later version.
54437 +
54438 +Libiberty is distributed in the hope that it will be useful,
54439 +but WITHOUT ANY WARRANTY; without even the implied warranty of
54440 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
54441 +Library General Public License for more details.
54442 +
54443 +You should have received a copy of the GNU Library General Public
54444 +License along with libiberty; see the file COPYING.LIB. If not, write
54445 +to the Free Software Foundation, Inc., 51 Franklin Street - Fifth
54446 +Floor, Boston, MA 02110-1301, USA. */
54447 +
54448 +#include <windows.h>
54449 +#include <errno.h>
54450 +#include <fcntl.h>
54451 +#include <sys/stat.h>
54452 +#include <sys/types.h>
54453 +#include <io.h>
54454 +#include <process.h>
54455 +#include <stdbool.h>
54456 +#include <stdio.h>
54457 +#include <stdlib.h>
54458 +#include "libiberty.h"
54459 +
54460 +/* If non-zero, we have attempted to use cygpath. CYGPATH_PEX may
54461 + still be NULL, if cygpath is unavailable. */
54462 +static int cygpath_initialized;
54463 +
54464 +/* If non-NULL, an instance of cygpath connected via a pipe. */
54465 +static struct pex_obj *cygpath_pex;
54466 +
54467 +/* The input to cygpath. */
54468 +static FILE *cygpath_in;
54469 +
54470 +/* The output from cygpath. */
54471 +static FILE *cygpath_out;
54472 +
54473 +/* If non-NULL, a file to which path translations are logged. */
54474 +static FILE *cygpath_log;
54475 +
54476 +/* Record MESSAGE in the CYGPATH_LOG. MESSAGE is a format string,
54477 + which is expected to have a single "%s" field, to be replaced by
54478 + ARG. */
54479 +static void
54480 +cygpath_log_msg_arg (const char *message, const char *arg)
54481 +{
54482 + if (!cygpath_log)
54483 + return;
54484 + fprintf (cygpath_log, "[%d] cygpath: ", _getpid ());
54485 + fprintf (cygpath_log, message, arg);
54486 + fprintf (cygpath_log, "\n");
54487 + fflush (cygpath_log);
54488 +}
54489 +
54490 +/* Record MESSAGE in the CYGPATH_LOG. */
54491 +static void
54492 +cygpath_log_msg (const char *message)
54493 +{
54494 + cygpath_log_msg_arg ("%s", message);
54495 +}
54496 +
54497 +/* An error has occured. Add the MESSAGE to the CYGPATH_LOG, noting
54498 + the cause of the error based on errno. */
54499 +static void
54500 +cygpath_perror (const char *message)
54501 +{
54502 + if (!cygpath_log)
54503 + return;
54504 + fprintf (cygpath_log, "[%d] cygpath: error: %s: %s\n",
54505 + _getpid(), message, strerror (errno));
54506 + fflush (cygpath_log);
54507 +}
54508 +
54509 +/* Closes CYGPATH_PEX and frees all associated
54510 + resoures. */
54511 +static void
54512 +cygpath_close (void)
54513 +{
54514 + /* Free resources. */
54515 + if (cygpath_out)
54516 + {
54517 + fclose (cygpath_out);
54518 + cygpath_out = NULL;
54519 + }
54520 + if (cygpath_in)
54521 + {
54522 + fclose (cygpath_in);
54523 + cygpath_in = NULL;
54524 + }
54525 + if (cygpath_pex)
54526 + {
54527 + pex_free (cygpath_pex);
54528 + cygpath_pex = NULL;
54529 + }
54530 + if (cygpath_log)
54531 + {
54532 + cygpath_log_msg ("end");
54533 + cygpath_log = NULL;
54534 + }
54535 +}
54536 +
54537 +/* CYG_PATH is a pointer to a Cygwin path. This function converts the
54538 + Cygwin path to a Windows path, storing the result in
54539 + WIN32_PATH. Returns true if the conversion was successful; false
54540 + otherwise. */
54541 +int
54542 +cygpath (const char *cyg_path, char win32_path[MAX_PATH + 1])
54543 +{
54544 + bool ok;
54545 + bool retrying;
54546 +
54547 + /* Special-case the empty path. cygpath cannot handle the empty
54548 + path correctly. It ignores the empty line, waiting for a
54549 + non-empty line, which in turn causes an application using this
54550 + function to appear stuck. */
54551 + if (cyg_path[0] == '\0')
54552 + {
54553 + win32_path[0] = '\0';
54554 + return true;
54555 + }
54556 +
54557 + retrying = false;
54558 +
54559 + retry:
54560 + if (!cygpath_initialized)
54561 + {
54562 + const char *argv[] = { "cygpath", "-w", "-f", "-", NULL };
54563 + const char *cygpath_path;
54564 + const char *log;
54565 + int err;
54566 +
54567 + /* If we are unable to invoke cygpath, we do not want to try
54568 + again. So, we set the initialized flag at this point; if
54569 + errors occur during the invocation, it will remain set. */
54570 + cygpath_initialized = 1;
54571 + /* Check to see if the user wants cygpath support. */
54572 + cygpath_path = getenv ("CYGPATH");
54573 + if (!cygpath_path)
54574 + /* The user doesn't need to support Cygwin paths. */
54575 + goto error;
54576 + /* If debugging, open the log file. */
54577 + log = getenv ("CSL_DEBUG_CYGPATH");
54578 + if (log && log[0])
54579 + {
54580 + /* The log file is opened for "append" so that multiple
54581 + processes (perhaps invoked from "make") can share it. */
54582 + cygpath_log = fopen (log, "a");
54583 + if (cygpath_log)
54584 + cygpath_log_msg ("begin");
54585 + }
54586 + /* If the environment variable is set to a non-empty string, use
54587 + that string as the path to cygpath. */
54588 + if (cygpath_path[0] != '\0')
54589 + argv[0] = cygpath_path;
54590 + /* Create the pex object. */
54591 + cygpath_pex = pex_init (PEX_SEARCH | PEX_USE_PIPES,
54592 + "cygpath", NULL);
54593 + if (!cygpath_pex)
54594 + goto error;
54595 + /* Get the FILE we will use to write to the child. */
54596 + cygpath_in = pex_input_pipe (cygpath_pex, /*binary=*/0);
54597 + if (!cygpath_in)
54598 + goto error;
54599 + /* Start the child process. */
54600 + if (pex_run (cygpath_pex, PEX_SEARCH | PEX_USE_PIPES,
54601 + argv[0], (char**) argv,
54602 + NULL, NULL,
54603 + &err) != NULL)
54604 + goto error;
54605 + /* Get the FILE we will use to read from the child. */
54606 + cygpath_out = pex_read_output (cygpath_pex, /*binary=*/1);
54607 + if (!cygpath_out)
54608 + goto error;
54609 + }
54610 + else if (!cygpath_pex)
54611 + /* We previously tried to use cygpath, but something went wrong. */
54612 + return false;
54613 +
54614 + /* Write CYG_PATH to the child, on a line by itself. */
54615 + cygpath_log_msg_arg ("-> %s", cyg_path);
54616 + if (fprintf (cygpath_in, "%s\n", cyg_path) < 0)
54617 + {
54618 + cygpath_perror ("write failed");
54619 + goto error;
54620 + }
54621 + /* Flush the output. (We cannot set the stream into line-buffered
54622 + mode with setvbuf because Windows treats _IOLBF as a synonym for
54623 + _IOFBF.) */
54624 + if (fflush (cygpath_in))
54625 + cygpath_perror ("flush failed");
54626 + /* Read the output. */
54627 + ok = true;
54628 + while (1)
54629 + {
54630 + size_t pathlen;
54631 + if (!fgets (win32_path, MAX_PATH, cygpath_out))
54632 + {
54633 + if (ferror (cygpath_out))
54634 + cygpath_perror ("read failed");
54635 + else
54636 + {
54637 + cygpath_log_msg ("error: EOF");
54638 + /* Unfortunately, cygpath sometimes crashes for no
54639 + apparent reason. We give it two chances... */
54640 + if (!retrying)
54641 + {
54642 + retrying = true;
54643 + cygpath_log_msg ("retrying");
54644 + cygpath_close ();
54645 + cygpath_initialized = 0;
54646 + goto retry;
54647 + }
54648 + }
54649 + goto error;
54650 + }
54651 + pathlen = strlen (win32_path);
54652 + if (pathlen == 0 && ok)
54653 + /* This isn't a well-formed response from cygpath. */
54654 + goto error;
54655 + if (win32_path[pathlen - 1] == '\n')
54656 + {
54657 + win32_path[pathlen - 1] = '\0';
54658 + cygpath_log_msg_arg ("<- %s", win32_path);
54659 + break;
54660 + }
54661 + /* We didn't reach the end of the line. There's no point in
54662 + trying to use this output, since we know the length of
54663 + paths are limited to MAX_PATH characters, but we read the
54664 + entire line so that we are still in sync with
54665 + cygpath. */
54666 + ok = false;
54667 + if (cygpath_log)
54668 + cygpath_log_msg_arg ("error: invalid response: %s",
54669 + win32_path);
54670 + }
54671 +
54672 + return ok;
54673 +
54674 + error:
54675 + cygpath_close();
54676 + return false;
54677 +}
54678 +
54679 +/* Returns the handle for the MVCRT DLL, or NULL if it is not
54680 + available. */
54681 +static HMODULE
54682 +msvcrt_dll (void)
54683 +{
54684 + static HMODULE dll = (HMODULE)(-1);
54685 +
54686 + /* After we call LoadLibrary, DLL will be either a valid handle or
54687 + NULL, so this check ensures that we only try to load the library
54688 + once. */
54689 + if (dll == (HMODULE)(-1))
54690 + dll = LoadLibrary ("msvcrt.dll");
54691 +
54692 + return dll;
54693 +}
54694 +
54695 +/* Call the underlying MSVCRT fopen with PATH and MODE, and return
54696 + what it returns. */
54697 +static FILE *
54698 +msvcrt_fopen (const char *path, const char *mode)
54699 +{
54700 + typedef FILE *(fopen_type)(const char *path,
54701 + const char *mode);
54702 +
54703 + static fopen_type *f = NULL;
54704 +
54705 + /* Get the address of "fopen". */
54706 + if (!f)
54707 + {
54708 + HMODULE dll = msvcrt_dll ();
54709 + if (!dll)
54710 + {
54711 + errno = ENOSYS;
54712 + return NULL;
54713 + }
54714 + f = (fopen_type *) GetProcAddress (dll, "fopen");
54715 + if (!f)
54716 + {
54717 + errno = ENOSYS;
54718 + return NULL;
54719 + }
54720 + }
54721 +
54722 + /* Call fopen. */
54723 + return (*f)(path, mode);
54724 +}
54725 +
54726 +FILE *
54727 +fopen (const char *path, const char *mode)
54728 +{
54729 + FILE *f;
54730 + char win32_path[MAX_PATH + 1];
54731 +
54732 + /* Assume PATH is a Windows path. */
54733 + f = msvcrt_fopen (path, mode);
54734 + if (f || errno != ENOENT)
54735 + return f;
54736 + /* Perhaps it is a Cygwin path? */
54737 + if (cygpath (path, win32_path))
54738 + f = msvcrt_fopen (win32_path, mode);
54739 + return f;
54740 +}
54741 +
54742 +int
54743 +open (const char *path, int oflag, ...)
54744 +{
54745 + int fd;
54746 + char win32_path[MAX_PATH + 1];
54747 + int pmode = 0;
54748 +
54749 + if ((oflag & _O_CREAT))
54750 + {
54751 + va_list ap;
54752 + va_start (ap, oflag);
54753 + pmode = va_arg (ap, int);
54754 + va_end (ap);
54755 + }
54756 +
54757 + /* Assume PATH is a Windows path. */
54758 + fd = _open (path, oflag, pmode);
54759 + if (fd != -1 || errno != ENOENT)
54760 + return fd;
54761 + /* Perhaps it is a Cygwin path? */
54762 + if (cygpath (path, win32_path))
54763 + fd = _open (win32_path, oflag, pmode);
54764 + return fd;
54765 +}
54766 +
54767 +int
54768 +stat (const char *path, struct stat *buffer)
54769 +{
54770 + int r;
54771 + char win32_path[MAX_PATH + 1];
54772 +
54773 + /* Assume PATH is a Windows path. */
54774 + r = _stat (path, (struct _stat *) buffer);
54775 + if (r != -1 || errno != ENOENT)
54776 + return r;
54777 + /* Perhaps it is a Cygwin path? */
54778 + if (cygpath (path, win32_path))
54779 + r = _stat (win32_path, (struct _stat *) buffer);
54780 + return r;
54781 +}
54782 +
54783 +int
54784 +access (const char *path, int mode)
54785 +{
54786 + int r;
54787 + char win32_path[MAX_PATH + 1];
54788 +
54789 +#ifdef _WIN32
54790 + /* Some GNU tools mistakenly defined X_OK to 1 on Windows. */
54791 + mode = mode & ~1;
54792 +#endif
54793 + /* Assume PATH is a Windows path. */
54794 + r = _access (path, mode);
54795 + if (r != -1 || errno != ENOENT)
54796 + return r;
54797 + /* Perhaps it is a Cygwin path? */
54798 + if (cygpath (path, win32_path))
54799 + r = _access (win32_path, mode);
54800 + return r;
54801 +}
54802 +
54803 +/* Given the WINDOWS_CODE (typically the result of GetLastError), set
54804 + ERRNO to the corresponding error code. If there is no obvious
54805 + correspondence, ERRNO will be set to EACCES. */
54806 +static void
54807 +set_errno_from_windows_code (DWORD windows_code)
54808 +{
54809 + int mapping[][2] = {
54810 + {ERROR_ACCESS_DENIED, EACCES},
54811 + {ERROR_ACCOUNT_DISABLED, EACCES},
54812 + {ERROR_ACCOUNT_RESTRICTION, EACCES},
54813 + {ERROR_ALREADY_ASSIGNED, EBUSY},
54814 + {ERROR_ALREADY_EXISTS, EEXIST},
54815 + {ERROR_ARITHMETIC_OVERFLOW, ERANGE},
54816 + {ERROR_BAD_COMMAND, EIO},
54817 + {ERROR_BAD_DEVICE, ENODEV},
54818 + {ERROR_BAD_DRIVER_LEVEL, ENXIO},
54819 + {ERROR_BAD_EXE_FORMAT, ENOEXEC},
54820 + {ERROR_BAD_FORMAT, ENOEXEC},
54821 + {ERROR_BAD_LENGTH, EINVAL},
54822 + {ERROR_BAD_PATHNAME, ENOENT},
54823 + {ERROR_BAD_PIPE, EPIPE},
54824 + {ERROR_BAD_UNIT, ENODEV},
54825 + {ERROR_BAD_USERNAME, EINVAL},
54826 + {ERROR_BROKEN_PIPE, EPIPE},
54827 + {ERROR_BUFFER_OVERFLOW, ENOMEM},
54828 + {ERROR_BUSY, EBUSY},
54829 + {ERROR_BUSY_DRIVE, EBUSY},
54830 + {ERROR_CALL_NOT_IMPLEMENTED, ENOSYS},
54831 + {ERROR_CRC, EIO},
54832 + {ERROR_CURRENT_DIRECTORY, EINVAL},
54833 + {ERROR_DEVICE_IN_USE, EBUSY},
54834 + {ERROR_DIR_NOT_EMPTY, EEXIST},
54835 + {ERROR_DIRECTORY, ENOENT},
54836 + {ERROR_DISK_CHANGE, EIO},
54837 + {ERROR_DISK_FULL, ENOSPC},
54838 + {ERROR_DRIVE_LOCKED, EBUSY},
54839 + {ERROR_ENVVAR_NOT_FOUND, EINVAL},
54840 + {ERROR_EXE_MARKED_INVALID, ENOEXEC},
54841 + {ERROR_FILE_EXISTS, EEXIST},
54842 + {ERROR_FILE_INVALID, ENODEV},
54843 + {ERROR_FILE_NOT_FOUND, ENOENT},
54844 + {ERROR_FILENAME_EXCED_RANGE, ENAMETOOLONG},
54845 + {ERROR_GEN_FAILURE, EIO},
54846 + {ERROR_HANDLE_DISK_FULL, ENOSPC},
54847 + {ERROR_INSUFFICIENT_BUFFER, ENOMEM},
54848 + {ERROR_INVALID_ACCESS, EINVAL},
54849 + {ERROR_INVALID_ADDRESS, EFAULT},
54850 + {ERROR_INVALID_BLOCK, EFAULT},
54851 + {ERROR_INVALID_DATA, EINVAL},
54852 + {ERROR_INVALID_DRIVE, ENODEV},
54853 + {ERROR_INVALID_EXE_SIGNATURE, ENOEXEC},
54854 + {ERROR_INVALID_FLAGS, EINVAL},
54855 + {ERROR_INVALID_FUNCTION, ENOSYS},
54856 + {ERROR_INVALID_HANDLE, EBADF},
54857 + {ERROR_INVALID_LOGON_HOURS, EACCES},
54858 + {ERROR_INVALID_NAME, ENOENT},
54859 + {ERROR_INVALID_OWNER, EINVAL},
54860 + {ERROR_INVALID_PARAMETER, EINVAL},
54861 + {ERROR_INVALID_PASSWORD, EPERM},
54862 + {ERROR_INVALID_PRIMARY_GROUP, EINVAL},
54863 + {ERROR_INVALID_SIGNAL_NUMBER, EINVAL},
54864 + {ERROR_INVALID_TARGET_HANDLE, EIO},
54865 + {ERROR_INVALID_WORKSTATION, EACCES},
54866 + {ERROR_IO_DEVICE, EIO},
54867 + {ERROR_IO_INCOMPLETE, EINTR},
54868 + {ERROR_LOCKED, EBUSY},
54869 + {ERROR_LOGON_FAILURE, EACCES},
54870 + {ERROR_MAPPED_ALIGNMENT, EINVAL},
54871 + {ERROR_META_EXPANSION_TOO_LONG, E2BIG},
54872 + {ERROR_MORE_DATA, EPIPE},
54873 + {ERROR_NEGATIVE_SEEK, ESPIPE},
54874 + {ERROR_NO_DATA, EPIPE},
54875 + {ERROR_NO_MORE_SEARCH_HANDLES, EIO},
54876 + {ERROR_NO_PROC_SLOTS, EAGAIN},
54877 + {ERROR_NO_SUCH_PRIVILEGE, EACCES},
54878 + {ERROR_NOACCESS, EFAULT},
54879 + {ERROR_NONE_MAPPED, EINVAL},
54880 + {ERROR_NOT_ENOUGH_MEMORY, ENOMEM},
54881 + {ERROR_NOT_READY, ENODEV},
54882 + {ERROR_NOT_SAME_DEVICE, EXDEV},
54883 + {ERROR_OPEN_FAILED, EIO},
54884 + {ERROR_OPERATION_ABORTED, EINTR},
54885 + {ERROR_OUTOFMEMORY, ENOMEM},
54886 + {ERROR_PASSWORD_EXPIRED, EACCES},
54887 + {ERROR_PATH_BUSY, EBUSY},
54888 + {ERROR_PATH_NOT_FOUND, ENOTDIR},
54889 + {ERROR_PIPE_BUSY, EBUSY},
54890 + {ERROR_PIPE_CONNECTED, EPIPE},
54891 + {ERROR_PIPE_LISTENING, EPIPE},
54892 + {ERROR_PIPE_NOT_CONNECTED, EPIPE},
54893 + {ERROR_PRIVILEGE_NOT_HELD, EACCES},
54894 + {ERROR_READ_FAULT, EIO},
54895 + {ERROR_SEEK, ESPIPE},
54896 + {ERROR_SEEK_ON_DEVICE, ESPIPE},
54897 + {ERROR_SHARING_BUFFER_EXCEEDED, ENFILE},
54898 + {ERROR_STACK_OVERFLOW, ENOMEM},
54899 + {ERROR_SWAPERROR, ENOENT},
54900 + {ERROR_TOO_MANY_MODULES, EMFILE},
54901 + {ERROR_TOO_MANY_OPEN_FILES, EMFILE},
54902 + {ERROR_UNRECOGNIZED_MEDIA, ENXIO},
54903 + {ERROR_UNRECOGNIZED_VOLUME, ENODEV},
54904 + {ERROR_WAIT_NO_CHILDREN, ECHILD},
54905 + {ERROR_WRITE_FAULT, EIO},
54906 + {ERROR_WRITE_PROTECT, EROFS}
54907 +/* MinGW does not define ETXTBSY as yet.
54908 + {ERROR_LOCK_VIOLATION, ETXTBSY},
54909 + {ERROR_SHARING_VIOLATION, ETXTBSY},
54910 +*/
54911 + };
54912 +
54913 + size_t i;
54914 +
54915 + for (i = 0; i < sizeof (mapping)/sizeof (mapping[0]); ++i)
54916 + if (mapping[i][0] == windows_code)
54917 + {
54918 + errno = mapping[i][1];
54919 + return;
54920 + }
54921 +
54922 + /* Unrecognized error. Use EACCESS to have some error code,
54923 + not misleading "No error" thing. */
54924 + errno = EACCES;
54925 +}
54926 +
54927 +int rename (const char *oldpath, const char *newpath)
54928 +{
54929 + BOOL r;
54930 + int oldpath_converted = 0;
54931 + char win32_oldpath[MAX_PATH + 1];
54932 + char win32_newpath[MAX_PATH + 1];
54933 +
54934 + /* Older versions of the cygpath program called FindFirstFile, but
54935 + not FindClose. As a result, a long-running cygpath program ends
54936 + up leaking these handles, and, as a result, the Windows kernel
54937 + will not let us remove or rename things in directories. Therefore,
54938 + we kill the child cygpath program now.
54939 +
54940 + The defect in cygpath was corrected by this patch:
54941 +
54942 + http://cygwin.com/ml/cygwin-patches/2007-q1/msg00033.html
54943 +
54944 + but older versions of cygpath will be in use for the forseeable
54945 + future. */
54946 +
54947 + cygpath_close ();
54948 + cygpath_initialized = 0;
54949 +
54950 + /* Assume all paths are Windows paths. */
54951 + r = MoveFileEx (oldpath, newpath, MOVEFILE_REPLACE_EXISTING);
54952 + if (r)
54953 + return 0;
54954 + else if (GetLastError () != ERROR_PATH_NOT_FOUND)
54955 + goto error;
54956 +
54957 + /* Perhaps the old path is a cygwin path? */
54958 + if (cygpath (oldpath, win32_oldpath))
54959 + {
54960 + oldpath_converted = 1;
54961 + r = MoveFileEx (win32_oldpath, newpath, MOVEFILE_REPLACE_EXISTING);
54962 + if (r)
54963 + return 0;
54964 + else if (GetLastError () != ERROR_PATH_NOT_FOUND)
54965 + goto error;
54966 + }
54967 +
54968 + /* Perhaps the new path is a cygwin path? */
54969 + if (cygpath (newpath, win32_newpath))
54970 + {
54971 + r = MoveFileEx (oldpath_converted ? win32_oldpath : oldpath,
54972 + win32_newpath, MOVEFILE_REPLACE_EXISTING);
54973 + if (r == TRUE)
54974 + return 0;
54975 + }
54976 +error:
54977 + set_errno_from_windows_code (GetLastError ());
54978 + return -1;
54979 +}
54980 +
54981 +int remove (const char *pathname)
54982 +{
54983 + int r;
54984 + char win32_path[MAX_PATH + 1];
54985 +
54986 + cygpath_close ();
54987 + cygpath_initialized = 0;
54988 +
54989 + /* Assume PATH is a Windows path. */
54990 + r = _unlink (pathname);
54991 + if (r != -1 || errno != ENOENT)
54992 + return r;
54993 + /* Perhaps it is a Cygwin path? */
54994 + if (cygpath (pathname, win32_path))
54995 + r = _unlink (win32_path);
54996 + return r;
54997 +}
54998 +
54999 +int unlink(const char *pathname)
55000 +{
55001 + return remove (pathname);
55002 +}
55003 +
55004 +int
55005 +chdir (const char *path)
55006 +{
55007 + int ret;
55008 + char win32_path[MAX_PATH + 1];
55009 +
55010 + /* Assume PATH is a Windows path. */
55011 + ret = _chdir (path);
55012 + if (ret != -1 || errno != ENOENT)
55013 + return ret;
55014 + /* Perhaps it is a Cygwin path? */
55015 + if (cygpath (path, win32_path))
55016 + ret = _chdir (win32_path);
55017 + return ret;
55018 +}
55019 --- a/libiberty/make-temp-file.c
55020 +++ b/libiberty/make-temp-file.c
55021 @@ -23,6 +23,7 @@ Boston, MA 02110-1301, USA. */
55022
55023 #include <stdio.h> /* May get P_tmpdir. */
55024 #include <sys/types.h>
55025 +#include <errno.h>
55026 #ifdef HAVE_UNISTD_H
55027 #include <unistd.h>
55028 #endif
55029 @@ -35,6 +36,9 @@ Boston, MA 02110-1301, USA. */
55030 #ifdef HAVE_SYS_FILE_H
55031 #include <sys/file.h> /* May get R_OK, etc. on some systems. */
55032 #endif
55033 +#if defined(_WIN32) && !defined(__CYGWIN__)
55034 +#include <windows.h>
55035 +#endif
55036
55037 #ifndef R_OK
55038 #define R_OK 4
55039 @@ -55,6 +59,8 @@ extern int mkstemps (char *, int);
55040 #define TEMP_FILE "ccXXXXXX"
55041 #define TEMP_FILE_LEN (sizeof(TEMP_FILE) - 1)
55042
55043 +#if !defined(_WIN32) || defined(__CYGWIN__)
55044 +
55045 /* Subroutine of choose_tmpdir.
55046 If BASE is non-NULL, return it.
55047 Otherwise it checks if DIR is a usable directory.
55048 @@ -80,6 +86,8 @@ static const char usrtmp[] =
55049 static const char vartmp[] =
55050 { DIR_SEPARATOR, 'v', 'a', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 };
55051
55052 +#endif
55053 +
55054 static char *memoized_tmpdir;
55055
55056 /*
55057 @@ -96,40 +104,58 @@ files in.
55058 char *
55059 choose_tmpdir (void)
55060 {
55061 - const char *base = 0;
55062 - char *tmpdir;
55063 - unsigned int len;
55064 -
55065 - if (memoized_tmpdir)
55066 - return memoized_tmpdir;
55067 -
55068 - base = try_dir (getenv ("TMPDIR"), base);
55069 - base = try_dir (getenv ("TMP"), base);
55070 - base = try_dir (getenv ("TEMP"), base);
55071 -
55072 + if (!memoized_tmpdir)
55073 + {
55074 +#if !defined(_WIN32) || defined(__CYGWIN__)
55075 + const char *base = 0;
55076 + char *tmpdir;
55077 + unsigned int len;
55078 +
55079 + base = try_dir (getenv ("TMPDIR"), base);
55080 + base = try_dir (getenv ("TMP"), base);
55081 + base = try_dir (getenv ("TEMP"), base);
55082 +
55083 #ifdef P_tmpdir
55084 - base = try_dir (P_tmpdir, base);
55085 + base = try_dir (P_tmpdir, base);
55086 #endif
55087
55088 - /* Try /var/tmp, /usr/tmp, then /tmp. */
55089 - base = try_dir (vartmp, base);
55090 - base = try_dir (usrtmp, base);
55091 - base = try_dir (tmp, base);
55092 -
55093 - /* If all else fails, use the current directory! */
55094 - if (base == 0)
55095 - base = ".";
55096 -
55097 - /* Append DIR_SEPARATOR to the directory we've chosen
55098 - and return it. */
55099 - len = strlen (base);
55100 - tmpdir = XNEWVEC (char, len + 2);
55101 - strcpy (tmpdir, base);
55102 - tmpdir[len] = DIR_SEPARATOR;
55103 - tmpdir[len+1] = '\0';
55104 + /* Try /var/tmp, /usr/tmp, then /tmp. */
55105 + base = try_dir (vartmp, base);
55106 + base = try_dir (usrtmp, base);
55107 + base = try_dir (tmp, base);
55108 +
55109 + /* If all else fails, use the current directory! */
55110 + if (base == 0)
55111 + base = ".";
55112 + /* Append DIR_SEPARATOR to the directory we've chosen
55113 + and return it. */
55114 + len = strlen (base);
55115 + tmpdir = XNEWVEC (char, len + 2);
55116 + strcpy (tmpdir, base);
55117 + tmpdir[len] = DIR_SEPARATOR;
55118 + tmpdir[len+1] = '\0';
55119 + memoized_tmpdir = tmpdir;
55120 +#else /* defined(_WIN32) && !defined(__CYGWIN__) */
55121 + DWORD len;
55122 +
55123 + /* Figure out how much space we need. */
55124 + len = GetTempPath(0, NULL);
55125 + if (len)
55126 + {
55127 + memoized_tmpdir = XNEWVEC (char, len);
55128 + if (!GetTempPath(len, memoized_tmpdir))
55129 + {
55130 + XDELETEVEC (memoized_tmpdir);
55131 + memoized_tmpdir = NULL;
55132 + }
55133 + }
55134 + if (!memoized_tmpdir)
55135 + /* If all else fails, use the current directory. */
55136 + memoized_tmpdir = xstrdup (".\\");
55137 +#endif /* defined(_WIN32) && !defined(__CYGWIN__) */
55138 + }
55139
55140 - memoized_tmpdir = tmpdir;
55141 - return tmpdir;
55142 + return memoized_tmpdir;
55143 }
55144
55145 /*
55146 @@ -166,11 +192,14 @@ make_temp_file (const char *suffix)
55147 strcpy (temp_filename + base_len + TEMP_FILE_LEN, suffix);
55148
55149 fd = mkstemps (temp_filename, suffix_len);
55150 - /* If mkstemps failed, then something bad is happening. Maybe we should
55151 - issue a message about a possible security attack in progress? */
55152 + /* Mkstemps failed. It may be EPERM, ENOSPC etc. */
55153 if (fd == -1)
55154 - abort ();
55155 - /* Similarly if we can not close the file. */
55156 + {
55157 + fprintf (stderr, "Cannot create temporary file in %s: %s\n",
55158 + base, strerror (errno));
55159 + abort ();
55160 + }
55161 + /* We abort on failed close out of sheer paranoia. */
55162 if (close (fd))
55163 abort ();
55164 return temp_filename;
55165 --- a/libiberty/mkstemps.c
55166 +++ b/libiberty/mkstemps.c
55167 @@ -127,6 +127,13 @@ mkstemps (char *pattern, int suffix_len)
55168 if (fd >= 0)
55169 /* The file does not exist. */
55170 return fd;
55171 + if (errno != EEXIST
55172 +#ifdef EISDIR
55173 + && errno != EISDIR
55174 +#endif
55175 + )
55176 + /* Fatal error (EPERM, ENOSPC etc). Doesn't make sense to loop. */
55177 + break;
55178
55179 /* This is a random value. It is only necessary that the next
55180 TMP_MAX values generated by adding 7777 to VALUE are different
55181 --- a/libiberty/pex-win32.c
55182 +++ b/libiberty/pex-win32.c
55183 @@ -119,7 +119,7 @@ static int
55184 pex_win32_open_read (struct pex_obj *obj ATTRIBUTE_UNUSED, const char *name,
55185 int binary)
55186 {
55187 - return _open (name, _O_RDONLY | (binary ? _O_BINARY : _O_TEXT));
55188 + return open (name, _O_RDONLY | (binary ? _O_BINARY : _O_TEXT));
55189 }
55190
55191 /* Open a file for writing. */
55192 @@ -130,10 +130,10 @@ pex_win32_open_write (struct pex_obj *ob
55193 {
55194 /* Note that we can't use O_EXCL here because gcc may have already
55195 created the temporary file via make_temp_file. */
55196 - return _open (name,
55197 - (_O_WRONLY | _O_CREAT | _O_TRUNC
55198 - | (binary ? _O_BINARY : _O_TEXT)),
55199 - _S_IREAD | _S_IWRITE);
55200 + return open (name,
55201 + (_O_WRONLY | _O_CREAT | _O_TRUNC
55202 + | (binary ? _O_BINARY : _O_TEXT)),
55203 + _S_IREAD | _S_IWRITE);
55204 }
55205
55206 /* Close a file. */
55207 --- a/libjava/Makefile.am
55208 +++ b/libjava/Makefile.am
55209 @@ -48,9 +48,14 @@ endif
55210
55211 dbexec_LTLIBRARIES = libjvm.la
55212
55213 -pkgconfigdir = $(libdir)/pkgconfig
55214 +# Install the pkgconfig file in a target-specific directory, since the
55215 +# libraries it indicates
55216
55217 -jardir = $(datadir)/java
55218 +pkgconfigdir = $(toolexeclibdir)/pkgconfig
55219 +
55220 +# We install the JAR in a target-specific directory so that toolchains
55221 +# build from different sources can be installed in the same directory.
55222 +jardir = $(prefix)/$(target_noncanonical)/share/java
55223 jar_DATA = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar
55224 if INSTALL_ECJ_JAR
55225 jar_DATA += $(ECJ_BUILD_JAR)
55226 @@ -81,7 +86,7 @@ bin_PROGRAMS = jv-convert gij grmic grmi
55227 dbexec_DATA = $(db_name)
55228 endif
55229
55230 -bin_SCRIPTS = addr2name.awk
55231 +bin_SCRIPTS =
55232
55233 if BUILD_ECJ1
55234 ## We build ecjx and not ecj1 because in one mode, ecjx will not work
55235 @@ -107,12 +112,15 @@ if ANONVERSCRIPT
55236 extra_ldflags_libjava += -Wl,--version-script=$(srcdir)/libgcj.ver
55237 endif
55238
55239 +LTLDFLAGS = $(shell $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
55240 GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) \
55241 - $(LDFLAGS) -o $@
55242 + $(LTLDFLAGS) -o $@
55243 GCJ_FOR_ECJX = @GCJ_FOR_ECJX@
55244 GCJ_FOR_ECJX_LINK = $(GCJ_FOR_ECJX) -o $@
55245 LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) \
55246 - $(LDFLAGS) $(extra_ldflags_libjava) $(extra_ldflags) -o $@
55247 + $(LTLDFLAGS) $(extra_ldflags_libjava) $(extra_ldflags) -o $@
55248 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
55249 + $(CXXFLAGS) $(AM_LDFLAGS) $(LTLDFLAGS) -o $@
55250
55251 GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
55252
55253 --- a/libjava/Makefile.in
55254 +++ b/libjava/Makefile.in
55255 @@ -508,8 +508,6 @@ LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mo
55256 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
55257 $(AM_CXXFLAGS) $(CXXFLAGS)
55258 CXXLD = $(CXX)
55259 -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
55260 - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
55261 GCJCOMPILE = $(GCJ) $(AM_GCJFLAGS) $(GCJFLAGS)
55262 LTGCJCOMPILE = $(LIBTOOL) --tag=GCJ --mode=compile $(GCJ) \
55263 $(AM_GCJFLAGS) $(GCJFLAGS)
55264 @@ -836,8 +834,14 @@ toolexeclib_LTLIBRARIES = libgcj.la libg
55265 $(am__append_2) $(am__append_3)
55266 toolexecmainlib_DATA = libgcj.spec
55267 dbexec_LTLIBRARIES = libjvm.la
55268 -pkgconfigdir = $(libdir)/pkgconfig
55269 -jardir = $(datadir)/java
55270 +
55271 +# Install the pkgconfig file in a target-specific directory, since the
55272 +# libraries it indicates
55273 +pkgconfigdir = $(toolexeclibdir)/pkgconfig
55274 +
55275 +# We install the JAR in a target-specific directory so that toolchains
55276 +# build from different sources can be installed in the same directory.
55277 +jardir = $(prefix)/$(target_noncanonical)/share/java
55278 jar_DATA = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar \
55279 $(am__append_4)
55280 @JAVA_HOME_SET_FALSE@JAVA_HOME_DIR = $(prefix)
55281 @@ -847,14 +851,18 @@ jar_DATA = libgcj-$(gcc_version).jar lib
55282 db_name = classmap.db
55283 db_pathtail = $(gcjsubdir)/$(db_name)
55284 @NATIVE_TRUE@dbexec_DATA = $(db_name)
55285 -bin_SCRIPTS = addr2name.awk
55286 +bin_SCRIPTS =
55287 GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
55288 +LTLDFLAGS = $(shell $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
55289 GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) \
55290 - $(LDFLAGS) -o $@
55291 + $(LTLDFLAGS) -o $@
55292
55293 GCJ_FOR_ECJX_LINK = $(GCJ_FOR_ECJX) -o $@
55294 LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) \
55295 - $(LDFLAGS) $(extra_ldflags_libjava) $(extra_ldflags) -o $@
55296 + $(LTLDFLAGS) $(extra_ldflags_libjava) $(extra_ldflags) -o $@
55297 +
55298 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
55299 + $(CXXFLAGS) $(AM_LDFLAGS) $(LTLDFLAGS) -o $@
55300
55301 WARNINGS = -Wextra -Wall
55302 AM_CXXFLAGS = \
55303 --- a/libjava/classpath/Makefile.in
55304 +++ b/libjava/classpath/Makefile.in
55305 @@ -357,9 +357,12 @@ sysconfdir = @sysconfdir@
55306 target = @target@
55307 target_alias = @target_alias@
55308 target_cpu = @target_cpu@
55309 +target_noncanonical = @target_noncanonical@
55310 target_os = @target_os@
55311 target_vendor = @target_vendor@
55312 +toolexecdir = @toolexecdir@
55313 toolexeclibdir = @toolexeclibdir@
55314 +toolexecmainlibdir = @toolexecmainlibdir@
55315 vm_classes = @vm_classes@
55316
55317 # lib first, to compile .class files before native code, last examples
55318 --- a/libjava/classpath/configure
55319 +++ b/libjava/classpath/configure
55320 @@ -461,7 +461,7 @@ ac_includes_default="\
55321 # include <unistd.h>
55322 #endif"
55323
55324 -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os JAVA_MAINTAINER_MODE_TRUE JAVA_MAINTAINER_MODE_FALSE GENINSRC_TRUE GENINSRC_FALSE multi_basedir LIBVERSION CLASSPATH_MODULE CLASSPATH_CONVENIENCE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CREATE_COLLECTIONS_TRUE CREATE_COLLECTIONS_FALSE CREATE_JNI_LIBRARIES_TRUE CREATE_JNI_LIBRARIES_FALSE CREATE_CORE_JNI_LIBRARIES_TRUE CREATE_CORE_JNI_LIBRARIES_FALSE CREATE_GCONF_PEER_LIBRARIES_TRUE CREATE_GCONF_PEER_LIBRARIES_FALSE CREATE_GSTREAMER_PEER_LIBRARIES_TRUE CREATE_GSTREAMER_PEER_LIBRARIES_FALSE default_toolkit CREATE_XMLJ_LIBRARY_TRUE CREATE_XMLJ_LIBRARY_FALSE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP CREATE_ALSA_LIBRARIES_TRUE CREATE_ALSA_LIBRARIES_FALSE CREATE_DSSI_LIBRARIES_TRUE CREATE_DSSI_LIBRARIES_FALSE CREATE_GTK_PEER_LIBRARIES_TRUE CREATE_GTK_PEER_LIBRARIES_FALSE CREATE_QT_PEER_LIBRARIES_TRUE CREATE_QT_PEER_LIBRARIES_FALSE CREATE_PLUGIN_TRUE CREATE_PLUGIN_FALSE toolexeclibdir nativeexeclibdir glibjdir VM_BINARY CREATE_JNI_HEADERS_TRUE CREATE_JNI_HEADERS_FALSE CREATE_WRAPPERS_TRUE CREATE_WRAPPERS_FALSE LN_S LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM AR ac_ct_AR RANLIB ac_ct_RANLIB lt_ECHO CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP PERL COLLECTIONS_PREFIX LIBMAGIC LIBICONV LTLIBICONV WARNING_CFLAGS STRICT_WARNING_CFLAGS ERROR_CFLAGS PKG_CONFIG XML_CFLAGS XML_LIBS XSLT_CFLAGS XSLT_LIBS X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS GTK_CFLAGS GTK_LIBS FREETYPE2_CFLAGS FREETYPE2_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS CAIRO_CFLAGS CAIRO_LIBS XTEST_LIBS GCONF_CFLAGS GCONF_LIBS GDK_CFLAGS GDK_LIBS GSTREAMER_CFLAGS GSTREAMER_LIBS GSTREAMER_BASE_CFLAGS GSTREAMER_BASE_LIBS GSTREAMER_PLUGINS_BASE_CFLAGS GSTREAMER_PLUGINS_BASE_LIBS GST_PLUGIN_LDFLAGS GSTREAMER_FILE_READER GSTREAMER_MIXER_PROVIDER QT_CFLAGS QT_LIBS MOC MOZILLA_CFLAGS MOZILLA_LIBS GLIB_CFLAGS GLIB_LIBS PLUGIN_DIR USER_JAVAH CLASSPATH_INCLUDES GCJ JIKES JIKESENCODING JIKESWARNINGS KJC ECJ JAVAC FOUND_GCJ_TRUE FOUND_GCJ_FALSE FOUND_JIKES_TRUE FOUND_JIKES_FALSE FOUND_ECJ_TRUE FOUND_ECJ_FALSE FOUND_JAVAC_TRUE FOUND_JAVAC_FALSE FOUND_KJC_TRUE FOUND_KJC_FALSE USER_CLASSLIB USER_SPECIFIED_CLASSLIB_TRUE USER_SPECIFIED_CLASSLIB_FALSE vm_classes MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBDEBUG INIT_LOAD_LIBRARY ECJ_JAR JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION REMOVE MKDIR CP DATE FIND ZIP FASTJAR INSTALL_GLIBJ_ZIP_TRUE INSTALL_GLIBJ_ZIP_FALSE INSTALL_CLASS_FILES_TRUE INSTALL_CLASS_FILES_FALSE BUILD_CLASS_FILES_TRUE BUILD_CLASS_FILES_FALSE EXAMPLESDIR GJDOC CREATE_API_DOCS_TRUE CREATE_API_DOCS_FALSE JAY JAY_SKELETON REGEN_PARSERS_TRUE REGEN_PARSERS_FALSE USE_PREBUILT_GLIBJ_ZIP_TRUE USE_PREBUILT_GLIBJ_ZIP_FALSE PATH_TO_GLIBJ_ZIP USE_ESCHER_TRUE USE_ESCHER_FALSE PATH_TO_ESCHER ENABLE_LOCAL_SOCKETS_TRUE ENABLE_LOCAL_SOCKETS_FALSE DEFAULT_PREFS_PEER LIBOBJS LTLIBOBJS'
55325 +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os JAVA_MAINTAINER_MODE_TRUE JAVA_MAINTAINER_MODE_FALSE GENINSRC_TRUE GENINSRC_FALSE multi_basedir LIBVERSION CLASSPATH_MODULE CLASSPATH_CONVENIENCE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CREATE_COLLECTIONS_TRUE CREATE_COLLECTIONS_FALSE CREATE_JNI_LIBRARIES_TRUE CREATE_JNI_LIBRARIES_FALSE CREATE_CORE_JNI_LIBRARIES_TRUE CREATE_CORE_JNI_LIBRARIES_FALSE CREATE_GCONF_PEER_LIBRARIES_TRUE CREATE_GCONF_PEER_LIBRARIES_FALSE CREATE_GSTREAMER_PEER_LIBRARIES_TRUE CREATE_GSTREAMER_PEER_LIBRARIES_FALSE default_toolkit CREATE_XMLJ_LIBRARY_TRUE CREATE_XMLJ_LIBRARY_FALSE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP CREATE_ALSA_LIBRARIES_TRUE CREATE_ALSA_LIBRARIES_FALSE CREATE_DSSI_LIBRARIES_TRUE CREATE_DSSI_LIBRARIES_FALSE CREATE_GTK_PEER_LIBRARIES_TRUE CREATE_GTK_PEER_LIBRARIES_FALSE CREATE_QT_PEER_LIBRARIES_TRUE CREATE_QT_PEER_LIBRARIES_FALSE CREATE_PLUGIN_TRUE CREATE_PLUGIN_FALSE target_noncanonical toolexecdir toolexecmainlibdir toolexeclibdir nativeexeclibdir glibjdir VM_BINARY CREATE_JNI_HEADERS_TRUE CREATE_JNI_HEADERS_FALSE CREATE_WRAPPERS_TRUE CREATE_WRAPPERS_FALSE LN_S LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM AR ac_ct_AR RANLIB ac_ct_RANLIB lt_ECHO CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP PERL COLLECTIONS_PREFIX LIBMAGIC LIBICONV LTLIBICONV WARNING_CFLAGS STRICT_WARNING_CFLAGS ERROR_CFLAGS PKG_CONFIG XML_CFLAGS XML_LIBS XSLT_CFLAGS XSLT_LIBS X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS GTK_CFLAGS GTK_LIBS FREETYPE2_CFLAGS FREETYPE2_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS CAIRO_CFLAGS CAIRO_LIBS XTEST_LIBS GCONF_CFLAGS GCONF_LIBS GDK_CFLAGS GDK_LIBS GSTREAMER_CFLAGS GSTREAMER_LIBS GSTREAMER_BASE_CFLAGS GSTREAMER_BASE_LIBS GSTREAMER_PLUGINS_BASE_CFLAGS GSTREAMER_PLUGINS_BASE_LIBS GST_PLUGIN_LDFLAGS GSTREAMER_FILE_READER GSTREAMER_MIXER_PROVIDER QT_CFLAGS QT_LIBS MOC MOZILLA_CFLAGS MOZILLA_LIBS GLIB_CFLAGS GLIB_LIBS PLUGIN_DIR USER_JAVAH CLASSPATH_INCLUDES GCJ JIKES JIKESENCODING JIKESWARNINGS KJC ECJ JAVAC FOUND_GCJ_TRUE FOUND_GCJ_FALSE FOUND_JIKES_TRUE FOUND_JIKES_FALSE FOUND_ECJ_TRUE FOUND_ECJ_FALSE FOUND_JAVAC_TRUE FOUND_JAVAC_FALSE FOUND_KJC_TRUE FOUND_KJC_FALSE USER_CLASSLIB USER_SPECIFIED_CLASSLIB_TRUE USER_SPECIFIED_CLASSLIB_FALSE vm_classes MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBDEBUG INIT_LOAD_LIBRARY ECJ_JAR JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION REMOVE MKDIR CP DATE FIND ZIP FASTJAR INSTALL_GLIBJ_ZIP_TRUE INSTALL_GLIBJ_ZIP_FALSE INSTALL_CLASS_FILES_TRUE INSTALL_CLASS_FILES_FALSE BUILD_CLASS_FILES_TRUE BUILD_CLASS_FILES_FALSE EXAMPLESDIR GJDOC CREATE_API_DOCS_TRUE CREATE_API_DOCS_FALSE JAY JAY_SKELETON REGEN_PARSERS_TRUE REGEN_PARSERS_FALSE USE_PREBUILT_GLIBJ_ZIP_TRUE USE_PREBUILT_GLIBJ_ZIP_FALSE PATH_TO_GLIBJ_ZIP USE_ESCHER_TRUE USE_ESCHER_FALSE PATH_TO_ESCHER ENABLE_LOCAL_SOCKETS_TRUE ENABLE_LOCAL_SOCKETS_FALSE DEFAULT_PREFS_PEER LIBOBJS LTLIBOBJS'
55326 ac_subst_files=''
55327
55328 # Initialize some variables set by options.
55329 @@ -1058,6 +1058,9 @@ Optional Features:
55330 default=no
55331 --disable-plugin compile gcjwebplugin (disabled by --disable-plugin)
55332 default=yes
55333 + --enable-version-specific-runtime-libs
55334 + specify that runtime libraries should be installed
55335 + in a compiler-specific directory
55336 --enable-regen-headers automatically regenerate JNI headers default=no
55337 --enable-tool-wrappers create tool wrapper binaries default=no
55338 --enable-static[=PKGS]
55339 @@ -4753,16 +4756,64 @@ else
55340 fi
55341
55342
55343 +case ${host_alias} in
55344 + "") host_noncanonical=${build_noncanonical} ;;
55345 + *) host_noncanonical=${host_alias} ;;
55346 +esac
55347 +case ${target_alias} in
55348 + "") target_noncanonical=${host_noncanonical} ;;
55349 + *) target_noncanonical=${target_alias} ;;
55350 +esac
55351 +
55352 +
55353 +# Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given.
55354 +if test "${enable_version_specific_runtime_libs+set}" = set; then
55355 + enableval="$enable_version_specific_runtime_libs"
55356 + case "$enableval" in
55357 + yes) version_specific_libs=yes ;;
55358 + no) version_specific_libs=no ;;
55359 + *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable version-specific libs" >&5
55360 +echo "$as_me: error: Unknown argument to enable/disable version-specific libs" >&2;}
55361 + { (exit 1); exit 1; }; };;
55362 + esac
55363 +else
55364 + version_specific_libs=no
55365 +
55366 +fi;
55367
55368 - multi_os_directory=`$CC -print-multi-os-directory`
55369 - case $multi_os_directory in
55370 - .) toolexeclibdir=${libdir} ;; # Avoid trailing /.
55371 - *) toolexeclibdir=${libdir}/${multi_os_directory} ;;
55372 + case ${version_specific_libs} in
55373 + yes)
55374 + # Need the gcc compiler version to know where to install libraries
55375 + # and header files if --enable-version-specific-runtime-libs option
55376 + # is selected.
55377 + includedir='$(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include/'
55378 + toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
55379 + toolexecmainlibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
55380 + toolexeclibdir=$toolexecmainlibdir
55381 + ;;
55382 + no)
55383 + if test -n "$with_cross_host" &&
55384 + test x"$with_cross_host" != x"no"; then
55385 + # Install a library built with a cross compiler in tooldir, not libdir.
55386 + toolexecdir='$(exec_prefix)/$(target_noncanonical)'
55387 + toolexecmainlibdir='$(toolexecdir)/lib'
55388 + else
55389 + toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
55390 + toolexecmainlibdir='$(libdir)'
55391 + fi
55392 + multi_os_directory=`$CC -print-multi-os-directory`
55393 + case $multi_os_directory in
55394 + .) toolexeclibdir=$toolexecmainlibdir ;; # Avoid trailing /.
55395 + *) toolexeclibdir=$toolexecmainlibdir/$multi_os_directory ;;
55396 + esac
55397 + ;;
55398 esac
55399
55400
55401
55402
55403 +
55404 +
55405 # Check whether --with-native-libdir or --without-native-libdir was given.
55406 if test "${with_native_libdir+set}" = set; then
55407 withval="$with_native_libdir"
55408 @@ -5702,13 +5753,13 @@ if test "${lt_cv_nm_interface+set}" = se
55409 else
55410 lt_cv_nm_interface="BSD nm"
55411 echo "int some_variable = 0;" > conftest.$ac_ext
55412 - (eval echo "\"\$as_me:5705: $ac_compile\"" >&5)
55413 + (eval echo "\"\$as_me:5756: $ac_compile\"" >&5)
55414 (eval "$ac_compile" 2>conftest.err)
55415 cat conftest.err >&5
55416 - (eval echo "\"\$as_me:5708: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
55417 + (eval echo "\"\$as_me:5759: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
55418 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
55419 cat conftest.err >&5
55420 - (eval echo "\"\$as_me:5711: output\"" >&5)
55421 + (eval echo "\"\$as_me:5762: output\"" >&5)
55422 cat conftest.out >&5
55423 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
55424 lt_cv_nm_interface="MS dumpbin"
55425 @@ -6752,7 +6803,7 @@ ia64-*-hpux*)
55426 ;;
55427 *-*-irix6*)
55428 # Find out which ABI we are using.
55429 - echo '#line 6755 "configure"' > conftest.$ac_ext
55430 + echo '#line 6806 "configure"' > conftest.$ac_ext
55431 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
55432 (eval $ac_compile) 2>&5
55433 ac_status=$?
55434 @@ -7384,11 +7435,11 @@ else
55435 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
55436 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
55437 -e 's:$: $lt_compiler_flag:'`
55438 - (eval echo "\"\$as_me:7387: $lt_compile\"" >&5)
55439 + (eval echo "\"\$as_me:7438: $lt_compile\"" >&5)
55440 (eval "$lt_compile" 2>conftest.err)
55441 ac_status=$?
55442 cat conftest.err >&5
55443 - echo "$as_me:7391: \$? = $ac_status" >&5
55444 + echo "$as_me:7442: \$? = $ac_status" >&5
55445 if (exit $ac_status) && test -s "$ac_outfile"; then
55446 # The compiler can only warn and ignore the option if not recognized
55447 # So say no if there are warnings other than the usual output.
55448 @@ -7706,11 +7757,11 @@ else
55449 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
55450 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
55451 -e 's:$: $lt_compiler_flag:'`
55452 - (eval echo "\"\$as_me:7709: $lt_compile\"" >&5)
55453 + (eval echo "\"\$as_me:7760: $lt_compile\"" >&5)
55454 (eval "$lt_compile" 2>conftest.err)
55455 ac_status=$?
55456 cat conftest.err >&5
55457 - echo "$as_me:7713: \$? = $ac_status" >&5
55458 + echo "$as_me:7764: \$? = $ac_status" >&5
55459 if (exit $ac_status) && test -s "$ac_outfile"; then
55460 # The compiler can only warn and ignore the option if not recognized
55461 # So say no if there are warnings other than the usual output.
55462 @@ -7811,11 +7862,11 @@ else
55463 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
55464 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
55465 -e 's:$: $lt_compiler_flag:'`
55466 - (eval echo "\"\$as_me:7814: $lt_compile\"" >&5)
55467 + (eval echo "\"\$as_me:7865: $lt_compile\"" >&5)
55468 (eval "$lt_compile" 2>out/conftest.err)
55469 ac_status=$?
55470 cat out/conftest.err >&5
55471 - echo "$as_me:7818: \$? = $ac_status" >&5
55472 + echo "$as_me:7869: \$? = $ac_status" >&5
55473 if (exit $ac_status) && test -s out/conftest2.$ac_objext
55474 then
55475 # The compiler can only warn and ignore the option if not recognized
55476 @@ -7866,11 +7917,11 @@ else
55477 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
55478 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
55479 -e 's:$: $lt_compiler_flag:'`
55480 - (eval echo "\"\$as_me:7869: $lt_compile\"" >&5)
55481 + (eval echo "\"\$as_me:7920: $lt_compile\"" >&5)
55482 (eval "$lt_compile" 2>out/conftest.err)
55483 ac_status=$?
55484 cat out/conftest.err >&5
55485 - echo "$as_me:7873: \$? = $ac_status" >&5
55486 + echo "$as_me:7924: \$? = $ac_status" >&5
55487 if (exit $ac_status) && test -s out/conftest2.$ac_objext
55488 then
55489 # The compiler can only warn and ignore the option if not recognized
55490 @@ -10718,7 +10769,7 @@ else
55491 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
55492 lt_status=$lt_dlunknown
55493 cat > conftest.$ac_ext <<_LT_EOF
55494 -#line 10721 "configure"
55495 +#line 10772 "configure"
55496 #include "confdefs.h"
55497
55498 #if HAVE_DLFCN_H
55499 @@ -10818,7 +10869,7 @@ else
55500 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
55501 lt_status=$lt_dlunknown
55502 cat > conftest.$ac_ext <<_LT_EOF
55503 -#line 10821 "configure"
55504 +#line 10872 "configure"
55505 #include "confdefs.h"
55506
55507 #if HAVE_DLFCN_H
55508 @@ -15215,11 +15266,11 @@ else
55509 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
55510 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
55511 -e 's:$: $lt_compiler_flag:'`
55512 - (eval echo "\"\$as_me:15218: $lt_compile\"" >&5)
55513 + (eval echo "\"\$as_me:15269: $lt_compile\"" >&5)
55514 (eval "$lt_compile" 2>conftest.err)
55515 ac_status=$?
55516 cat conftest.err >&5
55517 - echo "$as_me:15222: \$? = $ac_status" >&5
55518 + echo "$as_me:15273: \$? = $ac_status" >&5
55519 if (exit $ac_status) && test -s "$ac_outfile"; then
55520 # The compiler can only warn and ignore the option if not recognized
55521 # So say no if there are warnings other than the usual output.
55522 @@ -15314,11 +15365,11 @@ else
55523 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
55524 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
55525 -e 's:$: $lt_compiler_flag:'`
55526 - (eval echo "\"\$as_me:15317: $lt_compile\"" >&5)
55527 + (eval echo "\"\$as_me:15368: $lt_compile\"" >&5)
55528 (eval "$lt_compile" 2>out/conftest.err)
55529 ac_status=$?
55530 cat out/conftest.err >&5
55531 - echo "$as_me:15321: \$? = $ac_status" >&5
55532 + echo "$as_me:15372: \$? = $ac_status" >&5
55533 if (exit $ac_status) && test -s out/conftest2.$ac_objext
55534 then
55535 # The compiler can only warn and ignore the option if not recognized
55536 @@ -15366,11 +15417,11 @@ else
55537 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
55538 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
55539 -e 's:$: $lt_compiler_flag:'`
55540 - (eval echo "\"\$as_me:15369: $lt_compile\"" >&5)
55541 + (eval echo "\"\$as_me:15420: $lt_compile\"" >&5)
55542 (eval "$lt_compile" 2>out/conftest.err)
55543 ac_status=$?
55544 cat out/conftest.err >&5
55545 - echo "$as_me:15373: \$? = $ac_status" >&5
55546 + echo "$as_me:15424: \$? = $ac_status" >&5
55547 if (exit $ac_status) && test -s out/conftest2.$ac_objext
55548 then
55549 # The compiler can only warn and ignore the option if not recognized
55550 @@ -30956,6 +31007,9 @@ s,@CREATE_QT_PEER_LIBRARIES_TRUE@,$CREAT
55551 s,@CREATE_QT_PEER_LIBRARIES_FALSE@,$CREATE_QT_PEER_LIBRARIES_FALSE,;t t
55552 s,@CREATE_PLUGIN_TRUE@,$CREATE_PLUGIN_TRUE,;t t
55553 s,@CREATE_PLUGIN_FALSE@,$CREATE_PLUGIN_FALSE,;t t
55554 +s,@target_noncanonical@,$target_noncanonical,;t t
55555 +s,@toolexecdir@,$toolexecdir,;t t
55556 +s,@toolexecmainlibdir@,$toolexecmainlibdir,;t t
55557 s,@toolexeclibdir@,$toolexeclibdir,;t t
55558 s,@nativeexeclibdir@,$nativeexeclibdir,;t t
55559 s,@glibjdir@,$glibjdir,;t t
55560 --- a/libjava/classpath/configure.ac
55561 +++ b/libjava/classpath/configure.ac
55562 @@ -289,6 +289,16 @@ dnl defined to the same value for all mu
55563 dnl so that we can refer to the multilib installation directories from
55564 dnl classpath's build files.
55565 dnl -----------------------------------------------------------
55566 +AC_ARG_ENABLE(version-specific-runtime-libs,
55567 + AS_HELP_STRING([--enable-version-specific-runtime-libs],
55568 + [specify that runtime libraries should be installed in a compiler-specific directory]),
55569 + [case "$enableval" in
55570 + yes) version_specific_libs=yes ;;
55571 + no) version_specific_libs=no ;;
55572 + *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
55573 + esac],
55574 + [version_specific_libs=no]
55575 +)
55576 CLASSPATH_TOOLEXECLIBDIR
55577
55578 dnl -----------------------------------------------------------
55579 --- a/libjava/classpath/doc/Makefile.in
55580 +++ b/libjava/classpath/doc/Makefile.in
55581 @@ -334,9 +334,12 @@ sysconfdir = @sysconfdir@
55582 target = @target@
55583 target_alias = @target_alias@
55584 target_cpu = @target_cpu@
55585 +target_noncanonical = @target_noncanonical@
55586 target_os = @target_os@
55587 target_vendor = @target_vendor@
55588 +toolexecdir = @toolexecdir@
55589 toolexeclibdir = @toolexeclibdir@
55590 +toolexecmainlibdir = @toolexecmainlibdir@
55591 vm_classes = @vm_classes@
55592 SUBDIRS = api
55593 EXTRA_DIST = README.jaxp texi2pod.pl $(man_MANS)
55594 --- a/libjava/classpath/doc/api/Makefile.in
55595 +++ b/libjava/classpath/doc/api/Makefile.in
55596 @@ -311,9 +311,12 @@ sysconfdir = @sysconfdir@
55597 target = @target@
55598 target_alias = @target_alias@
55599 target_cpu = @target_cpu@
55600 +target_noncanonical = @target_noncanonical@
55601 target_os = @target_os@
55602 target_vendor = @target_vendor@
55603 +toolexecdir = @toolexecdir@
55604 toolexeclibdir = @toolexeclibdir@
55605 +toolexecmainlibdir = @toolexecmainlibdir@
55606 vm_classes = @vm_classes@
55607 @CREATE_API_DOCS_TRUE@noinst_DATA = html
55608 sourcepath = $(top_builddir):$(top_srcdir):$(top_srcdir)/vm/reference:$(top_srcdir)/external/w3c_dom:$(top_srcdir)/external/sax
55609 --- a/libjava/classpath/examples/Makefile.in
55610 +++ b/libjava/classpath/examples/Makefile.in
55611 @@ -320,9 +320,12 @@ sysconfdir = @sysconfdir@
55612 target = @target@
55613 target_alias = @target_alias@
55614 target_cpu = @target_cpu@
55615 +target_noncanonical = @target_noncanonical@
55616 target_os = @target_os@
55617 target_vendor = @target_vendor@
55618 +toolexecdir = @toolexecdir@
55619 toolexeclibdir = @toolexeclibdir@
55620 +toolexecmainlibdir = @toolexecmainlibdir@
55621 vm_classes = @vm_classes@
55622 GLIBJ_CLASSPATH = '$(top_builddir)/lib':'$(top_builddir)/lib/glibj.zip':'$(top_builddir)/tools/tools.zip'
55623 @FOUND_ECJ_FALSE@@FOUND_JAVAC_TRUE@JCOMPILER = $(JAVAC) -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath .
55624 --- a/libjava/classpath/external/Makefile.in
55625 +++ b/libjava/classpath/external/Makefile.in
55626 @@ -318,9 +318,12 @@ sysconfdir = @sysconfdir@
55627 target = @target@
55628 target_alias = @target_alias@
55629 target_cpu = @target_cpu@
55630 +target_noncanonical = @target_noncanonical@
55631 target_os = @target_os@
55632 target_vendor = @target_vendor@
55633 +toolexecdir = @toolexecdir@
55634 toolexeclibdir = @toolexeclibdir@
55635 +toolexecmainlibdir = @toolexecmainlibdir@
55636 vm_classes = @vm_classes@
55637 SUBDIRS = sax w3c_dom relaxngDatatype jsr166
55638 EXTRA_DIST = README
55639 --- a/libjava/classpath/external/jsr166/Makefile.in
55640 +++ b/libjava/classpath/external/jsr166/Makefile.in
55641 @@ -309,9 +309,12 @@ sysconfdir = @sysconfdir@
55642 target = @target@
55643 target_alias = @target_alias@
55644 target_cpu = @target_cpu@
55645 +target_noncanonical = @target_noncanonical@
55646 target_os = @target_os@
55647 target_vendor = @target_vendor@
55648 +toolexecdir = @toolexecdir@
55649 toolexeclibdir = @toolexeclibdir@
55650 +toolexecmainlibdir = @toolexecmainlibdir@
55651 vm_classes = @vm_classes@
55652 EXTRA_DIST = IMPORTING \
55653 readme \
55654 --- a/libjava/classpath/external/relaxngDatatype/Makefile.in
55655 +++ b/libjava/classpath/external/relaxngDatatype/Makefile.in
55656 @@ -309,9 +309,12 @@ sysconfdir = @sysconfdir@
55657 target = @target@
55658 target_alias = @target_alias@
55659 target_cpu = @target_cpu@
55660 +target_noncanonical = @target_noncanonical@
55661 target_os = @target_os@
55662 target_vendor = @target_vendor@
55663 +toolexecdir = @toolexecdir@
55664 toolexeclibdir = @toolexeclibdir@
55665 +toolexecmainlibdir = @toolexecmainlibdir@
55666 vm_classes = @vm_classes@
55667 EXTRA_DIST = README.txt \
55668 copying.txt \
55669 --- a/libjava/classpath/external/sax/Makefile.in
55670 +++ b/libjava/classpath/external/sax/Makefile.in
55671 @@ -309,9 +309,12 @@ sysconfdir = @sysconfdir@
55672 target = @target@
55673 target_alias = @target_alias@
55674 target_cpu = @target_cpu@
55675 +target_noncanonical = @target_noncanonical@
55676 target_os = @target_os@
55677 target_vendor = @target_vendor@
55678 +toolexecdir = @toolexecdir@
55679 toolexeclibdir = @toolexeclibdir@
55680 +toolexecmainlibdir = @toolexecmainlibdir@
55681 vm_classes = @vm_classes@
55682 EXTRA_DIST = README \
55683 org/xml/sax/ext/Attributes2.java \
55684 --- a/libjava/classpath/external/w3c_dom/Makefile.in
55685 +++ b/libjava/classpath/external/w3c_dom/Makefile.in
55686 @@ -309,9 +309,12 @@ sysconfdir = @sysconfdir@
55687 target = @target@
55688 target_alias = @target_alias@
55689 target_cpu = @target_cpu@
55690 +target_noncanonical = @target_noncanonical@
55691 target_os = @target_os@
55692 target_vendor = @target_vendor@
55693 +toolexecdir = @toolexecdir@
55694 toolexeclibdir = @toolexeclibdir@
55695 +toolexecmainlibdir = @toolexecmainlibdir@
55696 vm_classes = @vm_classes@
55697 EXTRA_DIST = README \
55698 org/w3c/dom/Attr.java \
55699 --- a/libjava/classpath/include/Makefile.in
55700 +++ b/libjava/classpath/include/Makefile.in
55701 @@ -310,9 +310,12 @@ sysconfdir = @sysconfdir@
55702 target = @target@
55703 target_alias = @target_alias@
55704 target_cpu = @target_cpu@
55705 +target_noncanonical = @target_noncanonical@
55706 target_os = @target_os@
55707 target_vendor = @target_vendor@
55708 +toolexecdir = @toolexecdir@
55709 toolexeclibdir = @toolexeclibdir@
55710 +toolexecmainlibdir = @toolexecmainlibdir@
55711 vm_classes = @vm_classes@
55712 DISTCLEANFILES = jni_md.h config-int.h
55713 ARG_JNI_JAVAH = -jni
55714 --- a/libjava/classpath/lib/Makefile.in
55715 +++ b/libjava/classpath/lib/Makefile.in
55716 @@ -314,9 +314,12 @@ sysconfdir = @sysconfdir@
55717 target = @target@
55718 target_alias = @target_alias@
55719 target_cpu = @target_cpu@
55720 +target_noncanonical = @target_noncanonical@
55721 target_os = @target_os@
55722 target_vendor = @target_vendor@
55723 +toolexecdir = @toolexecdir@
55724 toolexeclibdir = @toolexeclibdir@
55725 +toolexecmainlibdir = @toolexecmainlibdir@
55726 vm_classes = @vm_classes@
55727 JAVA_DEPEND = java.dep
55728 compile_classpath = $(vm_classes):$(top_srcdir):$(top_srcdir)/external/w3c_dom:$(top_srcdir)/external/sax:$(top_srcdir)/external/relaxngDatatype:$(top_srcdir)/external/jsr166:.:$(USER_CLASSLIB):$(PATH_TO_ESCHER)
55729 --- a/libjava/classpath/m4/acinclude.m4
55730 +++ b/libjava/classpath/m4/acinclude.m4
55731 @@ -427,11 +427,45 @@ dnl GCJ LOCAL: Calculate toolexeclibdir
55732 dnl -----------------------------------------------------------
55733 AC_DEFUN([CLASSPATH_TOOLEXECLIBDIR],
55734 [
55735 - multi_os_directory=`$CC -print-multi-os-directory`
55736 - case $multi_os_directory in
55737 - .) toolexeclibdir=${libdir} ;; # Avoid trailing /.
55738 - *) toolexeclibdir=${libdir}/${multi_os_directory} ;;
55739 + case ${host_alias} in
55740 + "") host_noncanonical=${build_noncanonical} ;;
55741 + *) host_noncanonical=${host_alias} ;;
55742 esac
55743 + case ${target_alias} in
55744 + "") target_noncanonical=${host_noncanonical} ;;
55745 + *) target_noncanonical=${target_alias} ;;
55746 + esac
55747 + AC_SUBST(target_noncanonical)
55748 +
55749 + case ${version_specific_libs} in
55750 + yes)
55751 + # Need the gcc compiler version to know where to install libraries
55752 + # and header files if --enable-version-specific-runtime-libs option
55753 + # is selected.
55754 + includedir='$(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include/'
55755 + toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
55756 + toolexecmainlibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
55757 + toolexeclibdir=$toolexecmainlibdir
55758 + ;;
55759 + no)
55760 + if test -n "$with_cross_host" &&
55761 + test x"$with_cross_host" != x"no"; then
55762 + # Install a library built with a cross compiler in tooldir, not libdir.
55763 + toolexecdir='$(exec_prefix)/$(target_noncanonical)'
55764 + toolexecmainlibdir='$(toolexecdir)/lib'
55765 + else
55766 + toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
55767 + toolexecmainlibdir='$(libdir)'
55768 + fi
55769 + multi_os_directory=`$CC -print-multi-os-directory`
55770 + case $multi_os_directory in
55771 + .) toolexeclibdir=$toolexecmainlibdir ;; # Avoid trailing /.
55772 + *) toolexeclibdir=$toolexecmainlibdir/$multi_os_directory ;;
55773 + esac
55774 + ;;
55775 + esac
55776 + AC_SUBST(toolexecdir)
55777 + AC_SUBST(toolexecmainlibdir)
55778 AC_SUBST(toolexeclibdir)
55779 ])
55780
55781 --- a/libjava/classpath/native/Makefile.in
55782 +++ b/libjava/classpath/native/Makefile.in
55783 @@ -317,9 +317,12 @@ sysconfdir = @sysconfdir@
55784 target = @target@
55785 target_alias = @target_alias@
55786 target_cpu = @target_cpu@
55787 +target_noncanonical = @target_noncanonical@
55788 target_os = @target_os@
55789 target_vendor = @target_vendor@
55790 +toolexecdir = @toolexecdir@
55791 toolexeclibdir = @toolexeclibdir@
55792 +toolexecmainlibdir = @toolexecmainlibdir@
55793 vm_classes = @vm_classes@
55794 @CREATE_JNI_LIBRARIES_TRUE@JNIDIR = jni
55795 @CREATE_GTK_PEER_LIBRARIES_TRUE@JAWTDIR = jawt
55796 --- a/libjava/classpath/native/fdlibm/Makefile.in
55797 +++ b/libjava/classpath/native/fdlibm/Makefile.in
55798 @@ -336,9 +336,12 @@ sysconfdir = @sysconfdir@
55799 target = @target@
55800 target_alias = @target_alias@
55801 target_cpu = @target_cpu@
55802 +target_noncanonical = @target_noncanonical@
55803 target_os = @target_os@
55804 target_vendor = @target_vendor@
55805 +toolexecdir = @toolexecdir@
55806 toolexeclibdir = @toolexeclibdir@
55807 +toolexecmainlibdir = @toolexecmainlibdir@
55808 vm_classes = @vm_classes@
55809 noinst_LTLIBRARIES = libfdlibm.la
55810 libfdlibm_la_SOURCES = \
55811 --- a/libjava/classpath/native/jawt/Makefile.in
55812 +++ b/libjava/classpath/native/jawt/Makefile.in
55813 @@ -336,9 +336,12 @@ sysconfdir = @sysconfdir@
55814 target = @target@
55815 target_alias = @target_alias@
55816 target_cpu = @target_cpu@
55817 +target_noncanonical = @target_noncanonical@
55818 target_os = @target_os@
55819 target_vendor = @target_vendor@
55820 +toolexecdir = @toolexecdir@
55821 toolexeclibdir = @toolexeclibdir@
55822 +toolexecmainlibdir = @toolexecmainlibdir@
55823 vm_classes = @vm_classes@
55824 nativeexeclib_LTLIBRARIES = libjawt.la
55825 libjawt_la_SOURCES = jawt.c
55826 --- a/libjava/classpath/native/jni/Makefile.in
55827 +++ b/libjava/classpath/native/jni/Makefile.in
55828 @@ -317,9 +317,12 @@ sysconfdir = @sysconfdir@
55829 target = @target@
55830 target_alias = @target_alias@
55831 target_cpu = @target_cpu@
55832 +target_noncanonical = @target_noncanonical@
55833 target_os = @target_os@
55834 target_vendor = @target_vendor@
55835 +toolexecdir = @toolexecdir@
55836 toolexeclibdir = @toolexeclibdir@
55837 +toolexecmainlibdir = @toolexecmainlibdir@
55838 vm_classes = @vm_classes@
55839 @CREATE_CORE_JNI_LIBRARIES_TRUE@JNIDIRS = native-lib java-io java-lang java-net java-nio java-util
55840 @CREATE_ALSA_LIBRARIES_TRUE@ALSADIR = midi-alsa
55841 --- a/libjava/classpath/native/jni/classpath/Makefile.in
55842 +++ b/libjava/classpath/native/jni/classpath/Makefile.in
55843 @@ -327,9 +327,12 @@ sysconfdir = @sysconfdir@
55844 target = @target@
55845 target_alias = @target_alias@
55846 target_cpu = @target_cpu@
55847 +target_noncanonical = @target_noncanonical@
55848 target_os = @target_os@
55849 target_vendor = @target_vendor@
55850 +toolexecdir = @toolexecdir@
55851 toolexeclibdir = @toolexeclibdir@
55852 +toolexecmainlibdir = @toolexecmainlibdir@
55853 vm_classes = @vm_classes@
55854
55855 # Header needed for jawt implementations such as the one found in ../gtk-peer.
55856 --- a/libjava/classpath/native/jni/gconf-peer/Makefile.in
55857 +++ b/libjava/classpath/native/jni/gconf-peer/Makefile.in
55858 @@ -336,9 +336,12 @@ sysconfdir = @sysconfdir@
55859 target = @target@
55860 target_alias = @target_alias@
55861 target_cpu = @target_cpu@
55862 +target_noncanonical = @target_noncanonical@
55863 target_os = @target_os@
55864 target_vendor = @target_vendor@
55865 +toolexecdir = @toolexecdir@
55866 toolexeclibdir = @toolexeclibdir@
55867 +toolexecmainlibdir = @toolexecmainlibdir@
55868 vm_classes = @vm_classes@
55869 nativeexeclib_LTLIBRARIES = libgconfpeer.la
55870 libgconfpeer_la_SOURCES = GConfNativePeer.c
55871 --- a/libjava/classpath/native/jni/gstreamer-peer/Makefile.in
55872 +++ b/libjava/classpath/native/jni/gstreamer-peer/Makefile.in
55873 @@ -337,9 +337,12 @@ sysconfdir = @sysconfdir@
55874 target = @target@
55875 target_alias = @target_alias@
55876 target_cpu = @target_cpu@
55877 +target_noncanonical = @target_noncanonical@
55878 target_os = @target_os@
55879 target_vendor = @target_vendor@
55880 +toolexecdir = @toolexecdir@
55881 toolexeclibdir = @toolexeclibdir@
55882 +toolexecmainlibdir = @toolexecmainlibdir@
55883 vm_classes = @vm_classes@
55884 nativeexeclib_LTLIBRARIES = libgstreamerpeer.la
55885 libgstreamerpeer_la_SOURCES = GStreamerIOPeer.c \
55886 --- a/libjava/classpath/native/jni/gtk-peer/Makefile.in
55887 +++ b/libjava/classpath/native/jni/gtk-peer/Makefile.in
55888 @@ -374,9 +374,12 @@ sysconfdir = @sysconfdir@
55889 target = @target@
55890 target_alias = @target_alias@
55891 target_cpu = @target_cpu@
55892 +target_noncanonical = @target_noncanonical@
55893 target_os = @target_os@
55894 target_vendor = @target_vendor@
55895 +toolexecdir = @toolexecdir@
55896 toolexeclibdir = @toolexeclibdir@
55897 +toolexecmainlibdir = @toolexecmainlibdir@
55898 vm_classes = @vm_classes@
55899 nativeexeclib_LTLIBRARIES = libgtkpeer.la
55900
55901 --- a/libjava/classpath/native/jni/java-io/Makefile.in
55902 +++ b/libjava/classpath/native/jni/java-io/Makefile.in
55903 @@ -338,9 +338,12 @@ sysconfdir = @sysconfdir@
55904 target = @target@
55905 target_alias = @target_alias@
55906 target_cpu = @target_cpu@
55907 +target_noncanonical = @target_noncanonical@
55908 target_os = @target_os@
55909 target_vendor = @target_vendor@
55910 +toolexecdir = @toolexecdir@
55911 toolexeclibdir = @toolexeclibdir@
55912 +toolexecmainlibdir = @toolexecmainlibdir@
55913 vm_classes = @vm_classes@
55914 nativeexeclib_LTLIBRARIES = libjavaio.la
55915 libjavaio_la_SOURCES = java_io_VMFile.c \
55916 --- a/libjava/classpath/native/jni/java-lang/Makefile.in
55917 +++ b/libjava/classpath/native/jni/java-lang/Makefile.in
55918 @@ -352,9 +352,12 @@ sysconfdir = @sysconfdir@
55919 target = @target@
55920 target_alias = @target_alias@
55921 target_cpu = @target_cpu@
55922 +target_noncanonical = @target_noncanonical@
55923 target_os = @target_os@
55924 target_vendor = @target_vendor@
55925 +toolexecdir = @toolexecdir@
55926 toolexeclibdir = @toolexeclibdir@
55927 +toolexecmainlibdir = @toolexecmainlibdir@
55928 vm_classes = @vm_classes@
55929 nativeexeclib_LTLIBRARIES = libjavalang.la libjavalangreflect.la libjavalangmanagement.la
55930 libjavalang_la_SOURCES = java_lang_VMSystem.c \
55931 --- a/libjava/classpath/native/jni/java-net/Makefile.in
55932 +++ b/libjava/classpath/native/jni/java-net/Makefile.in
55933 @@ -348,9 +348,12 @@ sysconfdir = @sysconfdir@
55934 target = @target@
55935 target_alias = @target_alias@
55936 target_cpu = @target_cpu@
55937 +target_noncanonical = @target_noncanonical@
55938 target_os = @target_os@
55939 target_vendor = @target_vendor@
55940 +toolexecdir = @toolexecdir@
55941 toolexeclibdir = @toolexeclibdir@
55942 +toolexecmainlibdir = @toolexecmainlibdir@
55943 vm_classes = @vm_classes@
55944 nativeexeclib_LTLIBRARIES = libjavanet.la
55945 @ENABLE_LOCAL_SOCKETS_FALSE@local_sources = gnu_java_net_local_LocalSocketImpl.c
55946 --- a/libjava/classpath/native/jni/java-nio/Makefile.in
55947 +++ b/libjava/classpath/native/jni/java-nio/Makefile.in
55948 @@ -346,9 +346,12 @@ sysconfdir = @sysconfdir@
55949 target = @target@
55950 target_alias = @target_alias@
55951 target_cpu = @target_cpu@
55952 +target_noncanonical = @target_noncanonical@
55953 target_os = @target_os@
55954 target_vendor = @target_vendor@
55955 +toolexecdir = @toolexecdir@
55956 toolexeclibdir = @toolexeclibdir@
55957 +toolexecmainlibdir = @toolexecmainlibdir@
55958 vm_classes = @vm_classes@
55959 nativeexeclib_LTLIBRARIES = libjavanio.la
55960 libjavanio_la_SOURCES = gnu_java_nio_VMPipe.c \
55961 --- a/libjava/classpath/native/jni/java-util/Makefile.in
55962 +++ b/libjava/classpath/native/jni/java-util/Makefile.in
55963 @@ -335,9 +335,12 @@ sysconfdir = @sysconfdir@
55964 target = @target@
55965 target_alias = @target_alias@
55966 target_cpu = @target_cpu@
55967 +target_noncanonical = @target_noncanonical@
55968 target_os = @target_os@
55969 target_vendor = @target_vendor@
55970 +toolexecdir = @toolexecdir@
55971 toolexeclibdir = @toolexeclibdir@
55972 +toolexecmainlibdir = @toolexecmainlibdir@
55973 vm_classes = @vm_classes@
55974 nativeexeclib_LTLIBRARIES = libjavautil.la
55975 libjavautil_la_SOURCES = java_util_VMTimeZone.c
55976 --- a/libjava/classpath/native/jni/midi-alsa/Makefile.in
55977 +++ b/libjava/classpath/native/jni/midi-alsa/Makefile.in
55978 @@ -338,9 +338,12 @@ sysconfdir = @sysconfdir@
55979 target = @target@
55980 target_alias = @target_alias@
55981 target_cpu = @target_cpu@
55982 +target_noncanonical = @target_noncanonical@
55983 target_os = @target_os@
55984 target_vendor = @target_vendor@
55985 +toolexecdir = @toolexecdir@
55986 toolexeclibdir = @toolexeclibdir@
55987 +toolexecmainlibdir = @toolexecmainlibdir@
55988 vm_classes = @vm_classes@
55989 nativeexeclib_LTLIBRARIES = libgjsmalsa.la
55990 libgjsmalsa_la_SOURCES = gnu_javax_sound_midi_alsa_AlsaMidiSequencerDevice.c \
55991 --- a/libjava/classpath/native/jni/midi-dssi/Makefile.in
55992 +++ b/libjava/classpath/native/jni/midi-dssi/Makefile.in
55993 @@ -338,9 +338,12 @@ sysconfdir = @sysconfdir@
55994 target = @target@
55995 target_alias = @target_alias@
55996 target_cpu = @target_cpu@
55997 +target_noncanonical = @target_noncanonical@
55998 target_os = @target_os@
55999 target_vendor = @target_vendor@
56000 +toolexecdir = @toolexecdir@
56001 toolexeclibdir = @toolexeclibdir@
56002 +toolexecmainlibdir = @toolexecmainlibdir@
56003 vm_classes = @vm_classes@
56004 nativeexeclib_LTLIBRARIES = libgjsmdssi.la
56005 libgjsmdssi_la_SOURCES = gnu_javax_sound_midi_dssi_DSSIMidiDeviceProvider.c \
56006 --- a/libjava/classpath/native/jni/native-lib/Makefile.in
56007 +++ b/libjava/classpath/native/jni/native-lib/Makefile.in
56008 @@ -327,9 +327,12 @@ sysconfdir = @sysconfdir@
56009 target = @target@
56010 target_alias = @target_alias@
56011 target_cpu = @target_cpu@
56012 +target_noncanonical = @target_noncanonical@
56013 target_os = @target_os@
56014 target_vendor = @target_vendor@
56015 +toolexecdir = @toolexecdir@
56016 toolexeclibdir = @toolexeclibdir@
56017 +toolexecmainlibdir = @toolexecmainlibdir@
56018 vm_classes = @vm_classes@
56019 noinst_LTLIBRARIES = libclasspathnative.la
56020 libclasspathnative_la_SOURCES = cpnet.c \
56021 --- a/libjava/classpath/native/jni/qt-peer/Makefile.in
56022 +++ b/libjava/classpath/native/jni/qt-peer/Makefile.in
56023 @@ -353,9 +353,12 @@ sysconfdir = @sysconfdir@
56024 target = @target@
56025 target_alias = @target_alias@
56026 target_cpu = @target_cpu@
56027 +target_noncanonical = @target_noncanonical@
56028 target_os = @target_os@
56029 target_vendor = @target_vendor@
56030 +toolexecdir = @toolexecdir@
56031 toolexeclibdir = @toolexeclibdir@
56032 +toolexecmainlibdir = @toolexecmainlibdir@
56033 vm_classes = @vm_classes@
56034 noinst_LTLIBRARIES = libqtpeer.la
56035 AM_LDFLAGS = @CLASSPATH_MODULE@ @QT_LIBS@
56036 --- a/libjava/classpath/native/jni/xmlj/Makefile.in
56037 +++ b/libjava/classpath/native/jni/xmlj/Makefile.in
56038 @@ -337,9 +337,12 @@ sysconfdir = @sysconfdir@
56039 target = @target@
56040 target_alias = @target_alias@
56041 target_cpu = @target_cpu@
56042 +target_noncanonical = @target_noncanonical@
56043 target_os = @target_os@
56044 target_vendor = @target_vendor@
56045 +toolexecdir = @toolexecdir@
56046 toolexeclibdir = @toolexeclibdir@
56047 +toolexecmainlibdir = @toolexecmainlibdir@
56048 vm_classes = @vm_classes@
56049 nativeexeclib_LTLIBRARIES = libxmlj.la
56050 libxmlj_la_SOURCES = \
56051 --- a/libjava/classpath/native/plugin/Makefile.in
56052 +++ b/libjava/classpath/native/plugin/Makefile.in
56053 @@ -335,9 +335,12 @@ sysconfdir = @sysconfdir@
56054 target = @target@
56055 target_alias = @target_alias@
56056 target_cpu = @target_cpu@
56057 +target_noncanonical = @target_noncanonical@
56058 target_os = @target_os@
56059 target_vendor = @target_vendor@
56060 +toolexecdir = @toolexecdir@
56061 toolexeclibdir = @toolexeclibdir@
56062 +toolexecmainlibdir = @toolexecmainlibdir@
56063 vm_classes = @vm_classes@
56064 nativeexeclib_LTLIBRARIES = libgcjwebplugin.la
56065 libgcjwebplugin_la_SOURCES = gcjwebplugin.cc
56066 --- a/libjava/classpath/resource/Makefile.in
56067 +++ b/libjava/classpath/resource/Makefile.in
56068 @@ -320,9 +320,12 @@ sysconfdir = @sysconfdir@
56069 target = @target@
56070 target_alias = @target_alias@
56071 target_cpu = @target_cpu@
56072 +target_noncanonical = @target_noncanonical@
56073 target_os = @target_os@
56074 target_vendor = @target_vendor@
56075 +toolexecdir = @toolexecdir@
56076 toolexeclibdir = @toolexeclibdir@
56077 +toolexecmainlibdir = @toolexecmainlibdir@
56078 vm_classes = @vm_classes@
56079 logging_DATA = java/util/logging/logging.properties
56080 loggingdir = $(toolexeclibdir)
56081 --- a/libjava/classpath/scripts/Makefile.in
56082 +++ b/libjava/classpath/scripts/Makefile.in
56083 @@ -310,9 +310,12 @@ sysconfdir = @sysconfdir@
56084 target = @target@
56085 target_alias = @target_alias@
56086 target_cpu = @target_cpu@
56087 +target_noncanonical = @target_noncanonical@
56088 target_os = @target_os@
56089 target_vendor = @target_vendor@
56090 +toolexecdir = @toolexecdir@
56091 toolexeclibdir = @toolexeclibdir@
56092 +toolexecmainlibdir = @toolexecmainlibdir@
56093 vm_classes = @vm_classes@
56094 EXTRA_DIST = check_jni_methods.sh generate-locale-list.sh import-cacerts.sh
56095 all: all-am
56096 --- a/libjava/classpath/tools/Makefile.in
56097 +++ b/libjava/classpath/tools/Makefile.in
56098 @@ -412,9 +412,12 @@ sysconfdir = @sysconfdir@
56099 target = @target@
56100 target_alias = @target_alias@
56101 target_cpu = @target_cpu@
56102 +target_noncanonical = @target_noncanonical@
56103 target_os = @target_os@
56104 target_vendor = @target_vendor@
56105 +toolexecdir = @toolexecdir@
56106 toolexeclibdir = @toolexeclibdir@
56107 +toolexecmainlibdir = @toolexecmainlibdir@
56108 vm_classes = @vm_classes@
56109 GLIBJ_BOOTCLASSPATH = '$(top_srcdir)/lib'
56110 GLIBJ_CLASSPATH = $(srcdir)/asm
56111 --- a/libjava/configure
56112 +++ b/libjava/configure
56113 @@ -18552,6 +18552,9 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
56114 enable_sjlj_exceptions=yes
56115 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
56116 enable_sjlj_exceptions=no
56117 + elif grep __cxa_end_cleanup conftest.s >/dev/null 2>&1 ; then
56118 + # ARM EH ABI.
56119 + enable_sjlj_exceptions=no
56120 fi
56121 fi
56122 CXXFLAGS="$old_CXXFLAGS"
56123 @@ -26229,10 +26232,10 @@ gcjsubdir=gcj-$gcjversion-$libgcj_sovers
56124 multi_os_directory=`$CC -print-multi-os-directory`
56125 case $multi_os_directory in
56126 .)
56127 - dbexecdir='$(libdir)/'$gcjsubdir # Avoid /.
56128 + dbexecdir='$(toolexeclibdir)/'$gcjsubdir # Avoid /.
56129 ;;
56130 *)
56131 - dbexecdir='$(libdir)/'$multi_os_directory/$gcjsubdir
56132 + dbexecdir='$(toolexeclibdir)/'$multi_os_directory/$gcjsubdir
56133 ;;
56134 esac
56135
56136 --- a/libjava/configure.ac
56137 +++ b/libjava/configure.ac
56138 @@ -605,6 +605,9 @@ if AC_TRY_EVAL(ac_compile); then
56139 enable_sjlj_exceptions=yes
56140 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
56141 enable_sjlj_exceptions=no
56142 + elif grep __cxa_end_cleanup conftest.s >/dev/null 2>&1 ; then
56143 + # ARM EH ABI.
56144 + enable_sjlj_exceptions=no
56145 fi
56146 fi
56147 CXXFLAGS="$old_CXXFLAGS"
56148 @@ -1406,10 +1409,10 @@ gcjsubdir=gcj-$gcjversion-$libgcj_sovers
56149 multi_os_directory=`$CC -print-multi-os-directory`
56150 case $multi_os_directory in
56151 .)
56152 - dbexecdir='$(libdir)/'$gcjsubdir # Avoid /.
56153 + dbexecdir='$(toolexeclibdir)/'$gcjsubdir # Avoid /.
56154 ;;
56155 *)
56156 - dbexecdir='$(libdir)/'$multi_os_directory/$gcjsubdir
56157 + dbexecdir='$(toolexeclibdir)/'$multi_os_directory/$gcjsubdir
56158 ;;
56159 esac
56160 AC_SUBST(dbexecdir)
56161 --- a/libstdc++-v3/Makefile.in
56162 +++ b/libstdc++-v3/Makefile.in
56163 @@ -189,6 +189,8 @@ LIBMATHOBJS = @LIBMATHOBJS@
56164 LIBOBJS = @LIBOBJS@
56165 LIBS = @LIBS@
56166 LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
56167 +LIBSUPCXX_PRONLY_FALSE = @LIBSUPCXX_PRONLY_FALSE@
56168 +LIBSUPCXX_PRONLY_TRUE = @LIBSUPCXX_PRONLY_TRUE@
56169 LIBTOOL = @LIBTOOL@
56170 LN_S = @LN_S@
56171 LTLIBICONV = @LTLIBICONV@
56172 --- a/libstdc++-v3/config.h.in
56173 +++ b/libstdc++-v3/config.h.in
56174 @@ -114,12 +114,6 @@
56175 /* Define to 1 if you have the `frexpl' function. */
56176 #undef HAVE_FREXPL
56177
56178 -/* Define to 1 if you have the <gconf.h> header file. */
56179 -#undef HAVE_GCONF_H
56180 -
56181 -/* Define to 1 if you have the <gconv.h> header file. */
56182 -#undef HAVE_GCONV_H
56183 -
56184 /* Define if _Unwind_GetIPInfo is available. */
56185 #undef HAVE_GETIPINFO
56186
56187 --- a/libstdc++-v3/config/cpu/mips/atomicity.h
56188 +++ b/libstdc++-v3/config/cpu/mips/atomicity.h
56189 @@ -41,16 +41,18 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
56190
56191 __asm__ __volatile__
56192 ("/* Inline exchange & add */\n\t"
56193 - "1:\n\t"
56194 ".set push\n\t"
56195 #if _MIPS_SIM == _ABIO32
56196 ".set mips2\n\t"
56197 #endif
56198 + "sync \n\t"
56199 + "1:\n\t"
56200 "ll %0,0(%2)\n\t"
56201 "addu %1,%3,%0\n\t"
56202 "sc %1,0(%2)\n\t"
56203 - ".set pop\n\t"
56204 "beqz %1,1b\n\t"
56205 + "sync \n\t"
56206 + ".set pop\n\t"
56207 "/* End exchange & add */"
56208 : "=&r"(__result), "=&r"(__tmp)
56209 : "r"(__mem), "r"(__val)
56210 @@ -67,16 +69,18 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
56211
56212 __asm__ __volatile__
56213 ("/* Inline atomic add */\n\t"
56214 - "1:\n\t"
56215 ".set push\n\t"
56216 #if _MIPS_SIM == _ABIO32
56217 ".set mips2\n\t"
56218 #endif
56219 + "sync \n\t"
56220 + "1:\n\t"
56221 "ll %0,0(%1)\n\t"
56222 "addu %0,%2,%0\n\t"
56223 "sc %0,0(%1)\n\t"
56224 - ".set pop\n\t"
56225 "beqz %0,1b\n\t"
56226 + "sync \n\t"
56227 + ".set pop\n\t"
56228 "/* End atomic add */"
56229 : "=&r"(__result)
56230 : "r"(__mem), "r"(__val)
56231 --- a/libstdc++-v3/config/cpu/sh/atomicity.h
56232 +++ b/libstdc++-v3/config/cpu/sh/atomicity.h
56233 @@ -30,47 +30,48 @@
56234
56235 #ifdef __SH4A__
56236
56237 -#ifndef _GLIBCXX_ATOMICITY_H
56238 -#define _GLIBCXX_ATOMICITY_H 1
56239 +#include <ext/atomicity.h>
56240
56241 -typedef int _Atomic_word;
56242 +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
56243
56244 -static inline _Atomic_word
56245 -__attribute__ ((__unused__))
56246 -__exchange_and_add (volatile _Atomic_word* __mem, int __val)
56247 -{
56248 - _Atomic_word __result;
56249 + typedef int _Atomic_word;
56250
56251 - __asm__ __volatile__
56252 - ("0:\n"
56253 - "\tmovli.l\t@%2,r0\n"
56254 - "\tmov\tr0,%1\n"
56255 - "\tadd\t%3,r0\n"
56256 - "\tmovco.l\tr0,@%2\n"
56257 - "\tbf\t0b"
56258 - : "+m" (*__mem), "=r" (__result)
56259 - : "r" (__mem), "rI08" (__val)
56260 - : "r0");
56261 -
56262 - return __result;
56263 -}
56264 -
56265 -
56266 -static inline void
56267 -__attribute__ ((__unused__))
56268 -__atomic_add (volatile _Atomic_word* __mem, int __val)
56269 -{
56270 - asm("0:\n"
56271 - "\tmovli.l\t@%1,r0\n"
56272 - "\tadd\t%2,r0\n"
56273 - "\tmovco.l\tr0,@%1\n"
56274 - "\tbf\t0b"
56275 - : "+m" (*__mem)
56276 - : "r" (__mem), "rI08" (__val)
56277 - : "r0");
56278 -}
56279 + _Atomic_word
56280 + __attribute__ ((__unused__))
56281 + __exchange_and_add (volatile _Atomic_word* __mem, int __val)
56282 + {
56283 + _Atomic_word __result;
56284
56285 -#endif
56286 + __asm__ __volatile__
56287 + ("0:\n"
56288 + "\tmovli.l\t@%2,r0\n"
56289 + "\tmov\tr0,%1\n"
56290 + "\tadd\t%3,r0\n"
56291 + "\tmovco.l\tr0,@%2\n"
56292 + "\tbf\t0b"
56293 + : "+m" (*__mem), "=r" (__result)
56294 + : "r" (__mem), "rI08" (__val)
56295 + : "r0");
56296 +
56297 + return __result;
56298 + }
56299 +
56300 +
56301 + void
56302 + __attribute__ ((__unused__))
56303 + __atomic_add (volatile _Atomic_word* __mem, int __val)
56304 + {
56305 + asm("0:\n"
56306 + "\tmovli.l\t@%1,r0\n"
56307 + "\tadd\t%2,r0\n"
56308 + "\tmovco.l\tr0,@%1\n"
56309 + "\tbf\t0b"
56310 + : "+m" (*__mem)
56311 + : "r" (__mem), "rI08" (__val)
56312 + : "r0");
56313 + }
56314 +
56315 +_GLIBCXX_END_NAMESPACE
56316
56317 #else /* !__SH4A__ */
56318
56319 --- /dev/null
56320 +++ b/libstdc++-v3/config/os/gnu-linux/arm-eabi-extra.ver
56321 @@ -0,0 +1,18 @@
56322 +# Appended to version file.
56323 +
56324 +CXXABI_ARM_1.3.3 {
56325 + # ARM ABI helper functions provided in libsupc++.
56326 + __aeabi_atexit;
56327 + __aeabi_vec_ctor_nocookie_nodtor;
56328 + __aeabi_vec_ctor_cookie_nodtor;
56329 + __aeabi_vec_cctor_nocookie_nodtor;
56330 + __aeabi_vec_new_cookie_noctor;
56331 + __aeabi_vec_new_nocookie;
56332 + __aeabi_vec_new_cookie_nodtor;
56333 + __aeabi_vec_new_cookie;
56334 + __aeabi_vec_dtor;
56335 + __aeabi_vec_dtor_cookie;
56336 + __aeabi_vec_delete;
56337 + __aeabi_vec_delete3;
56338 + __aeabi_vec_delete3_nodtor;
56339 +};
56340 --- a/libstdc++-v3/configure
56341 +++ b/libstdc++-v3/configure
56342 @@ -458,7 +458,7 @@ ac_includes_default="\
56343 # include <unistd.h>
56344 #endif"
56345
56346 -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libtool_VERSION multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar glibcxx_builddir glibcxx_srcdir toplevel_srcdir CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LN_S AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CPP CPPFLAGS EGREP LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM lt_ECHO LDFLAGS CXXCPP enable_shared enable_static GLIBCXX_HOSTED_TRUE GLIBCXX_HOSTED_FALSE GLIBCXX_BUILD_PCH_TRUE GLIBCXX_BUILD_PCH_FALSE glibcxx_PCHFLAGS CSTDIO_H BASIC_FILE_H BASIC_FILE_CC check_msgfmt glibcxx_MOFILES glibcxx_POFILES glibcxx_localedir USE_NLS CLOCALE_H CMESSAGES_H CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_H CTIME_CC CLOCALE_CC CLOCALE_INTERNAL_H ALLOCATOR_H ALLOCATOR_NAME C_INCLUDE_DIR GLIBCXX_C_HEADERS_C_TRUE GLIBCXX_C_HEADERS_C_FALSE GLIBCXX_C_HEADERS_C_STD_TRUE GLIBCXX_C_HEADERS_C_STD_FALSE GLIBCXX_C_HEADERS_C_GLOBAL_TRUE GLIBCXX_C_HEADERS_C_GLOBAL_FALSE GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE GLIBCXX_C_HEADERS_EXTRA_TRUE GLIBCXX_C_HEADERS_EXTRA_FALSE DEBUG_FLAGS GLIBCXX_BUILD_DEBUG_TRUE GLIBCXX_BUILD_DEBUG_FALSE ENABLE_PARALLEL_TRUE ENABLE_PARALLEL_FALSE EXTRA_CXX_FLAGS glibcxx_thread_h WERROR SECTION_FLAGS SECTION_LDFLAGS OPT_LDFLAGS LIBMATHOBJS LIBICONV LTLIBICONV SYMVER_FILE port_specific_symbol_files ENABLE_SYMVERS_TRUE ENABLE_SYMVERS_FALSE ENABLE_SYMVERS_GNU_TRUE ENABLE_SYMVERS_GNU_FALSE ENABLE_SYMVERS_GNU_NAMESPACE_TRUE ENABLE_SYMVERS_GNU_NAMESPACE_FALSE ENABLE_SYMVERS_DARWIN_TRUE ENABLE_SYMVERS_DARWIN_FALSE ENABLE_VISIBILITY_TRUE ENABLE_VISIBILITY_FALSE GLIBCXX_LDBL_COMPAT_TRUE GLIBCXX_LDBL_COMPAT_FALSE baseline_dir ATOMICITY_SRCDIR ATOMIC_WORD_SRCDIR ATOMIC_FLAGS CPU_DEFINES_SRCDIR ABI_TWEAKS_SRCDIR OS_INC_SRCDIR ERROR_CONSTANTS_SRCDIR glibcxx_prefixdir gxx_include_dir glibcxx_toolexecdir glibcxx_toolexeclibdir GLIBCXX_INCLUDES TOPLEVEL_INCLUDES OPTIMIZE_CXXFLAGS WARN_FLAGS LIBSUPCXX_PICFLAGS LIBOBJS LTLIBOBJS'
56347 +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libtool_VERSION multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar glibcxx_builddir glibcxx_srcdir toplevel_srcdir CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LN_S AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CPP CPPFLAGS EGREP LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM lt_ECHO LDFLAGS CXXCPP enable_shared enable_static GLIBCXX_HOSTED_TRUE GLIBCXX_HOSTED_FALSE GLIBCXX_BUILD_PCH_TRUE GLIBCXX_BUILD_PCH_FALSE glibcxx_PCHFLAGS CSTDIO_H BASIC_FILE_H BASIC_FILE_CC check_msgfmt glibcxx_MOFILES glibcxx_POFILES glibcxx_localedir USE_NLS CLOCALE_H CMESSAGES_H CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_H CTIME_CC CLOCALE_CC CLOCALE_INTERNAL_H ALLOCATOR_H ALLOCATOR_NAME C_INCLUDE_DIR GLIBCXX_C_HEADERS_C_TRUE GLIBCXX_C_HEADERS_C_FALSE GLIBCXX_C_HEADERS_C_STD_TRUE GLIBCXX_C_HEADERS_C_STD_FALSE GLIBCXX_C_HEADERS_C_GLOBAL_TRUE GLIBCXX_C_HEADERS_C_GLOBAL_FALSE GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE GLIBCXX_C_HEADERS_EXTRA_TRUE GLIBCXX_C_HEADERS_EXTRA_FALSE DEBUG_FLAGS GLIBCXX_BUILD_DEBUG_TRUE GLIBCXX_BUILD_DEBUG_FALSE ENABLE_PARALLEL_TRUE ENABLE_PARALLEL_FALSE EXTRA_CXX_FLAGS glibcxx_thread_h WERROR SECTION_FLAGS SECTION_LDFLAGS OPT_LDFLAGS LIBMATHOBJS LIBICONV LTLIBICONV SYMVER_FILE port_specific_symbol_files ENABLE_SYMVERS_TRUE ENABLE_SYMVERS_FALSE ENABLE_SYMVERS_GNU_TRUE ENABLE_SYMVERS_GNU_FALSE ENABLE_SYMVERS_GNU_NAMESPACE_TRUE ENABLE_SYMVERS_GNU_NAMESPACE_FALSE ENABLE_SYMVERS_DARWIN_TRUE ENABLE_SYMVERS_DARWIN_FALSE ENABLE_VISIBILITY_TRUE ENABLE_VISIBILITY_FALSE GLIBCXX_LDBL_COMPAT_TRUE GLIBCXX_LDBL_COMPAT_FALSE baseline_dir ATOMICITY_SRCDIR ATOMIC_WORD_SRCDIR ATOMIC_FLAGS CPU_DEFINES_SRCDIR ABI_TWEAKS_SRCDIR OS_INC_SRCDIR ERROR_CONSTANTS_SRCDIR LIBSUPCXX_PRONLY_TRUE LIBSUPCXX_PRONLY_FALSE glibcxx_prefixdir gxx_include_dir glibcxx_toolexecdir glibcxx_toolexeclibdir GLIBCXX_INCLUDES TOPLEVEL_INCLUDES OPTIMIZE_CXXFLAGS WARN_FLAGS LIBSUPCXX_PICFLAGS LIBOBJS LTLIBOBJS'
56348 ac_subst_files=''
56349
56350 # Initialize some variables set by options.
56351 @@ -17195,9 +17195,8 @@ if $GLIBCXX_IS_NATIVE; then
56352
56353
56354
56355 -
56356 for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
56357 - machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
56358 + machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h \
56359 sys/types.h sys/ipc.h sys/sem.h
56360 do
56361 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
56362 @@ -62933,9 +62932,8 @@ _ACEOF
56363
56364
56365
56366 -
56367 for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
56368 - machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
56369 + machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h \
56370 sys/types.h
56371 do
56372 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
56373 @@ -86333,11 +86331,10 @@ _ACEOF
56374
56375
56376
56377 -
56378 for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \
56379 machine/endian.h machine/param.h sys/machine.h sys/types.h \
56380 fp.h float.h endian.h inttypes.h locale.h float.h stdint.h \
56381 - sys/ipc.h sys/sem.h gconf.h
56382 + sys/ipc.h sys/sem.h
56383 do
56384 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
56385 if eval "test \"\${$as_ac_Header+set}\" = set"; then
56386 @@ -108853,6 +108850,223 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
56387
56388
56389
56390 + cat >>confdefs.h <<\_ACEOF
56391 +#define _GLIBCXX_USE_RANDOM_TR1 1
56392 +_ACEOF
56393 +
56394 +
56395 +
56396 + if test "${ac_cv_header_locale_h+set}" = set; then
56397 + echo "$as_me:$LINENO: checking for locale.h" >&5
56398 +echo $ECHO_N "checking for locale.h... $ECHO_C" >&6
56399 +if test "${ac_cv_header_locale_h+set}" = set; then
56400 + echo $ECHO_N "(cached) $ECHO_C" >&6
56401 +fi
56402 +echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
56403 +echo "${ECHO_T}$ac_cv_header_locale_h" >&6
56404 +else
56405 + # Is the header compilable?
56406 +echo "$as_me:$LINENO: checking locale.h usability" >&5
56407 +echo $ECHO_N "checking locale.h usability... $ECHO_C" >&6
56408 +cat >conftest.$ac_ext <<_ACEOF
56409 +/* confdefs.h. */
56410 +_ACEOF
56411 +cat confdefs.h >>conftest.$ac_ext
56412 +cat >>conftest.$ac_ext <<_ACEOF
56413 +/* end confdefs.h. */
56414 +$ac_includes_default
56415 +#include <locale.h>
56416 +_ACEOF
56417 +rm -f conftest.$ac_objext
56418 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
56419 + (eval $ac_compile) 2>conftest.er1
56420 + ac_status=$?
56421 + grep -v '^ *+' conftest.er1 >conftest.err
56422 + rm -f conftest.er1
56423 + cat conftest.err >&5
56424 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56425 + (exit $ac_status); } &&
56426 + { ac_try='test -z "$ac_c_werror_flag"
56427 + || test ! -s conftest.err'
56428 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
56429 + (eval $ac_try) 2>&5
56430 + ac_status=$?
56431 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56432 + (exit $ac_status); }; } &&
56433 + { ac_try='test -s conftest.$ac_objext'
56434 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
56435 + (eval $ac_try) 2>&5
56436 + ac_status=$?
56437 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56438 + (exit $ac_status); }; }; then
56439 + ac_header_compiler=yes
56440 +else
56441 + echo "$as_me: failed program was:" >&5
56442 +sed 's/^/| /' conftest.$ac_ext >&5
56443 +
56444 +ac_header_compiler=no
56445 +fi
56446 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
56447 +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
56448 +echo "${ECHO_T}$ac_header_compiler" >&6
56449 +
56450 +# Is the header present?
56451 +echo "$as_me:$LINENO: checking locale.h presence" >&5
56452 +echo $ECHO_N "checking locale.h presence... $ECHO_C" >&6
56453 +cat >conftest.$ac_ext <<_ACEOF
56454 +/* confdefs.h. */
56455 +_ACEOF
56456 +cat confdefs.h >>conftest.$ac_ext
56457 +cat >>conftest.$ac_ext <<_ACEOF
56458 +/* end confdefs.h. */
56459 +#include <locale.h>
56460 +_ACEOF
56461 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
56462 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
56463 + ac_status=$?
56464 + grep -v '^ *+' conftest.er1 >conftest.err
56465 + rm -f conftest.er1
56466 + cat conftest.err >&5
56467 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56468 + (exit $ac_status); } >/dev/null; then
56469 + if test -s conftest.err; then
56470 + ac_cpp_err=$ac_c_preproc_warn_flag
56471 + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
56472 + else
56473 + ac_cpp_err=
56474 + fi
56475 +else
56476 + ac_cpp_err=yes
56477 +fi
56478 +if test -z "$ac_cpp_err"; then
56479 + ac_header_preproc=yes
56480 +else
56481 + echo "$as_me: failed program was:" >&5
56482 +sed 's/^/| /' conftest.$ac_ext >&5
56483 +
56484 + ac_header_preproc=no
56485 +fi
56486 +rm -f conftest.err conftest.$ac_ext
56487 +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
56488 +echo "${ECHO_T}$ac_header_preproc" >&6
56489 +
56490 +# So? What about this header?
56491 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
56492 + yes:no: )
56493 + { echo "$as_me:$LINENO: WARNING: locale.h: accepted by the compiler, rejected by the preprocessor!" >&5
56494 +echo "$as_me: WARNING: locale.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
56495 + { echo "$as_me:$LINENO: WARNING: locale.h: proceeding with the compiler's result" >&5
56496 +echo "$as_me: WARNING: locale.h: proceeding with the compiler's result" >&2;}
56497 + ac_header_preproc=yes
56498 + ;;
56499 + no:yes:* )
56500 + { echo "$as_me:$LINENO: WARNING: locale.h: present but cannot be compiled" >&5
56501 +echo "$as_me: WARNING: locale.h: present but cannot be compiled" >&2;}
56502 + { echo "$as_me:$LINENO: WARNING: locale.h: check for missing prerequisite headers?" >&5
56503 +echo "$as_me: WARNING: locale.h: check for missing prerequisite headers?" >&2;}
56504 + { echo "$as_me:$LINENO: WARNING: locale.h: see the Autoconf documentation" >&5
56505 +echo "$as_me: WARNING: locale.h: see the Autoconf documentation" >&2;}
56506 + { echo "$as_me:$LINENO: WARNING: locale.h: section \"Present But Cannot Be Compiled\"" >&5
56507 +echo "$as_me: WARNING: locale.h: section \"Present But Cannot Be Compiled\"" >&2;}
56508 + { echo "$as_me:$LINENO: WARNING: locale.h: proceeding with the preprocessor's result" >&5
56509 +echo "$as_me: WARNING: locale.h: proceeding with the preprocessor's result" >&2;}
56510 + { echo "$as_me:$LINENO: WARNING: locale.h: in the future, the compiler will take precedence" >&5
56511 +echo "$as_me: WARNING: locale.h: in the future, the compiler will take precedence" >&2;}
56512 + (
56513 + cat <<\_ASBOX
56514 +## ----------------------------------------- ##
56515 +## Report this to the package-unused lists. ##
56516 +## ----------------------------------------- ##
56517 +_ASBOX
56518 + ) |
56519 + sed "s/^/$as_me: WARNING: /" >&2
56520 + ;;
56521 +esac
56522 +echo "$as_me:$LINENO: checking for locale.h" >&5
56523 +echo $ECHO_N "checking for locale.h... $ECHO_C" >&6
56524 +if test "${ac_cv_header_locale_h+set}" = set; then
56525 + echo $ECHO_N "(cached) $ECHO_C" >&6
56526 +else
56527 + ac_cv_header_locale_h=$ac_header_preproc
56528 +fi
56529 +echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
56530 +echo "${ECHO_T}$ac_cv_header_locale_h" >&6
56531 +
56532 +fi
56533 +if test $ac_cv_header_locale_h = yes; then
56534 +
56535 + echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5
56536 +echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6
56537 +if test "${ac_cv_val_LC_MESSAGES+set}" = set; then
56538 + echo $ECHO_N "(cached) $ECHO_C" >&6
56539 +else
56540 + if test x$gcc_no_link = xyes; then
56541 + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
56542 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
56543 + { (exit 1); exit 1; }; }
56544 +fi
56545 +cat >conftest.$ac_ext <<_ACEOF
56546 +/* confdefs.h. */
56547 +_ACEOF
56548 +cat confdefs.h >>conftest.$ac_ext
56549 +cat >>conftest.$ac_ext <<_ACEOF
56550 +/* end confdefs.h. */
56551 +#include <locale.h>
56552 +int
56553 +main ()
56554 +{
56555 +return LC_MESSAGES
56556 + ;
56557 + return 0;
56558 +}
56559 +_ACEOF
56560 +rm -f conftest.$ac_objext conftest$ac_exeext
56561 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
56562 + (eval $ac_link) 2>conftest.er1
56563 + ac_status=$?
56564 + grep -v '^ *+' conftest.er1 >conftest.err
56565 + rm -f conftest.er1
56566 + cat conftest.err >&5
56567 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56568 + (exit $ac_status); } &&
56569 + { ac_try='test -z "$ac_c_werror_flag"
56570 + || test ! -s conftest.err'
56571 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
56572 + (eval $ac_try) 2>&5
56573 + ac_status=$?
56574 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56575 + (exit $ac_status); }; } &&
56576 + { ac_try='test -s conftest$ac_exeext'
56577 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
56578 + (eval $ac_try) 2>&5
56579 + ac_status=$?
56580 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56581 + (exit $ac_status); }; }; then
56582 + ac_cv_val_LC_MESSAGES=yes
56583 +else
56584 + echo "$as_me: failed program was:" >&5
56585 +sed 's/^/| /' conftest.$ac_ext >&5
56586 +
56587 +ac_cv_val_LC_MESSAGES=no
56588 +fi
56589 +rm -f conftest.err conftest.$ac_objext \
56590 + conftest$ac_exeext conftest.$ac_ext
56591 +fi
56592 +echo "$as_me:$LINENO: result: $ac_cv_val_LC_MESSAGES" >&5
56593 +echo "${ECHO_T}$ac_cv_val_LC_MESSAGES" >&6
56594 + if test $ac_cv_val_LC_MESSAGES = yes; then
56595 +
56596 +cat >>confdefs.h <<\_ACEOF
56597 +#define HAVE_LC_MESSAGES 1
56598 +_ACEOF
56599 +
56600 + fi
56601 +
56602 +fi
56603 +
56604 +
56605 +
56606 +
56607 # Check for sigsetjmp
56608 cat >conftest.$ac_ext <<_ACEOF
56609 /* confdefs.h. */
56610 @@ -108905,6 +109119,266 @@ sed 's/^/| /' conftest.$ac_ext >&5
56611
56612 fi
56613 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
56614 +
56615 + cat >>confdefs.h <<\_ACEOF
56616 +#define HAVE_MMAP 1
56617 +_ACEOF
56618 +
56619 +
56620 + # For iconv support.
56621 +
56622 +
56623 +
56624 +
56625 +
56626 + am_save_CPPFLAGS="$CPPFLAGS"
56627 +
56628 + for element in $INCICONV; do
56629 + haveit=
56630 + for x in $CPPFLAGS; do
56631 +
56632 + acl_save_prefix="$prefix"
56633 + prefix="$acl_final_prefix"
56634 + acl_save_exec_prefix="$exec_prefix"
56635 + exec_prefix="$acl_final_exec_prefix"
56636 + eval x=\"$x\"
56637 + exec_prefix="$acl_save_exec_prefix"
56638 + prefix="$acl_save_prefix"
56639 +
56640 + if test "X$x" = "X$element"; then
56641 + haveit=yes
56642 + break
56643 + fi
56644 + done
56645 + if test -z "$haveit"; then
56646 + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
56647 + fi
56648 + done
56649 +
56650 +
56651 + echo "$as_me:$LINENO: checking for iconv" >&5
56652 +echo $ECHO_N "checking for iconv... $ECHO_C" >&6
56653 +if test "${am_cv_func_iconv+set}" = set; then
56654 + echo $ECHO_N "(cached) $ECHO_C" >&6
56655 +else
56656 +
56657 + am_cv_func_iconv="no, consider installing GNU libiconv"
56658 + am_cv_lib_iconv=no
56659 + if test x$gcc_no_link = xyes; then
56660 + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
56661 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
56662 + { (exit 1); exit 1; }; }
56663 +fi
56664 +cat >conftest.$ac_ext <<_ACEOF
56665 +/* confdefs.h. */
56666 +_ACEOF
56667 +cat confdefs.h >>conftest.$ac_ext
56668 +cat >>conftest.$ac_ext <<_ACEOF
56669 +/* end confdefs.h. */
56670 +#include <stdlib.h>
56671 +#include <iconv.h>
56672 +int
56673 +main ()
56674 +{
56675 +iconv_t cd = iconv_open("","");
56676 + iconv(cd,NULL,NULL,NULL,NULL);
56677 + iconv_close(cd);
56678 + ;
56679 + return 0;
56680 +}
56681 +_ACEOF
56682 +rm -f conftest.$ac_objext conftest$ac_exeext
56683 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
56684 + (eval $ac_link) 2>conftest.er1
56685 + ac_status=$?
56686 + grep -v '^ *+' conftest.er1 >conftest.err
56687 + rm -f conftest.er1
56688 + cat conftest.err >&5
56689 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56690 + (exit $ac_status); } &&
56691 + { ac_try='test -z "$ac_c_werror_flag"
56692 + || test ! -s conftest.err'
56693 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
56694 + (eval $ac_try) 2>&5
56695 + ac_status=$?
56696 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56697 + (exit $ac_status); }; } &&
56698 + { ac_try='test -s conftest$ac_exeext'
56699 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
56700 + (eval $ac_try) 2>&5
56701 + ac_status=$?
56702 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56703 + (exit $ac_status); }; }; then
56704 + am_cv_func_iconv=yes
56705 +else
56706 + echo "$as_me: failed program was:" >&5
56707 +sed 's/^/| /' conftest.$ac_ext >&5
56708 +
56709 +fi
56710 +rm -f conftest.err conftest.$ac_objext \
56711 + conftest$ac_exeext conftest.$ac_ext
56712 + if test "$am_cv_func_iconv" != yes; then
56713 + am_save_LIBS="$LIBS"
56714 + LIBS="$LIBS $LIBICONV"
56715 + if test x$gcc_no_link = xyes; then
56716 + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
56717 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
56718 + { (exit 1); exit 1; }; }
56719 +fi
56720 +cat >conftest.$ac_ext <<_ACEOF
56721 +/* confdefs.h. */
56722 +_ACEOF
56723 +cat confdefs.h >>conftest.$ac_ext
56724 +cat >>conftest.$ac_ext <<_ACEOF
56725 +/* end confdefs.h. */
56726 +#include <stdlib.h>
56727 +#include <iconv.h>
56728 +int
56729 +main ()
56730 +{
56731 +iconv_t cd = iconv_open("","");
56732 + iconv(cd,NULL,NULL,NULL,NULL);
56733 + iconv_close(cd);
56734 + ;
56735 + return 0;
56736 +}
56737 +_ACEOF
56738 +rm -f conftest.$ac_objext conftest$ac_exeext
56739 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
56740 + (eval $ac_link) 2>conftest.er1
56741 + ac_status=$?
56742 + grep -v '^ *+' conftest.er1 >conftest.err
56743 + rm -f conftest.er1
56744 + cat conftest.err >&5
56745 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56746 + (exit $ac_status); } &&
56747 + { ac_try='test -z "$ac_c_werror_flag"
56748 + || test ! -s conftest.err'
56749 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
56750 + (eval $ac_try) 2>&5
56751 + ac_status=$?
56752 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56753 + (exit $ac_status); }; } &&
56754 + { ac_try='test -s conftest$ac_exeext'
56755 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
56756 + (eval $ac_try) 2>&5
56757 + ac_status=$?
56758 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56759 + (exit $ac_status); }; }; then
56760 + am_cv_lib_iconv=yes
56761 + am_cv_func_iconv=yes
56762 +else
56763 + echo "$as_me: failed program was:" >&5
56764 +sed 's/^/| /' conftest.$ac_ext >&5
56765 +
56766 +fi
56767 +rm -f conftest.err conftest.$ac_objext \
56768 + conftest$ac_exeext conftest.$ac_ext
56769 + LIBS="$am_save_LIBS"
56770 + fi
56771 +
56772 +fi
56773 +echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5
56774 +echo "${ECHO_T}$am_cv_func_iconv" >&6
56775 + if test "$am_cv_func_iconv" = yes; then
56776 +
56777 +cat >>confdefs.h <<\_ACEOF
56778 +#define HAVE_ICONV 1
56779 +_ACEOF
56780 +
56781 + fi
56782 + if test "$am_cv_lib_iconv" = yes; then
56783 + echo "$as_me:$LINENO: checking how to link with libiconv" >&5
56784 +echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6
56785 + echo "$as_me:$LINENO: result: $LIBICONV" >&5
56786 +echo "${ECHO_T}$LIBICONV" >&6
56787 + else
56788 + CPPFLAGS="$am_save_CPPFLAGS"
56789 + LIBICONV=
56790 + LTLIBICONV=
56791 + fi
56792 +
56793 +
56794 +
56795 + if test "$am_cv_func_iconv" = yes; then
56796 + echo "$as_me:$LINENO: checking for iconv declaration" >&5
56797 +echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6
56798 + if test "${am_cv_proto_iconv+set}" = set; then
56799 + echo $ECHO_N "(cached) $ECHO_C" >&6
56800 +else
56801 +
56802 + cat >conftest.$ac_ext <<_ACEOF
56803 +/* confdefs.h. */
56804 +_ACEOF
56805 +cat confdefs.h >>conftest.$ac_ext
56806 +cat >>conftest.$ac_ext <<_ACEOF
56807 +/* end confdefs.h. */
56808 +
56809 +#include <stdlib.h>
56810 +#include <iconv.h>
56811 +extern
56812 +#ifdef __cplusplus
56813 +"C"
56814 +#endif
56815 +#if defined(__STDC__) || defined(__cplusplus)
56816 +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
56817 +#else
56818 +size_t iconv();
56819 +#endif
56820 +
56821 +int
56822 +main ()
56823 +{
56824 +
56825 + ;
56826 + return 0;
56827 +}
56828 +_ACEOF
56829 +rm -f conftest.$ac_objext
56830 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
56831 + (eval $ac_compile) 2>conftest.er1
56832 + ac_status=$?
56833 + grep -v '^ *+' conftest.er1 >conftest.err
56834 + rm -f conftest.er1
56835 + cat conftest.err >&5
56836 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56837 + (exit $ac_status); } &&
56838 + { ac_try='test -z "$ac_c_werror_flag"
56839 + || test ! -s conftest.err'
56840 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
56841 + (eval $ac_try) 2>&5
56842 + ac_status=$?
56843 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56844 + (exit $ac_status); }; } &&
56845 + { ac_try='test -s conftest.$ac_objext'
56846 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
56847 + (eval $ac_try) 2>&5
56848 + ac_status=$?
56849 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
56850 + (exit $ac_status); }; }; then
56851 + am_cv_proto_iconv_arg1=""
56852 +else
56853 + echo "$as_me: failed program was:" >&5
56854 +sed 's/^/| /' conftest.$ac_ext >&5
56855 +
56856 +am_cv_proto_iconv_arg1="const"
56857 +fi
56858 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
56859 + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
56860 +fi
56861 +
56862 + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
56863 + echo "$as_me:$LINENO: result: ${ac_t:-
56864 + }$am_cv_proto_iconv" >&5
56865 +echo "${ECHO_T}${ac_t:-
56866 + }$am_cv_proto_iconv" >&6
56867 +
56868 +cat >>confdefs.h <<_ACEOF
56869 +#define ICONV_CONST $am_cv_proto_iconv_arg1
56870 +_ACEOF
56871 +
56872 + fi
56873 +
56874 ;;
56875 *-mingw32*)
56876
56877 @@ -109059,6 +109533,14 @@ fi
56878
56879 done
56880
56881 + cat >>confdefs.h <<\_ACEOF
56882 +#define HAVE_STRTOF 1
56883 +_ACEOF
56884 +
56885 + cat >>confdefs.h <<\_ACEOF
56886 +#define HAVE_STRTOLD 1
56887 +_ACEOF
56888 +
56889
56890 # If we're not using GNU ld, then there's no point in even trying these
56891 # tests. Check for that first. We should have already tested for gld
56892 @@ -115963,6 +116445,24 @@ ABI_TWEAKS_SRCDIR=config/${abi_tweaks_di
56893
56894
56895
56896 +# For SymbianOS, we use a highly cut-down libsupc++. This lets us
56897 +# conditionalise libsupc++'s Makefile.am to include only the necessary sources.
56898 +case "$target" in
56899 + *arm*-symbianelf)
56900 + LIBSUPCXX_PRONLY=yes;;
56901 + *);;
56902 +esac
56903 +
56904 +
56905 +if test x$LIBSUPCXX_PRONLY = xyes; then
56906 + LIBSUPCXX_PRONLY_TRUE=
56907 + LIBSUPCXX_PRONLY_FALSE='#'
56908 +else
56909 + LIBSUPCXX_PRONLY_TRUE='#'
56910 + LIBSUPCXX_PRONLY_FALSE=
56911 +fi
56912 +
56913 +
56914 # Determine cross-compile flags and AM_CONDITIONALs.
56915 #AC_SUBST(GLIBCXX_IS_NATIVE)
56916 #AM_CONDITIONAL(CANADIAN, test $CANADIAN = yes)
56917 @@ -116543,6 +117043,13 @@ echo "$as_me: error: conditional \"GLIBC
56918 Usually this means the macro was only invoked conditionally." >&2;}
56919 { (exit 1); exit 1; }; }
56920 fi
56921 +if test -z "${LIBSUPCXX_PRONLY_TRUE}" && test -z "${LIBSUPCXX_PRONLY_FALSE}"; then
56922 + { { echo "$as_me:$LINENO: error: conditional \"LIBSUPCXX_PRONLY\" was never defined.
56923 +Usually this means the macro was only invoked conditionally." >&5
56924 +echo "$as_me: error: conditional \"LIBSUPCXX_PRONLY\" was never defined.
56925 +Usually this means the macro was only invoked conditionally." >&2;}
56926 + { (exit 1); exit 1; }; }
56927 +fi
56928
56929 : ${CONFIG_STATUS=./config.status}
56930 ac_clean_files_save=$ac_clean_files
56931 @@ -117580,6 +118087,8 @@ s,@CPU_DEFINES_SRCDIR@,$CPU_DEFINES_SRCD
56932 s,@ABI_TWEAKS_SRCDIR@,$ABI_TWEAKS_SRCDIR,;t t
56933 s,@OS_INC_SRCDIR@,$OS_INC_SRCDIR,;t t
56934 s,@ERROR_CONSTANTS_SRCDIR@,$ERROR_CONSTANTS_SRCDIR,;t t
56935 +s,@LIBSUPCXX_PRONLY_TRUE@,$LIBSUPCXX_PRONLY_TRUE,;t t
56936 +s,@LIBSUPCXX_PRONLY_FALSE@,$LIBSUPCXX_PRONLY_FALSE,;t t
56937 s,@glibcxx_prefixdir@,$glibcxx_prefixdir,;t t
56938 s,@gxx_include_dir@,$gxx_include_dir,;t t
56939 s,@glibcxx_toolexecdir@,$glibcxx_toolexecdir,;t t
56940 --- a/libstdc++-v3/configure.ac
56941 +++ b/libstdc++-v3/configure.ac
56942 @@ -138,7 +138,7 @@ if $GLIBCXX_IS_NATIVE; then
56943
56944 # Check for available headers.
56945 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
56946 - machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
56947 + machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h \
56948 sys/types.h sys/ipc.h sys/sem.h])
56949
56950 GLIBCXX_CHECK_LINKER_FEATURES
56951 @@ -344,13 +344,22 @@ AC_SUBST(OS_INC_SRCDIR)
56952 AC_SUBST(ERROR_CONSTANTS_SRCDIR)
56953
56954
56955 +# For SymbianOS, we use a highly cut-down libsupc++. This lets us
56956 +# conditionalise libsupc++'s Makefile.am to include only the necessary sources.
56957 +case "$target" in
56958 + *arm*-symbianelf)
56959 + LIBSUPCXX_PRONLY=yes;;
56960 + *);;
56961 +esac
56962 +AM_CONDITIONAL(LIBSUPCXX_PRONLY, test x$LIBSUPCXX_PRONLY = xyes)
56963 +
56964 # Determine cross-compile flags and AM_CONDITIONALs.
56965 #AC_SUBST(GLIBCXX_IS_NATIVE)
56966 #AM_CONDITIONAL(CANADIAN, test $CANADIAN = yes)
56967 # from GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT:
56968 #AM_CONDITIONAL(GLIBCXX_BUILD_LIBMATH, test $need_libmath = yes)
56969 GLIBCXX_EVALUATE_CONDITIONALS
56970 -
56971 +
56972 AC_CACHE_SAVE
56973
56974 if test ${multilib} = yes; then
56975 --- a/libstdc++-v3/configure.host
56976 +++ b/libstdc++-v3/configure.host
56977 @@ -320,6 +320,11 @@ case "${host}" in
56978 abi_baseline_pair=${try_cpu}-linux-gnu
56979 fi
56980 esac
56981 + case "${host}" in
56982 + arm*-*-linux-*eabi)
56983 + port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
56984 + ;;
56985 + esac
56986 ;;
56987 mips*-*-*)
56988 case "${host_os}" in
56989 --- a/libstdc++-v3/crossconfig.m4
56990 +++ b/libstdc++-v3/crossconfig.m4
56991 @@ -46,7 +46,7 @@ case "${host}" in
56992 # so we just check for all the features here.
56993 # Check for available headers.
56994 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
56995 - machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
56996 + machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h \
56997 sys/types.h])
56998
56999 # Don't call GLIBCXX_CHECK_LINKER_FEATURES, Darwin doesn't have a GNU ld
57000 @@ -197,7 +197,7 @@ case "${host}" in
57001 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
57002 machine/endian.h machine/param.h sys/machine.h sys/types.h \
57003 fp.h float.h endian.h inttypes.h locale.h float.h stdint.h \
57004 - sys/ipc.h sys/sem.h gconf.h])
57005 + sys/ipc.h sys/sem.h])
57006 SECTION_FLAGS='-ffunction-sections -fdata-sections'
57007 AC_SUBST(SECTION_FLAGS)
57008 GLIBCXX_CHECK_COMPILER_FEATURES
57009 @@ -223,6 +223,10 @@ case "${host}" in
57010 # For C99 support to TR1.
57011 GLIBCXX_CHECK_C99_TR1
57012
57013 + AC_DEFINE(_GLIBCXX_USE_RANDOM_TR1)
57014 +
57015 + AC_LC_MESSAGES
57016 +
57017 # Check for sigsetjmp
57018 AC_TRY_COMPILE(
57019 [#include <setjmp.h>],
57020 @@ -231,9 +235,16 @@ case "${host}" in
57021 siglongjmp (env, 1);
57022 ],
57023 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available.])])
57024 +
57025 + AC_DEFINE(HAVE_MMAP)
57026 +
57027 + # For iconv support.
57028 + AM_ICONV
57029 ;;
57030 *-mingw32*)
57031 AC_CHECK_HEADERS([sys/types.h locale.h float.h])
57032 + AC_DEFINE(HAVE_STRTOF)
57033 + AC_DEFINE(HAVE_STRTOLD)
57034 GLIBCXX_CHECK_LINKER_FEATURES
57035 GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
57036 ;;
57037 --- a/libstdc++-v3/doc/Makefile.in
57038 +++ b/libstdc++-v3/doc/Makefile.in
57039 @@ -157,6 +157,8 @@ LIBMATHOBJS = @LIBMATHOBJS@
57040 LIBOBJS = @LIBOBJS@
57041 LIBS = @LIBS@
57042 LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
57043 +LIBSUPCXX_PRONLY_FALSE = @LIBSUPCXX_PRONLY_FALSE@
57044 +LIBSUPCXX_PRONLY_TRUE = @LIBSUPCXX_PRONLY_TRUE@
57045 LIBTOOL = @LIBTOOL@
57046 LN_S = @LN_S@
57047 LTLIBICONV = @LTLIBICONV@
57048 --- a/libstdc++-v3/include/Makefile.am
57049 +++ b/libstdc++-v3/include/Makefile.am
57050 @@ -1103,8 +1103,14 @@ ${pch3_output}: ${pch3_source} ${pch2_ou
57051 if GLIBCXX_HOSTED
57052 install-data-local: install-headers
57053 else
57054 +if LIBSUPCXX_PRONLY
57055 +# Don't install any headers if we're only putting eh_personality in
57056 +# libsupc++ (e.g. on SymbianOS)
57057 +install-data-local:
57058 +else
57059 install-data-local: install-freestanding-headers
57060 endif
57061 +endif
57062
57063 # This is a subset of the full install-headers rule. We only need <cstddef>,
57064 # <limits>, <cstdlib>, <cstdarg>, <new>, <typeinfo>, <exception>, and any
57065 --- a/libstdc++-v3/include/Makefile.in
57066 +++ b/libstdc++-v3/include/Makefile.in
57067 @@ -157,6 +157,8 @@ LIBMATHOBJS = @LIBMATHOBJS@
57068 LIBOBJS = @LIBOBJS@
57069 LIBS = @LIBS@
57070 LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
57071 +LIBSUPCXX_PRONLY_FALSE = @LIBSUPCXX_PRONLY_FALSE@
57072 +LIBSUPCXX_PRONLY_TRUE = @LIBSUPCXX_PRONLY_TRUE@
57073 LIBTOOL = @LIBTOOL@
57074 LN_S = @LN_S@
57075 LTLIBICONV = @LTLIBICONV@
57076 @@ -1492,7 +1494,10 @@ ${pch3_output}: ${pch3_source} ${pch2_ou
57077 # the rest are taken from the original source tree.
57078
57079 @GLIBCXX_HOSTED_TRUE@install-data-local: install-headers
57080 -@GLIBCXX_HOSTED_FALSE@install-data-local: install-freestanding-headers
57081 +# Don't install any headers if we're only putting eh_personality in
57082 +# libsupc++ (e.g. on SymbianOS)
57083 +@GLIBCXX_HOSTED_FALSE@@LIBSUPCXX_PRONLY_TRUE@install-data-local:
57084 +@GLIBCXX_HOSTED_FALSE@@LIBSUPCXX_PRONLY_FALSE@install-data-local: install-freestanding-headers
57085
57086 # This is a subset of the full install-headers rule. We only need <cstddef>,
57087 # <limits>, <cstdlib>, <cstdarg>, <new>, <typeinfo>, <exception>, and any
57088 --- a/libstdc++-v3/include/std/type_traits
57089 +++ b/libstdc++-v3/include/std/type_traits
57090 @@ -455,15 +455,18 @@ namespace std
57091 struct __make_unsigned_selector<_Tp, false, true>
57092 {
57093 private:
57094 - // GNU enums start with sizeof short.
57095 - typedef unsigned short __smallest;
57096 - static const bool __b1 = sizeof(_Tp) <= sizeof(__smallest);
57097 + // With -fshort-enums, an enum may be as small as a char.
57098 + typedef unsigned char __smallest;
57099 + static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest);
57100 + static const bool __b1 = sizeof(_Tp) <= sizeof(unsigned short);
57101 static const bool __b2 = sizeof(_Tp) <= sizeof(unsigned int);
57102 - typedef conditional<__b2, unsigned int, unsigned long> __cond;
57103 - typedef typename __cond::type __cond_type;
57104 + typedef conditional<__b2, unsigned int, unsigned long> __cond2;
57105 + typedef typename __cond2::type __cond2_type;
57106 + typedef conditional<__b1, unsigned short, __cond2_type> __cond1;
57107 + typedef typename __cond1::type __cond1_type;
57108
57109 public:
57110 - typedef typename conditional<__b1, __smallest, __cond_type>::type __type;
57111 + typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
57112 };
57113
57114 // Given an integral/enum type, return the corresponding unsigned
57115 @@ -530,15 +533,18 @@ namespace std
57116 struct __make_signed_selector<_Tp, false, true>
57117 {
57118 private:
57119 - // GNU enums start with sizeof short.
57120 - typedef signed short __smallest;
57121 - static const bool __b1 = sizeof(_Tp) <= sizeof(__smallest);
57122 + // With -fshort-enums, an enum may be as small as a char.
57123 + typedef signed char __smallest;
57124 + static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest);
57125 + static const bool __b1 = sizeof(_Tp) <= sizeof(signed short);
57126 static const bool __b2 = sizeof(_Tp) <= sizeof(signed int);
57127 - typedef conditional<__b2, signed int, signed long> __cond;
57128 - typedef typename __cond::type __cond_type;
57129 + typedef conditional<__b2, signed int, signed long> __cond2;
57130 + typedef typename __cond2::type __cond2_type;
57131 + typedef conditional<__b1, signed short, __cond2_type> __cond1;
57132 + typedef typename __cond1::type __cond1_type;
57133
57134 public:
57135 - typedef typename conditional<__b1, __smallest, __cond_type>::type __type;
57136 + typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
57137 };
57138
57139 // Given an integral/enum type, return the corresponding signed
57140 --- a/libstdc++-v3/libmath/Makefile.in
57141 +++ b/libstdc++-v3/libmath/Makefile.in
57142 @@ -172,6 +172,8 @@ LIBMATHOBJS = @LIBMATHOBJS@
57143 LIBOBJS = @LIBOBJS@
57144 LIBS = @LIBS@
57145 LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
57146 +LIBSUPCXX_PRONLY_FALSE = @LIBSUPCXX_PRONLY_FALSE@
57147 +LIBSUPCXX_PRONLY_TRUE = @LIBSUPCXX_PRONLY_TRUE@
57148
57149 # Only compiling "C" sources in this directory.
57150 LIBTOOL = @LIBTOOL@ --tag CC
57151 --- a/libstdc++-v3/libsupc++/Makefile.am
57152 +++ b/libstdc++-v3/libsupc++/Makefile.am
57153 @@ -31,6 +31,11 @@ toolexeclib_LTLIBRARIES = libsupc++.la
57154 # 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
57155 noinst_LTLIBRARIES = libsupc++convenience.la
57156
57157 +if LIBSUPCXX_PRONLY
57158 +sources = \
57159 + eh_personality.cc
57160 +
57161 +else
57162
57163 headers = \
57164 exception new typeinfo cxxabi.h cxxabi-forced.h exception_defines.h
57165 @@ -83,6 +88,7 @@ sources = \
57166 vec.cc \
57167 vmi_class_type_info.cc \
57168 vterminate.cc
57169 +endif
57170
57171 libsupc___la_SOURCES = $(sources) $(c_sources)
57172 libsupc__convenience_la_SOURCES = $(sources) $(c_sources)
57173 --- a/libstdc++-v3/libsupc++/Makefile.in
57174 +++ b/libstdc++-v3/libsupc++/Makefile.in
57175 @@ -38,7 +38,7 @@ POST_UNINSTALL = :
57176 build_triplet = @build@
57177 host_triplet = @host@
57178 target_triplet = @target@
57179 -DIST_COMMON = $(glibcxxinstall_HEADERS) $(srcdir)/Makefile.am \
57180 +DIST_COMMON = $(am__glibcxxinstall_HEADERS_DIST) $(srcdir)/Makefile.am \
57181 $(srcdir)/Makefile.in $(top_srcdir)/fragment.am
57182 subdir = libsupc++
57183 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
57184 @@ -84,19 +84,29 @@ am__libsupc___la_SOURCES_DIST = array_ty
57185 pmem_type_info.cc pointer_type_info.cc pure.cc \
57186 si_class_type_info.cc tinfo.cc tinfo2.cc vec.cc \
57187 vmi_class_type_info.cc vterminate.cc cp-demangle.c
57188 -am__objects_1 = array_type_info.lo atexit_arm.lo bad_cast.lo \
57189 - bad_typeid.lo class_type_info.lo del_op.lo del_opnt.lo \
57190 - del_opv.lo del_opvnt.lo dyncast.lo eh_alloc.lo eh_arm.lo \
57191 - eh_aux_runtime.lo eh_call.lo eh_catch.lo eh_exception.lo \
57192 - eh_globals.lo eh_personality.lo eh_term_handler.lo \
57193 - eh_terminate.lo eh_throw.lo eh_type.lo eh_unex_handler.lo \
57194 - enum_type_info.lo function_type_info.lo \
57195 - fundamental_type_info.lo guard.lo new_handler.lo new_op.lo \
57196 - new_opnt.lo new_opv.lo new_opvnt.lo pbase_type_info.lo \
57197 - pmem_type_info.lo pointer_type_info.lo pure.lo \
57198 - si_class_type_info.lo tinfo.lo tinfo2.lo vec.lo \
57199 - vmi_class_type_info.lo vterminate.lo
57200 -@GLIBCXX_HOSTED_TRUE@am__objects_2 = cp-demangle.lo
57201 +@LIBSUPCXX_PRONLY_FALSE@am__objects_1 = array_type_info.lo \
57202 +@LIBSUPCXX_PRONLY_FALSE@ atexit_arm.lo bad_cast.lo \
57203 +@LIBSUPCXX_PRONLY_FALSE@ bad_typeid.lo class_type_info.lo \
57204 +@LIBSUPCXX_PRONLY_FALSE@ del_op.lo del_opnt.lo del_opv.lo \
57205 +@LIBSUPCXX_PRONLY_FALSE@ del_opvnt.lo dyncast.lo eh_alloc.lo \
57206 +@LIBSUPCXX_PRONLY_FALSE@ eh_arm.lo eh_aux_runtime.lo eh_call.lo \
57207 +@LIBSUPCXX_PRONLY_FALSE@ eh_catch.lo eh_exception.lo \
57208 +@LIBSUPCXX_PRONLY_FALSE@ eh_globals.lo eh_personality.lo \
57209 +@LIBSUPCXX_PRONLY_FALSE@ eh_term_handler.lo eh_terminate.lo \
57210 +@LIBSUPCXX_PRONLY_FALSE@ eh_throw.lo eh_type.lo \
57211 +@LIBSUPCXX_PRONLY_FALSE@ eh_unex_handler.lo enum_type_info.lo \
57212 +@LIBSUPCXX_PRONLY_FALSE@ function_type_info.lo \
57213 +@LIBSUPCXX_PRONLY_FALSE@ fundamental_type_info.lo guard.lo \
57214 +@LIBSUPCXX_PRONLY_FALSE@ new_handler.lo new_op.lo new_opnt.lo \
57215 +@LIBSUPCXX_PRONLY_FALSE@ new_opv.lo new_opvnt.lo \
57216 +@LIBSUPCXX_PRONLY_FALSE@ pbase_type_info.lo pmem_type_info.lo \
57217 +@LIBSUPCXX_PRONLY_FALSE@ pointer_type_info.lo pure.lo \
57218 +@LIBSUPCXX_PRONLY_FALSE@ si_class_type_info.lo tinfo.lo \
57219 +@LIBSUPCXX_PRONLY_FALSE@ tinfo2.lo vec.lo \
57220 +@LIBSUPCXX_PRONLY_FALSE@ vmi_class_type_info.lo vterminate.lo
57221 +@LIBSUPCXX_PRONLY_TRUE@am__objects_1 = eh_personality.lo
57222 +@GLIBCXX_HOSTED_TRUE@@LIBSUPCXX_PRONLY_FALSE@am__objects_2 = \
57223 +@GLIBCXX_HOSTED_TRUE@@LIBSUPCXX_PRONLY_FALSE@ cp-demangle.lo
57224 am_libsupc___la_OBJECTS = $(am__objects_1) $(am__objects_2)
57225 libsupc___la_OBJECTS = $(am_libsupc___la_OBJECTS)
57226 libsupc__convenience_la_LIBADD =
57227 @@ -129,6 +139,8 @@ CXXLD = $(CXX)
57228 SOURCES = $(libsupc___la_SOURCES) $(libsupc__convenience_la_SOURCES)
57229 DIST_SOURCES = $(am__libsupc___la_SOURCES_DIST) \
57230 $(am__libsupc__convenience_la_SOURCES_DIST)
57231 +am__glibcxxinstall_HEADERS_DIST = exception new typeinfo cxxabi.h \
57232 + cxxabi-forced.h exception_defines.h
57233 glibcxxinstallHEADERS_INSTALL = $(INSTALL_HEADER)
57234 HEADERS = $(glibcxxinstall_HEADERS)
57235 ETAGS = etags
57236 @@ -227,6 +239,8 @@ LIBMATHOBJS = @LIBMATHOBJS@
57237 LIBOBJS = @LIBOBJS@
57238 LIBS = @LIBS@
57239 LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
57240 +LIBSUPCXX_PRONLY_FALSE = @LIBSUPCXX_PRONLY_FALSE@
57241 +LIBSUPCXX_PRONLY_TRUE = @LIBSUPCXX_PRONLY_TRUE@
57242 LIBTOOL = @LIBTOOL@
57243 LN_S = @LN_S@
57244 LTLIBICONV = @LTLIBICONV@
57245 @@ -350,55 +364,58 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
57246 toolexeclib_LTLIBRARIES = libsupc++.la
57247 # 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
57248 noinst_LTLIBRARIES = libsupc++convenience.la
57249 -headers = \
57250 - exception new typeinfo cxxabi.h cxxabi-forced.h exception_defines.h
57251 +@LIBSUPCXX_PRONLY_FALSE@sources = \
57252 +@LIBSUPCXX_PRONLY_FALSE@ array_type_info.cc \
57253 +@LIBSUPCXX_PRONLY_FALSE@ atexit_arm.cc \
57254 +@LIBSUPCXX_PRONLY_FALSE@ bad_cast.cc \
57255 +@LIBSUPCXX_PRONLY_FALSE@ bad_typeid.cc \
57256 +@LIBSUPCXX_PRONLY_FALSE@ class_type_info.cc \
57257 +@LIBSUPCXX_PRONLY_FALSE@ del_op.cc \
57258 +@LIBSUPCXX_PRONLY_FALSE@ del_opnt.cc \
57259 +@LIBSUPCXX_PRONLY_FALSE@ del_opv.cc \
57260 +@LIBSUPCXX_PRONLY_FALSE@ del_opvnt.cc \
57261 +@LIBSUPCXX_PRONLY_FALSE@ dyncast.cc \
57262 +@LIBSUPCXX_PRONLY_FALSE@ eh_alloc.cc \
57263 +@LIBSUPCXX_PRONLY_FALSE@ eh_arm.cc \
57264 +@LIBSUPCXX_PRONLY_FALSE@ eh_aux_runtime.cc \
57265 +@LIBSUPCXX_PRONLY_FALSE@ eh_call.cc \
57266 +@LIBSUPCXX_PRONLY_FALSE@ eh_catch.cc \
57267 +@LIBSUPCXX_PRONLY_FALSE@ eh_exception.cc \
57268 +@LIBSUPCXX_PRONLY_FALSE@ eh_globals.cc \
57269 +@LIBSUPCXX_PRONLY_FALSE@ eh_personality.cc \
57270 +@LIBSUPCXX_PRONLY_FALSE@ eh_term_handler.cc \
57271 +@LIBSUPCXX_PRONLY_FALSE@ eh_terminate.cc \
57272 +@LIBSUPCXX_PRONLY_FALSE@ eh_throw.cc \
57273 +@LIBSUPCXX_PRONLY_FALSE@ eh_type.cc \
57274 +@LIBSUPCXX_PRONLY_FALSE@ eh_unex_handler.cc \
57275 +@LIBSUPCXX_PRONLY_FALSE@ enum_type_info.cc \
57276 +@LIBSUPCXX_PRONLY_FALSE@ function_type_info.cc \
57277 +@LIBSUPCXX_PRONLY_FALSE@ fundamental_type_info.cc \
57278 +@LIBSUPCXX_PRONLY_FALSE@ guard.cc \
57279 +@LIBSUPCXX_PRONLY_FALSE@ new_handler.cc \
57280 +@LIBSUPCXX_PRONLY_FALSE@ new_op.cc \
57281 +@LIBSUPCXX_PRONLY_FALSE@ new_opnt.cc \
57282 +@LIBSUPCXX_PRONLY_FALSE@ new_opv.cc \
57283 +@LIBSUPCXX_PRONLY_FALSE@ new_opvnt.cc \
57284 +@LIBSUPCXX_PRONLY_FALSE@ pbase_type_info.cc \
57285 +@LIBSUPCXX_PRONLY_FALSE@ pmem_type_info.cc \
57286 +@LIBSUPCXX_PRONLY_FALSE@ pointer_type_info.cc \
57287 +@LIBSUPCXX_PRONLY_FALSE@ pure.cc \
57288 +@LIBSUPCXX_PRONLY_FALSE@ si_class_type_info.cc \
57289 +@LIBSUPCXX_PRONLY_FALSE@ tinfo.cc \
57290 +@LIBSUPCXX_PRONLY_FALSE@ tinfo2.cc \
57291 +@LIBSUPCXX_PRONLY_FALSE@ vec.cc \
57292 +@LIBSUPCXX_PRONLY_FALSE@ vmi_class_type_info.cc \
57293 +@LIBSUPCXX_PRONLY_FALSE@ vterminate.cc
57294
57295 -@GLIBCXX_HOSTED_TRUE@c_sources = \
57296 -@GLIBCXX_HOSTED_TRUE@ cp-demangle.c
57297 +@LIBSUPCXX_PRONLY_TRUE@sources = \
57298 +@LIBSUPCXX_PRONLY_TRUE@ eh_personality.cc
57299
57300 -sources = \
57301 - array_type_info.cc \
57302 - atexit_arm.cc \
57303 - bad_cast.cc \
57304 - bad_typeid.cc \
57305 - class_type_info.cc \
57306 - del_op.cc \
57307 - del_opnt.cc \
57308 - del_opv.cc \
57309 - del_opvnt.cc \
57310 - dyncast.cc \
57311 - eh_alloc.cc \
57312 - eh_arm.cc \
57313 - eh_aux_runtime.cc \
57314 - eh_call.cc \
57315 - eh_catch.cc \
57316 - eh_exception.cc \
57317 - eh_globals.cc \
57318 - eh_personality.cc \
57319 - eh_term_handler.cc \
57320 - eh_terminate.cc \
57321 - eh_throw.cc \
57322 - eh_type.cc \
57323 - eh_unex_handler.cc \
57324 - enum_type_info.cc \
57325 - function_type_info.cc \
57326 - fundamental_type_info.cc \
57327 - guard.cc \
57328 - new_handler.cc \
57329 - new_op.cc \
57330 - new_opnt.cc \
57331 - new_opv.cc \
57332 - new_opvnt.cc \
57333 - pbase_type_info.cc \
57334 - pmem_type_info.cc \
57335 - pointer_type_info.cc \
57336 - pure.cc \
57337 - si_class_type_info.cc \
57338 - tinfo.cc \
57339 - tinfo2.cc \
57340 - vec.cc \
57341 - vmi_class_type_info.cc \
57342 - vterminate.cc
57343 +@LIBSUPCXX_PRONLY_FALSE@headers = \
57344 +@LIBSUPCXX_PRONLY_FALSE@ exception new typeinfo cxxabi.h cxxabi-forced.h exception_defines.h
57345 +
57346 +@GLIBCXX_HOSTED_TRUE@@LIBSUPCXX_PRONLY_FALSE@c_sources = \
57347 +@GLIBCXX_HOSTED_TRUE@@LIBSUPCXX_PRONLY_FALSE@ cp-demangle.c
57348
57349 libsupc___la_SOURCES = $(sources) $(c_sources)
57350 libsupc__convenience_la_SOURCES = $(sources) $(c_sources)
57351 --- a/libstdc++-v3/libsupc++/eh_arm.cc
57352 +++ b/libstdc++-v3/libsupc++/eh_arm.cc
57353 @@ -46,12 +46,14 @@ __cxa_type_match(_Unwind_Exception* ue_h
57354 bool is_reference __attribute__((__unused__)),
57355 void** thrown_ptr_p)
57356 {
57357 - bool foreign_exception = !__is_gxx_exception_class(ue_header->exception_class);
57358 + bool forced_unwind = __is_gxx_forced_unwind_class(ue_header->exception_class);
57359 + bool foreign_exception = !forced_unwind && !__is_gxx_exception_class(ue_header->exception_class);
57360 __cxa_exception* xh = __get_exception_header_from_ue(ue_header);
57361 const std::type_info* throw_type;
57362
57363 - // XXX What to do with forced unwind?
57364 - if (foreign_exception)
57365 + if (forced_unwind)
57366 + throw_type = &typeid(abi::__forced_unwind);
57367 + else if (foreign_exception)
57368 throw_type = &typeid(abi::__foreign_exception);
57369 else
57370 throw_type = xh->exceptionType;
57371 --- a/libstdc++-v3/libsupc++/eh_personality.cc
57372 +++ b/libstdc++-v3/libsupc++/eh_personality.cc
57373 @@ -544,8 +544,12 @@ PERSONALITY_FUNCTION (int version,
57374
57375 #ifdef __ARM_EABI_UNWINDER__
57376 throw_type = ue_header;
57377 - if ((actions & _UA_FORCE_UNWIND)
57378 - || foreign_exception)
57379 + if (actions & _UA_FORCE_UNWIND)
57380 + {
57381 + __GXX_INIT_FORCED_UNWIND_CLASS(ue_header->exception_class);
57382 + thrown_ptr = 0;
57383 + }
57384 + else if (foreign_exception)
57385 thrown_ptr = 0;
57386 #else
57387 // During forced unwinding, match a magic exception type.
57388 --- a/libstdc++-v3/libsupc++/unwind-cxx.h
57389 +++ b/libstdc++-v3/libsupc++/unwind-cxx.h
57390 @@ -201,6 +201,32 @@ __GXX_INIT_EXCEPTION_CLASS(_Unwind_Excep
57391 c[7] = '\0';
57392 }
57393
57394 +static inline bool
57395 +__is_gxx_forced_unwind_class(_Unwind_Exception_Class c)
57396 +{
57397 + return c[0] == 'G'
57398 + && c[1] == 'N'
57399 + && c[2] == 'U'
57400 + && c[3] == 'C'
57401 + && c[4] == 'F'
57402 + && c[5] == 'O'
57403 + && c[6] == 'R'
57404 + && c[7] == '\0';
57405 +}
57406 +
57407 +static inline void
57408 +__GXX_INIT_FORCED_UNWIND_CLASS(_Unwind_Exception_Class c)
57409 +{
57410 + c[0] = 'G';
57411 + c[1] = 'N';
57412 + c[2] = 'U';
57413 + c[3] = 'C';
57414 + c[4] = 'F';
57415 + c[5] = 'O';
57416 + c[6] = 'R';
57417 + c[7] = '\0';
57418 +}
57419 +
57420 static inline void*
57421 __gxx_caught_object(_Unwind_Exception* eo)
57422 {
57423 --- a/libstdc++-v3/libsupc++/vec.cc
57424 +++ b/libstdc++-v3/libsupc++/vec.cc
57425 @@ -461,6 +461,9 @@ namespace __aeabiv1
57426 __aeabi_vec_dtor_cookie (void *array_address,
57427 abi::__cxa_cdtor_type destructor)
57428 {
57429 + if (!array_address)
57430 + return NULL;
57431 +
57432 abi::__cxa_vec_dtor (array_address,
57433 reinterpret_cast<std::size_t *>(array_address)[-1],
57434 reinterpret_cast<std::size_t *>(array_address)[-2],
57435 @@ -473,6 +476,9 @@ namespace __aeabiv1
57436 __aeabi_vec_delete (void *array_address,
57437 abi::__cxa_cdtor_type destructor)
57438 {
57439 + if (!array_address)
57440 + return;
57441 +
57442 abi::__cxa_vec_delete (array_address,
57443 reinterpret_cast<std::size_t *>(array_address)[-2],
57444 2 * sizeof (std::size_t),
57445 @@ -484,6 +490,9 @@ namespace __aeabiv1
57446 abi::__cxa_cdtor_type destructor,
57447 void (*dealloc) (void *, std::size_t))
57448 {
57449 + if (!array_address)
57450 + return;
57451 +
57452 abi::__cxa_vec_delete3 (array_address,
57453 reinterpret_cast<std::size_t *>(array_address)[-2],
57454 2 * sizeof (std::size_t),
57455 @@ -494,6 +503,9 @@ namespace __aeabiv1
57456 __aeabi_vec_delete3_nodtor (void *array_address,
57457 void (*dealloc) (void *, std::size_t))
57458 {
57459 + if (!array_address)
57460 + return;
57461 +
57462 abi::__cxa_vec_delete3 (array_address,
57463 reinterpret_cast<std::size_t *>(array_address)[-2],
57464 2 * sizeof (std::size_t),
57465 --- a/libstdc++-v3/po/Makefile.in
57466 +++ b/libstdc++-v3/po/Makefile.in
57467 @@ -157,6 +157,8 @@ LIBMATHOBJS = @LIBMATHOBJS@
57468 LIBOBJS = @LIBOBJS@
57469 LIBS = @LIBS@
57470 LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
57471 +LIBSUPCXX_PRONLY_FALSE = @LIBSUPCXX_PRONLY_FALSE@
57472 +LIBSUPCXX_PRONLY_TRUE = @LIBSUPCXX_PRONLY_TRUE@
57473 LIBTOOL = @LIBTOOL@
57474 LN_S = @LN_S@
57475 LTLIBICONV = @LTLIBICONV@
57476 --- a/libstdc++-v3/src/Makefile.in
57477 +++ b/libstdc++-v3/src/Makefile.in
57478 @@ -211,6 +211,8 @@ LIBMATHOBJS = @LIBMATHOBJS@
57479 LIBOBJS = @LIBOBJS@
57480 LIBS = @LIBS@
57481 LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
57482 +LIBSUPCXX_PRONLY_FALSE = @LIBSUPCXX_PRONLY_FALSE@
57483 +LIBSUPCXX_PRONLY_TRUE = @LIBSUPCXX_PRONLY_TRUE@
57484 LIBTOOL = @LIBTOOL@
57485 LN_S = @LN_S@
57486 LTLIBICONV = @LTLIBICONV@
This page took 3.209114 seconds and 3 git commands to generate.