summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips
diff options
context:
space:
mode:
authormacro <macro@138bc75d-0d04-0410-961f-82ee72b054a4>2013-07-29 14:37:30 +0000
committermacro <macro@138bc75d-0d04-0410-961f-82ee72b054a4>2013-07-29 14:37:30 +0000
commit0bd32132d471995f3e333138363d1d928a9dde60 (patch)
tree4b72a5f006ea9267e8c0e91ce37fdae020e14228 /gcc/testsuite/gcc.target/mips
parent9834debf37d25899ac88afa6f0cc812fc347eba4 (diff)
downloadgcc-0bd32132d471995f3e333138363d1d928a9dde60.tar.gz
gcc/
* config/mips/linux.h (GLIBC_DYNAMIC_LINKER): Handle `-mnan=2008'. (UCLIBC_DYNAMIC_LINKER): New macro. * config/mips/linux64.h (GLIBC_DYNAMIC_LINKER32): Handle `-mnan=2008'. (GLIBC_DYNAMIC_LINKER64, GLIBC_DYNAMIC_LINKERN32): Likewise. (UCLIBC_DYNAMIC_LINKER32): Undefine macro first. Handle `-mnan=2008'. (UCLIBC_DYNAMIC_LINKER64): Redefine macro. (UCLIBC_DYNAMIC_LINKERN32): Likewise. * config/mips/mips-modes.def: Remove RESET_FLOAT_FORMAT calls for SF and DF modes. Use ieee_quad_format for TF mode. * config/mips/mips-opts.h (mips_ieee_754_setting): New enum. * config/mips/mips.c (mips_file_start): Output a `.nan' directive. (mips_option_override): Handle `-mnan=legacy'. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Handle `-mabs=2008' and `-mnan=2008'. (OPTION_DEFAULT_SPECS): Add "nan" default. (ASM_SPEC): Handle `-mnan='. [!HAVE_AS_NAN] (HAVE_AS_NAN): New macro. * config/mips/mips.md (abs<mode>2): Handle `-mabs=2008', update comment accordingly. (neg<mode>2): Likewise. * config/mips/mips.opt (mabs, mnan): New options. * doc/install.texi (Configuration): Document `--with-nan=' option. * doc/invoke.texi (Option Summary): List MIPS `-mabs=' and `-mnan=' options. (MIPS Options): Document them. * config.gcc <mips*-*-*>: Handle `--with-nan='. * configure.ac <mips*-*-*>: Check for GAS `-mnan=2008' support. * configure: Regenerate. * config.in: Regenerate. gcc/testsuite/ * gcc.target/mips/fabs-2008.c: New test case. * gcc.target/mips/fabs-legacy.c: New test case. * gcc.target/mips/fabsf-2008.c: New test case. * gcc.target/mips/fabsf-legacy.c: New test case. * gcc.target/mips/fneg-2008.c: New test case. * gcc.target/mips/fneg-legacy.c: New test case. * gcc.target/mips/fneg-2008.c: New test case. * gcc.target/mips/fneg-legacy.c: New test case. * gcc.target/mips/nan-2008.c: New test case. * gcc.target/mips/nan-legacy.c: New test case. * gcc.target/mips/nanf-2008.c: New test case. * gcc.target/mips/nanf-legacy.c: New test case. * gcc.target/mips/nans-2008.c: New test case. * gcc.target/mips/nans-legacy.c: New test case. * gcc.target/mips/nansf-2008.c: New test case. * gcc.target/mips/nansf-legacy.c: New test case. * gcc.target/mips/mips.exp: Handle `-mabs=' and `-mnan='. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201313 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/mips')
-rw-r--r--gcc/testsuite/gcc.target/mips/fabs-2008.c10
-rw-r--r--gcc/testsuite/gcc.target/mips/fabs-legacy.c10
-rw-r--r--gcc/testsuite/gcc.target/mips/fabsf-2008.c10
-rw-r--r--gcc/testsuite/gcc.target/mips/fabsf-legacy.c10
-rw-r--r--gcc/testsuite/gcc.target/mips/fneg-2008.c10
-rw-r--r--gcc/testsuite/gcc.target/mips/fneg-legacy.c10
-rw-r--r--gcc/testsuite/gcc.target/mips/fnegf-2008.c10
-rw-r--r--gcc/testsuite/gcc.target/mips/fnegf-legacy.c10
-rw-r--r--gcc/testsuite/gcc.target/mips/mips.exp18
-rw-r--r--gcc/testsuite/gcc.target/mips/nan-2008.c7
-rw-r--r--gcc/testsuite/gcc.target/mips/nan-legacy.c7
-rw-r--r--gcc/testsuite/gcc.target/mips/nanf-2008.c7
-rw-r--r--gcc/testsuite/gcc.target/mips/nanf-legacy.c7
-rw-r--r--gcc/testsuite/gcc.target/mips/nans-2008.c7
-rw-r--r--gcc/testsuite/gcc.target/mips/nans-legacy.c7
-rw-r--r--gcc/testsuite/gcc.target/mips/nansf-2008.c7
-rw-r--r--gcc/testsuite/gcc.target/mips/nansf-legacy.c7
17 files changed, 154 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/mips/fabs-2008.c b/gcc/testsuite/gcc.target/mips/fabs-2008.c
new file mode 100644
index 00000000000..f48437d58cf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/fabs-2008.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-mabs=2008" } */
+
+NOMIPS16 double
+fabs_2008 (double d)
+{
+ return __builtin_fabs (d);
+}
+
+/* { dg-final { scan-assembler "\tabs\.d\t" } } */
diff --git a/gcc/testsuite/gcc.target/mips/fabs-legacy.c b/gcc/testsuite/gcc.target/mips/fabs-legacy.c
new file mode 100644
index 00000000000..af86b85fb83
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/fabs-legacy.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-mabs=legacy" } */
+
+NOMIPS16 double
+fabs_legacy (double d)
+{
+ return __builtin_fabs (d);
+}
+
+/* { dg-final { scan-assembler-not "\tabs\.d\t" } } */
diff --git a/gcc/testsuite/gcc.target/mips/fabsf-2008.c b/gcc/testsuite/gcc.target/mips/fabsf-2008.c
new file mode 100644
index 00000000000..229dae66b8f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/fabsf-2008.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-mabs=2008" } */
+
+NOMIPS16 float
+fabsf_2008 (float f)
+{
+ return __builtin_fabsf (f);
+}
+
+/* { dg-final { scan-assembler "\tabs\.s\t" } } */
diff --git a/gcc/testsuite/gcc.target/mips/fabsf-legacy.c b/gcc/testsuite/gcc.target/mips/fabsf-legacy.c
new file mode 100644
index 00000000000..453a0690ef8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/fabsf-legacy.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-mabs=legacy" } */
+
+NOMIPS16 float
+fabsf_legacy (float f)
+{
+ return __builtin_fabsf (f);
+}
+
+/* { dg-final { scan-assembler-not "\tabs\.s\t" } } */
diff --git a/gcc/testsuite/gcc.target/mips/fneg-2008.c b/gcc/testsuite/gcc.target/mips/fneg-2008.c
new file mode 100644
index 00000000000..7d76f45292d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/fneg-2008.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-mabs=2008" } */
+
+NOMIPS16 double
+fneg_2008 (double d)
+{
+ return -d;
+}
+
+/* { dg-final { scan-assembler "\tneg\.d\t" } } */
diff --git a/gcc/testsuite/gcc.target/mips/fneg-legacy.c b/gcc/testsuite/gcc.target/mips/fneg-legacy.c
new file mode 100644
index 00000000000..cd1422df148
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/fneg-legacy.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-mabs=legacy" } */
+
+NOMIPS16 double
+fneg_legacy (double d)
+{
+ return -d;
+}
+
+/* { dg-final { scan-assembler-not "\tneg\.d\t" } } */
diff --git a/gcc/testsuite/gcc.target/mips/fnegf-2008.c b/gcc/testsuite/gcc.target/mips/fnegf-2008.c
new file mode 100644
index 00000000000..72d8ef15f97
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/fnegf-2008.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-mabs=2008" } */
+
+NOMIPS16 float
+fnegf_2008 (float f)
+{
+ return -f;
+}
+
+/* { dg-final { scan-assembler "\tneg\.s\t" } } */
diff --git a/gcc/testsuite/gcc.target/mips/fnegf-legacy.c b/gcc/testsuite/gcc.target/mips/fnegf-legacy.c
new file mode 100644
index 00000000000..946a6ef6772
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/fnegf-legacy.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-mabs=legacy" } */
+
+NOMIPS16 float
+fnegf_legacy (float f)
+{
+ return -f;
+}
+
+/* { dg-final { scan-assembler-not "\tneg\.s\t" } } */
diff --git a/gcc/testsuite/gcc.target/mips/mips.exp b/gcc/testsuite/gcc.target/mips/mips.exp
index 54c97db2481..f648f073659 100644
--- a/gcc/testsuite/gcc.target/mips/mips.exp
+++ b/gcc/testsuite/gcc.target/mips/mips.exp
@@ -276,8 +276,10 @@ foreach option {
# Add -mfoo= options to mips_option_groups.
foreach option {
+ abs
branch-cost
code-readable
+ nan
r10k-cache-barrier
tune
} {
@@ -705,6 +707,18 @@ proc mips-dg-init {} {
"-msoft-float",
#endif
+ #ifdef __mips_abs2008
+ "-mabs=2008",
+ #else
+ "-mabs=legacy",
+ #endif
+
+ #ifdef __mips_nan2008
+ "-mnan=2008",
+ #else
+ "-mnan=legacy",
+ #endif
+
#if __mips_fpr == 64
"-mfp64",
#else
@@ -826,6 +840,8 @@ proc mips-dg-finish {} {
# | |
# -mfp64 -mfp32
# | |
+# -mabs=2008/-mabs=legacy <no option>
+# | |
# -mhard-float -msoft-float
# | |
# -mno-sym32 -msym32
@@ -913,6 +929,8 @@ proc mips-dg-options { args } {
mips_option_dependency options "-mips3d" "-mpaired-single"
mips_option_dependency options "-mpaired-single" "-mfp64"
mips_option_dependency options "-mfp64" "-mhard-float"
+ mips_option_dependency options "-mabs=2008" "-mhard-float"
+ mips_option_dependency options "-mabs=legacy" "-mhard-float"
mips_option_dependency options "-mrelax-pic-calls" "-mno-plt"
mips_option_dependency options "-mrelax-pic-calls" "-mabicalls"
mips_option_dependency options "-mrelax-pic-calls" "-mexplicit-relocs"
diff --git a/gcc/testsuite/gcc.target/mips/nan-2008.c b/gcc/testsuite/gcc.target/mips/nan-2008.c
new file mode 100644
index 00000000000..b31299dfda0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/nan-2008.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-mnan=2008 -EB" } */
+
+double d = __builtin_nan ("");
+
+/* { dg-final { scan-assembler "\t\.nan\t2008\n" } } */
+/* { dg-final { scan-assembler "\t\.word\t2146959360\n\t.word\t0\n" } } */
diff --git a/gcc/testsuite/gcc.target/mips/nan-legacy.c b/gcc/testsuite/gcc.target/mips/nan-legacy.c
new file mode 100644
index 00000000000..8ae7166d083
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/nan-legacy.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-mnan=legacy -EB" } */
+
+double d = __builtin_nan ("");
+
+/* { dg-final { scan-assembler "\t\.nan\tlegacy\n" } } */
+/* { dg-final { scan-assembler "\t\.word\t2146959359\n\t.word\t-1\n" } } */
diff --git a/gcc/testsuite/gcc.target/mips/nanf-2008.c b/gcc/testsuite/gcc.target/mips/nanf-2008.c
new file mode 100644
index 00000000000..6c5bd7babe5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/nanf-2008.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-mnan=2008 -EB" } */
+
+float f = __builtin_nanf ("");
+
+/* { dg-final { scan-assembler "\t\.nan\t2008\n" } } */
+/* { dg-final { scan-assembler "\t\.word\t2143289344\n" } } */
diff --git a/gcc/testsuite/gcc.target/mips/nanf-legacy.c b/gcc/testsuite/gcc.target/mips/nanf-legacy.c
new file mode 100644
index 00000000000..b13d3398daf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/nanf-legacy.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-mnan=legacy -EB" } */
+
+float f = __builtin_nanf ("");
+
+/* { dg-final { scan-assembler "\t\.nan\tlegacy\n" } } */
+/* { dg-final { scan-assembler "\t\.word\t2143289343\n" } } */
diff --git a/gcc/testsuite/gcc.target/mips/nans-2008.c b/gcc/testsuite/gcc.target/mips/nans-2008.c
new file mode 100644
index 00000000000..b75fc28fda0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/nans-2008.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-mnan=2008 -EB" } */
+
+double ds = __builtin_nans ("");
+
+/* { dg-final { scan-assembler "\t\.nan\t2008\n" } } */
+/* { dg-final { scan-assembler "\t\.word\t2146697216\n\t.word\t0\n" } } */
diff --git a/gcc/testsuite/gcc.target/mips/nans-legacy.c b/gcc/testsuite/gcc.target/mips/nans-legacy.c
new file mode 100644
index 00000000000..45fab68dd74
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/nans-legacy.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-mnan=legacy -EB" } */
+
+double ds = __builtin_nans ("");
+
+/* { dg-final { scan-assembler "\t\.nan\tlegacy\n" } } */
+/* { dg-final { scan-assembler "\t\.word\t2147483647\n\t.word\t-1\n" } } */
diff --git a/gcc/testsuite/gcc.target/mips/nansf-2008.c b/gcc/testsuite/gcc.target/mips/nansf-2008.c
new file mode 100644
index 00000000000..d6c86a8472f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/nansf-2008.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-mnan=2008 -EB" } */
+
+float fs = __builtin_nansf ("");
+
+/* { dg-final { scan-assembler "\t\.nan\t2008\n" } } */
+/* { dg-final { scan-assembler "\t\.word\t2141192192\n" } } */
diff --git a/gcc/testsuite/gcc.target/mips/nansf-legacy.c b/gcc/testsuite/gcc.target/mips/nansf-legacy.c
new file mode 100644
index 00000000000..27c480f5551
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/nansf-legacy.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-mnan=legacy -EB" } */
+
+float fs = __builtin_nansf ("");
+
+/* { dg-final { scan-assembler "\t\.nan\tlegacy\n" } } */
+/* { dg-final { scan-assembler "\t\.word\t2147483647\n" } } */