(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
pr102464-vrndscaleph.c
       1  /* PR target/102464.  */
       2  /* { dg-do compile } */
       3  /* { dg-options "-Ofast -mavx512fp16 -mavx512vl -mprefer-vector-width=512" } */
       4  #include<math.h>
       5  void
       6  foo (_Float16* __restrict a, _Float16* b)
       7  {
       8      for (int i = 0; i != 8; i++)
       9        a[i] = floor (b[i]);
      10  }
      11  
      12  void
      13  foo1 (_Float16* __restrict a, _Float16* b)
      14  {
      15      for (int i = 0; i != 8; i++)
      16        a[i] = ceil (b[i]);
      17  }
      18  
      19  void
      20  foo2 (_Float16* __restrict a, _Float16* b)
      21  {
      22      for (int i = 0; i != 8; i++)
      23        a[i] = trunc (b[i]);
      24  }
      25  
      26  void
      27  foo3 (_Float16* __restrict a, _Float16* b)
      28  {
      29      for (int i = 0; i != 8; i++)
      30        a[i] = nearbyint (b[i]);
      31  }
      32  
      33  void
      34  foo4 (_Float16* __restrict a, _Float16* b)
      35  {
      36      for (int i = 0; i != 8; i++)
      37        a[i] = rint (b[i]);
      38  }
      39  
      40  void
      41  foo5 (_Float16* __restrict a, _Float16* b)
      42  {
      43      for (int i = 0; i != 16; i++)
      44        a[i] = floor (b[i]);
      45  }
      46  
      47  void
      48  foo6 (_Float16* __restrict a, _Float16* b)
      49  {
      50      for (int i = 0; i != 16; i++)
      51        a[i] = ceil (b[i]);
      52  }
      53  
      54  void
      55  foo7 (_Float16* __restrict a, _Float16* b)
      56  {
      57      for (int i = 0; i != 16; i++)
      58        a[i] = trunc (b[i]);
      59  }
      60  
      61  void
      62  foo8 (_Float16* __restrict a, _Float16* b)
      63  {
      64      for (int i = 0; i != 16; i++)
      65        a[i] = nearbyint (b[i]);
      66  }
      67  
      68  void
      69  foo9 (_Float16* __restrict a, _Float16* b)
      70  {
      71      for (int i = 0; i != 16; i++)
      72        a[i] = rint (b[i]);
      73  }
      74  
      75  void
      76  foo10 (_Float16* __restrict a, _Float16* b)
      77  {
      78      for (int i = 0; i != 32; i++)
      79        a[i] = floor (b[i]);
      80  }
      81  
      82  void
      83  foo11 (_Float16* __restrict a, _Float16* b)
      84  {
      85      for (int i = 0; i != 32; i++)
      86        a[i] = ceil (b[i]);
      87  }
      88  
      89  void
      90  foo12 (_Float16* __restrict a, _Float16* b)
      91  {
      92      for (int i = 0; i != 32; i++)
      93        a[i] = trunc (b[i]);
      94  }
      95  
      96  void
      97  foo13 (_Float16* __restrict a, _Float16* b)
      98  {
      99      for (int i = 0; i != 32; i++)
     100        a[i] = nearbyint (b[i]);
     101  }
     102  
     103  void
     104  foo14 (_Float16* __restrict a, _Float16* b)
     105  {
     106      for (int i = 0; i != 32; i++)
     107        a[i] = rint (b[i]);
     108  }
     109  
     110  /* { dg-final { scan-assembler-not "vcvtsh2s\[sd\]" } } */
     111  /* { dg-final { scan-assembler-not "vcvtph2p\[sd\]" } } */
     112  /* { dg-final { scan-assembler-not "extendhfxf" } } */
     113  /* { dg-final { scan-assembler-times "vrndscaleph\[^\n\r\]*xmm\[0-9\]" 5 } } */
     114  /* { dg-final { scan-assembler-times "vrndscaleph\[^\n\r\]*ymm\[0-9\]" 5 } } */
     115  /* { dg-final { scan-assembler-times "vrndscaleph\[^\n\r\]*zmm\[0-9\]" 5 } } */