(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
sse-recip.c
       1  /* { dg-do run } */
       2  /* { dg-options "-O2 -ffast-math -msse -mfpmath=sse -mrecip" } */
       3  /* { dg-require-effective-target sse } */
       4  
       5  #include "sse-check.h"
       6  
       7  extern float sqrtf (float);
       8  extern float fabsf (float);
       9  
      10  #define N 8
      11  
      12  static void
      13  sse_test (void)
      14  {
      15    float a[N] = { 0.f, 18.f, 108.f, 324.f, 720.f, 1944.f, 3087.f, 5832.f };
      16    float b[N] = { 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f };
      17    float r[N];
      18  
      19    float rc[N] = { 0.f, 3.f, 6.f, 9.f, 12.f, 18.f, 21.f, 27.f };
      20  
      21    int i;
      22  
      23    for (i = 0; i < N; i++)
      24      {
      25        r[i] = sqrtf (a[i] / b[i]);
      26      }
      27  
      28    /* check results:  */
      29    for (i = 0; i < N; i++)
      30      {
      31        if (fabsf (r[i] - rc[i]) > 0.0001)
      32  	abort();
      33      }   
      34  }