sse-recip-vec.c: Add file, missing from my previous commit.

* gcc.target/i386/sse-recip-vec.c: Add file, missing from my
	previous commit.

From-SVN: r125767
This commit is contained in:
Uros Bizjak 2007-06-17 09:20:21 +02:00 committed by Uros Bizjak
parent 6e34d7b8a6
commit b92d0c7126
6 changed files with 57 additions and 5 deletions

View File

@ -6,6 +6,7 @@
* gcc.target/i386/recip-vec-divf.c: Ditto.
* gcc.target/i386/recip-vec-sqrtf.c: Ditto.
* gcc.target/i386/sse-recip.c: Ditto.
* gcc.target/i386/sse-recip-vec.c: Ditto.
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>

View File

@ -1,5 +1,5 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-O2 -ffast-math -msse2 -mfpmath=sse -mrecip" } */
/* { dg-options "-O2 -ffast-math -msse -mfpmath=sse -mrecip" } */
float t1(float a, float b)
{

View File

@ -1,5 +1,5 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-O2 -ffast-math -msse2 -mfpmath=sse -mrecip" } */
/* { dg-options "-O2 -ffast-math -msse -mfpmath=sse -mrecip" } */
extern float sqrtf (float);
@ -8,7 +8,7 @@ float t1(float a, float b)
return a/sqrtf(b);
}
float t2(float x, float a, float b)
float t2(float a, float b)
{
return sqrtf(a/b);
}

View File

@ -1,5 +1,5 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse2 -mfpmath=sse -mrecip" } */
/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse -mfpmath=sse -mrecip" } */
float a[16];
float b[16];

View File

@ -1,5 +1,5 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse2 -mfpmath=sse -mrecip" } */
/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse -mfpmath=sse -mrecip" } */
float a[16];
float b[16];

View File

@ -0,0 +1,51 @@
/* { dg-do run } */
/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse -mfpmath=sse -mrecip" } */
#include "../../gcc.dg/i386-cpuid.h"
extern float sqrtf (float);
extern void abort (void);
#define N 8
int __attribute__((noinline))
main1 ()
{
float a[N] = { 0.f, 18.f, 108.f, 324.f, 720.f, 1944.f, 3087.f, 5832.f };
float b[N] = { 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f };
float r[N];
float rc[N] = { 0.f, 3.f, 6.f, 9.f, 12.f, 18.f, 21.f, 27.f };
int i;
for (i = 0; i < N; i++)
{
r[i] = sqrtf (a[i] / b[i]);
}
/* check results: */
for (i = 0; i < N; i++)
{
if (r[i] != rc[i])
abort();
}
return 0;
}
int
main ()
{
unsigned long cpu_facilities;
cpu_facilities = i386_cpuid ();
if ((cpu_facilities & (bit_MMX | bit_SSE | bit_CMOV))
!= (bit_MMX | bit_SSE | bit_CMOV))
/* If host has no vector support, pass. */
return 0;
main1 ();
return 0;
}