mips.exp: Minor formatting.

* gcc.target/mips/mips.exp: Minor formatting.  Call setup_mips_tests.
	(setup_mips_tests, dg-mips-options): New procedures.
	* gcc.target/mips/asm-1.c, gcc.target/mips/fix-vr4130-1.c,
	* gcc.target/mips/fix-vr4130-2.c, gcc.target/mips/fix-vr4130-3.c
	* gcc.target/mips/fix-vr4130-4.c, gcc.target/mips/mips-3d-1.c,
	* gcc.target/mips/mips-3d-2.c, gcc.target/mips/mips-3d-3.c,
	* gcc.target/mips/mips-3d-4.c, gcc.target/mips/mips-3d-5.c,
	* gcc.target/mips/mips-3d-6.c, gcc.target/mips/mips-3d-7.c,
	* gcc.target/mips/mips-3d-8.c, gcc.target/mips/mips-3d-9.c,
	* gcc.target/mips/mips-3d-2.c, gcc.target/mips/mips-3d-3.c,
	* gcc.target/mips/mips-ps-1.c, gcc.target/mips/mips-ps-2.c,
	* gcc.target/mips/mips-ps-3.c, gcc.target/mips/mips-ps-4.c,
	* gcc.target/mips/mips-ps-type.c, gcc.target/mips/sb1-1.c: Use
	dg-mips-options instead of dg-options.  Remove now-redundant
	preprocessor guards.
	* gcc.dg/mips-args-1.c, gcc.dg/mips-args-2.c, gcc.dg/mips-args-3.c,
	* gcc.dg/mips-movcc-1.c, gcc.dg/mips-movcc-2.c, gcc.dg/mips-movcc-3.c,
	* gcc.dg/mips-nmadd-1.c, gcc.dg/mips-nmadd-2.c, gcc.dg/mips-rsqrt-1.c,
	* gcc.dg/mips-rsqrt-2.c, gcc.dg/mips-rsqrt-3.c, gcc.dg/vr-mult-1.c,
	* gcc.dg/vr-mult-2.c: Delete.
	* gcc.target/mips/args-1.c, gcc.target/mips/args-2.c,
	* gcc.target/mips/args-3.c, gcc.target/mips/movcc-1.c,
	* gcc.target/mips/movcc-2.c, gcc.target/mips/movcc-3.c,
	* gcc.target/mips/nmadd-1.c, gcc.target/mips/nmadd-2.c,
	* gcc.target/mips/rsqrt-1.c, gcc.target/mips/rsqrt-2.c,
	* gcc.target/mips/rsqrt-3.c, gcc.target/mips/vr-mult-1.c,
	* gcc.target/mips/vr-mult-2.c: New tests, based on the old gcc.dg ones.

From-SVN: r98345
This commit is contained in:
Richard Sandiford 2005-04-18 20:34:36 +00:00 committed by Richard Sandiford
parent 16a5a05324
commit 636423701a
39 changed files with 284 additions and 182 deletions

View File

@ -1,3 +1,33 @@
2005-04-18 Richard Sandiford <rsandifo@redhat.com>
* gcc.target/mips/mips.exp: Minor formatting. Call setup_mips_tests.
(setup_mips_tests, dg-mips-options): New procedures.
* gcc.target/mips/asm-1.c, gcc.target/mips/fix-vr4130-1.c,
* gcc.target/mips/fix-vr4130-2.c, gcc.target/mips/fix-vr4130-3.c
* gcc.target/mips/fix-vr4130-4.c, gcc.target/mips/mips-3d-1.c,
* gcc.target/mips/mips-3d-2.c, gcc.target/mips/mips-3d-3.c,
* gcc.target/mips/mips-3d-4.c, gcc.target/mips/mips-3d-5.c,
* gcc.target/mips/mips-3d-6.c, gcc.target/mips/mips-3d-7.c,
* gcc.target/mips/mips-3d-8.c, gcc.target/mips/mips-3d-9.c,
* gcc.target/mips/mips-3d-2.c, gcc.target/mips/mips-3d-3.c,
* gcc.target/mips/mips-ps-1.c, gcc.target/mips/mips-ps-2.c,
* gcc.target/mips/mips-ps-3.c, gcc.target/mips/mips-ps-4.c,
* gcc.target/mips/mips-ps-type.c, gcc.target/mips/sb1-1.c: Use
dg-mips-options instead of dg-options. Remove now-redundant
preprocessor guards.
* gcc.dg/mips-args-1.c, gcc.dg/mips-args-2.c, gcc.dg/mips-args-3.c,
* gcc.dg/mips-movcc-1.c, gcc.dg/mips-movcc-2.c, gcc.dg/mips-movcc-3.c,
* gcc.dg/mips-nmadd-1.c, gcc.dg/mips-nmadd-2.c, gcc.dg/mips-rsqrt-1.c,
* gcc.dg/mips-rsqrt-2.c, gcc.dg/mips-rsqrt-3.c, gcc.dg/vr-mult-1.c,
* gcc.dg/vr-mult-2.c: Delete.
* gcc.target/mips/args-1.c, gcc.target/mips/args-2.c,
* gcc.target/mips/args-3.c, gcc.target/mips/movcc-1.c,
* gcc.target/mips/movcc-2.c, gcc.target/mips/movcc-3.c,
* gcc.target/mips/nmadd-1.c, gcc.target/mips/nmadd-2.c,
* gcc.target/mips/rsqrt-1.c, gcc.target/mips/rsqrt-2.c,
* gcc.target/mips/rsqrt-3.c, gcc.target/mips/vr-mult-1.c,
* gcc.target/mips/vr-mult-2.c: New tests, based on the old gcc.dg ones.
2005-04-18 Laurent GUERBY <laurent@guerby.net>
* ada/acats/run_all.sh: Use sync when executable not present.

View File

@ -1,33 +0,0 @@
/* { dg-do compile { target "mips*-*-*" } } */
/* { dg-options "-O2 -mips4" } */
/* { dg-final { scan-assembler "movz" } } */
/* { dg-final { scan-assembler "movn" } } */
/* { dg-final { scan-assembler "movt" } } */
void ext_int (int);
#if __mips < 4
asm ("# movz movn");
#else
int
sub1 (int i, int j, int k)
{
ext_int (k ? i : j);
}
int
sub2 (int i, int j, long l)
{
ext_int (!l ? i : j);
}
#endif
#if __mips < 4 || __mips_soft_float
asm ("# movt");
#else
int
sub3 (int i, int j, float f)
{
ext_int (f ? i : j);
}
#endif

View File

@ -1,33 +0,0 @@
/* { dg-do compile { target "mips*-*-*" } } */
/* { dg-options "-O2 -mips4" } */
/* { dg-final { scan-assembler "movz" } } */
/* { dg-final { scan-assembler "movn" } } */
/* { dg-final { scan-assembler "movf" } } */
void ext_long (long);
#if __mips < 4
asm ("# movz movn");
#else
long
sub4 (long i, long j, long k)
{
ext_long (k ? i : j);
}
long
sub5 (long i, long j, int k)
{
ext_long (!k ? i : j);
}
#endif
#if __mips < 4 || __mips_soft_float
asm ("# movf");
#else
long
sub6 (long i, long j, float f)
{
ext_long (!f ? i : j);
}
#endif

View File

@ -1,10 +0,0 @@
/* Make sure that mul/addu is preferred over mtlo/macc on targets that
support both. */
/* { dg-do compile { target mips*-*-* } } */
/* { dg-options "-O2" } */
#if defined (_MIPS_ARCH_VR5400) || defined (_MIPS_ARCH_VR5500)
int f (int a, int b, int c) { return a + b * c; }
#else
void f () { asm volatile ("mul/addu"); }
#endif
/* { dg-final { scan-assembler "mul.*addu" } } */

View File

@ -1,10 +0,0 @@
/* Make sure that mul/subu is preferred over mtlo/msac on targets that
support both. */
/* { dg-do compile { target mips*-*-* } } */
/* { dg-options "-O2" } */
#if defined (_MIPS_ARCH_VR5400) || defined (_MIPS_ARCH_VR5500)
int f (int a, int b, int c) { return a - b * c; }
#else
void f () { asm volatile ("mul/subu"); }
#endif
/* { dg-final { scan-assembler "mul.*subu" } } */

View File

@ -1,6 +1,6 @@
/* Check that certain preprocessor macros are defined, and do some
consistency checks. */
/* { dg-do compile { target mips*-*-* } } */
/* { dg-do compile } */
const char *compiled_for = _MIPS_ARCH;
const char *optimized_for = _MIPS_TUNE;

View File

@ -1,5 +1,5 @@
/* Check the _MIPSEB and _MIPSEL macros are accurate. */
/* { dg-do run { target mips*-*-* } } */
/* { dg-do run } */
extern void abort (void);
extern void exit (int);

View File

@ -1,6 +1,6 @@
/* __mips, and related defines, guarantee that certain assembly
instructions can be used. Check a few examples. */
/* { dg-do run { target mips*-*-* } } */
/* { dg-do run } */
extern void abort (void);
extern void exit (int);

View File

@ -1,8 +1,7 @@
/* PR target/17565. GCC used to put the asm into the delay slot
of the call. */
/* { dg-do assemble } */
/* { dg-options "-O" } */
#ifndef __mips16
/* { dg-mips-options "-O -mno-mips16" } */
int foo (int n)
{
register int k asm ("$16") = n;
@ -13,4 +12,3 @@ int foo (int n)
}
return k;
}
#endif

View File

@ -1,9 +1,4 @@
/* { dg-do compile { target mips*-*-* } } */
/* { dg-skip-if "" { mips-sgi-irix* } { "-mabi=32" } { "" } } */
/* { dg-options "-mfix-vr4130 -march=vr4130" } */
#if _MIPS_ARCH_VR4130 && !__mips16
/* { dg-do compile } */
/* { dg-mips-options "-march=vr4130 -mfix-vr4130" } */
int foo (void) { int r; asm ("# foo" : "=h" (r)); return r; }
#else
asm ("#\tmacchi\t");
#endif
/* { dg-final { scan-assembler "\tmacchi\t" } } */

View File

@ -1,9 +1,4 @@
/* { dg-do compile { target mips*-*-* } } */
/* { dg-skip-if "" { mips-sgi-irix* } { "-mabi=32" } { "" } } */
/* { dg-options "-mfix-vr4130 -march=vr4130" } */
#if _MIPS_ARCH_VR4130 && !__mips16
/* { dg-do compile } */
/* { dg-mips-options "-march=vr4130 -mfix-vr4130" } */
int foo (void) { int r; asm ("# foo" : "=l" (r)); return r; }
#else
asm ("#\tmacc\t");
#endif
/* { dg-final { scan-assembler "\tmacc\t" } } */

View File

@ -1,9 +1,4 @@
/* { dg-do compile { target mips*-*-* } } */
/* { dg-skip-if "" { mips-sgi-irix* } { "-mabi=32" } { "" } } */
/* { dg-options "-mfix-vr4130 -march=vr4130" } */
#if _MIPS_ARCH_VR4130 && !__mips16 && __mips64
/* { dg-do compile } */
/* { dg-mips-options "-march=vr4130 -mgp64 -mfix-vr4130" } */
long long foo (void) { long long r; asm ("# foo" : "=h" (r)); return r; }
#else
asm ("#\tdmacchi\t");
#endif
/* { dg-final { scan-assembler "\tdmacchi\t" } } */

View File

@ -1,9 +1,4 @@
/* { dg-do compile { target mips*-*-* } } */
/* { dg-skip-if "" { mips-sgi-irix* } { "-mabi=32" } { "" } } */
/* { dg-options "-mfix-vr4130 -march=vr4130" } */
#if _MIPS_ARCH_VR4130 && !__mips16 && __mips64
/* { dg-do compile } */
/* { dg-mips-options "-march=vr4130 -mgp64 -mfix-vr4130" } */
long long foo (void) { long long r; asm ("# foo" : "=l" (r)); return r; }
#else
asm ("#\tdmacc\t");
#endif
/* { dg-final { scan-assembler "\tdmacc\t" } } */

View File

@ -1,5 +1,5 @@
/* { dg-do run { target mipsisa64*-*-* } } */
/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
/* Test MIPS-3D builtin functions */
#include <stdlib.h>

View File

@ -1,5 +1,5 @@
/* { dg-do run { target mipsisa64*-*-* } } */
/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
/* Test MIPS-3D branch-if-any-two builtin functions */
#include <stdlib.h>

View File

@ -1,5 +1,5 @@
/* { dg-do run { target mipsisa64*-*-* } } */
/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
/* Test MIPS-3D absolute compare builtin functions */
#include <stdlib.h>

View File

@ -1,5 +1,5 @@
/* { dg-do run { target mipsisa64*-*-* } } */
/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
/* Test MIPS-3D branch-if-any-four builtin functions */
#include <stdlib.h>

View File

@ -1,5 +1,5 @@
/* { dg-do run { target mipsisa64*-*-* } } */
/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
/* Test MIPS-3D absolute-compare & branch-if-any-four builtin functions */
#include <stdlib.h>

View File

@ -1,5 +1,5 @@
/* { dg-do run { target mipsisa64*-*-* } } */
/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
/* Test MIPS-3D absolute compare (floats) builtin functions */
#include <stdlib.h>

View File

@ -1,5 +1,5 @@
/* { dg-do run { target mipsisa64*-*-* } } */
/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
/* Test MIPS-3D absolute compare (doubles) builtin functions */
#include <stdlib.h>

View File

@ -1,5 +1,5 @@
/* { dg-do run { target mipsisa64*-*-* } } */
/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
/* Test MIPS-3D absolute compare and conditional move builtin functions */
#include <stdlib.h>

View File

@ -1,5 +1,5 @@
/* { dg-do run { target mipsisa64*-*-* } } */
/* { dg-options "-mips64 -O2 -mips3d -mhard-float -mfp64" } */
/* { dg-mips-options "-mips64 -O2 -mips3d -mhard-float -mgp64" } */
/* Matrix Multiplications */
#include <stdlib.h>

View File

@ -1,5 +1,5 @@
/* { dg-do run { target mipsisa64*-*-* } } */
/* { dg-options "-mips64 -O2 -mpaired-single -mhard-float -mfp64" } */
/* { dg-mips-options "-mips64 -O2 -mpaired-single -mhard-float -mgp64" } */
/* Test v2sf calculations */
#include <stdlib.h>

View File

@ -1,5 +1,5 @@
/* { dg-do run { target mipsisa64*-*-* } } */
/* { dg-options "-mips64 -O2 -mpaired-single -mhard-float -mfp64" } */
/* { dg-mips-options "-mips64 -O2 -mpaired-single -mhard-float -mgp64" } */
/* Test MIPS paired-single builtin functions */
#include <stdlib.h>

View File

@ -1,5 +1,5 @@
/* { dg-do run { target mipsisa64*-*-* } } */
/* { dg-options "-mips64 -O2 -mpaired-single -mhard-float -mfp64" } */
/* { dg-mips-options "-mips64 -O2 -mpaired-single -mhard-float -mgp64" } */
/* Test MIPS paired-single conditional move */
#include <stdlib.h>

View File

@ -1,5 +1,5 @@
/* { dg-do run { target mipsisa64*-*-* } } */
/* { dg-options "-mips64 -O2 -mpaired-single -mhard-float -mfp64" } */
/* { dg-mips-options "-mips64 -O2 -mpaired-single -mhard-float -mgp64" } */
/* Test MIPS paired-single comparisons */
#include <stdlib.h>

View File

@ -1,6 +1,6 @@
/* Test v2sf calculations */
/* { dg-do compile { target mipsisa64*-*-* } } */
/* { dg-options "-mips64 -O2 -mpaired-single -mhard-float -mfp64" } */
/* { dg-do compile } */
/* { dg-mips-options "-mips64 -O2 -mpaired-single -mhard-float -mgp64" } */
/* { dg-final { scan-assembler "cvt.ps.s" } } */
/* { dg-final { scan-assembler "mov.ps" } } */
/* { dg-final { scan-assembler "ldc1" } } */

View File

@ -17,25 +17,160 @@
# GCC testsuite that uses the `dg.exp' driver.
# Exit immediately if this isn't a MIPS target.
if ![istarget mips*-*-*] then {
if ![istarget mips*-*-*] {
return
}
# Load support procs.
load_lib gcc-dg.exp
# If a testcase doesn't have special options, use these.
global DEFAULT_CFLAGS
if ![info exists DEFAULT_CFLAGS] then {
set DEFAULT_CFLAGS " -ansi -pedantic-errors"
# Find out which target is selected by the default compiler flags.
# Also remember which aspects of the target are forced on the command
# line (as opposed to being overridable defaults).
#
# $mips_isa: the ISA level specified by __mips
# $mips_arch: the architecture specified by _MIPS_ARCH
# $mips_mips16: true if MIPS16 mode is selected
# $mips_mips64: true if 64-bit output is selected
# $mips_float: "hard" or "soft"
#
# $mips_forced_isa: true if the command line uses -march=* or -mips*
# $mips_forced_abi: true if the command line uses -mabi=* or -mgp*
# $mips_forced_float: true if the command line uses -mhard/soft-float
proc setup_mips_tests {} {
global mips_isa
global mips_arch
global mips_mips16
global mips_mips64
global mips_float
global mips_forced_isa
global mips_forced_abi
global mips_forced_float
global compiler_flags
global tool
set src dummy[pid].c
set f [open $src "w"]
puts $f {
int isa = __mips;
const char *arch = _MIPS_ARCH;
#ifdef __mips16
int mips16 = 1;
#endif
#ifdef __mips64
int mips64 = 1;
#endif
#ifdef __mips_hard_float
const char *float = "hard";
#else
const char *float = "soft";
#endif
}
close $f
set output [${tool}_target_compile $src "" preprocess ""]
file delete $src
regexp {isa = ([^;]*)} $output dummy mips_isa
regexp {arch = "([^"]*)} $output dummy mips_arch
set mips_mips16 [regexp {mips16 = 1} $output]
set mips_mips64 [regexp {mips64 = 1} $output]
regexp {float = "([^"]*)} $output dummy mips_float
set mips_forced_isa [regexp -- {(-mips|-march)} $compiler_flags]
set mips_forced_abi [regexp -- {(-mgp|-mabi)} $compiler_flags]
set mips_forced_float [regexp -- {-m(hard|soft)-float} $compiler_flags]
}
# Initialize `dg'.
# Like dg-options, but treats certain MIPS-specific options specially:
#
# -mgp32
# Force 32-bit code. Skip the test if the multilib flags force
# a 64-bit ABI.
#
# -mgp64
# Force 64-bit code. Also force a 64-bit target architecture
# if the other flags don't do so. Skip the test if the multilib
# flags force a 32-bit ABI or a 32-bit architecture.
#
# -mno-mips16
# Skip the test for MIPS16 targets.
#
# -march=*
# -mips*
# Select the target architecture. Skip the test for MIPS16 targets
# or if the multilib flags force a different architecture.
#
# -msoft-float
# -mhard-float
# Select the given floating-point mode. Skip the test if the
# multilib flags force a different selection.
proc dg-mips-options {args} {
upvar dg-extra-tool-flags extra_tool_flags
upvar dg-do-what do_what
global mips_isa
global mips_arch
global mips_mips16
global mips_mips64
global mips_float
global mips_forced_isa
global mips_forced_abi
global mips_forced_float
set flags [lindex $args 1]
set matches 1
# First handle the -mgp* options. Add an architecture option if necessary.
foreach flag $flags {
if {$flag == "-mgp32" && $mips_mips64} {
if {$mips_forced_abi} {
set matches 0
} else {
append flags " -mabi=32"
}
} elseif {$flag == "-mgp64" && !$mips_mips64} {
if {$mips_forced_abi} {
set matches 0
} else {
append flags " -mabi=o64"
if {[lsearch -regexp $flags {^(-mips|-march)}] < 0} {
append flags " -mips3"
}
}
}
}
# Handle the other options.
foreach flag $flags {
if {$flag == "-mno-mips16"} {
if {$mips_mips16} {
set matches 0
}
} elseif {[regexp -- {^-march=(.*)} $flag dummy arch]} {
if {$mips_mips16 || ($arch != $mips_arch && $mips_forced_isa)} {
set matches 0
}
} elseif {[regexp -- {^-mips(.*)} $flag dummy isa] && $isa != 16} {
if {$mips_mips16 || ($isa != $mips_isa && $mips_forced_isa)} {
set matches 0
}
} elseif {[regexp -- {^-m(hard|soft)-float} $flag dummy float]} {
if {$mips_float != $float && $mips_forced_float} {
set matches 0
}
}
}
if {$matches} {
set extra_tool_flags $flags
} else {
set do_what [list [lindex $do_what 0] "N" "P"]
}
}
setup_mips_tests
dg-init
# Main loop.
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
"" $DEFAULT_CFLAGS
# All done.
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] "" ""
dg-finish

View File

@ -0,0 +1,18 @@
/* { dg-do compile } */
/* { dg-mips-options "-O2 -mips4" } */
/* { dg-final { scan-assembler "movz" } } */
/* { dg-final { scan-assembler "movn" } } */
void ext_int (int);
int
sub1 (int i, int j, int k)
{
ext_int (k ? i : j);
}
int
sub2 (int i, int j, long l)
{
ext_int (!l ? i : j);
}

View File

@ -0,0 +1,18 @@
/* { dg-do compile } */
/* { dg-mips-options "-O2 -mips4" } */
/* { dg-final { scan-assembler "movz" } } */
/* { dg-final { scan-assembler "movn" } } */
void ext_long (long);
long
sub4 (long i, long j, long k)
{
ext_long (k ? i : j);
}
long
sub5 (long i, long j, int k)
{
ext_long (!k ? i : j);
}

View File

@ -1,5 +1,7 @@
/* { dg-do compile { target "mips*-*-*" } } */
/* { dg-options "-O2 -mips4" } */
/* { dg-do compile } */
/* { dg-mips-options "-O2 -mips4 -mhard-float" } */
/* { dg-final { scan-assembler "movt" } } */
/* { dg-final { scan-assembler "movf" } } */
/* { dg-final { scan-assembler "movz.s" } } */
/* { dg-final { scan-assembler "movn.s" } } */
/* { dg-final { scan-assembler "movt.s" } } */
@ -7,12 +9,23 @@
/* { dg-final { scan-assembler "movn.d" } } */
/* { dg-final { scan-assembler "movf.d" } } */
#if __mips < 4 || __mips_soft_float
asm ("# movz.s movn.s movt.s movz.d movn.d movf.d");
#else
void ext_int (int);
void ext_long (long);
void ext_float (float);
void ext_double (double);
int
sub3 (int i, int j, float f)
{
ext_int (f ? i : j);
}
long
sub6 (long i, long j, float f)
{
ext_long (!f ? i : j);
}
float
sub7 (float f, float g, int i)
{
@ -48,4 +61,3 @@ subc (double f, double g, double h)
{
ext_double (!h ? f : g);
}
#endif

View File

@ -1,13 +1,10 @@
/* { dg-do compile { target "mips*-*-*" } } */
/* { dg-options "-O2 -ffast-math -mips4" } */
/* { dg-do compile } */
/* { dg-mips-options "-O2 -ffast-math -mips4 -mhard-float" } */
/* { dg-final { scan-assembler "nmadd.s" } } */
/* { dg-final { scan-assembler "nmadd.d" } } */
/* { dg-final { scan-assembler "nmsub.s" } } */
/* { dg-final { scan-assembler "nmsub.d" } } */
#if (__mips != 4 && __mips != 64) || __mips_soft_float
asm ("# nmadd.s nmadd.d nmsub.s nmsub.d");
#else
float
sub1 (float f, float g, float h)
{
@ -31,4 +28,3 @@ sub4 (double f, double g, double h)
{
return -((f * g) - h);
}
#endif

View File

@ -1,13 +1,10 @@
/* { dg-do compile { target "mips*-*-*" } } */
/* { dg-options "-O2 -fno-fast-math -mips4" } */
/* { dg-do compile } */
/* { dg-mips-options "-O2 -fno-fast-math -mips4 -mhard-float" } */
/* { dg-final { scan-assembler "nmadd.s" } } */
/* { dg-final { scan-assembler "nmadd.d" } } */
/* { dg-final { scan-assembler "nmsub.s" } } */
/* { dg-final { scan-assembler "nmsub.d" } } */
#if (__mips != 4 && __mips != 64) || __mips_soft_float
asm ("# nmadd.s nmadd.d nmsub.s nmsub.d");
#else
float
sub1 (float f, float g, float h)
{
@ -31,4 +28,3 @@ sub4 (double f, double g, double h)
{
return -((f * g) - h);
}
#endif

View File

@ -1,11 +1,8 @@
/* { dg-do compile { target "mips*-*-*" } } */
/* { dg-options "-O2 -ffast-math -mips4" } */
/* { dg-do compile } */
/* { dg-mips-options "-O2 -ffast-math -mips4 -mhard-float" } */
/* { dg-final { scan-assembler "rsqrt.d" } } */
/* { dg-final { scan-assembler "rsqrt.s" } } */
#if (__mips != 4 && __mips != 64) || __mips_soft_float
asm ("# rsqrt.d rsqrt.s");
#else
extern double sqrt(double);
extern float sqrtf(float);
@ -18,4 +15,3 @@ float bar(float x)
{
return 1.0f/sqrtf(x);
}
#endif

View File

@ -1,11 +1,8 @@
/* { dg-do compile { target "mips*-*-*" } } */
/* { dg-options "-O2 -ffast-math -mips4" } */
/* { dg-do compile } */
/* { dg-mips-options "-O2 -ffast-math -mips4 -mhard-float" } */
/* { dg-final { scan-assembler "rsqrt.d" } } */
/* { dg-final { scan-assembler "rsqrt.s" } } */
#if (__mips != 4 && __mips != 64) || __mips_soft_float
asm ("# rsqrt.d rsqrt.s");
#else
extern double sqrt(double);
extern float sqrtf(float);
@ -18,4 +15,3 @@ float bar(float x)
{
return sqrtf(1.0f/x);
}
#endif

View File

@ -1,5 +1,5 @@
/* { dg-do compile { target "mips*-*-*" } } */
/* { dg-options "-O2 -mips4" } */
/* { dg-do compile } */
/* { dg-mips-options "-O2 -mips4 -mhard-float" } */
/* { dg-final { scan-assembler-not "rsqrt.d" } } */
/* { dg-final { scan-assembler-not "rsqrt.s" } } */
@ -25,4 +25,3 @@ float barf(float x)
{
return sqrtf(1.0f/x);
}

View File

@ -1,6 +1,6 @@
/* Test SB-1 v2sf extensions. */
/* { dg-do compile { target mipsisa64*-*-* } } */
/* { dg-options "-march=sb1 -O2 -mpaired-single -mhard-float -mfp64 -ffast-math" } */
/* { dg-do compile } */
/* { dg-mips-options "-march=sb1 -O2 -mpaired-single -mhard-float -mgp64 -ffast-math" } */
/* { dg-final { scan-assembler "div.ps" } } */
/* { dg-final { scan-assembler "recip.ps" } } */
/* { dg-final { scan-assembler "sqrt.ps" } } */

View File

@ -0,0 +1,7 @@
/* Make sure that mul/addu is preferred over mtlo/macc and that mul/subu
is preferred over mtlo/msac. */
/* { dg-do compile } */
/* { dg-mips-options "-O2 -march=vr5400" } */
int f1 (int a, int b, int c) { return a + b * c; }
int f2 (int a, int b, int c) { return a - b * c; }
/* { dg-final { scan-assembler "\tmul\t.*\tmul\t" } } */

View File

@ -0,0 +1,7 @@
/* Make sure that mul/addu is preferred over mtlo/macc and that mul/subu
is preferred over mtlo/msac. */
/* { dg-do compile } */
/* { dg-mips-options "-O2 -march=vr5500" } */
int f1 (int a, int b, int c) { return a + b * c; }
int f2 (int a, int b, int c) { return a - b * c; }
/* { dg-final { scan-assembler "\tmul\t.*\tmul\t" } } */