From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gcc.target/mips/mips-ps-type.c | 111 +++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 gcc/testsuite/gcc.target/mips/mips-ps-type.c (limited to 'gcc/testsuite/gcc.target/mips/mips-ps-type.c') diff --git a/gcc/testsuite/gcc.target/mips/mips-ps-type.c b/gcc/testsuite/gcc.target/mips/mips-ps-type.c new file mode 100644 index 000000000..2a10f91bd --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/mips-ps-type.c @@ -0,0 +1,111 @@ +/* Test v2sf calculations. The nmadd and nmsub patterns need + -ffinite-math-only. */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mpaired-single -mgp64 -ffinite-math-only" } */ +/* { dg-final { scan-assembler "cvt.ps.s" } } */ +/* { dg-final { scan-assembler "mov.ps" } } */ +/* { dg-final { scan-assembler "ldc1" } } */ +/* { dg-final { scan-assembler "sdc1" } } */ +/* { dg-final { scan-assembler "add.ps" } } */ +/* { dg-final { scan-assembler "sub.ps" } } */ +/* { dg-final { scan-assembler "neg.ps" } } */ +/* { dg-final { scan-assembler "mul.ps" } } */ +/* { dg-final { scan-assembler "madd.ps" } } */ +/* { dg-final { scan-assembler "msub.ps" } } */ +/* { dg-final { scan-assembler "nmadd.ps" } } */ +/* { dg-final { scan-assembler "nmsub.ps" } } */ +/* { dg-final { scan-assembler "mov(n|z).ps" } } */ + +typedef float v2sf __attribute__ ((vector_size(8))); + +v2sf A = {100, 200}; + +/* Init from floats */ +NOMIPS16 v2sf init (float a, float b) +{ + return (v2sf) {a, b}; +} + +/* Move between registers */ +NOMIPS16 v2sf move (v2sf a) +{ + return a; +} + +/* Load from memory */ +NOMIPS16 v2sf load () +{ + return A; +} + +/* Store to memory */ +NOMIPS16 void store (v2sf a) +{ + A = a; +} + +/* Add */ +NOMIPS16 v2sf add (v2sf a, v2sf b) +{ + return a + b; +} + +/* Subtract */ +NOMIPS16 v2sf sub (v2sf a, v2sf b) +{ + return a - b; +} + +/* Negate */ +NOMIPS16 v2sf neg (v2sf a) +{ + return - a; +} + +/* Multiply */ +NOMIPS16 v2sf mul (v2sf a, v2sf b) +{ + return a * b; +} + +/* Multiply and add */ +NOMIPS16 v2sf madd (v2sf a, v2sf b, v2sf c) +{ + return a * b + c; +} + +/* Multiply and subtract */ +NOMIPS16 v2sf msub (v2sf a, v2sf b, v2sf c) +{ + return a * b - c; +} + +/* Negate Multiply and add */ +NOMIPS16 v2sf nmadd (v2sf a, v2sf b, v2sf c) +{ + return - (a * b + c); +} + +/* Negate Multiply and subtract */ +NOMIPS16 v2sf nmsub (v2sf a, v2sf b, v2sf c) +{ + return - (a * b - c); +} + +/* Conditional Move */ +NOMIPS16 v2sf cond_move1 (v2sf a, v2sf b, long i) +{ + if (i > 0) + return a; + else + return b; +} + +/* Conditional Move */ +NOMIPS16 v2sf cond_move2 (v2sf a, v2sf b, int i) +{ + if (i > 0) + return a; + else + return b; +} -- cgit v1.2.3