Commit 0c436cbd by Richard Sandiford Committed by Richard Sandiford

mips.exp: Use gcc-dg-runtest rather than dg-runtest.

gcc/testsuite/
	* gcc.target/mips/mips.exp: Use gcc-dg-runtest rather than dg-runtest.
	(mips_option_groups): Remove optimization.  Add various -f options.
	(mips-dg-options): Make -funroll-loops imply -funroll-all-loops
	and -pg imply -fno-omit-frame-pointer.
	* gcc.target/mips/abi-eabi32-long32.c: Remove optimization flag.
	* gcc.target/mips/abi-eabi32-long64.c: Likewise.
	* gcc.target/mips/abi-eabi64-long32.c: Likewise.
	* gcc.target/mips/abi-eabi64-long64.c: Likewise.
	* gcc.target/mips/abi-n32-long32-no-shared.c: Likewise.
	* gcc.target/mips/abi-n32-long32-pic.c: Likewise.
	* gcc.target/mips/abi-n32-long32.c: Likewise.
	* gcc.target/mips/abi-n32-long64-no-shared.c: Likewise.
	* gcc.target/mips/abi-n32-long64-pic.c: Likewise.
	* gcc.target/mips/abi-n32-long64.c: Likewise.
	* gcc.target/mips/abi-n64-long32-no-shared.c: Likewise.
	* gcc.target/mips/abi-n64-long32-pic.c: Likewise.
	* gcc.target/mips/abi-n64-long32.c: Likewise.
	* gcc.target/mips/abi-n64-long64-no-shared.c: Likewise.
	* gcc.target/mips/abi-n64-long64-pic.c: Likewise.
	* gcc.target/mips/abi-n64-long64.c: Likewise.
	* gcc.target/mips/abi-o32-long32-no-shared.c: Likewise.
	* gcc.target/mips/abi-o32-long32-pic.c: Likewise.
	* gcc.target/mips/abi-o32-long32.c: Likewise.
	* gcc.target/mips/abi-o32-long64-no-shared.c: Likewise.
	* gcc.target/mips/abi-o32-long64-pic.c: Likewise.
	* gcc.target/mips/abi-o32-long64.c: Likewise.
	* gcc.target/mips/abi-o64-long32-no-shared.c: Likewise.
	* gcc.target/mips/abi-o64-long32-pic.c: Likewise.
	* gcc.target/mips/abi-o64-long32.c: Likewise.
	* gcc.target/mips/abi-o64-long64-no-shared.c: Likewise.
	* gcc.target/mips/abi-o64-long64-pic.c: Likewise.
	* gcc.target/mips/abi-o64-long64.c: Likewise.
	* gcc.target/mips/asm-1.c: Likewise.
	* gcc.target/mips/branch-1.c: Likewise.
	* gcc.target/mips/call-3.c: Likewise.
	* gcc.target/mips/call-saved-3.c: Likewise.
	* gcc.target/mips/clear-cache-1.c: Likewise.
	* gcc.target/mips/div-1.c: Likewise.
	* gcc.target/mips/div-2.c: Likewise.
	* gcc.target/mips/div-3.c: Likewise.
	* gcc.target/mips/div-4.c: Likewise.
	* gcc.target/mips/div-5.c: Likewise.
	* gcc.target/mips/div-6.c: Likewise.
	* gcc.target/mips/div-7.c: Likewise.
	* gcc.target/mips/div-8.c: Likewise.
	* gcc.target/mips/div-9.c: Likewise.
	* gcc.target/mips/div-10.c: Likewise.
	* gcc.target/mips/div-11.c: Likewise.
	* gcc.target/mips/div-12.c: Likewise.
	* gcc.target/mips/dsp-ctrl.c: Likewise.
	* gcc.target/mips/dsp-no-lhx.c: Likewise.
	* gcc.target/mips/ext-8.c: Likewise.
	* gcc.target/mips/extend-2.c: Likewise.
	* gcc.target/mips/fix-r10000-1.c: Likewise.
	* gcc.target/mips/fix-r10000-2.c: Likewise.
	* gcc.target/mips/fix-r10000-3.c: Likewise.
	* gcc.target/mips/fix-r10000-4.c: Likewise.
	* gcc.target/mips/fix-r10000-5.c: Likewise.
	* gcc.target/mips/fix-r10000-6.c: Likewise.
	* gcc.target/mips/fix-r10000-7.c: Likewise.
	* gcc.target/mips/fix-r10000-8.c: Likewise.
	* gcc.target/mips/fix-r10000-9.c: Likewise.
	* gcc.target/mips/fix-r10000-10.c: Likewise.
	* gcc.target/mips/fix-r10000-11.c: Likewise.
	* gcc.target/mips/fix-r10000-12.c: Likewise.
	* gcc.target/mips/fix-r10000-13.c: Likewise.
	* gcc.target/mips/fix-r10000-14.c: Likewise.
	* gcc.target/mips/fix-r10000-15.c: Likewise.
	* gcc.target/mips/fpcmp-1.c: Likewise.
	* gcc.target/mips/fpcmp-2.c: Likewise.
	* gcc.target/mips/fpr-moves-7.c: Likewise.
	* gcc.target/mips/fpr-moves-8.c: Likewise.
	* gcc.target/mips/int-moves-1.c: Likewise.
	* gcc.target/mips/int-moves-2.c: Likewise.
	* gcc.target/mips/long-calls-pg.c: Likewise.
	* gcc.target/mips/loongson-muldiv-1.c: Likewise.
	* gcc.target/mips/loongson-muldiv-2.c: Likewise.
	* gcc.target/mips/loongson-shift-count-truncated-1.c: Likewise.
	* gcc.target/mips/loongson3a-muldiv-1.c: Likewise.
	* gcc.target/mips/loongson3a-muldiv-2.c: Likewise.
	* gcc.target/mips/mips-3d-1.c: Likewise.
	* gcc.target/mips/mips-3d-2.c: Likewise.
	* gcc.target/mips/mips-3d-3.c: Likewise.
	* gcc.target/mips/mips-3d-4.c: Likewise.
	* gcc.target/mips/mips-3d-5.c: Likewise.
	* gcc.target/mips/mips-3d-6.c: Likewise.
	* gcc.target/mips/mips-3d-7.c: Likewise.
	* gcc.target/mips/mips-3d-8.c: Likewise.
	* gcc.target/mips/mips-3d-9.c: Likewise.
	* gcc.target/mips/mips-ps-1.c: Likewise.
	* gcc.target/mips/mips-ps-2.c: Likewise.
	* gcc.target/mips/mips-ps-3.c: Likewise.
	* gcc.target/mips/mips-ps-4.c: Likewise.
	* gcc.target/mips/mips-ps-6.c: Likewise.
	* gcc.target/mips/mips32-dspr2.c: Likewise.
	* gcc.target/mips/mmcount-ra-address-1.c: Likewise.
	* gcc.target/mips/neg-abs-1.c: Likewise.
	* gcc.target/mips/neg-abs-2.c: Likewise.
	* gcc.target/mips/nmadd-3.c: Likewise.
	* gcc.target/mips/no-smartmips-lwxs.c: Likewise.
	* gcc.target/mips/no-smartmips-ror-1.c: Likewise.
	* gcc.target/mips/octeon-pop-1.c: Likewise.
	* gcc.target/mips/pr26765.c: Likewise.
	* gcc.target/mips/pr33256.c: Likewise.
	* gcc.target/mips/pr33635-1.c: Likewise.
	* gcc.target/mips/pr33755.c: Likewise.
	* gcc.target/mips/pr35802.c: Likewise.
	* gcc.target/mips/pr45074.c: Likewise.
	* gcc.target/mips/r10k-cache-barrier-1.c: Likewise.
	* gcc.target/mips/r10k-cache-barrier-2.c: Likewise.
	* gcc.target/mips/r10k-cache-barrier-3.c: Likewise.
	* gcc.target/mips/r10k-cache-barrier-4.c: Likewise.
	* gcc.target/mips/r10k-cache-barrier-5.c: Likewise.
	* gcc.target/mips/r10k-cache-barrier-6.c: Likewise.
	* gcc.target/mips/r10k-cache-barrier-7.c: Likewise.
	* gcc.target/mips/r10k-cache-barrier-8.c: Likewise.
	* gcc.target/mips/r10k-cache-barrier-9.c: Likewise.
	* gcc.target/mips/r10k-cache-barrier-11.c: Likewise.
	* gcc.target/mips/r10k-cache-barrier-12.c: Likewise.
	* gcc.target/mips/r10k-cache-barrier-13.c: Likewise.
	* gcc.target/mips/r10k-cache-barrier-14.c: Likewise.
	* gcc.target/mips/r10k-cache-barrier-15.c: Likewise.
	* gcc.target/mips/save-restore-1.c: Likewise.
	* gcc.target/mips/save-restore-3.c: Likewise.
	* gcc.target/mips/save-restore-5.c: Likewise.
	* gcc.target/mips/smartmips-ror-1.c: Likewise.
	* gcc.target/mips/smartmips-ror-2.c: Likewise.
	* gcc.target/mips/smartmips-ror-3.c: Likewise.
	* gcc.target/mips/smartmips-ror-4.c: Likewise.
	* gcc.target/mips/stack-1.c: Likewise.

	* gcc.target/mips/clear-cache-2.c: Remove optimization flag.
	Tighten regexps.

	* gcc.target/mips/branch-8.c: Arrange for the delay slot of the
	branch under test to be filled with preceding rather than
	following instructions.
	* gcc.target/mips/branch-10.c: Likewise.
	* gcc.target/mips/branch-11.c: Likewise.
	* gcc.target/mips/branch-12.c: Likewise.
	* gcc.target/mips/branch-13.c: Likewise.
	* gcc.target/mips/branch-9.c: Likewise.  Allow the frame pointer
	to be eliminated.  Tighten $28 scan-assembler-not test.

	* gcc.target/mips/call-2.c: Remove optimization flag.  Move second
	function to...
	* gcc.target/mips/call-4.c: ...this new test.

	* gcc.target/mips/code-readable-2.c: Rework to make a jump table
	more likely.
	* gcc.target/mips/code-readable-3.c: Likewise.
	* gcc.target/mips/code-readable-1.c: Likewise.  Remove optimization
	flag but skip for -O0.
	* gcc.target/mips/code-readable-4.c: Likewise.

	* gcc.target/mips/mips32-dsp-run.c: Prevent compile-time reduction
	of operations under test.
	* gcc.target/mips/mips32-dsp.c: Likewise.  Remove optimization flag.

	* gcc.target/mips/near-far-3.c: Remove optimization flag.
	Don't require sibling-call optimization.
	* gcc.target/mips/near-far-4.c: Likewise.

	* gcc.target/mips/no-dsp-1.c: Require -ffat-lto-objects.
	Make sure that the register variable is used.
	* gcc.target/mips/soft-float-1.c: Likewise.

	* gcc.target/mips/sdata-1.c: Make static data volatile.
	* gcc.target/mips/sdata-2.c: Likewise.
	* gcc.target/mips/sdata-3.c: Likewise.
	* gcc.target/mips/sdata-4.c: Likewise.

	* gcc.target/mips/20020620-1.c: Remove optimization flag but
	skip for -O0.
	* gcc.target/mips/atomic-memory-2.c: Likewise.
	* gcc.target/mips/branch-cost-1.c: Likewise.
	* gcc.target/mips/branch-cost-2.c: Likewise.
	* gcc.target/mips/cache-1.c: Likewise.
	* gcc.target/mips/call-1.c: Likewise.
	* gcc.target/mips/call-saved-2.c: Likewise.
	* gcc.target/mips/const-anchor-1.c: Likewise.
	* gcc.target/mips/const-anchor-2.c: Likewise.
	* gcc.target/mips/dse-1.c: Likewise.
	* gcc.target/mips/dsp-lhx.c: Likewise.
	* gcc.target/mips/dspr2-MULTU.c: Likewise.
	* gcc.target/mips/ext-1.c: Likewise.
	* gcc.target/mips/ext-2.c: Likewise.
	* gcc.target/mips/ext-3.c: Likewise.
	* gcc.target/mips/ext-4.c: Likewise.
	* gcc.target/mips/ext-5.c: Likewise.
	* gcc.target/mips/ext-6.c: Likewise.
	* gcc.target/mips/ext-7.c: Likewise.
	* gcc.target/mips/extend-1.c: Likewise.
	* gcc.target/mips/fix-r4000-1.c: Likewise.
	* gcc.target/mips/fix-r4000-3.c: Likewise.
	* gcc.target/mips/fix-r4000-5.c: Likewise.
	* gcc.target/mips/fix-r4000-6.c: Likewise.
	* gcc.target/mips/fix-r4000-8.c: Likewise.
	* gcc.target/mips/fix-r4000-10.c: Likewise.
	* gcc.target/mips/fixed-scalar-type.c: Likewise.
	* gcc.target/mips/fixed-vector-type.c: Likewise.
	* gcc.target/mips/fpr-moves-1.c: Likewise.
	* gcc.target/mips/fpr-moves-2.c: Likewise.
	* gcc.target/mips/fpr-moves-3.c: Likewise.
	* gcc.target/mips/fpr-moves-4.c: Likewise.
	* gcc.target/mips/fpr-moves-5.c: Likewise.
	* gcc.target/mips/fpr-moves-6.c: Likewise.
	* gcc.target/mips/ins-1.c: Likewise.
	* gcc.target/mips/ins-2.c: Likewise.
	* gcc.target/mips/interrupt_handler-2.c: Likewise.
	* gcc.target/mips/interrupt_handler-3.c: Likewise.
	* gcc.target/mips/lazy-binding-1.c: Likewise.
	* gcc.target/mips/madd-3.c: Likewise.
	* gcc.target/mips/madd-5.c: Likewise.
	* gcc.target/mips/madd-6.c: Likewise.
	* gcc.target/mips/madd-8.c: Likewise.
	* gcc.target/mips/madd-9.c: Likewise.
	* gcc.target/mips/memcpy-1.c: Likewise.
	* gcc.target/mips/mips-ps-type.c: Likewise.
	* gcc.target/mips/mips-ps-type-2.c: Likewise.
	* gcc.target/mips/mips-sched-madd.c: Likewise.
	* gcc.target/mips/mips16e-extends.c: Likewise.
	* gcc.target/mips/mips32r2-mxhc1.c: Likewise.
	* gcc.target/mips/mips64-dsp-ldx.c: Likewise.
	* gcc.target/mips/movcc-1.c: Likewise.
	* gcc.target/mips/movcc-2.c: Likewise.
	* gcc.target/mips/movcc-3.c: Likewise.
	* gcc.target/mips/msub-5.c: Likewise.
	* gcc.target/mips/msub-6.c: Likewise.
	* gcc.target/mips/msub-8.c: Likewise.
	* gcc.target/mips/mult-2.c: Likewise.
	* gcc.target/mips/mult-3.c: Likewise.
	* gcc.target/mips/mult-5.c: Likewise.
	* gcc.target/mips/mult-6.c: Likewise.
	* gcc.target/mips/mult-7.c: Likewise.
	* gcc.target/mips/mult-12.c: Likewise.
	* gcc.target/mips/mult-13.c: Likewise.
	* gcc.target/mips/mult-14.c: Likewise.
	* gcc.target/mips/mult-15.c: Likewise.
	* gcc.target/mips/mult-17.c: Likewise.
	* gcc.target/mips/mult-18.c: Likewise.
	* gcc.target/mips/mult-19.c: Likewise.
	* gcc.target/mips/nmadd-1.c: Likewise.
	* gcc.target/mips/nmadd-2.c: Likewise.
	* gcc.target/mips/octeon-baddu-1.c: Likewise.
	* gcc.target/mips/octeon-cins-1.c: Likewise.
	* gcc.target/mips/octeon-cins-2.c: Likewise.
	* gcc.target/mips/octeon-dmul-3.c: Likewise.
	* gcc.target/mips/octeon-exts-2.c: Likewise.
	* gcc.target/mips/octeon-exts-3.c: Likewise.
	* gcc.target/mips/octeon-exts-4.c: Likewise.
	* gcc.target/mips/octeon-exts-5.c: Likewise.
	* gcc.target/mips/octeon-exts-6.c: Likewise.
	* gcc.target/mips/octeon-exts-7.c: Likewise.
	* gcc.target/mips/octeon-pop-2.c: Likewise.
	* gcc.target/mips/octeon-seq-3.c: Likewise.
	* gcc.target/mips/octeon-seq-4.c: Likewise.
	* gcc.target/mips/octeon2-lx-1.c: Likewise.
	* gcc.target/mips/octeon2-lx-2.c: Likewise.
	* gcc.target/mips/octeon2-lx-3.c: Likewise.
	* gcc.target/mips/pr54240.c: Likewise.
	* gcc.target/mips/rsqrt-1.c: Likewise.
	* gcc.target/mips/rsqrt-2.c: Likewise.
	* gcc.target/mips/rsqrt-3.c: Likewise.
	* gcc.target/mips/rsqrt-4.c: Likewise.
	* gcc.target/mips/save-restore-2.c: Likewise.
	* gcc.target/mips/save-restore-4.c: Likewise.
	* gcc.target/mips/sb1-1.c: Likewise.
	* gcc.target/mips/scc-1.c: Likewise.
	* gcc.target/mips/scc-2.c: Likewise.
	* gcc.target/mips/scc-3.c: Likewise.
	* gcc.target/mips/scc-4.c: Likewise.
	* gcc.target/mips/smartmips-lwxs.c: Likewise.
	* gcc.target/mips/truncate-1.c: Likewise.
	* gcc.target/mips/truncate-2.c: Likewise.
	* gcc.target/mips/truncate-3.c: Likewise.
	* gcc.target/mips/truncate-4.c: Likewise.
	* gcc.target/mips/truncate-5.c: Likewise.
	* gcc.target/mips/truncate-6.c: Likewise.
	* gcc.target/mips/unaligned-1.c: Likewise.

	* gcc.target/mips/dpaq_sa_l_w.c: Remove optimization flag but
	skip for -O0.  Require -fexpensive-optimizations.
	* gcc.target/mips/dpsq_sa_l_w.c: Likewise.
	* gcc.target/mips/dspr2-MULT.c: Likewise.
	* gcc.target/mips/fix-r4000-2.c: Likewise.
	* gcc.target/mips/fix-r4000-4.c: Likewise.
	* gcc.target/mips/fix-r4000-7.c: Likewise.
	* gcc.target/mips/fix-r4000-9.c: Likewise.
	* gcc.target/mips/madd-1.c: Likewise.
	* gcc.target/mips/madd-2.c: Likewise.
	* gcc.target/mips/madd-4.c: Likewise.
	* gcc.target/mips/maddu-1.c: Likewise.
	* gcc.target/mips/maddu-2.c: Likewise.
	* gcc.target/mips/maddu-3.c: Likewise.
	* gcc.target/mips/maddu-4.c: Likewise.
	* gcc.target/mips/msub-1.c: Likewise.
	* gcc.target/mips/msub-2.c: Likewise.
	* gcc.target/mips/msub-3.c: Likewise.
	* gcc.target/mips/msub-4.c: Likewise.
	* gcc.target/mips/msubu-1.c: Likewise.
	* gcc.target/mips/msubu-2.c: Likewise.
	* gcc.target/mips/msubu-3.c: Likewise.
	* gcc.target/mips/msubu-4.c: Likewise.
	* gcc.target/mips/mult-1.c: Likewise.
	* gcc.target/mips/mult-4.c: Likewise.
	* gcc.target/mips/mult-8.c: Likewise.
	* gcc.target/mips/mult-9.c: Likewise.
	* gcc.target/mips/mult-10.c: Likewise.
	* gcc.target/mips/mult-11.c: Likewise.
	* gcc.target/mips/mult-16.c: Likewise.

	* gcc.target/mips/fix-r4000-11.c: Remove optimization flag but
	skip for -O0 and -Os.
	* gcc.target/mips/fix-r4000-12.c: Likewise.
	* gcc.target/mips/madd-7.c: Likewise.
	* gcc.target/mips/mips-ps-5.c: Likewise.
	* gcc.target/mips/mips-ps-7.c: Likewise.
	* gcc.target/mips/msub-7.c: Likewise.

	* gcc.target/mips/mmcount-ra-address-2.c: Remove optimization flag but
	skip for -O0.  Require -mno-abicalls.
	* gcc.target/mips/mmcount-ra-address-3.c: Likewise.

	* gcc.target/mips/octeon-bbit-1.c: Remove optimization flag but
	skip for -O0.  Require a total number of BBIT instructions and
	at least one of each kind.

	* gcc.target/mips/octeon-bbit-2.c: Remove optimization flag but
	skip for -O0.  Require -fno-unroll-loops.

	* gcc.target/mips/octeon-bbit-3.c: Remove optimization flag but
	skip for -O0.  Allow BLTZ as well as BGEZ.

	* gcc.target/mips/octeon-dmul-2.c: Skip for -Os.

	* gcc.target/mips/octeon-pipe-1.c: Remove optimization flag but
	skip for -O0.  Require -fschedule-insns2.
	* gcc.target/mips/octeon2-pipe-1.c: Likewise.

	* gcc.target/mips/r10k-cache-barrier-10.c: Remove optimization flag
	but skip for -O0.  Make a branch-likely more likely.

	* gcc.target/mips/timode-2.c: Split each test into its own function.
	* gcc.target/mips/timode-1.c: Likewise.  Skip for -Os.

	* gcc.target/mips/vr-mult-1.c: Remove optimization flag but
	skip for -O0.  Require -fpeephole2.
	* gcc.target/mips/vr-mult-2.c: Likewise.

From-SVN: r190718
parent cb038fd2
2012-08-27 Richard Sandiford <rdsandiford@googlemail.com>
* gcc.target/mips/mips.exp: Use gcc-dg-runtest rather than dg-runtest.
(mips_option_groups): Remove optimization. Add various -f options.
(mips-dg-options): Make -funroll-loops imply -funroll-all-loops
and -pg imply -fno-omit-frame-pointer.
* gcc.target/mips/abi-eabi32-long32.c: Remove optimization flag.
* gcc.target/mips/abi-eabi32-long64.c: Likewise.
* gcc.target/mips/abi-eabi64-long32.c: Likewise.
* gcc.target/mips/abi-eabi64-long64.c: Likewise.
* gcc.target/mips/abi-n32-long32-no-shared.c: Likewise.
* gcc.target/mips/abi-n32-long32-pic.c: Likewise.
* gcc.target/mips/abi-n32-long32.c: Likewise.
* gcc.target/mips/abi-n32-long64-no-shared.c: Likewise.
* gcc.target/mips/abi-n32-long64-pic.c: Likewise.
* gcc.target/mips/abi-n32-long64.c: Likewise.
* gcc.target/mips/abi-n64-long32-no-shared.c: Likewise.
* gcc.target/mips/abi-n64-long32-pic.c: Likewise.
* gcc.target/mips/abi-n64-long32.c: Likewise.
* gcc.target/mips/abi-n64-long64-no-shared.c: Likewise.
* gcc.target/mips/abi-n64-long64-pic.c: Likewise.
* gcc.target/mips/abi-n64-long64.c: Likewise.
* gcc.target/mips/abi-o32-long32-no-shared.c: Likewise.
* gcc.target/mips/abi-o32-long32-pic.c: Likewise.
* gcc.target/mips/abi-o32-long32.c: Likewise.
* gcc.target/mips/abi-o32-long64-no-shared.c: Likewise.
* gcc.target/mips/abi-o32-long64-pic.c: Likewise.
* gcc.target/mips/abi-o32-long64.c: Likewise.
* gcc.target/mips/abi-o64-long32-no-shared.c: Likewise.
* gcc.target/mips/abi-o64-long32-pic.c: Likewise.
* gcc.target/mips/abi-o64-long32.c: Likewise.
* gcc.target/mips/abi-o64-long64-no-shared.c: Likewise.
* gcc.target/mips/abi-o64-long64-pic.c: Likewise.
* gcc.target/mips/abi-o64-long64.c: Likewise.
* gcc.target/mips/asm-1.c: Likewise.
* gcc.target/mips/branch-1.c: Likewise.
* gcc.target/mips/call-3.c: Likewise.
* gcc.target/mips/call-saved-3.c: Likewise.
* gcc.target/mips/clear-cache-1.c: Likewise.
* gcc.target/mips/div-1.c: Likewise.
* gcc.target/mips/div-2.c: Likewise.
* gcc.target/mips/div-3.c: Likewise.
* gcc.target/mips/div-4.c: Likewise.
* gcc.target/mips/div-5.c: Likewise.
* gcc.target/mips/div-6.c: Likewise.
* gcc.target/mips/div-7.c: Likewise.
* gcc.target/mips/div-8.c: Likewise.
* gcc.target/mips/div-9.c: Likewise.
* gcc.target/mips/div-10.c: Likewise.
* gcc.target/mips/div-11.c: Likewise.
* gcc.target/mips/div-12.c: Likewise.
* gcc.target/mips/dsp-ctrl.c: Likewise.
* gcc.target/mips/dsp-no-lhx.c: Likewise.
* gcc.target/mips/ext-8.c: Likewise.
* gcc.target/mips/extend-2.c: Likewise.
* gcc.target/mips/fix-r10000-1.c: Likewise.
* gcc.target/mips/fix-r10000-2.c: Likewise.
* gcc.target/mips/fix-r10000-3.c: Likewise.
* gcc.target/mips/fix-r10000-4.c: Likewise.
* gcc.target/mips/fix-r10000-5.c: Likewise.
* gcc.target/mips/fix-r10000-6.c: Likewise.
* gcc.target/mips/fix-r10000-7.c: Likewise.
* gcc.target/mips/fix-r10000-8.c: Likewise.
* gcc.target/mips/fix-r10000-9.c: Likewise.
* gcc.target/mips/fix-r10000-10.c: Likewise.
* gcc.target/mips/fix-r10000-11.c: Likewise.
* gcc.target/mips/fix-r10000-12.c: Likewise.
* gcc.target/mips/fix-r10000-13.c: Likewise.
* gcc.target/mips/fix-r10000-14.c: Likewise.
* gcc.target/mips/fix-r10000-15.c: Likewise.
* gcc.target/mips/fpcmp-1.c: Likewise.
* gcc.target/mips/fpcmp-2.c: Likewise.
* gcc.target/mips/fpr-moves-7.c: Likewise.
* gcc.target/mips/fpr-moves-8.c: Likewise.
* gcc.target/mips/int-moves-1.c: Likewise.
* gcc.target/mips/int-moves-2.c: Likewise.
* gcc.target/mips/long-calls-pg.c: Likewise.
* gcc.target/mips/loongson-muldiv-1.c: Likewise.
* gcc.target/mips/loongson-muldiv-2.c: Likewise.
* gcc.target/mips/loongson-shift-count-truncated-1.c: Likewise.
* gcc.target/mips/loongson3a-muldiv-1.c: Likewise.
* gcc.target/mips/loongson3a-muldiv-2.c: Likewise.
* gcc.target/mips/mips-3d-1.c: Likewise.
* gcc.target/mips/mips-3d-2.c: Likewise.
* gcc.target/mips/mips-3d-3.c: Likewise.
* gcc.target/mips/mips-3d-4.c: Likewise.
* gcc.target/mips/mips-3d-5.c: Likewise.
* gcc.target/mips/mips-3d-6.c: Likewise.
* gcc.target/mips/mips-3d-7.c: Likewise.
* gcc.target/mips/mips-3d-8.c: Likewise.
* gcc.target/mips/mips-3d-9.c: Likewise.
* gcc.target/mips/mips-ps-1.c: Likewise.
* gcc.target/mips/mips-ps-2.c: Likewise.
* gcc.target/mips/mips-ps-3.c: Likewise.
* gcc.target/mips/mips-ps-4.c: Likewise.
* gcc.target/mips/mips-ps-6.c: Likewise.
* gcc.target/mips/mips32-dspr2.c: Likewise.
* gcc.target/mips/mmcount-ra-address-1.c: Likewise.
* gcc.target/mips/neg-abs-1.c: Likewise.
* gcc.target/mips/neg-abs-2.c: Likewise.
* gcc.target/mips/nmadd-3.c: Likewise.
* gcc.target/mips/no-smartmips-lwxs.c: Likewise.
* gcc.target/mips/no-smartmips-ror-1.c: Likewise.
* gcc.target/mips/octeon-pop-1.c: Likewise.
* gcc.target/mips/pr26765.c: Likewise.
* gcc.target/mips/pr33256.c: Likewise.
* gcc.target/mips/pr33635-1.c: Likewise.
* gcc.target/mips/pr33755.c: Likewise.
* gcc.target/mips/pr35802.c: Likewise.
* gcc.target/mips/pr45074.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-1.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-2.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-3.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-4.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-5.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-6.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-7.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-8.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-9.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-11.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-12.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-13.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-14.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-15.c: Likewise.
* gcc.target/mips/save-restore-1.c: Likewise.
* gcc.target/mips/save-restore-3.c: Likewise.
* gcc.target/mips/save-restore-5.c: Likewise.
* gcc.target/mips/smartmips-ror-1.c: Likewise.
* gcc.target/mips/smartmips-ror-2.c: Likewise.
* gcc.target/mips/smartmips-ror-3.c: Likewise.
* gcc.target/mips/smartmips-ror-4.c: Likewise.
* gcc.target/mips/stack-1.c: Likewise.
* gcc.target/mips/clear-cache-2.c: Remove optimization flag.
Tighten regexps.
* gcc.target/mips/branch-8.c: Arrange for the delay slot of the
branch under test to be filled with preceding rather than
following instructions.
* gcc.target/mips/branch-10.c: Likewise.
* gcc.target/mips/branch-11.c: Likewise.
* gcc.target/mips/branch-12.c: Likewise.
* gcc.target/mips/branch-13.c: Likewise.
* gcc.target/mips/branch-9.c: Likewise. Allow the frame pointer
to be eliminated. Tighten $28 scan-assembler-not test.
* gcc.target/mips/call-2.c: Remove optimization flag. Move second
function to...
* gcc.target/mips/call-4.c: ...this new test.
* gcc.target/mips/code-readable-2.c: Rework to make a jump table
more likely.
* gcc.target/mips/code-readable-3.c: Likewise.
* gcc.target/mips/code-readable-1.c: Likewise. Remove optimization
flag but skip for -O0.
* gcc.target/mips/code-readable-4.c: Likewise.
* gcc.target/mips/mips32-dsp-run.c: Prevent compile-time reduction
of operations under test.
* gcc.target/mips/mips32-dsp.c: Likewise. Remove optimization flag.
* gcc.target/mips/near-far-3.c: Remove optimization flag.
Don't require sibling-call optimization.
* gcc.target/mips/near-far-4.c: Likewise.
* gcc.target/mips/no-dsp-1.c: Require -ffat-lto-objects.
Make sure that the register variable is used.
* gcc.target/mips/soft-float-1.c: Likewise.
* gcc.target/mips/sdata-1.c: Make static data volatile.
* gcc.target/mips/sdata-2.c: Likewise.
* gcc.target/mips/sdata-3.c: Likewise.
* gcc.target/mips/sdata-4.c: Likewise.
* gcc.target/mips/20020620-1.c: Remove optimization flag but
skip for -O0.
* gcc.target/mips/atomic-memory-2.c: Likewise.
* gcc.target/mips/branch-cost-1.c: Likewise.
* gcc.target/mips/branch-cost-2.c: Likewise.
* gcc.target/mips/cache-1.c: Likewise.
* gcc.target/mips/call-1.c: Likewise.
* gcc.target/mips/call-saved-2.c: Likewise.
* gcc.target/mips/const-anchor-1.c: Likewise.
* gcc.target/mips/const-anchor-2.c: Likewise.
* gcc.target/mips/dse-1.c: Likewise.
* gcc.target/mips/dsp-lhx.c: Likewise.
* gcc.target/mips/dspr2-MULTU.c: Likewise.
* gcc.target/mips/ext-1.c: Likewise.
* gcc.target/mips/ext-2.c: Likewise.
* gcc.target/mips/ext-3.c: Likewise.
* gcc.target/mips/ext-4.c: Likewise.
* gcc.target/mips/ext-5.c: Likewise.
* gcc.target/mips/ext-6.c: Likewise.
* gcc.target/mips/ext-7.c: Likewise.
* gcc.target/mips/extend-1.c: Likewise.
* gcc.target/mips/fix-r4000-1.c: Likewise.
* gcc.target/mips/fix-r4000-3.c: Likewise.
* gcc.target/mips/fix-r4000-5.c: Likewise.
* gcc.target/mips/fix-r4000-6.c: Likewise.
* gcc.target/mips/fix-r4000-8.c: Likewise.
* gcc.target/mips/fix-r4000-10.c: Likewise.
* gcc.target/mips/fixed-scalar-type.c: Likewise.
* gcc.target/mips/fixed-vector-type.c: Likewise.
* gcc.target/mips/fpr-moves-1.c: Likewise.
* gcc.target/mips/fpr-moves-2.c: Likewise.
* gcc.target/mips/fpr-moves-3.c: Likewise.
* gcc.target/mips/fpr-moves-4.c: Likewise.
* gcc.target/mips/fpr-moves-5.c: Likewise.
* gcc.target/mips/fpr-moves-6.c: Likewise.
* gcc.target/mips/ins-1.c: Likewise.
* gcc.target/mips/ins-2.c: Likewise.
* gcc.target/mips/interrupt_handler-2.c: Likewise.
* gcc.target/mips/interrupt_handler-3.c: Likewise.
* gcc.target/mips/lazy-binding-1.c: Likewise.
* gcc.target/mips/madd-3.c: Likewise.
* gcc.target/mips/madd-5.c: Likewise.
* gcc.target/mips/madd-6.c: Likewise.
* gcc.target/mips/madd-8.c: Likewise.
* gcc.target/mips/madd-9.c: Likewise.
* gcc.target/mips/memcpy-1.c: Likewise.
* gcc.target/mips/mips-ps-type.c: Likewise.
* gcc.target/mips/mips-ps-type-2.c: Likewise.
* gcc.target/mips/mips-sched-madd.c: Likewise.
* gcc.target/mips/mips16e-extends.c: Likewise.
* gcc.target/mips/mips32r2-mxhc1.c: Likewise.
* gcc.target/mips/mips64-dsp-ldx.c: Likewise.
* gcc.target/mips/movcc-1.c: Likewise.
* gcc.target/mips/movcc-2.c: Likewise.
* gcc.target/mips/movcc-3.c: Likewise.
* gcc.target/mips/msub-5.c: Likewise.
* gcc.target/mips/msub-6.c: Likewise.
* gcc.target/mips/msub-8.c: Likewise.
* gcc.target/mips/mult-2.c: Likewise.
* gcc.target/mips/mult-3.c: Likewise.
* gcc.target/mips/mult-5.c: Likewise.
* gcc.target/mips/mult-6.c: Likewise.
* gcc.target/mips/mult-7.c: Likewise.
* gcc.target/mips/mult-12.c: Likewise.
* gcc.target/mips/mult-13.c: Likewise.
* gcc.target/mips/mult-14.c: Likewise.
* gcc.target/mips/mult-15.c: Likewise.
* gcc.target/mips/mult-17.c: Likewise.
* gcc.target/mips/mult-18.c: Likewise.
* gcc.target/mips/mult-19.c: Likewise.
* gcc.target/mips/nmadd-1.c: Likewise.
* gcc.target/mips/nmadd-2.c: Likewise.
* gcc.target/mips/octeon-baddu-1.c: Likewise.
* gcc.target/mips/octeon-cins-1.c: Likewise.
* gcc.target/mips/octeon-cins-2.c: Likewise.
* gcc.target/mips/octeon-dmul-3.c: Likewise.
* gcc.target/mips/octeon-exts-2.c: Likewise.
* gcc.target/mips/octeon-exts-3.c: Likewise.
* gcc.target/mips/octeon-exts-4.c: Likewise.
* gcc.target/mips/octeon-exts-5.c: Likewise.
* gcc.target/mips/octeon-exts-6.c: Likewise.
* gcc.target/mips/octeon-exts-7.c: Likewise.
* gcc.target/mips/octeon-pop-2.c: Likewise.
* gcc.target/mips/octeon-seq-3.c: Likewise.
* gcc.target/mips/octeon-seq-4.c: Likewise.
* gcc.target/mips/octeon2-lx-1.c: Likewise.
* gcc.target/mips/octeon2-lx-2.c: Likewise.
* gcc.target/mips/octeon2-lx-3.c: Likewise.
* gcc.target/mips/pr54240.c: Likewise.
* gcc.target/mips/rsqrt-1.c: Likewise.
* gcc.target/mips/rsqrt-2.c: Likewise.
* gcc.target/mips/rsqrt-3.c: Likewise.
* gcc.target/mips/rsqrt-4.c: Likewise.
* gcc.target/mips/save-restore-2.c: Likewise.
* gcc.target/mips/save-restore-4.c: Likewise.
* gcc.target/mips/sb1-1.c: Likewise.
* gcc.target/mips/scc-1.c: Likewise.
* gcc.target/mips/scc-2.c: Likewise.
* gcc.target/mips/scc-3.c: Likewise.
* gcc.target/mips/scc-4.c: Likewise.
* gcc.target/mips/smartmips-lwxs.c: Likewise.
* gcc.target/mips/truncate-1.c: Likewise.
* gcc.target/mips/truncate-2.c: Likewise.
* gcc.target/mips/truncate-3.c: Likewise.
* gcc.target/mips/truncate-4.c: Likewise.
* gcc.target/mips/truncate-5.c: Likewise.
* gcc.target/mips/truncate-6.c: Likewise.
* gcc.target/mips/unaligned-1.c: Likewise.
* gcc.target/mips/dpaq_sa_l_w.c: Remove optimization flag but
skip for -O0. Require -fexpensive-optimizations.
* gcc.target/mips/dpsq_sa_l_w.c: Likewise.
* gcc.target/mips/dspr2-MULT.c: Likewise.
* gcc.target/mips/fix-r4000-2.c: Likewise.
* gcc.target/mips/fix-r4000-4.c: Likewise.
* gcc.target/mips/fix-r4000-7.c: Likewise.
* gcc.target/mips/fix-r4000-9.c: Likewise.
* gcc.target/mips/madd-1.c: Likewise.
* gcc.target/mips/madd-2.c: Likewise.
* gcc.target/mips/madd-4.c: Likewise.
* gcc.target/mips/maddu-1.c: Likewise.
* gcc.target/mips/maddu-2.c: Likewise.
* gcc.target/mips/maddu-3.c: Likewise.
* gcc.target/mips/maddu-4.c: Likewise.
* gcc.target/mips/msub-1.c: Likewise.
* gcc.target/mips/msub-2.c: Likewise.
* gcc.target/mips/msub-3.c: Likewise.
* gcc.target/mips/msub-4.c: Likewise.
* gcc.target/mips/msubu-1.c: Likewise.
* gcc.target/mips/msubu-2.c: Likewise.
* gcc.target/mips/msubu-3.c: Likewise.
* gcc.target/mips/msubu-4.c: Likewise.
* gcc.target/mips/mult-1.c: Likewise.
* gcc.target/mips/mult-4.c: Likewise.
* gcc.target/mips/mult-8.c: Likewise.
* gcc.target/mips/mult-9.c: Likewise.
* gcc.target/mips/mult-10.c: Likewise.
* gcc.target/mips/mult-11.c: Likewise.
* gcc.target/mips/mult-16.c: Likewise.
* gcc.target/mips/fix-r4000-11.c: Remove optimization flag but
skip for -O0 and -Os.
* gcc.target/mips/fix-r4000-12.c: Likewise.
* gcc.target/mips/madd-7.c: Likewise.
* gcc.target/mips/mips-ps-5.c: Likewise.
* gcc.target/mips/mips-ps-7.c: Likewise.
* gcc.target/mips/msub-7.c: Likewise.
* gcc.target/mips/mmcount-ra-address-2.c: Remove optimization flag but
skip for -O0. Require -mno-abicalls.
* gcc.target/mips/mmcount-ra-address-3.c: Likewise.
* gcc.target/mips/octeon-bbit-1.c: Remove optimization flag but
skip for -O0. Require a total number of BBIT instructions and
at least one of each kind.
* gcc.target/mips/octeon-bbit-2.c: Remove optimization flag but
skip for -O0. Require -fno-unroll-loops.
* gcc.target/mips/octeon-bbit-3.c: Remove optimization flag but
skip for -O0. Allow BLTZ as well as BGEZ.
* gcc.target/mips/octeon-dmul-2.c: Skip for -Os.
* gcc.target/mips/octeon-pipe-1.c: Remove optimization flag but
skip for -O0. Require -fschedule-insns2.
* gcc.target/mips/octeon2-pipe-1.c: Likewise.
* gcc.target/mips/r10k-cache-barrier-10.c: Remove optimization flag
but skip for -O0. Make a branch-likely more likely.
* gcc.target/mips/timode-2.c: Split each test into its own function.
* gcc.target/mips/timode-1.c: Likewise. Skip for -Os.
* gcc.target/mips/vr-mult-1.c: Remove optimization flag but
skip for -O0. Require -fpeephole2.
* gcc.target/mips/vr-mult-2.c: Likewise.
2012-05-25 Dodji Seketeli <dodji@redhat.com> 2012-05-25 Dodji Seketeli <dodji@redhat.com>
PR preprocessor/53469 PR preprocessor/53469
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mlong64" } */ /* { dg-options "-mlong64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
int foo (int *x, int i) int foo (int *x, int i)
{ {
return x[i] + i; return x[i] + i;
......
/* { dg-options "-mabi=eabi -mgp32 -mlong32 -O2" } */ /* { dg-options "-mabi=eabi -mgp32 -mlong32" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=eabi -mgp32 -mlong64 -O2" } */ /* { dg-options "-mabi=eabi -mgp32 -mlong64" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=eabi -mgp64 -mlong32 -O2" } */ /* { dg-options "-mabi=eabi -mgp64 -mlong32" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=eabi -mgp64 -mlong64 -O2" } */ /* { dg-options "-mabi=eabi -mgp64 -mlong64" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=n32 -mlong32 -mabicalls -mno-shared -mno-plt -O2" } */ /* { dg-options "-mabi=n32 -mlong32 -mabicalls -mno-shared -mno-plt" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=n32 -mlong32 -fpic -O2" } */ /* { dg-options "-mabi=n32 -mlong32 -fpic" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=n32 -mlong32 addressing=absolute -O2" } */ /* { dg-options "-mabi=n32 -mlong32 addressing=absolute" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=n32 -mlong64 -mabicalls -mno-shared -mno-plt -O2" } */ /* { dg-options "-mabi=n32 -mlong64 -mabicalls -mno-shared -mno-plt" } */
/* { dg-error "is incompatible with" "" { target *-*-* } 0 } */ /* { dg-error "is incompatible with" "" { target *-*-* } 0 } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=n32 -mlong64 -fpic -O2" } */ /* { dg-options "-mabi=n32 -mlong64 -fpic" } */
/* { dg-error "is incompatible with" "" { target *-*-* } 0 } */ /* { dg-error "is incompatible with" "" { target *-*-* } 0 } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=n32 -mlong64 addressing=absolute -O2" } */ /* { dg-options "-mabi=n32 -mlong64 addressing=absolute" } */
/* { dg-error "is incompatible with" "" { target *-*-* } 0 } */ /* { dg-error "is incompatible with" "" { target *-*-* } 0 } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=64 -mlong32 -mabicalls -mno-shared -mno-plt -O2" } */ /* { dg-options "-mabi=64 -mlong32 -mabicalls -mno-shared -mno-plt" } */
/* { dg-error "is incompatible with" "" { target *-*-* } 0 } */ /* { dg-error "is incompatible with" "" { target *-*-* } 0 } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=64 -mlong32 -fpic -O2" } */ /* { dg-options "-mabi=64 -mlong32 -fpic" } */
/* { dg-error "is incompatible with" "" { target *-*-* } 0 } */ /* { dg-error "is incompatible with" "" { target *-*-* } 0 } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=64 -mlong32 addressing=absolute -O2" } */ /* { dg-options "-mabi=64 -mlong32 addressing=absolute" } */
/* { dg-error "is incompatible with" "" { target *-*-* } 0 } */ /* { dg-error "is incompatible with" "" { target *-*-* } 0 } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=64 -mlong64 -mabicalls -mno-shared -mno-plt -O2" } */ /* { dg-options "-mabi=64 -mlong64 -mabicalls -mno-shared -mno-plt" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=64 -mlong64 -fpic -O2" } */ /* { dg-options "-mabi=64 -mlong64 -fpic" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=64 -mlong64 addressing=absolute -O2" } */ /* { dg-options "-mabi=64 -mlong64 addressing=absolute" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=32 -mlong32 -mabicalls -mno-shared -mno-plt -O2" } */ /* { dg-options "-mabi=32 -mlong32 -mabicalls -mno-shared -mno-plt" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=32 -mlong32 -fpic -O2" } */ /* { dg-options "-mabi=32 -mlong32 -fpic" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=32 -mlong32 addressing=absolute -O2" } */ /* { dg-options "-mabi=32 -mlong32 addressing=absolute" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=32 -mlong64 -mabicalls -mno-shared -mno-plt -O2" } */ /* { dg-options "-mabi=32 -mlong64 -mabicalls -mno-shared -mno-plt" } */
/* { dg-error "is incompatible with" "" { target *-*-* } 0 } */ /* { dg-error "is incompatible with" "" { target *-*-* } 0 } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=32 -mlong64 -fpic -O2" } */ /* { dg-options "-mabi=32 -mlong64 -fpic" } */
/* { dg-error "is incompatible with" "" { target *-*-* } 0 } */ /* { dg-error "is incompatible with" "" { target *-*-* } 0 } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=32 -mlong64 addressing=absolute -O2" } */ /* { dg-options "-mabi=32 -mlong64 addressing=absolute" } */
/* { dg-error "is incompatible with" "" { target *-*-* } 0 } */ /* { dg-error "is incompatible with" "" { target *-*-* } 0 } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=o64 -mlong32 -mabicalls -mno-shared -mno-plt -O2" } */ /* { dg-options "-mabi=o64 -mlong32 -mabicalls -mno-shared -mno-plt" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=o64 -mlong32 -fpic -O2" } */ /* { dg-options "-mabi=o64 -mlong32 -fpic" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=o64 -mlong32 addressing=absolute -O2" } */ /* { dg-options "-mabi=o64 -mlong32 addressing=absolute" } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=o64 -mlong64 -mabicalls -mno-shared -mno-plt -O2" } */ /* { dg-options "-mabi=o64 -mlong64 -mabicalls -mno-shared -mno-plt" } */
/* { dg-error "is incompatible with" "" { target *-*-* } 0 } */ /* { dg-error "is incompatible with" "" { target *-*-* } 0 } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=o64 -mlong64 -fpic -O2" } */ /* { dg-options "-mabi=o64 -mlong64 -fpic" } */
/* { dg-error "is incompatible with" "" { target *-*-* } 0 } */ /* { dg-error "is incompatible with" "" { target *-*-* } 0 } */
#include "abi-main.h" #include "abi-main.h"
/* { dg-options "-mabi=o64 -mlong64 -mno-abicalls -O2" } */ /* { dg-options "-mabi=o64 -mlong64 -mno-abicalls" } */
#include "abi-main.h" #include "abi-main.h"
/* PR target/17565. GCC used to put the asm into the delay slot /* PR target/17565. GCC used to put the asm into the delay slot
of the call. */ of the call. */
/* { dg-do assemble } */ /* { dg-do assemble } */
/* { dg-options "-O" } */
NOMIPS16 int foo (int n) NOMIPS16 int foo (int n)
{ {
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 isa>=2 -mabi=32" } */ /* { dg-options "isa>=2 -mabi=32" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "addiu" } } */ /* { dg-final { scan-assembler "addiu" } } */
/* { dg-final { scan-assembler-not "subu" } } */ /* { dg-final { scan-assembler-not "subu" } } */
NOMIPS16 unsigned long NOMIPS16 unsigned long
f(unsigned long *p) f(unsigned long *p)
{ {
return __sync_fetch_and_sub (p, 5); return __sync_fetch_and_sub (p, 5);
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
but we test for "bbit" elsewhere. On other targets, we should implement but we test for "bbit" elsewhere. On other targets, we should implement
the "if" statements using an "andi" instruction followed by a branch the "if" statements using an "andi" instruction followed by a branch
on zero. */ on zero. */
/* { dg-options "-O2 forbid_cpu=octeon.*" } */ /* { dg-options "forbid_cpu=octeon.*" } */
void bar (void); void bar (void);
NOMIPS16 void f1 (int x) { if (x & 4) bar (); } NOMIPS16 void f1 (int x) { if (x & 4) bar (); }
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#include "branch-helper.h" #include "branch-helper.h"
NOMIPS16 void NOMIPS16 void
foo (void (*bar) (void), volatile int *x) foo (int (*bar) (void), int *x)
{ {
bar (); *x = bar ();
if (__builtin_expect (*x == 0, 1)) if (__builtin_expect (*x == 0, 1))
OCCUPY_0x1fff8; OCCUPY_0x1fff8;
} }
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
#include "branch-helper.h" #include "branch-helper.h"
NOMIPS16 void NOMIPS16 void
foo (void (*bar) (void), volatile int *x) foo (int (*bar) (void), int *x)
{ {
bar (); *x = bar ();
if (__builtin_expect (*x == 0, 1)) if (__builtin_expect (*x == 0, 1))
OCCUPY_0x1fffc; OCCUPY_0x1fffc;
} }
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#include "branch-helper.h" #include "branch-helper.h"
NOMIPS16 void NOMIPS16 void
foo (void (*bar) (void), volatile int *x) foo (int (*bar) (void), int *x)
{ {
bar (); *x = bar ();
if (__builtin_expect (*x == 0, 1)) if (__builtin_expect (*x == 0, 1))
OCCUPY_0x1fff8; OCCUPY_0x1fff8;
} }
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
#include "branch-helper.h" #include "branch-helper.h"
NOMIPS16 void NOMIPS16 void
foo (void (*bar) (void), volatile int *x) foo (int (*bar) (void), int *x)
{ {
bar (); *x = bar ();
if (__builtin_expect (*x == 0, 1)) if (__builtin_expect (*x == 0, 1))
OCCUPY_0x1fffc; OCCUPY_0x1fffc;
} }
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#include "branch-helper.h" #include "branch-helper.h"
NOMIPS16 void NOMIPS16 void
foo (void (*bar) (void), volatile int *x) foo (int (*bar) (void), int *x)
{ {
bar (); *x = bar ();
if (__builtin_expect (*x == 0, 1)) if (__builtin_expect (*x == 0, 1))
OCCUPY_0x1fff8; OCCUPY_0x1fff8;
} }
/* { dg-options "-mshared -mabi=32" } */ /* { dg-options "-mshared -mabi=32" } */
/* { dg-final { scan-assembler "\t\\.cpload\t\\\$25\n" } } */ /* { dg-final { scan-assembler "\t\\.cpload\t\\\$25\n" } } */
/* { dg-final { scan-assembler "\t\\.cprestore\t16\n" } } */ /* { dg-final { scan-assembler "\t\\.cprestore\t16\n" } } */
/* { dg-final { scan-assembler "\tlw\t\\\$1,16\\(\\\$fp\\)\n" } } */ /* { dg-final { scan-assembler "\tlw\t\\\$1,16\\(\\\$(fp|sp)\\)\n" } } */
/* { dg-final { scan-assembler "\tlw\t\\\$1,%got\\(\[^)\]*\\)\\(\\\$1\\)\n" } } */ /* { dg-final { scan-assembler "\tlw\t\\\$1,%got\\(\[^)\]*\\)\\(\\\$1\\)\n" } } */
/* { dg-final { scan-assembler "\taddiu\t\\\$1,\\\$1,%lo\\(\[^)\]*\\)\n" } } */ /* { dg-final { scan-assembler "\taddiu\t\\\$1,\\\$1,%lo\\(\[^)\]*\\)\n" } } */
/* { dg-final { scan-assembler "\tjr\t\\\$1\n" } } */ /* { dg-final { scan-assembler "\tjr\t\\\$1\n" } } */
/* { dg-final { scan-assembler-not "\tlw\t\\\$28,16\\(\\\$sp\\)\n" } } */ /* { dg-final { scan-assembler-not "\\\$28" } } */
#include "branch-helper.h" #include "branch-helper.h"
NOMIPS16 void NOMIPS16 void
foo (void (*bar) (void), volatile int *x) foo (int (*bar) (void), int *x)
{ {
bar (); *x = bar ();
if (__builtin_expect (*x == 0, 1)) if (__builtin_expect (*x == 0, 1))
OCCUPY_0x1fffc; OCCUPY_0x1fffc;
} }
/* { dg-options "-mbranch-cost=1 isa>=4 -O2" } */ /* { dg-options "-mbranch-cost=1 isa>=4" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
NOMIPS16 int NOMIPS16 int
foo (int x, int y, int z, int k) foo (int x, int y, int z, int k)
{ {
......
/* { dg-options "-mbranch-cost=10 isa>=4 -O2" } */ /* { dg-options "-mbranch-cost=10 isa>=4" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
NOMIPS16 int NOMIPS16 int
foo (int x, int y, int z, int k) foo (int x, int y, int z, int k)
{ {
......
/* { dg-options "-O2 isa>=3" } */ /* { dg-options "isa>=3" } */
/* { dg-skip-if "naming registers makes this a code quality test" { *-*-* } { "-O0" } { "" } } */
NOMIPS16 void NOMIPS16 void
f1 (int *area) f1 (int *area)
......
/* { dg-options "-O2 -mrelax-pic-calls -mshared" } */ /* { dg-options "-mrelax-pic-calls -mshared -foptimize-sibling-calls" } */
/* { dg-skip-if "requires -foptimize-sibling-calls" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,normal\n1:\tjalr\t" } } */ /* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,normal\n1:\tjalr\t" } } */
/* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,normal2\n1:\tjalr\t" } } */ /* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,normal2\n1:\tjalr\t" } } */
/* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,staticfunc\n1:\tjalr\t" } } */ /* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,staticfunc\n1:\tjalr\t" } } */
......
/* See through some simple data-flow. */ /* See through some simple data-flow. */
/* { dg-options "-O2 -mrelax-pic-calls" } */ /* { dg-options "-mrelax-pic-calls" } */
/* { dg-final { scan-assembler-times "\\.reloc\t1f,R_MIPS_JALR,g\n1:\tjalr\t" 3 } } */ /* { dg-final { scan-assembler-times "\\.reloc\t1f,R_MIPS_JALR,g\n1:\tjalr\t" 2 } } */
NOMIPS16 f (int i) NOMIPS16 f ()
{
while (i--)
g ();
}
NOMIPS16 ff ()
{ {
g (); g ();
g (); g ();
......
/* { dg-options "-O2 -mrelax-pic-calls -mno-shared" } */ /* { dg-options "-mrelax-pic-calls -mno-shared" } */
/* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,g\n1:\tjalr\t" } } */ /* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,g\n1:\tjalr\t" } } */
/* { dg-require-visibility "" } */ /* { dg-require-visibility "" } */
......
/* See through some simple data-flow. */
/* { dg-options "-mrelax-pic-calls" } */
/* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,g\n1:\tjalr\t" } } */
NOMIPS16 f (int i)
{
while (i--)
g ();
}
/* Check that we save non-MIPS16 GPRs if they are explicitly clobbered. */ /* Check that we save non-MIPS16 GPRs if they are explicitly clobbered. */
/* { dg-options "(-mips16) isa_rev=0 -O2" } */ /* { dg-options "(-mips16) isa_rev=0" } */
/* { dg-skip-if "naming registers makes this a code quality test" { *-*-* } { "-O0" } { "" } } */
MIPS16 void MIPS16 void
foo (void) foo (void)
......
/* Check that we save all call-saved GPRs in a MIPS16 __builtin_setjmp /* Check that we save all call-saved GPRs in a MIPS16 __builtin_setjmp
function. */ function. */
/* { dg-options "(-mips16) isa_rev=0 -O2" } */ /* { dg-options "(-mips16) isa_rev=0" } */
void bar (void); void bar (void);
extern int buf[]; extern int buf[];
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -msynci isa_rev>=2" } */ /* { dg-options "-msynci isa_rev>=2" } */
/* { dg-final { scan-assembler "synci" } } */ /* { dg-final { scan-assembler "synci" } } */
/* { dg-final { scan-assembler "jr.hb" } } */ /* { dg-final { scan-assembler "jr.hb" } } */
/* { dg-final { scan-assembler-not "_flush_cache|mips_sync_icache|_cacheflush" } } */ /* { dg-final { scan-assembler-not "_flush_cache|mips_sync_icache|_cacheflush" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mips32" } */ /* { dg-options "-mips32" } */
/* { dg-final { scan-assembler-not "synci" } } */ /* { dg-final { scan-assembler-not "\tsynci" } } */
/* { dg-final { scan-assembler-not "jr.hb" } } */ /* { dg-final { scan-assembler-not "\tjr.hb" } } */
/* { dg-final { scan-assembler "_flush_cache|mips_sync_icache|_cacheflush" } } */ /* { dg-final { scan-assembler "_flush_cache|mips_sync_icache|_cacheflush" } } */
void f() void f()
......
/* { dg-options "(-mips16) -mcode-readable=yes -mgp32 addressing=absolute -O" } */ /* { dg-options "(-mips16) -mcode-readable=yes -mgp32 addressing=absolute" } */
/* { dg-skip-if ".half requires -O" { *-*-* } { "-O0" } { "" } } */
volatile int x1;
volatile int x2;
volatile int x3;
volatile int x4;
volatile int x5;
volatile int x6;
volatile int x7;
MIPS16 int MIPS16 int
foo (int i) foo (int i, volatile *x)
{ {
switch (i) switch (i)
{ {
case 1: return 40; case 1: return x1 + x[0];
case 2: return 11; case 2: return x2 + x[1];
case 3: return 29; case 3: return x3 + x[2];
case 4: return 10; case 4: return x4 + x[3];
case 5: return 12; case 5: return x5 + x[4];
case 6: return 35; case 6: return x6 + x[5];
case 7: return 23; case 7: return x7 + x[6];
default: return 0; default: return 0;
} }
} }
......
/* { dg-options "(-mips16) -mcode-readable=pcrel -mgp32 addressing=absolute" } */ /* { dg-options "(-mips16) -mcode-readable=pcrel -mgp32 addressing=absolute" } */
volatile int x1;
volatile int x2;
volatile int x3;
volatile int x4;
volatile int x5;
volatile int x6;
volatile int x7;
MIPS16 int MIPS16 int
foo (int i) foo (int i, volatile *x)
{ {
switch (i) switch (i)
{ {
case 1: return 40; case 1: return x1 + x[0];
case 2: return 11; case 2: return x2 + x[1];
case 3: return 29; case 3: return x3 + x[2];
case 4: return 10; case 4: return x4 + x[3];
case 5: return 12; case 5: return x5 + x[4];
case 6: return 35; case 6: return x6 + x[5];
case 7: return 23; case 7: return x7 + x[6];
default: return 0; default: return 0;
} }
} }
......
/* { dg-options "(-mips16) -mcode-readable=no -mgp32 addressing=absolute" } */ /* { dg-options "(-mips16) -mcode-readable=no -mgp32 addressing=absolute" } */
volatile int x1;
volatile int x2;
volatile int x3;
volatile int x4;
volatile int x5;
volatile int x6;
volatile int x7;
MIPS16 int MIPS16 int
foo (int i) foo (int i, volatile *x)
{ {
switch (i) switch (i)
{ {
case 1: return 40; case 1: return x1 + x[0];
case 2: return 11; case 2: return x2 + x[1];
case 3: return 29; case 3: return x3 + x[2];
case 4: return 10; case 4: return x4 + x[3];
case 5: return 12; case 5: return x5 + x[4];
case 6: return 35; case 6: return x6 + x[5];
case 7: return 23; case 7: return x7 + x[6];
default: return 0; default: return 0;
} }
} }
......
/* { dg-options "(-mips16) -mcode-readable=yes -mabi=eabi -mgp64 -O" } */ /* { dg-options "(-mips16) -mcode-readable=yes -mabi=eabi -mgp64" } */
/* { dg-skip-if ".half requires -O" { *-*-* } { "-O0" } { "" } } */
volatile int x1;
volatile int x2;
volatile int x3;
volatile int x4;
volatile int x5;
volatile int x6;
volatile int x7;
MIPS16 int MIPS16 int
foo (int i) foo (int i, volatile *x)
{ {
switch (i) switch (i)
{ {
case 1: return 40; case 1: return x1 + x[0];
case 2: return 11; case 2: return x2 + x[1];
case 3: return 29; case 3: return x3 + x[2];
case 4: return 10; case 4: return x4 + x[3];
case 5: return 12; case 5: return x5 + x[4];
case 6: return 35; case 6: return x6 + x[5];
case 7: return 23; case 7: return x7 + x[6];
default: return 0; default: return 0;
} }
} }
......
/* Derive a constant (0x1233ffff) from an intermediate value /* Derive a constant (0x1233ffff) from an intermediate value
(0x1234000) used to build another constant. */ (0x1234000) used to build another constant. */
/* { dg-options "-O" } */ /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "0x12330000|305332224" } } */ /* { dg-final { scan-assembler-not "0x12330000|305332224" } } */
/* { dg-final { scan-assembler "addiu\t\\\$5,\\\$\[0-9\]*,-1" } } */ /* { dg-final { scan-assembler "addiu\t\\\$5,\\\$\[0-9\]*,-1" } } */
......
/* Derive a constant (0x30001) from another constant. */ /* Derive a constant (0x30001) from another constant. */
/* { dg-options "-O" } */ /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "0x300000|196608" } } */ /* { dg-final { scan-assembler-not "0x300000|196608" } } */
/* { dg-final { scan-assembler "addiu\t\\\$5,\\\$\[0-9\]*,32763" } } */ /* { dg-final { scan-assembler "addiu\t\\\$5,\\\$\[0-9\]*,32763" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-final { scan-assembler "\tddiv\t" } } */ /* { dg-final { scan-assembler "\tddiv\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler-not "\tmfhi\t" } } */ /* { dg-final { scan-assembler-not "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-final { scan-assembler "\tdivu\t" } } */ /* { dg-final { scan-assembler "\tdivu\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler-not "\tmfhi\t" } } */ /* { dg-final { scan-assembler-not "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-final { scan-assembler "\tdiv\t" } } */ /* { dg-final { scan-assembler "\tdiv\t" } } */
/* { dg-final { scan-assembler-not "\tmflo\t" } } */ /* { dg-final { scan-assembler-not "\tmflo\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-final { scan-assembler "\tdivu\t" } } */ /* { dg-final { scan-assembler "\tdivu\t" } } */
/* { dg-final { scan-assembler-not "\tmflo\t" } } */ /* { dg-final { scan-assembler-not "\tmflo\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-final { scan-assembler "\tddivu\t" } } */ /* { dg-final { scan-assembler "\tddivu\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler-not "\tmfhi\t" } } */ /* { dg-final { scan-assembler-not "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-final { scan-assembler "\tddiv\t" } } */ /* { dg-final { scan-assembler "\tddiv\t" } } */
/* { dg-final { scan-assembler-not "\tmflo\t" } } */ /* { dg-final { scan-assembler-not "\tmflo\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-final { scan-assembler "\tddivu\t" } } */ /* { dg-final { scan-assembler "\tddivu\t" } } */
/* { dg-final { scan-assembler-not "\tmflo\t" } } */ /* { dg-final { scan-assembler-not "\tmflo\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-final { scan-assembler "\tdiv\t" } } */ /* { dg-final { scan-assembler "\tdiv\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler-not "\tmfhi\t" } } */ /* { dg-final { scan-assembler-not "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-final { scan-assembler "\tdivu\t" } } */ /* { dg-final { scan-assembler "\tdivu\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler-not "\tmfhi\t" } } */ /* { dg-final { scan-assembler-not "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-final { scan-assembler "\tdiv\t" } } */ /* { dg-final { scan-assembler "\tdiv\t" } } */
/* { dg-final { scan-assembler-not "\tmflo\t" } } */ /* { dg-final { scan-assembler-not "\tmflo\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-final { scan-assembler "\tdivu\t" } } */ /* { dg-final { scan-assembler "\tdivu\t" } } */
/* { dg-final { scan-assembler-not "\tmflo\t" } } */ /* { dg-final { scan-assembler-not "\tmflo\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-final { scan-assembler "\tdiv\t" } } */ /* { dg-final { scan-assembler "\tdiv\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler-not "\tmfhi\t" } } */ /* { dg-final { scan-assembler-not "\tmfhi\t" } } */
......
/* { dg-do compile { target { fixed_point } } } */ /* { dg-do compile { target { fixed_point } } } */
/* { dg-options "-O2 -mgp32 -mdsp" } */ /* This test requires widening_mul */
/* { dg-options "-mgp32 -mdsp -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tdpaq_sa.l.w\t\\\$ac" 3 } } */ /* { dg-final { scan-assembler-times "\tdpaq_sa.l.w\t\\\$ac" 3 } } */
NOMIPS16 _Sat long long _Fract NOMIPS16 _Sat long long _Fract
......
/* { dg-do compile { target { fixed_point } } } */ /* { dg-do compile { target { fixed_point } } } */
/* { dg-options "-O2 -mgp32 -mdsp" } */ /* This test requires widening_mul */
/* { dg-options "-mgp32 -mdsp -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tdpsq_sa.l.w\t\\\$ac" 2 } } */ /* { dg-final { scan-assembler-times "\tdpsq_sa.l.w\t\\\$ac" 2 } } */
NOMIPS16 _Sat long long _Fract NOMIPS16 _Sat long long _Fract
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-mgp64 -O" } */ /* { dg-options "-mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
#define TEST(ID, TYPE1, TYPE2) \ #define TEST(ID, TYPE1, TYPE2) \
union u##ID { \ union u##ID { \
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mdsp -mgp32" } */ /* { dg-options "-mdsp -mgp32" } */
extern void abort (void); extern void abort (void);
extern void exit (int); extern void exit (int);
......
/* Test MIPS32 DSP LHX instruction */ /* Test MIPS32 DSP LHX instruction */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-mgp32 -mdsp -O2" } */ /* { dg-options "-mgp32 -mdsp" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tlhx\t" } } */ /* { dg-final { scan-assembler "\tlhx\t" } } */
......
/* Test MIPS32 DSP LHX instruction */ /* Test MIPS32 DSP LHX instruction */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-mgp32 -mdsp -O2" } */ /* { dg-options "-mgp32 -mdsp" } */
/* { dg-final { scan-assembler-not "\tlhx\t" } } */ /* { dg-final { scan-assembler-not "\tlhx\t" } } */
......
/* Test MIPS32 DSP REV 2 MULT instruction. Tune for a CPU that has /* Test MIPS32 DSP REV 2 MULT instruction. Tune for a CPU that has
pipelined mult. */ pipelined mult. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-mgp32 -mdspr2 -O2 -mtune=74kc" } */ /* This test requires widening_mul */
/* { dg-options "-mgp32 -mdspr2 -mtune=74kc -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* See PR target/51729 for the reason behind the XFAILs. */ /* See PR target/51729 for the reason behind the XFAILs. */
/* { dg-final { scan-assembler "\tmult\t" } } */ /* { dg-final { scan-assembler "\tmult\t" } } */
......
/* Test MIPS32 DSP REV 2 MULTU instruction. Tune for a CPU that has /* Test MIPS32 DSP REV 2 MULTU instruction. Tune for a CPU that has
pipelined multu. */ pipelined multu. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-mgp32 -mdspr2 -O2 -mtune=74kc" } */ /* { dg-options "-mgp32 -mdspr2 -mtune=74kc" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* See PR target/51729 for the reason behind the XFAILs. */ /* See PR target/51729 for the reason behind the XFAILs. */
/* { dg-final { scan-assembler "\tmultu\t" } } */ /* { dg-final { scan-assembler "\tmultu\t" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O isa_rev>=2 -mgp64" } */ /* { dg-options "isa_rev>=2 -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tdext\t" } } */ /* { dg-final { scan-assembler "\tdext\t" } } */
/* { dg-final { scan-assembler-not "and" } } */ /* { dg-final { scan-assembler-not "and" } } */
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
zero_extract. The truncate is due to TARGET_PROMOTE_PROTOTYPES, the zero_extract. The truncate is due to TARGET_PROMOTE_PROTOTYPES, the
zero_extend to PROMOTE_MODE. */ zero_extend to PROMOTE_MODE. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O isa_rev>=2 -mgp64" } */ /* { dg-options "isa_rev>=2 -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tdext\t" } } */ /* { dg-final { scan-assembler "\tdext\t" } } */
/* { dg-final { scan-assembler-not "and" } } */ /* { dg-final { scan-assembler-not "and" } } */
/* { dg-final { scan-assembler-not "srl" } } */ /* { dg-final { scan-assembler-not "srl" } } */
......
/* For MIPS64r2 use DEXT rather than DSLL/DSRL to zero-extend. */ /* For MIPS64r2 use DEXT rather than DSLL/DSRL to zero-extend. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O isa_rev>=2 -mgp64" } */ /* { dg-options "isa_rev>=2 -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tdext\t" } } */ /* { dg-final { scan-assembler "\tdext\t" } } */
/* { dg-final { scan-assembler-not "sll" } } */ /* { dg-final { scan-assembler-not "sll" } } */
......
/* For MIPS64r2 use DEXT rather than DSLL/DSRL for clear_upper32. */ /* For MIPS64r2 use DEXT rather than DSLL/DSRL for clear_upper32. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O isa_rev>=2 -mgp64" } */ /* { dg-options "isa_rev>=2 -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tdext\t" } } */ /* { dg-final { scan-assembler "\tdext\t" } } */
/* { dg-final { scan-assembler-not "sll" } } */ /* { dg-final { scan-assembler-not "sll" } } */
......
/* For MIPS32r2 use EXT when ANDing with low-order bitmasks. */ /* For MIPS32r2 use EXT when ANDing with low-order bitmasks. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O isa_rev>=2" } */ /* { dg-options "isa_rev>=2" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\text\t" } } */ /* { dg-final { scan-assembler "\text\t" } } */
/* { dg-final { scan-assembler-not "\tandi?\t" } } */ /* { dg-final { scan-assembler-not "\tandi?\t" } } */
......
/* For MIPS64r2 use DEXT when ANDing with low-order bitmasks. */ /* For MIPS64r2 use DEXT when ANDing with low-order bitmasks. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O isa_rev>=2 -mgp64" } */ /* { dg-options "isa_rev>=2 -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tdext\t" } } */ /* { dg-final { scan-assembler "\tdext\t" } } */
/* { dg-final { scan-assembler-not "\tandi?\t" } } */ /* { dg-final { scan-assembler-not "\tandi?\t" } } */
......
/* No need to use ext if we can use andi. */ /* No need to use ext if we can use andi. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O isa_rev>=2" } */ /* { dg-options "isa_rev>=2" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tandi\t" } } */ /* { dg-final { scan-assembler "\tandi\t" } } */
/* { dg-final { scan-assembler-not "\td?ext\t" } } */ /* { dg-final { scan-assembler-not "\td?ext\t" } } */
......
/* Also make sure we don't use ext for MIPS*r1. */ /* Also make sure we don't use ext for MIPS*r1. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O isa_rev<=1" } */ /* { dg-options "isa_rev<=1" } */
/* { dg-final { scan-assembler "\tand\t" } } */ /* { dg-final { scan-assembler "\tand\t" } } */
/* { dg-final { scan-assembler-not "\td?ext\t" } } */ /* { dg-final { scan-assembler-not "\td?ext\t" } } */
......
/* { dg-options "-O -mgp64 forbid_cpu=octeon.*" } */ /* { dg-options "-mgp64 forbid_cpu=octeon.*" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tdsll\t" 5 } } */ /* { dg-final { scan-assembler-times "\tdsll\t" 5 } } */
/* { dg-final { scan-assembler-times "\tdsra\t" 5 } } */ /* { dg-final { scan-assembler-times "\tdsra\t" 5 } } */
/* { dg-final { scan-assembler-not "\tsll\t" } } */ /* { dg-final { scan-assembler-not "\tsll\t" } } */
......
/* Check the shift_shift alternative of the AND patterns. */ /* Check the shift_shift alternative of the AND patterns. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O isa_rev<=1 -mgp64" } */ /* { dg-options "isa_rev<=1 -mgp64" } */
/* { dg-final { scan-assembler "\tdsrl\t" } } */ /* { dg-final { scan-assembler "\tdsrl\t" } } */
/* { dg-final { scan-assembler "\tdsll\t" } } */ /* { dg-final { scan-assembler "\tdsll\t" } } */
/* { dg-final { scan-assembler-not "\td?ext\t" } } */ /* { dg-final { scan-assembler-not "\td?ext\t" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
NOMIPS16 int NOMIPS16 int
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
NOMIPS16 int NOMIPS16 int
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
NOMIPS16 int NOMIPS16 int
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ /* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
NOMIPS16 int NOMIPS16 int
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
NOMIPS16 int NOMIPS16 int
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
NOMIPS16 int NOMIPS16 int
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
NOMIPS16 int NOMIPS16 int
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
NOMIPS16 int NOMIPS16 int
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
NOMIPS16 int NOMIPS16 int
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
NOMIPS16 int NOMIPS16 int
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ /* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
NOMIPS16 int NOMIPS16 int
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
NOMIPS16 int NOMIPS16 int
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mfix-r10000" } */ /* { dg-options "-mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
NOMIPS16 int NOMIPS16 int
......
/* { dg-options "-march=r4000 -mfix-r4000 -O2 -dp" } */ /* { dg-options "-march=r4000 -mfix-r4000 -dp" } */
/* { dg-skip-if "naming registers makes this a code quality test" { *-*-* } { "-O0" } { "" } } */
typedef int int32_t; typedef int int32_t;
typedef int uint32_t; typedef int uint32_t;
NOMIPS16 int32_t foo (int32_t x, int32_t y) { return x * y; } NOMIPS16 int32_t foo (int32_t x, int32_t y) { return x * y; }
......
/* ??? At the moment, lower-subreg.c decomposes the copy of the multiplication /* ??? At the moment, lower-subreg.c decomposes the copy of the multiplication
result to $2, which prevents the register allocators from storing the result to $2, which prevents the register allocators from storing the
multiplication result in $2. */ multiplication result in $2. */
/* { dg-options "-mips3 -mfix-r4000 -mgp64 -O2 -fno-split-wide-types -dp -EL" } */ /* { dg-options "-mips3 -mfix-r4000 -mgp64 -EL -fno-split-wide-types -dp" } */
/* { dg-skip-if "naming registers makes this a code quality test" { *-*-* } { "-O0" } { "" } } */
typedef unsigned long long uint64_t; typedef unsigned long long uint64_t;
typedef unsigned int uint128_t __attribute__((mode(TI))); typedef unsigned int uint128_t __attribute__((mode(TI)));
NOMIPS16 uint128_t foo (uint64_t x, uint64_t y) { return (uint128_t) x * y; } NOMIPS16 uint128_t foo (uint64_t x, uint64_t y) { return (uint128_t) x * y; }
......
/* { dg-options "-march=r4000 -mfix-r4000 -mgp64 -O2 -dp" } */ /* { dg-options "-march=r4000 -mfix-r4000 -mgp64 -dp" } */
/* { dg-skip-if "naming registers makes this a code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-skip-if "using DDIV gives a shorter sequence" { *-*-* } { "-Os" } { "" } } */
typedef long long int64_t; typedef long long int64_t;
NOMIPS16 int64_t foo (int64_t x) { return x / 11993; } NOMIPS16 int64_t foo (int64_t x) { return x / 11993; }
/* { dg-final { scan-assembler "[concat {\tdmult\t\$4,\$[0-9]+[^\n]+smuldi3_highpart[^\n]+\n\tmfhi\t\$[0-9]+\n}]" } } */ /* { dg-final { scan-assembler "[concat {\tdmult\t\$4,\$[0-9]+[^\n]+smuldi3_highpart[^\n]+\n\tmfhi\t\$[0-9]+\n}]" } } */
/* { dg-options "-march=r4000 -mfix-r4000 -mgp64 -O2 -dp" } */ /* { dg-options "-march=r4000 -mfix-r4000 -mgp64 -dp" } */
/* { dg-skip-if "naming registers makes this a code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-skip-if "using DDIVU gives a shorter sequence" { *-*-* } { "-Os" } { "" } } */
typedef unsigned long long uint64_t; typedef unsigned long long uint64_t;
NOMIPS16 uint64_t foo (uint64_t x) { return x / 11993; } NOMIPS16 uint64_t foo (uint64_t x) { return x / 11993; }
/* { dg-final { scan-assembler "[concat {\tdmultu\t\$4,\$[0-9]+[^\n]+umuldi3_highpart[^\n]+\n\tmfhi\t\$[0-9]+\n}]" } } */ /* { dg-final { scan-assembler "[concat {\tdmultu\t\$4,\$[0-9]+[^\n]+umuldi3_highpart[^\n]+\n\tmfhi\t\$[0-9]+\n}]" } } */
/* { dg-options "-mips1 -mfix-r4000 -O2 -dp -EB" } */ /* This test requires widening_mul */
/* { dg-options "-mips1 -mfix-r4000 -dp -EB -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
typedef int int32_t; typedef int int32_t;
typedef long long int64_t; typedef long long int64_t;
NOMIPS16 int32_t foo (int32_t x, int32_t y) { return ((int64_t) x * y) >> 32; } NOMIPS16 int32_t foo (int32_t x, int32_t y) { return ((int64_t) x * y) >> 32; }
......
/* { dg-options "-mips1 -mfix-r4000 -O2 -dp -EB" } */ /* { dg-options "-mips1 -mfix-r4000 -dp -EB" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
typedef unsigned long long uint64_t; typedef unsigned long long uint64_t;
NOMIPS16 uint32_t foo (uint32_t x, uint32_t y) { return ((uint64_t) x * y) >> 32; } NOMIPS16 uint32_t foo (uint32_t x, uint32_t y) { return ((uint64_t) x * y) >> 32; }
......
/* ??? At the moment, lower-subreg.c decomposes the copy of the multiplication /* ??? At the moment, lower-subreg.c decomposes the copy of the multiplication
result to $2, which prevents the register allocators from storing the result to $2, which prevents the register allocators from storing the
multiplication result in $2. */ multiplication result in $2. */
/* { dg-options "-mips1 -mfix-r4000 -O2 -fno-split-wide-types -dp -EL" } */ /* This test requires widening_mul */
/* { dg-options "-mips1 -mfix-r4000 -fno-split-wide-types -dp -EL -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
typedef int int32_t; typedef int int32_t;
typedef long long int64_t; typedef long long int64_t;
NOMIPS16 int64_t foo (int32_t x, int32_t y) { return (int64_t) x * y; } NOMIPS16 int64_t foo (int32_t x, int32_t y) { return (int64_t) x * y; }
......
/* ??? At the moment, lower-subreg.c decomposes the copy of the multiplication /* ??? At the moment, lower-subreg.c decomposes the copy of the multiplication
result to $2, which prevents the register allocators from storing the result to $2, which prevents the register allocators from storing the
multiplication result in $2. */ multiplication result in $2. */
/* { dg-options "-mips1 -mfix-r4000 -O2 -fno-split-wide-types -dp -EL" } */ /* { dg-options "-mips1 -mfix-r4000 -fno-split-wide-types -dp -EL" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
typedef unsigned long long uint64_t; typedef unsigned long long uint64_t;
NOMIPS16 uint64_t foo (uint32_t x, uint32_t y) { return (uint64_t) x * y; } NOMIPS16 uint64_t foo (uint32_t x, uint32_t y) { return (uint64_t) x * y; }
......
/* { dg-options "-march=r4000 -mfix-r4000 -mgp64 -O2 -dp" } */ /* { dg-options "-march=r4000 -mfix-r4000 -mgp64 -dp" } */
/* { dg-skip-if "naming registers makes this a code quality test" { *-*-* } { "-O0" } { "" } } */
typedef long long int64_t; typedef long long int64_t;
typedef unsigned long long uint64_t; typedef unsigned long long uint64_t;
NOMIPS16 int64_t foo (int64_t x, int64_t y) { return x * y; } NOMIPS16 int64_t foo (int64_t x, int64_t y) { return x * y; }
......
/* { dg-options "-march=r4000 -mfix-r4000 -O2 -mgp64 -dp -EB" } */ /* This test requires widening_mul */
/* { dg-options "-march=r4000 -mfix-r4000 -mgp64 -dp -EB -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
typedef long long int64_t; typedef long long int64_t;
typedef int int128_t __attribute__((mode(TI))); typedef int int128_t __attribute__((mode(TI)));
NOMIPS16 int64_t foo (int64_t x, int64_t y) { return ((int128_t) x * y) >> 64; } NOMIPS16 int64_t foo (int64_t x, int64_t y) { return ((int128_t) x * y) >> 64; }
......
/* { dg-options "-march=r4000 -mfix-r4000 -O2 -mgp64 -dp -EB" } */ /* { dg-options "-march=r4000 -mfix-r4000 -mgp64 -dp -EB" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
typedef unsigned long long uint64_t; typedef unsigned long long uint64_t;
typedef unsigned int uint128_t __attribute__((mode(TI))); typedef unsigned int uint128_t __attribute__((mode(TI)));
NOMIPS16 uint64_t foo (uint64_t x, uint64_t y) { return ((uint128_t) x * y) >> 64; } NOMIPS16 uint64_t foo (uint64_t x, uint64_t y) { return ((uint128_t) x * y) >> 64; }
......
/* ??? At the moment, lower-subreg.c decomposes the copy of the multiplication /* ??? At the moment, lower-subreg.c decomposes the copy of the multiplication
result to $2, which prevents the register allocators from storing the result to $2, which prevents the register allocators from storing the
multiplication result in $2. */ multiplication result in $2. */
/* { dg-options "-mips3 -mfix-r4000 -mgp64 -O2 -fno-split-wide-types -dp -EL" } */ /* This test requires widening_mul */
/* { dg-options "-mips3 -mfix-r4000 -mgp64 -fno-split-wide-types -dp -EL -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
typedef long long int64_t; typedef long long int64_t;
typedef int int128_t __attribute__((mode(TI))); typedef int int128_t __attribute__((mode(TI)));
NOMIPS16 int128_t foo (int64_t x, int64_t y) { return (int128_t) x * y; } NOMIPS16 int128_t foo (int64_t x, int64_t y) { return (int128_t) x * y; }
......
/* Test scalar fixed-point instructions */ /* Test scalar fixed-point instructions */
/* { dg-do compile { target { fixed_point } } } */ /* { dg-do compile { target { fixed_point } } } */
/* { dg-options "-mdspr2 -O2" } */ /* { dg-options "-mdspr2" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\taddu\t" 10 } } */ /* { dg-final { scan-assembler-times "\taddu\t" 10 } } */
/* { dg-final { scan-assembler-times "\tsubu\t" 10 } } */ /* { dg-final { scan-assembler-times "\tsubu\t" 10 } } */
/* { dg-final { scan-assembler "\taddu_s.qb\t" } } */ /* { dg-final { scan-assembler "\taddu_s.qb\t" } } */
......
/* Test vector fixed-point instructions */ /* Test vector fixed-point instructions */
/* { dg-do compile { target { fixed_point } } } */ /* { dg-do compile { target { fixed_point } } } */
/* { dg-options "-mdspr2 -O2" } */ /* { dg-options "-mdspr2" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\taddq_s.ph\t" 2 } } */ /* { dg-final { scan-assembler-times "\taddq_s.ph\t" 2 } } */
/* { dg-final { scan-assembler-times "\tsubq_s.ph\t" 2 } } */ /* { dg-final { scan-assembler-times "\tsubq_s.ph\t" 2 } } */
/* { dg-final { scan-assembler-times "\taddu_s.qb\t" 1 } } */ /* { dg-final { scan-assembler-times "\taddu_s.qb\t" 1 } } */
......
/* We used to use c.lt.fmt instead of c.ule.fmt here. */ /* We used to use c.lt.fmt instead of c.ule.fmt here. */
/* { dg-options "-mhard-float -O2" } */ /* { dg-options "-mhard-float" } */
NOMIPS16 int f1 (float x, float y) { return __builtin_isless (x, y); } NOMIPS16 int f1 (float x, float y) { return __builtin_isless (x, y); }
NOMIPS16 int f2 (double x, double y) { return __builtin_isless (x, y); } NOMIPS16 int f2 (double x, double y) { return __builtin_isless (x, y); }
/* { dg-final { scan-assembler "c\\.ule\\.s" } } */ /* { dg-final { scan-assembler "c\\.ule\\.s" } } */
......
/* We used to use c.le.fmt instead of c.ult.fmt here. */ /* We used to use c.le.fmt instead of c.ult.fmt here. */
/* { dg-options "-mhard-float -O2" } */ /* { dg-options "-mhard-float" } */
NOMIPS16 int f1 (float x, float y) { return __builtin_islessequal (x, y); } NOMIPS16 int f1 (float x, float y) { return __builtin_islessequal (x, y); }
NOMIPS16 int f2 (double x, double y) { return __builtin_islessequal (x, y); } NOMIPS16 int f2 (double x, double y) { return __builtin_islessequal (x, y); }
/* { dg-final { scan-assembler "c\\.ult\\.s" } } */ /* { dg-final { scan-assembler "c\\.ult\\.s" } } */
......
/* { dg-options "-mabi=32 -mhard-float -mips1 -O2 -EL" } */ /* { dg-options "-mabi=32 -mhard-float -mips1 -EL" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
NOMIPS16 void NOMIPS16 void
foo (double d, double *x) foo (double d, double *x)
......
/* { dg-options "-mabi=32 -mhard-float -mips1 -O2 -EB" } */ /* { dg-options "-mabi=32 -mhard-float -mips1 -EB" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
NOMIPS16 void NOMIPS16 void
foo (double d, double *x) foo (double d, double *x)
......
/* { dg-options "-mabi=32 -mfp64 -O2 -EL" } */ /* { dg-options "-mabi=32 -mfp64 -EL" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
NOMIPS16 double NOMIPS16 double
foo (double d) foo (double d)
......
/* { dg-options "-mabi=32 -mfp64 -O2 -EB" } */ /* { dg-options "-mabi=32 -mfp64 -EB" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
NOMIPS16 double NOMIPS16 double
foo (double d) foo (double d)
......
/* { dg-options "-mabi=64 -mhard-float -O2 -EL" } */ /* { dg-options "-mabi=64 -mhard-float -EL" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-require-effective-target mips_newabi_large_long_double } */ /* { dg-require-effective-target mips_newabi_large_long_double } */
NOMIPS16 void NOMIPS16 void
......
/* { dg-options "-mabi=64 -mhard-float -O2 -EB" } */ /* { dg-options "-mabi=64 -mhard-float -EB" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-require-effective-target mips_newabi_large_long_double } */ /* { dg-require-effective-target mips_newabi_large_long_double } */
NOMIPS16 void NOMIPS16 void
......
/* { dg-options "(-mips16) -mabi=64 -O2 -EL" } */ /* { dg-options "(-mips16) -mabi=64 -EL" } */
extern long double g[16]; extern long double g[16];
extern unsigned char gstuff[0x10000]; extern unsigned char gstuff[0x10000];
......
/* { dg-options "(-mips16) -mabi=64 -O2 -EB" } */ /* { dg-options "(-mips16) -mabi=64 -EB" } */
extern long double g[16]; extern long double g[16];
extern unsigned char gstuff[0x10000]; extern unsigned char gstuff[0x10000];
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O isa_rev>=2 -mgp32" } */ /* { dg-options "isa_rev>=2 -mgp32" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tins\t" } } */ /* { dg-final { scan-assembler "\tins\t" } } */
struct struct
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -meb isa_rev>=2 -mgp64" } */ /* { dg-options "-meb isa_rev>=2 -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tins\t|\tdins\t" 1 } } */ /* { dg-final { scan-assembler-times "\tins\t|\tdins\t" 1 } } */
/* { dg-final { scan-assembler-times "\tsll\t|\tins\t" 1 } } */ /* { dg-final { scan-assembler-times "\tsll\t|\tins\t" 1 } } */
......
/* { dg-options "(-mips16) -mgp64 -O2 -EL" } */ /* { dg-options "(-mips16) -mgp64 -EL" } */
typedef unsigned uint128_t __attribute__((mode(TI))); typedef unsigned uint128_t __attribute__((mode(TI)));
......
/* { dg-options "(-mips16) -mgp64 -O2 -EB" } */ /* { dg-options "(-mips16) -mgp64 -EB" } */
typedef unsigned uint128_t __attribute__((mode(TI))); typedef unsigned uint128_t __attribute__((mode(TI)));
......
/* Make sure that we emit .cfa_restore notes for LO and HI. */ /* Make sure that we emit .cfa_restore notes for LO and HI. */
/* { dg-options "-mips32r2 -msoft-float -O -g" } */ /* { dg-options "-mips32r2 -msoft-float -g" } */
/* { dg-skip-if "forbidding a frame pointer makes this a code quallity test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\t\\\.cfi_restore 64\n" } } */ /* { dg-final { scan-assembler "\t\\\.cfi_restore 64\n" } } */
/* { dg-final { scan-assembler "\t\\\.cfi_restore 65\n" } } */ /* { dg-final { scan-assembler "\t\\\.cfi_restore 65\n" } } */
/* { dg-final { scan-assembler-not "\\\.cfi_def_cfa( |\t)" } } */ /* { dg-final { scan-assembler-not "\\\.cfi_def_cfa( |\t)" } } */
......
/* Make sure that we emit .cfa_restore notes for LO, HI and GPRs. */ /* Make sure that we emit .cfa_restore notes for LO, HI and GPRs. */
/* { dg-options "-mips32r2 -msoft-float -O -g" } */ /* { dg-options "-mips32r2 -msoft-float -g" } */
/* { dg-skip-if "forbidding a frame pointer makes this a code quallity test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\t\\\.cfi_restore 1\n" } } */ /* { dg-final { scan-assembler "\t\\\.cfi_restore 1\n" } } */
/* { dg-final { scan-assembler "\t\\\.cfi_restore 2\n" } } */ /* { dg-final { scan-assembler "\t\\\.cfi_restore 2\n" } } */
/* { dg-final { scan-assembler "\t\\\.cfi_restore 3\n" } } */ /* { dg-final { scan-assembler "\t\\\.cfi_restore 3\n" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-mshared -mexplicit-relocs -O2 -fno-delayed-branch" } */ /* { dg-options "-mshared -mexplicit-relocs -fno-delayed-branch -fno-unroll-loops" } */
/* We can load into something other than $25 when not optimizing,
then immediately move into $25. */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
void bar (void); void bar (void);
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mabi=32 -pg -mno-abicalls -mlong-calls" } */ /* { dg-options "-mabi=32 -pg -mno-abicalls -mlong-calls" } */
/* { dg-final { scan-assembler-not "\tjal\t_mcount" } } */ /* { dg-final { scan-assembler-not "\tjal\t_mcount" } } */
NOMIPS16 void NOMIPS16 void
foo (void) foo (void)
......
/* { dg-options "-O2 isa=loongson" } */ /* { dg-options "isa=loongson" } */
typedef int st; typedef int st;
typedef unsigned int ut; typedef unsigned int ut;
......
/* { dg-options "-O2 isa=loongson -mgp64" } */ /* { dg-options "isa=loongson -mgp64" } */
typedef long long st; typedef long long st;
typedef unsigned long long ut; typedef unsigned long long ut;
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
/* loongson.h does not handle or check for MIPS16ness. There doesn't /* loongson.h does not handle or check for MIPS16ness. There doesn't
seem any good reason for it to, given that the Loongson processors seem any good reason for it to, given that the Loongson processors
do not support MIPS16. */ do not support MIPS16. */
/* { dg-options "isa=loongson -mhard-float -mno-mips16 -O1" } */ /* { dg-options "isa=loongson -mhard-float -mno-mips16" } */
/* See PR 52155. */ /* See PR 52155. */
/* { dg-options "isa=loongson -mhard-float -mno-mips16 -O1 -mlong64" { mips*-*-elf* && ilp32 } } */ /* { dg-options "isa=loongson -mhard-float -mno-mips16 -mlong64" { mips*-*-elf* && ilp32 } } */
#include "loongson.h" #include "loongson.h"
#include <assert.h> #include <assert.h>
......
/* { dg-options "-O2 -march=loongson3a" } */ /* { dg-options "-march=loongson3a" } */
typedef int st; typedef int st;
typedef unsigned int ut; typedef unsigned int ut;
......
/* { dg-options "-O2 -march=loongson3a -mgp64" } */ /* { dg-options "-march=loongson3a -mgp64" } */
typedef long long st; typedef long long st;
typedef unsigned long long ut; typedef unsigned long long ut;
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -march=vr4130 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "-march=vr4130 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmacc\t\\\$1," 3 } } */ /* { dg-final { scan-assembler-times "\tmacc\t\\\$1," 3 } } */
NOMIPS16 long long NOMIPS16 long long
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -march=vr5500 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "-march=vr5500 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmadd\t" 3 } } */ /* { dg-final { scan-assembler-times "\tmadd\t" 3 } } */
NOMIPS16 long long NOMIPS16 long long
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 isa_rev>=1 -mgp32" } */ /* { dg-options "isa_rev>=1 -mgp32" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmadd\t" 3 } } */ /* { dg-final { scan-assembler-times "\tmadd\t" 3 } } */
NOMIPS16 long long NOMIPS16 long long
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mdspr2 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "-mdspr2 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmadd\t\\\$ac" 3 } } */ /* { dg-final { scan-assembler-times "\tmadd\t\\\$ac" 3 } } */
NOMIPS16 long long NOMIPS16 long long
......
/* { dg-options "-O2 -march=5kc" } */ /* { dg-options "-march=5kc" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmadd\t" 4 } } */ /* { dg-final { scan-assembler-times "\tmadd\t" 4 } } */
/* { dg-final { scan-assembler-not "\tmtlo\t" } } */ /* { dg-final { scan-assembler-not "\tmtlo\t" } } */
/* { dg-final { scan-assembler-times "\tmflo\t" 3 } } */ /* { dg-final { scan-assembler-times "\tmflo\t" 3 } } */
......
/* { dg-options "-O2 -march=5kc" } */ /* { dg-options "-march=5kc" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "\tmadd\t" } } */ /* { dg-final { scan-assembler-not "\tmadd\t" } } */
/* { dg-final { scan-assembler "\tmul\t" } } */ /* { dg-final { scan-assembler "\tmul\t" } } */
/* { dg-final { scan-assembler "\taddu\t" } } */ /* { dg-final { scan-assembler "\taddu\t" } } */
......
/* { dg-options "-O2 -march=5kc" } */ /* { dg-options "-march=5kc" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-skip-if "requires -fira-region=all or =mixed" { *-*-* } { "-Os" } { "" } } */
/* { dg-final { scan-assembler-not "\tmul\t" } } */ /* { dg-final { scan-assembler-not "\tmul\t" } } */
/* { dg-final { scan-assembler "\tmadd\t" } } */ /* { dg-final { scan-assembler "\tmadd\t" } } */
......
/* { dg-options "-O2 -march=5kc" } */ /* { dg-options "-march=5kc" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tmul\t" } } */ /* { dg-final { scan-assembler "\tmul\t" } } */
/* { dg-final { scan-assembler-not "\tmadd\t" } } */ /* { dg-final { scan-assembler-not "\tmadd\t" } } */
/* { dg-final { scan-assembler-not "\tmtlo\t" } } */ /* { dg-final { scan-assembler-not "\tmtlo\t" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 isa_rev>=1 -mgp32" } */ /* { dg-options "isa_rev>=1 -mgp32" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "\tmul\t" } } */ /* { dg-final { scan-assembler-not "\tmul\t" } } */
/* { dg-final { scan-assembler "\tmadd\t" } } */ /* { dg-final { scan-assembler "\tmadd\t" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -march=vr4130 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "-march=vr4130 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmaccu\t\\\$1," 3 } } */ /* { dg-final { scan-assembler-times "\tmaccu\t\\\$1," 3 } } */
typedef unsigned int ui; typedef unsigned int ui;
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -march=vr5500 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "-march=vr5500 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmaddu\t" 3 } } */ /* { dg-final { scan-assembler-times "\tmaddu\t" 3 } } */
typedef unsigned int ui; typedef unsigned int ui;
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 isa_rev>=1 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "isa_rev>=1 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmaddu\t" 3 } } */ /* { dg-final { scan-assembler-times "\tmaddu\t" 3 } } */
typedef unsigned int ui; typedef unsigned int ui;
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mdspr2 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "-mdspr2 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmaddu\t\\\$ac" 3 } } */ /* { dg-final { scan-assembler-times "\tmaddu\t\\\$ac" 3 } } */
typedef unsigned int ui; typedef unsigned int ui;
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2" } */ /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "\tlbu\t" } } */ /* { dg-final { scan-assembler-not "\tlbu\t" } } */
#include <string.h> #include <string.h>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mips3d" } */ /* { dg-options "-mips3d" } */
/* Test MIPS-3D builtin functions */ /* Test MIPS-3D builtin functions */
#include <stdlib.h> #include <stdlib.h>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mips3d" } */ /* { dg-options "-mips3d" } */
/* Test MIPS-3D branch-if-any-two builtin functions */ /* Test MIPS-3D branch-if-any-two builtin functions */
#include <stdlib.h> #include <stdlib.h>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mips3d" } */ /* { dg-options "-mips3d" } */
/* Test MIPS-3D absolute compare builtin functions */ /* Test MIPS-3D absolute compare builtin functions */
#include <stdlib.h> #include <stdlib.h>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mips3d" } */ /* { dg-options "-mips3d" } */
/* Test MIPS-3D branch-if-any-four builtin functions */ /* Test MIPS-3D branch-if-any-four builtin functions */
#include <stdlib.h> #include <stdlib.h>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mips3d" } */ /* { dg-options "-mips3d" } */
/* Test MIPS-3D absolute-compare & branch-if-any-four builtin functions */ /* Test MIPS-3D absolute-compare & branch-if-any-four builtin functions */
#include <stdlib.h> #include <stdlib.h>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mips3d" } */ /* { dg-options "-mips3d" } */
/* Test MIPS-3D absolute compare (floats) builtin functions */ /* Test MIPS-3D absolute compare (floats) builtin functions */
#include <stdlib.h> #include <stdlib.h>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mips3d" } */ /* { dg-options "-mips3d" } */
/* Test MIPS-3D absolute compare (doubles) builtin functions */ /* Test MIPS-3D absolute compare (doubles) builtin functions */
#include <stdlib.h> #include <stdlib.h>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mips3d" } */ /* { dg-options "-mips3d" } */
/* Test MIPS-3D absolute compare and conditional move builtin functions */ /* Test MIPS-3D absolute compare and conditional move builtin functions */
#include <stdlib.h> #include <stdlib.h>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mips3d" } */ /* { dg-options "-mips3d" } */
/* Matrix Multiplications */ /* Matrix Multiplications */
#include <stdlib.h> #include <stdlib.h>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mpaired-single" } */ /* { dg-options "-mpaired-single" } */
/* Test v2sf calculations */ /* Test v2sf calculations */
#include <stdlib.h> #include <stdlib.h>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mpaired-single" } */ /* { dg-options "-mpaired-single" } */
/* Test MIPS paired-single builtin functions */ /* Test MIPS paired-single builtin functions */
#include <stdlib.h> #include <stdlib.h>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mpaired-single" } */ /* { dg-options "-mpaired-single" } */
/* Test MIPS paired-single conditional move */ /* Test MIPS paired-single conditional move */
#include <stdlib.h> #include <stdlib.h>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mpaired-single" } */ /* { dg-options "-mpaired-single" } */
/* Test MIPS paired-single comparisons */ /* Test MIPS paired-single comparisons */
#include <stdlib.h> #include <stdlib.h>
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mpaired-single -mgp64 -ftree-vectorize" } */ /* { dg-options "-mpaired-single -mgp64 -ftree-vectorize" } */
/* { dg-skip-if "requires vectorization" { *-*-* } { "-O0" "-Os" } { "" } } */
extern float a[], b[], c[]; extern float a[], b[], c[];
......
/* mips-ps-2.c with an extra -ffinite-math-only option. This option /* mips-ps-2.c with an extra -ffinite-math-only option. This option
changes the way that abs.ps is handled. */ changes the way that abs.ps is handled. */
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2 -mpaired-single -ffinite-math-only" } */ /* { dg-options "-mpaired-single -ffinite-math-only" } */
/* Test MIPS paired-single builtin functions */ /* Test MIPS paired-single builtin functions */
#include <stdlib.h> #include <stdlib.h>
......
/* mips-ps-5.c with -mgp32 instead of -mgp64. */ /* mips-ps-5.c with -mgp32 instead of -mgp64. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-mgp32 -O2 -mpaired-single -ftree-vectorize" } */ /* { dg-options "-mgp32 -mpaired-single -ftree-vectorize" } */
/* { dg-skip-if "requires vectorization" { *-*-* } { "-O0" "-Os" } { "" } } */
extern float a[], b[], c[]; extern float a[], b[], c[];
......
/* Test v2sf calculations. The nmadd and nmsub patterns need /* Test v2sf calculations. The nmadd and nmsub patterns need
-ffinite-math-only. */ -ffinite-math-only. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "isa_rev>=2 -mgp32 -O2 -mpaired-single -ffinite-math-only" } */ /* { dg-options "isa_rev>=2 -mgp32 -mpaired-single -ffinite-math-only" } */
/* { dg-skip-if "nmadd and nmsub need combine" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "cvt.ps.s" } } */ /* { dg-final { scan-assembler "cvt.ps.s" } } */
/* { dg-final { scan-assembler "mov.ps" } } */ /* { dg-final { scan-assembler "mov.ps" } } */
/* { dg-final { scan-assembler "ldc1" } } */ /* { dg-final { scan-assembler "ldc1" } } */
......
/* Test v2sf calculations. The nmadd and nmsub patterns need /* Test v2sf calculations. The nmadd and nmsub patterns need
-ffinite-math-only. */ -ffinite-math-only. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mpaired-single -mgp64 -ffinite-math-only" } */ /* { dg-options "-mpaired-single -mgp64 -ffinite-math-only" } */
/* { dg-skip-if "nmadd and nmsub need combine" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "cvt.ps.s" } } */ /* { dg-final { scan-assembler "cvt.ps.s" } } */
/* { dg-final { scan-assembler "mov.ps" } } */ /* { dg-final { scan-assembler "mov.ps" } } */
/* { dg-final { scan-assembler "ldc1" } } */ /* { dg-final { scan-assembler "ldc1" } } */
......
/* Test for case where another independent multiply insn may interfere /* Test for case where another independent multiply insn may interfere
with a macc chain. */ with a macc chain. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-Os -march=24kf" } */ /* { dg-options "-march=24kf" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
NOMIPS16 int foo (int a, int b, int c, int d, int e, int f, int g) NOMIPS16 int foo (int a, int b, int c, int d, int e, int f, int g)
{ {
......
...@@ -222,6 +222,10 @@ load_lib gcc-dg.exp ...@@ -222,6 +222,10 @@ load_lib gcc-dg.exp
# A list of GROUP REGEXP pairs. Each GROUP represents a logical group of # A list of GROUP REGEXP pairs. Each GROUP represents a logical group of
# options from which only one option should be chosen. REGEXP matches all # options from which only one option should be chosen. REGEXP matches all
# the options in that group; it is implicitly wrapped in "^(...)$". # the options in that group; it is implicitly wrapped in "^(...)$".
#
# Note that -O* is deliberately omitted from this list. Tests in this
# directory are run at various optimisation levels and should use
# dg-skip-if to skip any incompatible levels.
set mips_option_groups { set mips_option_groups {
abi "-mabi=.*" abi "-mabi=.*"
addressing "addressing=.*" addressing "addressing=.*"
...@@ -236,7 +240,6 @@ set mips_option_groups { ...@@ -236,7 +240,6 @@ set mips_option_groups {
long "-mlong(32|64)" long "-mlong(32|64)"
mips16 "-mips16|-mno-mips16|-mflip-mips16" mips16 "-mips16|-mno-mips16|-mflip-mips16"
mips3d "-mips3d|-mno-mips3d" mips3d "-mips3d|-mno-mips3d"
optimization "-O(|[0-3s])"
pic "-f(no-|)(pic|PIC)" pic "-f(no-|)(pic|PIC)"
profiling "-pg" profiling "-pg"
small-data "-G[0-9]+" small-data "-G[0-9]+"
...@@ -283,13 +286,21 @@ foreach option { ...@@ -283,13 +286,21 @@ foreach option {
# Add -ffoo/-fno-foo options to mips_option_groups. # Add -ffoo/-fno-foo options to mips_option_groups.
foreach option { foreach option {
delayed-branch delayed-branch
expensive-optimizations
fast-math fast-math
fat-lto-objects
finite-math-only finite-math-only
fixed-hi fixed-hi
fixed-lo fixed-lo
lax-vector-conversions lax-vector-conversions
omit-frame-pointer
optimize-sibling-calls
peephole2
schedule-insns2
split-wide-types split-wide-types
tree-vectorize tree-vectorize
unroll-all-loops
unroll-loops
} { } {
lappend mips_option_groups $option "-f(no-|)$option" lappend mips_option_groups $option "-f(no-|)$option"
} }
...@@ -881,6 +892,10 @@ proc mips-dg-options { args } { ...@@ -881,6 +892,10 @@ proc mips-dg-options { args } {
} }
} }
# Handle dependencies between the test options and the optimization ones.
mips_option_dependency options "-fno-unroll-loops" "-fno-unroll-all-loops"
mips_option_dependency options "-pg" "-fno-omit-frame-pointer"
# Handle dependencies between options on the left of the # Handle dependencies between options on the left of the
# dependency diagram. # dependency diagram.
mips_option_dependency options "-mips3d" "-mpaired-single" mips_option_dependency options "-mips3d" "-mpaired-single"
...@@ -1253,8 +1268,7 @@ proc mips-gcc-dg-test { prog do_what extra_tool_flags } { ...@@ -1253,8 +1268,7 @@ proc mips-gcc-dg-test { prog do_what extra_tool_flags } {
dg-init dg-init
mips-dg-init mips-dg-init
# MIPS16 is defined by "-mips16" or "(-mips16)" in dg-options. gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] \
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] "" \
"-DNOMIPS16=__attribute__((nomips16))" "-DNOMIPS16=__attribute__((nomips16))"
mips-dg-finish mips-dg-finish
dg-finish dg-finish
/* -mlong32 added because of PR target/38595. */ /* -mlong32 added because of PR target/38595. */
/* { dg-options "(-mips16) -Os isa_rev>=1 -mlong32" } */ /* { dg-options "(-mips16) isa_rev>=1 -mlong32" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
MIPS16 short cksum16 (unsigned long n) MIPS16 short cksum16 (unsigned long n)
{ {
......
/* Test MIPS32 DSP instructions */ /* Test MIPS32 DSP instructions */
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-mdsp -O2" } */ /* { dg-options "-mdsp" } */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
...@@ -59,8 +59,10 @@ NOMIPS16 void test_MIPS_DSP () ...@@ -59,8 +59,10 @@ NOMIPS16 void test_MIPS_DSP ()
v4i8 v4i8_a,v4i8_b,v4i8_c,v4i8_r,v4i8_s; v4i8 v4i8_a,v4i8_b,v4i8_c,v4i8_r,v4i8_s;
v2q15 v2q15_a,v2q15_b,v2q15_c,v2q15_r,v2q15_s; v2q15 v2q15_a,v2q15_b,v2q15_c,v2q15_r,v2q15_s;
q31 q31_a,q31_b,q31_c,q31_r,q31_s; q31 q31_a,q31_b,q31_c,q31_r,q31_s;
i32 i32_a,i32_b,i32_c,i32_r,i32_s; /* To protect the multiplication-related tests from being optimized
ui32 ui32_a,ui32_b,ui32_c; at compile time. */
volatile i32 i32_a,i32_b,i32_c,i32_r,i32_s;
volatile ui32 ui32_a,ui32_b,ui32_c;
a64 a64_a,a64_b,a64_c,a64_r,a64_s; a64 a64_a,a64_b,a64_c,a64_r,a64_s;
void *ptr_a; void *ptr_a;
......
...@@ -156,8 +156,10 @@ NOMIPS16 void test_MIPS_DSP () ...@@ -156,8 +156,10 @@ NOMIPS16 void test_MIPS_DSP ()
v4i8 v4i8_a,v4i8_b,v4i8_c,v4i8_r,v4i8_s; v4i8 v4i8_a,v4i8_b,v4i8_c,v4i8_r,v4i8_s;
v2q15 v2q15_a,v2q15_b,v2q15_c,v2q15_r,v2q15_s; v2q15 v2q15_a,v2q15_b,v2q15_c,v2q15_r,v2q15_s;
q31 q31_a,q31_b,q31_c,q31_r,q31_s; q31 q31_a,q31_b,q31_c,q31_r,q31_s;
i32 i32_a,i32_b,i32_c,i32_r,i32_s; /* To protect the multiplication-related tests from being optimized
ui32 ui32_a,ui32_b,ui32_c; at compile time. */
volatile i32 i32_a,i32_b,i32_c,i32_r,i32_s;
volatile ui32 ui32_a,ui32_b,ui32_c;
a64 a64_a,a64_b,a64_c,a64_r,a64_s; a64 a64_a,a64_b,a64_c,a64_r,a64_s;
void *ptr_a; void *ptr_a;
......
/* Test MIPS32 DSP REV 2 instructions */ /* Test MIPS32 DSP REV 2 instructions */
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-mdspr2 -O2" } */ /* { dg-options "-mdspr2" } */
typedef signed char v4q7 __attribute__ ((vector_size(4))); typedef signed char v4q7 __attribute__ ((vector_size(4)));
typedef signed char v4i8 __attribute__ ((vector_size(4))); typedef signed char v4i8 __attribute__ ((vector_size(4)));
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -mabi=32 -mfp64" } */ /* { dg-options "-mabi=32 -mfp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "mthc1" } } */ /* { dg-final { scan-assembler "mthc1" } } */
/* { dg-final { scan-assembler "mfhc1" } } */ /* { dg-final { scan-assembler "mfhc1" } } */
......
/* Test MIPS64 DSP instructions */ /* Test MIPS64 DSP instructions */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-mgp64 -mdsp -O" } */ /* { dg-options "-mgp64 -mdsp" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tldx\t" } } */ /* { dg-final { scan-assembler "\tldx\t" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -pg -mmcount-ra-address -mabi=64" } */ /* { dg-options "-pg -mmcount-ra-address -mabi=64" } */
/* { dg-final { scan-assembler "\tmove\t\\\$12,\\\$0" } } */ /* { dg-final { scan-assembler "\tmove\t\\\$12,\\\$0" } } */
NOMIPS16 int bazl(int i) NOMIPS16 int bazl(int i)
{ {
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -pg -mmcount-ra-address -mabi=64" } */ /* { dg-options "-pg -mmcount-ra-address -mabi=64 -mno-abicalls" } */
/* { dg-skip-if "requiring a specific frame layout makes this a code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tdla\t\\\$12,8\\(\\\$sp\\)" } } */ /* { dg-final { scan-assembler "\tdla\t\\\$12,8\\(\\\$sp\\)" } } */
int foo (int); int foo (int);
NOMIPS16 int bar (int i) NOMIPS16 int bar (int i)
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -pg -mmcount-ra-address -mabi=64" } */ /* { dg-options "-pg -mmcount-ra-address -mabi=64 -mno-abicalls" } */
/* { dg-skip-if "requiring a specific frame layout makes this a code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tdla\t\\\$12,200008\\(\\\$sp\\)" } } */ /* { dg-final { scan-assembler "\tdla\t\\\$12,200008\\(\\\$sp\\)" } } */
int foo (int *); int foo (int *);
NOMIPS16 int bar(int i) NOMIPS16 int bar(int i)
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 isa>=4" } */ /* { dg-options "isa>=4" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "movz" } } */ /* { dg-final { scan-assembler "movz" } } */
/* { dg-final { scan-assembler "movn" } } */ /* { dg-final { scan-assembler "movn" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 isa>=4" } */ /* { dg-options "isa>=4" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "movz" } } */ /* { dg-final { scan-assembler "movz" } } */
/* { dg-final { scan-assembler "movn" } } */ /* { dg-final { scan-assembler "movn" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 isa>=4 -mhard-float" } */ /* { dg-options "isa>=4 -mhard-float" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "movt" } } */ /* { dg-final { scan-assembler "movt" } } */
/* { dg-final { scan-assembler "movf" } } */ /* { dg-final { scan-assembler "movf" } } */
/* { dg-final { scan-assembler "movz.s" } } */ /* { dg-final { scan-assembler "movz.s" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -march=vr5400 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "-march=vr5400 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmsac\t\\\$0," 2 } } */ /* { dg-final { scan-assembler-times "\tmsac\t\\\$0," 2 } } */
NOMIPS16 long long NOMIPS16 long long
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -march=vr5500 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "-march=vr5500 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmsub\t" 2 } } */ /* { dg-final { scan-assembler-times "\tmsub\t" 2 } } */
NOMIPS16 long long NOMIPS16 long long
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 isa_rev>=1 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "isa_rev>=1 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmsub\t" 2 } } */ /* { dg-final { scan-assembler-times "\tmsub\t" 2 } } */
NOMIPS16 long long NOMIPS16 long long
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mdspr2 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "-mdspr2 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmsub\t\\\$ac" 2 } } */ /* { dg-final { scan-assembler-times "\tmsub\t\\\$ac" 2 } } */
NOMIPS16 long long NOMIPS16 long long
......
/* { dg-options "-O2 -march=5kc" } */ /* { dg-options "-march=5kc" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmsub\t" 4 } } */ /* { dg-final { scan-assembler-times "\tmsub\t" 4 } } */
/* { dg-final { scan-assembler-not "\tmtlo\t" } } */ /* { dg-final { scan-assembler-not "\tmtlo\t" } } */
/* { dg-final { scan-assembler-times "\tmflo\t" 3 } } */ /* { dg-final { scan-assembler-times "\tmflo\t" 3 } } */
......
/* { dg-options "-O2 -march=5kc" } */ /* { dg-options "-march=5kc" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "\tmsub\t" } } */ /* { dg-final { scan-assembler-not "\tmsub\t" } } */
/* { dg-final { scan-assembler "\tmul\t" } } */ /* { dg-final { scan-assembler "\tmul\t" } } */
/* { dg-final { scan-assembler "\tsubu\t" } } */ /* { dg-final { scan-assembler "\tsubu\t" } } */
......
/* { dg-options "-O2 -march=5kc" } */ /* { dg-options "-march=5kc" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-skip-if "requires -fira-region=all or =mixed" { *-*-* } { "-Os" } { "" } } */
/* { dg-final { scan-assembler-not "\tmul\t" } } */ /* { dg-final { scan-assembler-not "\tmul\t" } } */
/* { dg-final { scan-assembler "\tmsub\t" } } */ /* { dg-final { scan-assembler "\tmsub\t" } } */
......
/* { dg-options "-O2 -march=5kc" } */ /* { dg-options "-march=5kc" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tmul\t" } } */ /* { dg-final { scan-assembler "\tmul\t" } } */
/* { dg-final { scan-assembler-not "\tmsub\t" } } */ /* { dg-final { scan-assembler-not "\tmsub\t" } } */
/* { dg-final { scan-assembler-not "\tmtlo\t" } } */ /* { dg-final { scan-assembler-not "\tmtlo\t" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -march=vr5400 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "-march=vr5400 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmsacu\t\\\$0," 2 } } */ /* { dg-final { scan-assembler-times "\tmsacu\t\\\$0," 2 } } */
typedef unsigned int ui; typedef unsigned int ui;
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -march=vr5500 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "-march=vr5500 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmsubu\t" 2 } } */ /* { dg-final { scan-assembler-times "\tmsubu\t" 2 } } */
typedef unsigned int ui; typedef unsigned int ui;
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 isa_rev>=1 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "isa_rev>=1 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmsubu\t" 2 } } */ /* { dg-final { scan-assembler-times "\tmsubu\t" 2 } } */
typedef unsigned int ui; typedef unsigned int ui;
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mdspr2 -mgp32" } */ /* This test requires widening_mul */
/* { dg-options "-mdspr2 -mgp32 -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tmsubu\t\\\$ac" 2 } } */ /* { dg-final { scan-assembler-times "\tmsubu\t\\\$ac" 2 } } */
typedef unsigned int ui; typedef unsigned int ui;
......
/* For SI->DI widening multiplication we should use DINS to combine the two /* For SI->DI widening multiplication we should use DINS to combine the two
halves. For Octeon use DMUL with explicit widening. */ halves. For Octeon use DMUL with explicit widening. */
/* { dg-options "-O2 -mgp64 isa_rev>=2 forbid_cpu=octeon.*" } */ /* This test requires widening_mul */
/* { dg-options "-mgp64 isa_rev>=2 forbid_cpu=octeon.* -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tdins\t" } } */ /* { dg-final { scan-assembler "\tdins\t" } } */
/* { dg-final { scan-assembler-not "\tdsll\t" } } */ /* { dg-final { scan-assembler-not "\tdsll\t" } } */
/* { dg-final { scan-assembler-not "\tdsrl\t" } } */ /* { dg-final { scan-assembler-not "\tdsrl\t" } } */
......
/* { dg-options "-O2 -mgp64 (-mips16)" } */ /* This test requires widening_mul */
/* { dg-options "-mgp64 (-mips16) -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tmult\t" } } */ /* { dg-final { scan-assembler "\tmult\t" } } */
/* { dg-final { scan-assembler-not "\tmflo\t" { xfail *-*-* } } } */ /* { dg-final { scan-assembler-not "\tmflo\t" { xfail *-*-* } } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
......
/* { dg-options "-O2 -mgp64 (-mips16)" } */ /* This test requires widening_mul */
/* { dg-options "-mgp64 (-mips16) -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tmultu\t" } } */ /* { dg-final { scan-assembler "\tmultu\t" } } */
/* { dg-final { scan-assembler-not "\tmflo\t" } } */ /* { dg-final { scan-assembler-not "\tmflo\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tmultu?\t" } } */ /* { dg-final { scan-assembler "\tmultu?\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler-not "\tmfhi\t" } } */ /* { dg-final { scan-assembler-not "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tmultu?\t" } } */ /* { dg-final { scan-assembler "\tmultu?\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler-not "\tmfhi\t" } } */ /* { dg-final { scan-assembler-not "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp32 (-mips16)" } */ /* { dg-options "-mgp32 (-mips16)" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tmult\t" } } */ /* { dg-final { scan-assembler "\tmult\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp32 (-mips16)" } */ /* { dg-options "-mgp32 (-mips16)" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tmultu\t" } } */ /* { dg-final { scan-assembler "\tmultu\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
......
/* { dg-options "-O2 -mgp32 (-mips16)" } */ /* This test requires widening_mul */
/* { dg-options "-mgp32 (-mips16) -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tmult\t" } } */ /* { dg-final { scan-assembler "\tmult\t" } } */
/* { dg-final { scan-assembler-not "\tmflo\t" } } */ /* { dg-final { scan-assembler-not "\tmflo\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp32 (-mips16)" } */ /* { dg-options "-mgp32 (-mips16)" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tmultu\t" } } */ /* { dg-final { scan-assembler "\tmultu\t" } } */
/* { dg-final { scan-assembler-not "\tmflo\t" } } */ /* { dg-final { scan-assembler-not "\tmflo\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp32 (-mips16)" } */ /* { dg-options "-mgp32 (-mips16)" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tmultu?\t" } } */ /* { dg-final { scan-assembler "\tmultu?\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler-not "\tmfhi\t" } } */ /* { dg-final { scan-assembler-not "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp32 (-mips16)" } */ /* { dg-options "-mgp32 (-mips16)" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tmultu?\t" } } */ /* { dg-final { scan-assembler "\tmultu?\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler-not "\tmfhi\t" } } */ /* { dg-final { scan-assembler-not "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tdmult\t" } } */ /* { dg-final { scan-assembler "\tdmult\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tdmultu\t" } } */ /* { dg-final { scan-assembler "\tdmultu\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
......
/* { dg-options "-O2 -mgp64 (-mips16)" } */ /* This test requires widening_mul */
/* { dg-options "-mgp64 (-mips16) -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tdmult\t" } } */ /* { dg-final { scan-assembler "\tdmult\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
/* { dg-final { scan-assembler-not "\tmflo\t" } } */ /* { dg-final { scan-assembler-not "\tmflo\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tdmultu\t" } } */ /* { dg-final { scan-assembler "\tdmultu\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
/* { dg-final { scan-assembler-not "\tmflo\t" } } */ /* { dg-final { scan-assembler-not "\tmflo\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tdmultu?\t" } } */ /* { dg-final { scan-assembler "\tdmultu?\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler-not "\tmfhi\t" } } */ /* { dg-final { scan-assembler-not "\tmfhi\t" } } */
......
/* { dg-options "-O -mgp64 (-mips16)" } */ /* { dg-options "-mgp64 (-mips16)" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tdmultu?\t" } } */ /* { dg-final { scan-assembler "\tdmultu?\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler-not "\tmfhi\t" } } */ /* { dg-final { scan-assembler-not "\tmfhi\t" } } */
......
/* { dg-options "-O2 -mgp64 (-mips16)" } */ /* This test requires widening_mul */
/* { dg-options "-mgp64 (-mips16) -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tmult\t" } } */ /* { dg-final { scan-assembler "\tmult\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
......
/* { dg-options "-O2 -mgp64 (-mips16)" } */ /* This test requires widening_mul */
/* { dg-options "-mgp64 (-mips16) -fexpensive-optimizations" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tmultu\t" } } */ /* { dg-final { scan-assembler "\tmultu\t" } } */
/* { dg-final { scan-assembler "\tmflo\t" } } */ /* { dg-final { scan-assembler "\tmflo\t" } } */
/* { dg-final { scan-assembler "\tmfhi\t" } } */ /* { dg-final { scan-assembler "\tmfhi\t" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-mlong-calls addressing=absolute -O2" } */ /* { dg-options "-mlong-calls addressing=absolute" } */
NOMIPS16 extern int long_call_func () __attribute__((long_call)); NOMIPS16 extern int long_call_func () __attribute__((long_call));
NOMIPS16 extern int far_func () __attribute__((far)); NOMIPS16 extern int far_func () __attribute__((far));
...@@ -13,5 +13,5 @@ NOMIPS16 int test4 () { return normal_func (); } ...@@ -13,5 +13,5 @@ NOMIPS16 int test4 () { return normal_func (); }
/* { dg-final { scan-assembler-not "\tj\tlong_call_func\n" } } */ /* { dg-final { scan-assembler-not "\tj\tlong_call_func\n" } } */
/* { dg-final { scan-assembler-not "\tj\tfar_func\n" } } */ /* { dg-final { scan-assembler-not "\tj\tfar_func\n" } } */
/* { dg-final { scan-assembler "\tj\tnear_func\n" } } */ /* { dg-final { scan-assembler "\tj(|al)\tnear_func\n" } } */
/* { dg-final { scan-assembler-not "\tj\tnormal_func\n" } } */ /* { dg-final { scan-assembler-not "\tj\tnormal_func\n" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-mno-long-calls addressing=absolute -O2" } */ /* { dg-options "-mno-long-calls addressing=absolute" } */
NOMIPS16 extern int long_call_func () __attribute__((long_call)); NOMIPS16 extern int long_call_func () __attribute__((long_call));
NOMIPS16 extern int far_func () __attribute__((far)); NOMIPS16 extern int far_func () __attribute__((far));
...@@ -13,5 +13,5 @@ NOMIPS16 int test4 () { return normal_func (); } ...@@ -13,5 +13,5 @@ NOMIPS16 int test4 () { return normal_func (); }
/* { dg-final { scan-assembler-not "\tj\tlong_call_func\n" } } */ /* { dg-final { scan-assembler-not "\tj\tlong_call_func\n" } } */
/* { dg-final { scan-assembler-not "\tj\tfar_func\n" } } */ /* { dg-final { scan-assembler-not "\tj\tfar_func\n" } } */
/* { dg-final { scan-assembler "\tj\tnear_func\n" } } */ /* { dg-final { scan-assembler "\tj(|al)\tnear_func\n" } } */
/* { dg-final { scan-assembler "\tj\tnormal_func\n" } } */ /* { dg-final { scan-assembler "\tj(|al)\tnormal_func\n" } } */
/* Make sure that we use abs.fmt and neg.fmt when the signs of NaNs don't /* Make sure that we use abs.fmt and neg.fmt when the signs of NaNs don't
matter. */ matter. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mhard-float -ffinite-math-only" } */ /* { dg-options "-mhard-float -ffinite-math-only" } */
/* { dg-final { scan-assembler "neg.s" } } */ /* { dg-final { scan-assembler "neg.s" } } */
/* { dg-final { scan-assembler "neg.d" } } */ /* { dg-final { scan-assembler "neg.d" } } */
/* { dg-final { scan-assembler "abs.s" } } */ /* { dg-final { scan-assembler "abs.s" } } */
......
/* Make sure that we avoid abs.fmt and neg.fmt when the signs of NaNs /* Make sure that we avoid abs.fmt and neg.fmt when the signs of NaNs
matter. */ matter. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -mhard-float -fno-finite-math-only" } */ /* { dg-options "-mhard-float -fno-finite-math-only" } */
/* { dg-final { scan-assembler-not "neg.s" } } */ /* { dg-final { scan-assembler-not "neg.s" } } */
/* { dg-final { scan-assembler-not "neg.d" } } */ /* { dg-final { scan-assembler-not "neg.d" } } */
/* { dg-final { scan-assembler-not "abs.s" } } */ /* { dg-final { scan-assembler-not "abs.s" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -ffast-math isa=4 -mhard-float" } */ /* { dg-options "-ffast-math isa=4 -mhard-float" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "nmadd.s" } } */ /* { dg-final { scan-assembler "nmadd.s" } } */
/* { dg-final { scan-assembler "nmadd.d" } } */ /* { dg-final { scan-assembler "nmadd.d" } } */
/* { dg-final { scan-assembler "nmsub.s" } } */ /* { dg-final { scan-assembler "nmsub.s" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -fno-fast-math -ffinite-math-only isa=4 -mhard-float" } */ /* { dg-options "-fno-fast-math -ffinite-math-only isa=4 -mhard-float" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "nmadd.s" } } */ /* { dg-final { scan-assembler "nmadd.s" } } */
/* { dg-final { scan-assembler "nmadd.d" } } */ /* { dg-final { scan-assembler "nmadd.d" } } */
/* { dg-final { scan-assembler "nmsub.s" } } */ /* { dg-final { scan-assembler "nmsub.s" } } */
......
/* The same code as nmadd-2.c, but compiled with -fno-finite-math-only. /* The same code as nmadd-2.c, but compiled with -fno-finite-math-only.
We can't use nmadd and nmsub in that case. */ We can't use nmadd and nmsub in that case. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -fno-fast-math -fno-finite-math-only isa=4 -mhard-float" } */ /* { dg-options "-fno-fast-math -fno-finite-math-only isa=4 -mhard-float" } */
/* { dg-final { scan-assembler-not "nmadd.s" } } */ /* { dg-final { scan-assembler-not "nmadd.s" } } */
/* { dg-final { scan-assembler-not "nmadd.d" } } */ /* { dg-final { scan-assembler-not "nmadd.d" } } */
/* { dg-final { scan-assembler-not "nmsub.s" } } */ /* { dg-final { scan-assembler-not "nmsub.s" } } */
......
/* { dg-options "-mno-dsp" } */ /* { dg-options "-mno-dsp -ffat-lto-objects" } */
void void
foo (void) foo (void)
{ {
register int x asm ("$ac1hi"); /* { dg-error "cannot be accessed" } */ register int x asm ("$ac1hi"); /* { dg-error "cannot be accessed" } */
asm volatile ("" : "=r" (x));
} }
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -mno-smartmips" } */ /* { dg-options "-mno-smartmips" } */
NOMIPS16 int scaled_indexed_word_load (int a[], int b) NOMIPS16 int scaled_indexed_word_load (int a[], int b)
{ {
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -mno-smartmips -march=mips32" } */ /* { dg-options "-mno-smartmips -march=mips32" } */
NOMIPS16 int rotate_left (unsigned a, unsigned s) NOMIPS16 int rotate_left (unsigned a, unsigned s)
{ {
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -march=octeon" } */ /* { dg-options "-march=octeon" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tbaddu\t" 4 } } */ /* { dg-final { scan-assembler-times "\tbaddu\t" 4 } } */
/* { dg-final { scan-assembler-not "\tandi\t" } } */ /* { dg-final { scan-assembler-not "\tandi\t" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -march=octeon" } */ /* { dg-options "-march=octeon" } */
/* { dg-final { scan-assembler-times "\tbbit1\t" 4 } } */ /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tbbit0\t" 2 } } */ /* { dg-final { scan-assembler "\tbbit1\t" } } */
/* { dg-final { scan-assembler "\tbbit0\t" } } */
/* { dg-final { scan-assembler-times "\tbbit.\t" 6 } } */
/* { dg-final { scan-assembler-not "andi\t" } } */ /* { dg-final { scan-assembler-not "andi\t" } } */
NOMIPS16 void foo (void); NOMIPS16 void foo (void);
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -march=octeon -mbranch-likely" } */ /* { dg-options "-march=octeon -mbranch-likely -fno-unroll-loops" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tbbit\[01\]\t" } } */ /* { dg-final { scan-assembler "\tbbit\[01\]\t" } } */
/* { dg-final { scan-assembler-not "\tbbit\[01\]l\t" } } */ /* { dg-final { scan-assembler-not "\tbbit\[01\]l\t" } } */
/* { dg-final { scan-assembler "\tbnel\t" } } */ /* { dg-final { scan-assembler "\tbnel\t" } } */
......
...@@ -11,9 +11,10 @@ ...@@ -11,9 +11,10 @@
which does not get recognized as a valid bbit pattern. The which does not get recognized as a valid bbit pattern. The
middle-end should be able to simplify this further. */ middle-end should be able to simplify this further. */
/* { dg-options "-O2 -march=octeon -meb" } */ /* { dg-options "-march=octeon -meb" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tbbit\[01\]\t|\tbgez\t" 2 } } */ /* { dg-final { scan-assembler-times "\tbbit\[01\]\t|\tbgez\t|\tbltz\t" 2 } } */
/* { dg-final { scan-assembler-not "ext\t" } } */ /* { dg-final { scan-assembler-not "ext\t" } } */
void abort (void); void abort (void);
......
/* { dg-do compile } */ /* { dg-do compile } */
/* The tests also work with -mgp32. For long long tests, only one of /* The tests also work with -mgp32. For long long tests, only one of
the 32-bit parts is used. */ the 32-bit parts is used. */
/* { dg-options "-O -march=octeon" } */ /* { dg-options "-march=octeon" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tcins\t" 3 } } */ /* { dg-final { scan-assembler-times "\tcins\t" 3 } } */
/* { dg-final { scan-assembler-not "\tandi\t|sll\t" } } */ /* { dg-final { scan-assembler-not "\tandi\t|sll\t" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -march=octeon -mgp64" } */ /* { dg-options "-march=octeon -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "\tcins\t" } } */ /* { dg-final { scan-assembler-not "\tcins\t" } } */
NOMIPS16 unsigned NOMIPS16 unsigned
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-march=octeon -mgp64" } */ /* { dg-options "-march=octeon -mgp64" } */
/* { dg-skip-if "using DMUL is no worse size-wise, and can be better if the constant is used elsewhere" { *-*-* } { "-Os" } { "" } } */
/* { dg-final { scan-assembler-not "\tdmul" } } */ /* { dg-final { scan-assembler-not "\tdmul" } } */
NOMIPS16 long long NOMIPS16 long long
......
/* Use DMUL for widening multiplication too. */ /* Use DMUL for widening multiplication too. */
/* { dg-options "-O -march=octeon -mgp64" } */ /* { dg-options "-march=octeon -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\tdmul\t" 2 } } */ /* { dg-final { scan-assembler-times "\tdmul\t" 2 } } */
/* { dg-final { scan-assembler-not "\td?mult\t" } } */ /* { dg-final { scan-assembler-not "\td?mult\t" } } */
/* { dg-final { scan-assembler-times "\tdext\t" 2 } } */ /* { dg-final { scan-assembler-times "\tdext\t" 2 } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -march=octeon -meb" } */ /* { dg-options "-march=octeon -meb" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\texts\t" 4 } } */ /* { dg-final { scan-assembler-times "\texts\t" 4 } } */
struct bar struct bar
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -march=octeon -mgp64" } */ /* { dg-options "-march=octeon -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\texts\t" 3 } } */ /* { dg-final { scan-assembler-times "\texts\t" 3 } } */
struct foo struct foo
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -march=octeon -mgp64" } */ /* { dg-options "-march=octeon -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "\tsll\t\[^\n\]*,0" } } */ /* { dg-final { scan-assembler-not "\tsll\t\[^\n\]*,0" } } */
/* { dg-final { scan-assembler-times "\texts\t" 6 } } */ /* { dg-final { scan-assembler-times "\texts\t" 6 } } */
......
/* -mel version of octeon-exts-2.c. */ /* -mel version of octeon-exts-2.c. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -march=octeon -mel" } */ /* { dg-options "-march=octeon -mel" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\texts\t" 4 } } */ /* { dg-final { scan-assembler-times "\texts\t" 4 } } */
struct bar struct bar
......
/* { dg-options "-O -march=octeon -mgp64" } */ /* { dg-options "-march=octeon -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\texts\t" 5 } } */ /* { dg-final { scan-assembler-times "\texts\t" 5 } } */
/* { dg-final { scan-assembler-not "\t(dsll|dsra)\t" } } */ /* { dg-final { scan-assembler-not "\t(dsll|dsra)\t" } } */
/* { dg-final { scan-assembler-not "\tsll\t" } } */ /* { dg-final { scan-assembler-not "\tsll\t" } } */
......
/* Remove the redundant sign-extension after the sign-extraction. */ /* Remove the redundant sign-extension after the sign-extraction. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -march=octeon -mgp64" } */ /* { dg-options "-march=octeon -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "\texts\t" 1 } } */ /* { dg-final { scan-assembler-times "\texts\t" 1 } } */
/* { dg-final { scan-assembler-not "sll|sra" } } */ /* { dg-final { scan-assembler-not "sll|sra" } } */
......
/* Check that we use the octeon pipeline description. */ /* Check that we use the octeon pipeline description. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -march=octeon -fdump-rtl-sched2" } */ /* { dg-options "-march=octeon -fschedule-insns2 -fdump-rtl-sched2" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
NOMIPS16 int f (int a, int b) NOMIPS16 int f (int a, int b)
{ {
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -march=octeon -mgp64" } */ /* { dg-options "-march=octeon -mgp64" } */
/* { dg-final { scan-assembler "\tpop\t" } } */ /* { dg-final { scan-assembler "\tpop\t" } } */
/* { dg-final { scan-assembler "\tdpop\t" } } */ /* { dg-final { scan-assembler "\tdpop\t" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -march=octeon -mgp64" } */ /* { dg-options "-march=octeon -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* The pop instruction does not depend on the word value to be sign extended. */ /* The pop instruction does not depend on the word value to be sign extended. */
/* { dg-final { scan-assembler-not "sll\t" } } */ /* { dg-final { scan-assembler-not "sll\t" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -march=octeon -mgp64" } */ /* { dg-options "-march=octeon -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "and\t\|andi\t\|ext\t\|sll\t\|srl\t" } } */ /* { dg-final { scan-assembler-not "and\t\|andi\t\|ext\t\|sll\t\|srl\t" } } */
/* { dg-final { scan-assembler-times "\tseqi\t\|\tsnei\t" 4 } } */ /* { dg-final { scan-assembler-times "\tseqi\t\|\tsnei\t" 4 } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -march=octeon" } */ /* { dg-options "-march=octeon" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "xor" } } */ /* { dg-final { scan-assembler-not "xor" } } */
unsigned unsigned
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-march=octeon2 -O -mgp64" } */ /* { dg-options "-march=octeon2 -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
#define TEST(N, R, T) \ #define TEST(N, R, T) \
T fll##N (T j, signed R *b, long long i) { return j + b[i]; } \ T fll##N (T j, signed R *b, long long i) { return j + b[i]; } \
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-march=octeon2 -O -mgp64" } */ /* { dg-options "-march=octeon2 -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
#define TEST(N, T) \ #define TEST(N, T) \
T f##N (T *p, int i) { return p[i]; } \ T f##N (T *p, int i) { return p[i]; } \
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-march=octeon2 -O -mgp32" } */ /* { dg-options "-march=octeon2 -mgp32" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
#define TEST(N, T) \ #define TEST(N, T) \
T f##N (T *p, int i) { return p[i]; } \ T f##N (T *p, int i) { return p[i]; } \
......
/* Check that we use the octeon2 pipeline description. */ /* Check that we use the octeon2 pipeline description. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -fdump-rtl-sched2 -march=octeon2" } */ /* { dg-options "-fschedule-insns2 -fdump-rtl-sched2 -march=octeon2" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
NOMIPS16 int f (int a, int b) NOMIPS16 int f (int a, int b)
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
This testcase used to trigger an unrecognizable insn. */ This testcase used to trigger an unrecognizable insn. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -w" } */ /* { dg-options "-w" } */
__thread int *a = 0; __thread int *a = 0;
......
/* GCC used to report an ICE for this test because we generated a LO_SUM /* GCC used to report an ICE for this test because we generated a LO_SUM
for an illegitimate constant. */ for an illegitimate constant. */
/* { dg-options "-mabi=64 -msym32 -O2 -EB -mno-abicalls" } */ /* { dg-options "-mabi=64 -msym32 -EB -mno-abicalls" } */
extern unsigned long a[]; extern unsigned long a[];
int b (int); int b (int);
......
/* { dg-options "-mabi=64 -O2" } */ /* { dg-options "-mabi=64" } */
NOMIPS16 long double __powitf2 (long double x, int m) NOMIPS16 long double __powitf2 (long double x, int m)
{ {
......
/* { dg-do link } */ /* { dg-do link } */
/* { dg-options "-O2" } */
volatile int gv; volatile int gv;
const char *ptrs[2]; const char *ptrs[2];
......
/* { dg-options "-O2 -march=74kc -mgp32" } */ /* { dg-options "-march=74kc -mgp32" } */
__thread int x __attribute__((tls_model("initial-exec"))); __thread int x __attribute__((tls_model("initial-exec")));
__thread int y __attribute__((tls_model("initial-exec"))); __thread int y __attribute__((tls_model("initial-exec")));
......
/* { dg-options "-mhard-float -mgp32 -O" } */ /* { dg-options "-mhard-float -mgp32" } */
register double g __asm__("$f20"); register double g __asm__("$f20");
NOMIPS16 void NOMIPS16 void
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-phiopt-details isa>=4" } */ /* { dg-options "-fdump-tree-phiopt-details isa>=4" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" "-O1" } { "" } } */
typedef struct s { typedef struct s {
int v; int v;
......
/* { dg-options "-O2 -mabi=64 -mr10k-cache-barrier=store" } */ /* { dg-options "-mabi=64 -mr10k-cache-barrier=store" } */
/* Test that stores to uncached addresses do not get unnecessary /* Test that stores to uncached addresses do not get unnecessary
cache barriers. */ cache barriers. */
......
/* { dg-options "-O2 -mr10k-cache-barrier=store -mips4 -mbranch-likely -mno-abicalls" } */ /* { dg-options "-mr10k-cache-barrier=store -mips4 -mbranch-likely -mno-abicalls" } */
int bar (int); /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
unsigned char *bar (int);
/* Test that code after a branch-likely does not get an unnecessary /* Test that code after a branch-likely does not get an unnecessary
cache barrier. */ cache barrier. */
NOMIPS16 void NOMIPS16 void
foo (int n, int *x) foo (unsigned char *n)
{ {
do do
n = bar (n * 4 + 1); n = bar (*n + 1);
while (n); while (n);
/* The preceding branch should be a branch likely, with the shift as /* The preceding branch should be a branch likely, with the shift as
its delay slot. We therefore don't need a cache barrier here. */ its delay slot. We therefore don't need a cache barrier here. */
x[0] = 0; n[0] = 0;
} }
/* { dg-final { scan-assembler-not "\tcache\t" } } */ /* { dg-final { scan-assembler-not "\tcache\t" } } */
/* { dg-options "-O2 -mr10k-cache-barrier=store -mno-abicalls" } */ /* { dg-options "-mr10k-cache-barrier=store -mno-abicalls" } */
/* Test that loads are not unnecessarily protected. */ /* Test that loads are not unnecessarily protected. */
......
/* { dg-options "-O2 -mr10k-cache-barrier=load-store -mno-abicalls" } */ /* { dg-options "-mr10k-cache-barrier=load-store -mno-abicalls" } */
/* Test that loads are correctly protected. */ /* Test that loads are correctly protected. */
......
/* { dg-options "-O2 -mr10k-cache-barrier=store" } */ /* { dg-options "-mr10k-cache-barrier=store" } */
/* Test that indirect calls are protected. */ /* Test that indirect calls are protected. */
......
/* { dg-options "(-mips16) -O2 -mr10k-cache-barrier=store" } */ /* { dg-options "(-mips16) -mr10k-cache-barrier=store -ffat-lto-objects" } */
/* Test that indirect calls are protected. */ /* Test that indirect calls are protected. */
......
/* { dg-options "-O2 -mr10k-cache-barrier=store -mips2" } */ /* { dg-options "-mr10k-cache-barrier=store -mips2" } */
/* { dg-error "requires.*cache.*instruction" "" { target *-*-* } 0 } */ /* { dg-error "requires.*cache.*instruction" "" { target *-*-* } 0 } */
/* { dg-options "-O2 -mabi=64 -mr10k-cache-barrier=store" } */ /* { dg-options "-mabi=64 -mr10k-cache-barrier=store" } */
/* Test that stores to constant cached addresses are protected /* Test that stores to constant cached addresses are protected
by cache barriers. */ by cache barriers. */
......
/* { dg-options "-O2 -mr10k-cache-barrier=store -mno-abicalls" } */ /* { dg-options "-mr10k-cache-barrier=store -mno-abicalls" } */
/* Test that in-range stores to the frame are not protected by /* Test that in-range stores to the frame are not protected by
cache barriers. */ cache barriers. */
......
/* { dg-options "-O2 -mr10k-cache-barrier=store -mno-abicalls" } */ /* { dg-options "-mr10k-cache-barrier=store -mno-abicalls" } */
void bar (int *x); void bar (int *x);
......
/* { dg-options "-O2 -mr10k-cache-barrier=store -mno-abicalls -mabi=64" } */ /* { dg-options "-mr10k-cache-barrier=store -mno-abicalls -mabi=64" } */
/* Test that in-range stores to static objects do not get an unnecessary /* Test that in-range stores to static objects do not get an unnecessary
cache barrier. */ cache barrier. */
......
/* { dg-options "-O2 -mr10k-cache-barrier=store -mabi=64" } */ /* { dg-options "-mr10k-cache-barrier=store -mabi=64" } */
int x[4]; int x[4];
void bar (void); void bar (void);
......
/* { dg-options "-O2 -mr10k-cache-barrier=store -mno-abicalls" } */ /* { dg-options "-mr10k-cache-barrier=store -mno-abicalls" } */
void bar1 (void); void bar1 (void);
void bar2 (void); void bar2 (void);
......
/* { dg-options "-O2 -mr10k-cache-barrier=store -G8" } */ /* { dg-options "-mr10k-cache-barrier=store -G8" } */
/* Test that in-range stores to components of static objects /* Test that in-range stores to components of static objects
do not get an unnecessary cache barrier. */ do not get an unnecessary cache barrier. */
......
/* { dg-options "-O2 -mr10k-cache-barrier=store -G8" } */ /* { dg-options "-mr10k-cache-barrier=store -G8" } */
/* Test that out-of-range stores to components of static objects /* Test that out-of-range stores to components of static objects
are protected by a cache barrier. */ are protected by a cache barrier. */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -ffast-math isa=4 -mhard-float -mgp64" } */ /* { dg-options "-ffast-math isa=4 -mhard-float -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "rsqrt.d" } } */ /* { dg-final { scan-assembler "rsqrt.d" } } */
/* { dg-final { scan-assembler "rsqrt.s" } } */ /* { dg-final { scan-assembler "rsqrt.s" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -ffast-math isa=4 -mhard-float -mgp64" } */ /* { dg-options "-ffast-math isa=4 -mhard-float -mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "rsqrt.d" } } */ /* { dg-final { scan-assembler "rsqrt.d" } } */
/* { dg-final { scan-assembler "rsqrt.s" } } */ /* { dg-final { scan-assembler "rsqrt.s" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 isa=4 -mhard-float" } */ /* { dg-options "isa=4 -mhard-float" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "rsqrt.d" } } */ /* { dg-final { scan-assembler-not "rsqrt.d" } } */
/* { dg-final { scan-assembler-not "rsqrt.s" } } */ /* { dg-final { scan-assembler-not "rsqrt.s" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -mips64 -mhard-float -mgp32" } */ /* { dg-options "-ffast-math -mips64 -mhard-float -mgp32" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "\trsqrt.d\t" } } */ /* { dg-final { scan-assembler-not "\trsqrt.d\t" } } */
/* { dg-final { scan-assembler-times "\trsqrt.s\t" 2 } } */ /* { dg-final { scan-assembler-times "\trsqrt.s\t" 2 } } */
......
/* Check that we can use the save instruction to save varargs. */ /* Check that we can use the save instruction to save varargs. */
/* { dg-options "(-mips16) isa_rev>=1 -mabi=32 -O2" } */ /* { dg-options "(-mips16) isa_rev>=1 -mabi=32" } */
#include <stdarg.h> #include <stdarg.h>
......
/* Check that we can use the save instruction to save spilled arguments. */ /* Check that we can use the save instruction to save spilled arguments. */
/* { dg-options "(-mips16) isa_rev>=1 -mabi=32 -O2" } */ /* { dg-options "(-mips16) isa_rev>=1 -mabi=32" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
MIPS16 void MIPS16 void
foo (int *a, int b, int c) foo (int *a, int b, int c)
......
/* Check that we can use the save instruction to save spilled arguments /* Check that we can use the save instruction to save spilled arguments
when the argument save area is out of range of a direct load or store. */ when the argument save area is out of range of a direct load or store. */
/* { dg-options "(-mips16) isa_rev>=1 -mabi=32 -O2" } */ /* { dg-options "(-mips16) isa_rev>=1 -mabi=32" } */
void bar (int *); void bar (int *);
......
/* Check that we can use the save instruction to save $16, $17 and $31. */ /* Check that we can use the save instruction to save $16, $17 and $31. */
/* { dg-options "(-mips16) isa_rev>=1 -mabi=32 -O2" } */ /* { dg-options "(-mips16) isa_rev>=1 -mabi=32" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
void bar (void); void bar (void);
......
/* Check that we don't try to save the same register twice. */ /* Check that we don't try to save the same register twice. */
/* { dg-options "(-mips16) isa_rev>=1 -mgp32 -O2" } */ /* { dg-options "(-mips16) isa_rev>=1 -mgp32" } */
int bar (int, int, int, int); int bar (int, int, int, int);
void frob (void); void frob (void);
......
/* Test SB-1 v2sf extensions. */ /* Test SB-1 v2sf extensions. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-march=sb1 -O2 -mpaired-single -mgp64 -ffast-math" } */ /* { dg-options "-march=sb1 -mpaired-single -mgp64 -ffast-math" } */
/* { dg-skip-if "rsqrt code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "div.ps" } } */ /* { dg-final { scan-assembler "div.ps" } } */
/* { dg-final { scan-assembler "recip.ps" } } */ /* { dg-final { scan-assembler "recip.ps" } } */
/* { dg-final { scan-assembler "sqrt.ps" } } */ /* { dg-final { scan-assembler "sqrt.ps" } } */
/* { dg-final { scan-assembler "rsqrt.ps" } } */ /* { dg-final { scan-assembler "rsqrt.ps" } } */
typedef float v2sf __attribute__ ((vector_size (8))); typedef float v2sf __attribute__ ((vector_size (8)));
......
/* { dg-options "(-mips16) -O isa_rev>=1" } */ /* { dg-options "(-mips16) isa_rev>=1" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times {slt \$2,\$5,\$4} 1 } } */ /* { dg-final { scan-assembler-times {slt \$2,\$5,\$4} 1 } } */
/* { dg-final { scan-assembler-times {sltu \$2,\$5,\$4} 1 } } */ /* { dg-final { scan-assembler-times {sltu \$2,\$5,\$4} 1 } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -mgp64" } */ /* { dg-options "-mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "and\t\|andi\t\|ext\t\|sll\t\|srl\t" } } */ /* { dg-final { scan-assembler-not "and\t\|andi\t\|ext\t\|sll\t\|srl\t" } } */
/* { dg-final { scan-assembler-times "slt\t\|slti?u\t" 12 } } */ /* { dg-final { scan-assembler-times "slt\t\|slti?u\t" 12 } } */
......
/* { dg-options "(-mips16) -O -mabi=o64" } */ /* { dg-options "(-mips16) -mabi=o64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "and\t\|andi\t\|ext\t\|sll\t\|srl\t" } } */ /* { dg-final { scan-assembler-not "and\t\|andi\t\|ext\t\|sll\t\|srl\t" } } */
/* { dg-final { scan-assembler-times "slt\t\|slti?u\t" 8 } } */ /* { dg-final { scan-assembler-times "slt\t\|slti?u\t" 8 } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -mabi=o64" } */ /* { dg-options "-mabi=o64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "slt\t" } } */ /* { dg-final { scan-assembler "slt\t" } } */
/* { dg-final { scan-assembler "sltu\t\|xor\t\|xori\t" } } */ /* { dg-final { scan-assembler "sltu\t\|xor\t\|xori\t" } } */
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
/* { dg-final { scan-assembler-not "%gp_?rel\\(g8b\\)" } } */ /* { dg-final { scan-assembler-not "%gp_?rel\\(g8b\\)" } } */
/* { dg-final { scan-assembler "%gp_?rel\\(g8c\\)" } } */ /* { dg-final { scan-assembler "%gp_?rel\\(g8c\\)" } } */
static int l4a; static volatile int l4a;
static int l4b = 1; static volatile int l4b = 1;
static int __attribute__((section(".sdata"))) l4c; static volatile int __attribute__((section(".sdata"))) l4c;
extern int e4a; extern int e4a;
extern int __attribute__((section(".sdata"))) e4b; extern int __attribute__((section(".sdata"))) e4b;
int __attribute__((common)) c4; int __attribute__((common)) c4;
...@@ -30,9 +30,9 @@ int __attribute__((nocommon)) g4a; ...@@ -30,9 +30,9 @@ int __attribute__((nocommon)) g4a;
int g4b = 1; int g4b = 1;
int __attribute__((section(".sdata"))) g4c = 2; int __attribute__((section(".sdata"))) g4c = 2;
static int l8a[2]; static volatile int l8a[2];
static int l8b[2] = { 1, 2 }; static volatile int l8b[2] = { 1, 2 };
static int __attribute__((section(".sdata"))) l8c[2]; static volatile int __attribute__((section(".sdata"))) l8c[2];
extern int e8a[2]; extern int e8a[2];
extern int __attribute__((section(".sdata"))) e8b[2]; extern int __attribute__((section(".sdata"))) e8b[2];
int __attribute__((common)) c8[2]; int __attribute__((common)) c8[2];
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
/* { dg-final { scan-assembler-not "%gp_?rel\\(g8b\\)" } } */ /* { dg-final { scan-assembler-not "%gp_?rel\\(g8b\\)" } } */
/* { dg-final { scan-assembler "%gp_?rel\\(g8c\\)" } } */ /* { dg-final { scan-assembler "%gp_?rel\\(g8c\\)" } } */
static int l4a; static volatile int l4a;
static int l4b = 1; static volatile int l4b = 1;
static int __attribute__((section(".sdata"))) l4c; static volatile int __attribute__((section(".sdata"))) l4c;
extern int e4a; extern int e4a;
extern int __attribute__((section(".sdata"))) e4b; extern int __attribute__((section(".sdata"))) e4b;
int __attribute__((common)) c4; int __attribute__((common)) c4;
...@@ -30,9 +30,9 @@ int __attribute__((nocommon)) g4a; ...@@ -30,9 +30,9 @@ int __attribute__((nocommon)) g4a;
int g4b = 1; int g4b = 1;
int __attribute__((section(".sdata"))) g4c = 2; int __attribute__((section(".sdata"))) g4c = 2;
static int l8a[2]; static volatile int l8a[2];
static int l8b[2] = { 1, 2 }; static volatile int l8b[2] = { 1, 2 };
static int __attribute__((section(".sdata"))) l8c[2]; static volatile int __attribute__((section(".sdata"))) l8c[2];
extern int e8a[2]; extern int e8a[2];
extern int __attribute__((section(".sdata"))) e8b[2]; extern int __attribute__((section(".sdata"))) e8b[2];
int __attribute__((common)) c8[2]; int __attribute__((common)) c8[2];
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
/* { dg-final { scan-assembler-not "%gp_?rel\\(g8b\\)" } } */ /* { dg-final { scan-assembler-not "%gp_?rel\\(g8b\\)" } } */
/* { dg-final { scan-assembler "%gp_?rel\\(g8c\\)" } } */ /* { dg-final { scan-assembler "%gp_?rel\\(g8c\\)" } } */
static int l4a; static volatile int l4a;
static int l4b = 1; static volatile int l4b = 1;
static int __attribute__((section(".sdata"))) l4c; static volatile int __attribute__((section(".sdata"))) l4c;
extern int e4a; extern int e4a;
extern int __attribute__((section(".sdata"))) e4b; extern int __attribute__((section(".sdata"))) e4b;
int __attribute__((common)) c4; int __attribute__((common)) c4;
...@@ -30,9 +30,9 @@ int __attribute__((nocommon)) g4a; ...@@ -30,9 +30,9 @@ int __attribute__((nocommon)) g4a;
int g4b = 1; int g4b = 1;
int __attribute__((section(".sdata"))) g4c = 2; int __attribute__((section(".sdata"))) g4c = 2;
static int l8a[2]; static volatile int l8a[2];
static int l8b[2] = { 1, 2 }; static volatile int l8b[2] = { 1, 2 };
static int __attribute__((section(".sdata"))) l8c[2]; static volatile int __attribute__((section(".sdata"))) l8c[2];
extern int e8a[2]; extern int e8a[2];
extern int __attribute__((section(".sdata"))) e8b[2]; extern int __attribute__((section(".sdata"))) e8b[2];
int __attribute__((common)) c8[2]; int __attribute__((common)) c8[2];
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
/* { dg-final { scan-assembler-not "%gp_?rel" } } */ /* { dg-final { scan-assembler-not "%gp_?rel" } } */
/* { dg-final { scan-assembler-not "\\\$gp" } } */ /* { dg-final { scan-assembler-not "\\\$gp" } } */
static int l4a; static volatile int l4a;
static int l4b = 1; static volatile int l4b = 1;
static int __attribute__((section(".sdata"))) l4c; static volatile int __attribute__((section(".sdata"))) l4c;
extern int e4a; extern int e4a;
extern int __attribute__((section(".sdata"))) e4b; extern int __attribute__((section(".sdata"))) e4b;
int __attribute__((common)) c4; int __attribute__((common)) c4;
...@@ -13,9 +13,9 @@ int __attribute__((nocommon)) g4a; ...@@ -13,9 +13,9 @@ int __attribute__((nocommon)) g4a;
int g4b = 1; int g4b = 1;
int __attribute__((section(".sdata"))) g4c = 2; int __attribute__((section(".sdata"))) g4c = 2;
static int l8a[2]; static volatile int l8a[2];
static int l8b[2] = { 1, 2 }; static volatile int l8b[2] = { 1, 2 };
static int __attribute__((section(".sdata"))) l8c[2]; static volatile int __attribute__((section(".sdata"))) l8c[2];
extern int e8a[2]; extern int e8a[2];
extern int __attribute__((section(".sdata"))) e8b[2]; extern int __attribute__((section(".sdata"))) e8b[2];
int __attribute__((common)) c8[2]; int __attribute__((common)) c8[2];
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -msmartmips" } */ /* { dg-options "-msmartmips" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
NOMIPS16 int scaled_indexed_word_load (int a[], int b) NOMIPS16 int scaled_indexed_word_load (int a[], int b)
{ {
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -msmartmips" } */ /* { dg-options "-msmartmips" } */
NOMIPS16 int rotate_left (unsigned a, unsigned s) NOMIPS16 int rotate_left (unsigned a, unsigned s)
{ {
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -msmartmips" } */ /* { dg-options "-msmartmips" } */
NOMIPS16 int rotate_right (unsigned a, unsigned s) NOMIPS16 int rotate_right (unsigned a, unsigned s)
{ {
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -msmartmips" } */ /* { dg-options "-msmartmips" } */
#define S 13 #define S 13
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -msmartmips" } */ /* { dg-options "-msmartmips" } */
#define S 13 #define S 13
......
/* { dg-options "-msoft-float" } */ /* { dg-options "-msoft-float -ffat-lto-objects" } */
void void
foo (void) foo (void)
{ {
register float x asm ("$f0"); /* { dg-error "cannot be accessed" } */ register float x asm ("$f0"); /* { dg-error "cannot be accessed" } */
asm volatile ("" : "=r" (x));
} }
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler "addiu\t(\\\$sp,)?\\\$sp,\[1-9\]" } } */ /* { dg-final { scan-assembler "addiu\t(\\\$sp,)?\\\$sp,\[1-9\]" } } */
/* { dg-final { scan-assembler "\tlw\t" } } */ /* { dg-final { scan-assembler "\tlw\t" } } */
/* { dg-final { scan-assembler-not "addiu\t(\\\$sp,)?\\\$sp,\[1-9\].*\tlw\t" } } */ /* { dg-final { scan-assembler-not "addiu\t(\\\$sp,)?\\\$sp,\[1-9\].*\tlw\t" } } */
......
/* { dg-options "-mgp64" } */ /* { dg-options "-mgp64" } */
/* { dg-skip-if "we deliberately use calls when optimizing for size" { *-*-* } { "-Os" } { "" } } */
typedef int int128_t __attribute__((mode(TI))); typedef int int128_t __attribute__((mode(TI)));
typedef unsigned int uint128_t __attribute__((mode(TI))); typedef unsigned int uint128_t __attribute__((mode(TI)));
...@@ -22,44 +23,84 @@ volatile int amount = 4; ...@@ -22,44 +23,84 @@ volatile int amount = 4;
volatile uint128_t result; volatile uint128_t result;
int int
main (void) test1 (void)
{ {
result = a * b; result = a * b;
if (result != c) if (result != c)
return 1; return 1;
return 0;
}
int
test2 (void)
{
result = c + d; result = c + d;
if (result != e) if (result != e)
return 1; return 1;
return 0;
}
int
test3 (void)
{
result = e - d; result = e - d;
if (result != c) if (result != c)
return 1; return 1;
return 0;
}
int
test4 (void)
{
result = d & e; result = d & e;
if (result != f) if (result != f)
return 1; return 1;
return 0;
}
int
test5 (void)
{
result = d ^ e; result = d ^ e;
if (result != g) if (result != g)
return 1; return 1;
return 0;
}
int
test6 (void)
{
result = d | e; result = d | e;
if (result != h) if (result != h)
return 1; return 1;
return 0;
}
int
test7 (void)
{
result = g << amount; result = g << amount;
if (result != i) if (result != i)
return 1; return 1;
return 0;
}
int
test8 (void)
{
result = g >> amount; result = g >> amount;
if (result != j) if (result != j)
return 1; return 1;
return 0;
}
int
test9 (void)
{
result = (int128_t) g >> amount; result = (int128_t) g >> amount;
if (result != k) if (result != k)
return 1; return 1;
return 0; return 0;
} }
/* { dg-final { scan-assembler-not "\tjal" } } */ /* { dg-final { scan-assembler-not "\tjal" } } */
...@@ -23,43 +23,96 @@ volatile int amount = 4; ...@@ -23,43 +23,96 @@ volatile int amount = 4;
volatile uint128_t result; volatile uint128_t result;
int int
main (void) test1 (void)
{ {
result = a * b; result = a * b;
if (result != c) if (result != c)
return 1; return 1;
return 0;
}
int
test2 (void)
{
result = c + d; result = c + d;
if (result != e) if (result != e)
return 1; return 1;
return 0;
}
int
test3 (void)
{
result = e - d; result = e - d;
if (result != c) if (result != c)
return 1; return 1;
return 0;
}
int
test4 (void)
{
result = d & e; result = d & e;
if (result != f) if (result != f)
return 1; return 1;
return 0;
}
int
test5 (void)
{
result = d ^ e; result = d ^ e;
if (result != g) if (result != g)
return 1; return 1;
return 0;
}
int
test6 (void)
{
result = d | e; result = d | e;
if (result != h) if (result != h)
return 1; return 1;
return 0;
}
int
test7 (void)
{
result = g << amount; result = g << amount;
if (result != i) if (result != i)
return 1; return 1;
return 0;
}
int
test8 (void)
{
result = g >> amount; result = g >> amount;
if (result != j) if (result != j)
return 1; return 1;
return 0;
}
int
test9 (void)
{
result = (int128_t) g >> amount; result = (int128_t) g >> amount;
if (result != k) if (result != k)
return 1; return 1;
return 0; return 0;
} }
int
main (void)
{
return (test1 ()
| test2 ()
| test3 ()
| test4 ()
| test5 ()
| test6 ()
| test7 ()
| test8 ()
| test9 ());
}
/* { dg-options "-O -mgp64" } */ /* { dg-options "-mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
#define TEST(ID, TYPE, SHIFT) \ #define TEST(ID, TYPE, SHIFT) \
int __attribute__((nomips16)) \ int __attribute__((nomips16)) \
......
/* { dg-options "-O -mgp64" } */ /* { dg-options "-mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
#define TEST(ID, TYPE, SHIFT) \ #define TEST(ID, TYPE, SHIFT) \
int NOMIPS16 \ int NOMIPS16 \
......
/* Remove redundant operations in truncate's operand. */ /* Remove redundant operations in truncate's operand. */
/* { dg-options "-O -mgp64" } */ /* { dg-options "-mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "\tandi?\t" } } */ /* { dg-final { scan-assembler-not "\tandi?\t" } } */
f (long long d) f (long long d)
......
/* The and is performed in DI mode so there is no need for truncation. */ /* The and is performed in DI mode so there is no need for truncation. */
/* { dg-options "-O -mgp64" } */ /* { dg-options "-mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "\tsll\t" } } */ /* { dg-final { scan-assembler-not "\tsll\t" } } */
NOMIPS16 unsigned long long NOMIPS16 unsigned long long
......
/* If we AND in DI mode (i.e. replace the order of TRUNCATE and AND) then we /* If we AND in DI mode (i.e. replace the order of TRUNCATE and AND) then we
can remove the TRUNCATE. */ can remove the TRUNCATE. */
/* { dg-options "-O -mgp64" } */ /* { dg-options "-mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "\tsll\t\[^\n\]*,0" } } */ /* { dg-final { scan-assembler-not "\tsll\t\[^\n\]*,0" } } */
struct s struct s
......
/* setup_incoming_promotions should detect x to be already sign-extended due /* setup_incoming_promotions should detect x to be already sign-extended due
to PROMOTE_MODE. Thus the truncation should be removed by combine. Based to PROMOTE_MODE. Thus the truncation should be removed by combine. Based
on gcc.c-torture/execute/pr34070-2.c. */ on gcc.c-torture/execute/pr34070-2.c. */
/* { dg-options "-O -mgp64" } */ /* { dg-options "-mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "\tsll\t\[^\n\]*,0" } } */ /* { dg-final { scan-assembler-not "\tsll\t\[^\n\]*,0" } } */
NOMIPS16 int f(unsigned int x, int n, int *p) NOMIPS16 int f(unsigned int x, int n, int *p)
......
/* { dg-options "-O2 -mgp64" } */ /* { dg-options "-mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-times "sdl\t" 1 } } */ /* { dg-final { scan-assembler-times "sdl\t" 1 } } */
/* { dg-final { scan-assembler-times "sdr\t" 1 } } */ /* { dg-final { scan-assembler-times "sdr\t" 1 } } */
/* { dg-final { scan-assembler-times "ldl\t" 1 } } */ /* { dg-final { scan-assembler-times "ldl\t" 1 } } */
......
/* Make sure that mul/addu is preferred over mtlo/macc and that mul/subu /* Make sure that mul/addu is preferred over mtlo/macc and that mul/subu
is preferred over mtlo/msac. */ is preferred over mtlo/msac. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -march=vr5400" } */ /* { dg-options "-march=vr5400 -fpeephole2" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
NOMIPS16 int f1 (int a, int b, int c) { return a + b * c; } NOMIPS16 int f1 (int a, int b, int c) { return a + b * c; }
NOMIPS16 int f2 (int a, int b, int c) { return a - b * c; } NOMIPS16 int f2 (int a, int b, int c) { return a - b * c; }
/* { dg-final { scan-assembler "\tmul\t.*\tmul\t" } } */ /* { dg-final { scan-assembler "\tmul\t.*\tmul\t" } } */
/* Make sure that mul/addu is preferred over mtlo/macc and that mul/subu /* Make sure that mul/addu is preferred over mtlo/macc and that mul/subu
is preferred over mtlo/msac. */ is preferred over mtlo/msac. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -march=vr5500" } */ /* { dg-options "-march=vr5500 -fpeephole2" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
NOMIPS16 int f1 (int a, int b, int c) { return a + b * c; } NOMIPS16 int f1 (int a, int b, int c) { return a + b * c; }
NOMIPS16 int f2 (int a, int b, int c) { return a - b * c; } NOMIPS16 int f2 (int a, int b, int c) { return a - b * c; }
/* { dg-final { scan-assembler "\tmul\t.*\tmul\t" } } */ /* { dg-final { scan-assembler "\tmul\t.*\tmul\t" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment