(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
arm/
simd/
vdot-compile.c
       1  /* { dg-do compile } */
       2  /* { dg-additional-options "-O3" } */
       3  /* { dg-require-effective-target arm_v8_2a_dotprod_neon_ok } */
       4  /* { dg-add-options arm_v8_2a_dotprod_neon }  */
       5  
       6  #include <arm_neon.h>
       7  
       8  /* Unsigned Dot Product instructions.  */
       9  
      10  uint32x2_t ufoo (uint32x2_t r, uint8x8_t x, uint8x8_t y)
      11  {
      12    return vdot_u32 (r, x, y);
      13  }
      14  
      15  uint32x4_t ufooq (uint32x4_t r, uint8x16_t x, uint8x16_t y)
      16  {
      17    return vdotq_u32 (r, x, y);
      18  }
      19  
      20  uint32x2_t ufoo_lane (uint32x2_t r, uint8x8_t x, uint8x8_t y)
      21  {
      22    return vdot_lane_u32 (r, x, y, 0);
      23  }
      24  
      25  uint32x4_t ufooq_lane (uint32x4_t r, uint8x16_t x, uint8x8_t y)
      26  {
      27    return vdotq_lane_u32 (r, x, y, 0);
      28  }
      29  
      30  /* Signed Dot Product instructions.  */
      31  
      32  int32x2_t sfoo (int32x2_t r, int8x8_t x, int8x8_t y)
      33  {
      34    return vdot_s32 (r, x, y);
      35  }
      36  
      37  int32x4_t sfooq (int32x4_t r, int8x16_t x, int8x16_t y)
      38  {
      39    return vdotq_s32 (r, x, y);
      40  }
      41  
      42  int32x2_t sfoo_lane (int32x2_t r, int8x8_t x, int8x8_t y)
      43  {
      44    return vdot_lane_s32 (r, x, y, 0);
      45  }
      46  
      47  int32x4_t sfooq_lane (int32x4_t r, int8x16_t x, int8x8_t y)
      48  {
      49    return vdotq_lane_s32 (r, x, y, 0);
      50  }
      51  
      52  int32x2_t sfoo_laneq1 (int32x2_t r, int8x8_t x, int8x16_t y)
      53  {
      54    return vdot_laneq_s32 (r, x, y, 0);
      55  }
      56  
      57  int32x4_t sfooq_lane1 (int32x4_t r, int8x16_t x, int8x16_t y)
      58  {
      59    return vdotq_laneq_s32 (r, x, y, 0);
      60  }
      61  
      62  int32x2_t sfoo_laneq2 (int32x2_t r, int8x8_t x, int8x16_t y)
      63  {
      64    return vdot_laneq_s32 (r, x, y, 2);
      65  }
      66  
      67  int32x4_t sfooq_lane2 (int32x4_t r, int8x16_t x, int8x16_t y)
      68  {
      69    return vdotq_laneq_s32 (r, x, y, 2);
      70  }
      71  
      72  /* { dg-final { scan-assembler-times {v[us]dot\.[us]8\td[0-9]+, d[0-9]+, d[0-9]+} 6 } } */
      73  /* { dg-final { scan-assembler-times {v[us]dot\.[us]8\tq[0-9]+, q[0-9]+, q[0-9]+} 2 } } */
      74  /* { dg-final { scan-assembler-times {v[us]dot\.[us]8\td[0-9]+, d[0-9]+, d[0-9]+\[#?[0-9]\]} 4 } } */
      75  /* { dg-final { scan-assembler-times {v[us]dot\.[us]8\tq[0-9]+, q[0-9]+, d[0-9]+\[#?[0-9]\]} 4 } } */
      76