Patchwork [committed] gcc.target/mips tweaks for mips-sde-elf

login
register
mail settings
Submitter Richard Sandiford
Date Jan. 30, 2012, 7:22 p.m.
Message ID <877h09hu6g.fsf@firetop.home>
Download mbox | patch
Permalink /patch/138624/
State New
Headers show

Comments

Richard Sandiford - Jan. 30, 2012, 7:22 p.m.
This patch fixes a few failures in gcc.target/mips for mips-sde-elf:

  * "char" is unsigned for mips-sde-elf, so we need to explicitly
    ask for a signed char if we want one.

  * mips-sde-elf only supports 64-bit long doubles, so doesn't
    provide TFmode.

  * Function profiling isn't supported for MIPS16.

Tested on mips-sde-elf and applied.

Richard


gcc/testsuite/
	* gcc.target/mips/extend-1.c (TEST_CHAR): Use signed char.
	(TEST_SHORT): Reformat in the same way.
	* gcc.target/mips/octeon-exts-6.c (TEST_CHAR): Use signed char.
	(TEST_SHORT): Reformat in the same way.
	* gcc.target/mips/octeon2-lx-1.c (TEST): Make sign explicit.
	* gcc.target/mips/pr37362.c: Skip for mips-sde-elf.
	* gcc.target/mips/mmcount-ra-address-1.c (bazl): Add NOMIPS16.
	* gcc.target/mips/mmcount-ra-address-2.c (bar): Likewise.
	* gcc.target/mips/mmcount-ra-address-3.c (bar): Likewise.

Patch

Index: gcc/testsuite/gcc.target/mips/extend-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/extend-1.c	2012-01-30 19:01:41.000000000 +0000
+++ gcc/testsuite/gcc.target/mips/extend-1.c	2012-01-30 19:03:46.000000000 +0000
@@ -3,10 +3,18 @@ 
 /* { dg-final { scan-assembler-times "\tdsra\t" 5 } } */
 /* { dg-final { scan-assembler-not "\tsll\t" } } */
 
-#define TEST_CHAR(T, N)	\
-  NOMIPS16 T f##N (long long d, T *a, T *r) { T b = (char) d;  *r = b + *a; }
-#define TEST_SHORT(T, N) \
-  NOMIPS16 T g##N (long long d, T *a, T *r) { T b = (short) d; *r = b + *a; }
+#define TEST_CHAR(T, N)				\
+  NOMIPS16 T					\
+  f##N (long long d, T *a, T *r)		\
+  {						\
+    T b = (signed char) d; *r = b + *a;		\
+  }
+#define TEST_SHORT(T, N)			\
+  NOMIPS16 T					\
+  g##N (long long d, T *a, T *r)		\
+  {						\
+    T b = (short) d; *r = b + *a;		\
+  }
 #define TEST(T, N) TEST_CHAR (T, N) TEST_SHORT (T, N)
 
 TEST (int, 1);
Index: gcc/testsuite/gcc.target/mips/octeon-exts-6.c
===================================================================
--- gcc/testsuite/gcc.target/mips/octeon-exts-6.c	2012-01-30 19:01:41.000000000 +0000
+++ gcc/testsuite/gcc.target/mips/octeon-exts-6.c	2012-01-30 19:04:52.000000000 +0000
@@ -3,10 +3,18 @@ 
 /* { dg-final { scan-assembler-not "\t(dsll|dsra)\t" } } */
 /* { dg-final { scan-assembler-not "\tsll\t" } } */
 
-#define TEST_CHAR(T, N)	\
-  NOMIPS16 T f##N (long long d, T *a, T *r) { T b = (char) d;  *r = b + *a; }
-#define TEST_SHORT(T, N) \
-  NOMIPS16 T g##N (long long d, T *a, T *r) { T b = (short) d; *r = b + *a; }
+#define TEST_CHAR(T, N)				\
+  NOMIPS16 T					\
+  f##N (long long d, T *a, T *r)		\
+  {						\
+    T b = (signed char) d; *r = b + *a;		\
+  }
+#define TEST_SHORT(T, N)			\
+  NOMIPS16 T					\
+  g##N (long long d, T *a, T *r)		\
+  {						\
+    T b = (short) d; *r = b + *a;		\
+  }
 #define TEST(T, N) TEST_CHAR (T, N) TEST_SHORT (T, N)
 
 TEST (int, 1);
Index: gcc/testsuite/gcc.target/mips/octeon2-lx-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/octeon2-lx-1.c	2012-01-30 19:01:41.000000000 +0000
+++ gcc/testsuite/gcc.target/mips/octeon2-lx-1.c	2012-01-30 19:02:30.000000000 +0000
@@ -2,9 +2,9 @@ 
 /* { dg-options "-march=octeon2 -O -mgp64" } */
 
 #define TEST(N, R, T) \
- T fll##N (T j, R *b, long long i) { return j + b[i]; } \
+ T fll##N (T j, signed R *b, long long i) { return j + b[i]; } \
  T gll##N (T j, unsigned R *b, long long i) { return j + b[i]; } \
- T fi##N (T j, R *b, int i) { return j + b[i]; } \
+ T fi##N (T j, signed R *b, int i) { return j + b[i]; } \
  T gi##N (T j, unsigned R *b, int i) { return j + b[i]; } \
 
 TEST (1, char, int)
Index: gcc/testsuite/gcc.target/mips/pr37362.c
===================================================================
--- gcc/testsuite/gcc.target/mips/pr37362.c	2012-01-30 19:01:41.000000000 +0000
+++ gcc/testsuite/gcc.target/mips/pr37362.c	2012-01-30 19:02:30.000000000 +0000
@@ -1,4 +1,5 @@ 
-/* { dg-do compile } */
+/* mips*-sde-elf doesn't have 128-bit long doubles.  */
+/* { dg-do compile { target { ! mips*-sde-elf } } } */
 /* { dg-options "-march=mips64r2 -mabi=n32" } */
 
 typedef float TFtype __attribute__((mode(TF)));
Index: gcc/testsuite/gcc.target/mips/mmcount-ra-address-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/mmcount-ra-address-1.c	2012-01-30 19:02:15.000000000 +0000
+++ gcc/testsuite/gcc.target/mips/mmcount-ra-address-1.c	2012-01-30 19:02:30.000000000 +0000
@@ -1,7 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-options "-O2 -pg -mmcount-ra-address -mabi=64" } */
 /* { dg-final { scan-assembler "\tmove\t\\\$12,\\\$0" } } */
-int bazl(int i)
+NOMIPS16 int bazl(int i)
 {
   return i + 2;
 }
Index: gcc/testsuite/gcc.target/mips/mmcount-ra-address-2.c
===================================================================
--- gcc/testsuite/gcc.target/mips/mmcount-ra-address-2.c	2012-01-30 19:02:15.000000000 +0000
+++ gcc/testsuite/gcc.target/mips/mmcount-ra-address-2.c	2012-01-30 19:02:30.000000000 +0000
@@ -2,7 +2,7 @@ 
 /* { dg-options "-O2 -pg -mmcount-ra-address -mabi=64" } */
 /* { dg-final { scan-assembler "\tdla\t\\\$12,8\\(\\\$sp\\)" } } */
 int foo (int);
-int bar (int i)
+NOMIPS16 int bar (int i)
 {
   return foo (i) + 2;
 }
Index: gcc/testsuite/gcc.target/mips/mmcount-ra-address-3.c
===================================================================
--- gcc/testsuite/gcc.target/mips/mmcount-ra-address-3.c	2012-01-30 19:02:15.000000000 +0000
+++ gcc/testsuite/gcc.target/mips/mmcount-ra-address-3.c	2012-01-30 19:02:30.000000000 +0000
@@ -2,7 +2,7 @@ 
 /* { dg-options "-O2 -pg -mmcount-ra-address -mabi=64" } */
 /* { dg-final { scan-assembler "\tdla\t\\\$12,200008\\(\\\$sp\\)" } } */
 int foo (int *);
-int bar(int i)
+NOMIPS16 int bar(int i)
 {
   int big[50000];
   return foo (big) + 2;