This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix gcc.target/mips/dspr2-MULT*.c for Octeon


The tests dspr2-MULT.c and dspr2-MULTU.c fail on Octeon because the register
ac2 is not used in the code.

The problem is that the test does not specify which pipeline description
should be used to schedule the code.  Hence the default is used which might or
might have a pipelined mult/multu.  (Octeon not supporting the DSP ASE has mul
and dmul pipelined instead.)

The patch below changes the tests to use the pipeline description of a CPU
that has DSPr2 support according to mips_cpu_info_table.

The tests now pass and the change does not produce any regressions for
mips.exp on mips64octeon-linux.

OK to install?

Adam

	* gcc.target/mips/mips.exp: Add -mtune= to mips_option_groups.
	* gcc.target/mips/dspr2-MULT.c: Pass -mtune=74kc
	* gcc.target/mips/dspr2-MULTU.c: Likewise.

Index: mips.exp
===================================================================
--- mips.exp	(revision 146915)
+++ mips.exp	(working copy)
@@ -243,6 +243,7 @@ foreach option {
     branch-cost
     code-readable
     r10k-cache-barrier
+    tune
 } {
     lappend mips_option_groups $option "-m$option=.*"
 }
Index: dspr2-MULTU.c
===================================================================
--- dspr2-MULTU.c	(revision 146915)
+++ dspr2-MULTU.c	(working copy)
@@ -1,6 +1,7 @@
-/* Test MIPS32 DSP REV 2 MULTU instruction */
+/* Test MIPS32 DSP REV 2 MULTU instruction.  Tune for a CPU that has
+   pipelined multu.  */
 /* { dg-do compile } */
-/* { dg-options "-mgp32 -mdspr2 -O2 -ffixed-hi -ffixed-lo" } */
+/* { dg-options "-mgp32 -mdspr2 -O2 -ffixed-hi -ffixed-lo -mtune=74kc" } */
 
 /* { dg-final { scan-assembler "\tmultu\t" } } */
 /* { dg-final { scan-assembler "ac1" } } */
Index: dspr2-MULT.c
===================================================================
--- dspr2-MULT.c	(revision 146915)
+++ dspr2-MULT.c	(working copy)
@@ -1,6 +1,7 @@
-/* Test MIPS32 DSP REV 2 MULT instruction */
+/* Test MIPS32 DSP REV 2 MULT instruction.  Tune for a CPU that has
+   pipelined mult.  */
 /* { dg-do compile } */
-/* { dg-options "-mgp32 -mdspr2 -O2 -ffixed-hi -ffixed-lo" } */
+/* { dg-options "-mgp32 -mdspr2 -O2 -ffixed-hi -ffixed-lo -mtune=74kc" } */
 
 /* { dg-final { scan-assembler "\tmult\t" } } */
 /* { dg-final { scan-assembler "ac1" } } */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]