(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
pr106910-1.c
       1  /* { dg-do compile { target { ! ia32 } } } */
       2  /* { dg-options "-msse4.1 -O2 -Ofast" } */
       3  /* { dg-final { scan-assembler-times "roundps" 9 } } */
       4  /* { dg-final { scan-assembler-times "cvtps2dq" 1 } } */
       5  /* { dg-final { scan-assembler-times "cvttps2dq" 3 } } */
       6  
       7  #include<math.h>
       8  
       9  void
      10  foo (float* p, float* __restrict q)
      11  {
      12    p[0] = truncf (q[0]);
      13    p[1] = truncf (q[1]);
      14  }
      15  
      16  void
      17  foo1 (float* p, float* __restrict q)
      18  {
      19    p[0] = floorf (q[0]);
      20    p[1] = floorf (q[1]);
      21  }
      22  
      23  void
      24  foo1i (int* p, float* __restrict q)
      25  {
      26    p[0] = (int) floorf (q[0]);
      27    p[1] = (int) floorf (q[1]);
      28  }
      29  
      30  void
      31  foo2 (float* p, float* __restrict q)
      32  {
      33    p[0] = ceilf (q[0]);
      34    p[1] = ceilf (q[1]);
      35  }
      36  
      37  void
      38  foo2i (int* p, float* __restrict q)
      39  {
      40    p[0] = (int) ceilf (q[0]);
      41    p[1] = (int) ceilf (q[1]);
      42  }
      43  
      44  void
      45  foo3 (float* p, float* __restrict q)
      46  {
      47    p[0] = rintf (q[0]);
      48    p[1] = rintf (q[1]);
      49  }
      50  
      51  void
      52  foo3i (int* p, float* __restrict q)
      53  {
      54    p[0] = (int) rintf (q[0]);
      55    p[1] = (int) rintf (q[1]);
      56  }
      57  
      58  void
      59  foo4 (float* p, float* __restrict q)
      60  {
      61    p[0] = nearbyintf (q[0]);
      62    p[1] = nearbyintf (q[1]);
      63  }
      64  
      65  void
      66  foo5(float* p, float* __restrict q)
      67  {
      68    p[0] = roundf (q[0]);
      69    p[1] = roundf (q[1]);
      70  }
      71  
      72  void
      73  foo5i(int* p, float* __restrict q)
      74  {
      75    p[0] = (int) roundf (q[0]);
      76    p[1] = (int) roundf (q[1]);
      77  }