(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
aarch64/
vget_set_lane_1.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2" } */
       3  
       4  #include "arm_neon.h"
       5  
       6  #define BUILD_TEST(TYPE1, TYPE2, Q1, Q2, SUFFIX, INDEX1, INDEX2)	\
       7  TYPE1 __attribute__((noinline,noclone))				\
       8  test_copy##Q1##_lane##Q2##_##SUFFIX (TYPE1 a, TYPE2 b)			\
       9  {									\
      10    return vset##Q1##_lane_##SUFFIX (vget##Q2##_lane_##SUFFIX (b, INDEX2),\
      11  				    a, INDEX1);				\
      12  }
      13  
      14  BUILD_TEST (poly8x8_t, poly8x8_t, , , p8, 7, 6)
      15  BUILD_TEST (int8x8_t,  int8x8_t,  , , s8, 7, 6)
      16  BUILD_TEST (uint8x8_t, uint8x8_t, , , u8, 7, 6)
      17  /* { dg-final { scan-assembler-times "ins\\tv0.b\\\[7\\\], v1.b\\\[6\\\]" 3 } } */
      18  BUILD_TEST (poly16x4_t, poly16x4_t, , , p16, 3, 2)
      19  BUILD_TEST (int16x4_t,  int16x4_t,  , , s16, 3, 2)
      20  BUILD_TEST (uint16x4_t, uint16x4_t, , , u16, 3, 2)
      21  /* { dg-final { scan-assembler-times "ins\\tv0.h\\\[3\\\], v1.h\\\[2\\\]" 3 } } */
      22  BUILD_TEST (float32x2_t, float32x2_t, , , f32, 1, 0)
      23  BUILD_TEST (int32x2_t,   int32x2_t,   , , s32, 1, 0)
      24  BUILD_TEST (uint32x2_t,  uint32x2_t,  , , u32, 1, 0)
      25  /* { dg-final { scan-assembler-times "ins\\tv0.s\\\[1\\\], v1.s\\\[0\\\]" 3 } } */
      26  
      27  BUILD_TEST (poly8x8_t, poly8x16_t, , q, p8, 7, 15)
      28  BUILD_TEST (int8x8_t,  int8x16_t,  , q, s8, 7, 15)
      29  BUILD_TEST (uint8x8_t, uint8x16_t, , q, u8, 7, 15)
      30  /* { dg-final { scan-assembler-times "ins\\tv0.b\\\[7\\\], v1.b\\\[15\\\]" 3 } } */
      31  BUILD_TEST (poly16x4_t, poly16x8_t, , q, p16, 3, 7)
      32  BUILD_TEST (int16x4_t,  int16x8_t,  , q, s16, 3, 7)
      33  BUILD_TEST (uint16x4_t, uint16x8_t, , q, u16, 3, 7)
      34  /* { dg-final { scan-assembler-times "ins\\tv0.h\\\[3\\\], v1.h\\\[7\\\]" 3 } } */
      35  BUILD_TEST (float32x2_t, float32x4_t, , q, f32, 1, 3)
      36  BUILD_TEST (int32x2_t,   int32x4_t,   , q, s32, 1, 3)
      37  BUILD_TEST (uint32x2_t,  uint32x4_t,  , q, u32, 1, 3)
      38  /* { dg-final { scan-assembler-times "ins\\tv0.s\\\[1\\\], v1.s\\\[3\\\]" 3 } } */
      39  
      40  BUILD_TEST (poly8x16_t, poly8x8_t, q, , p8, 15, 7)
      41  BUILD_TEST (int8x16_t,  int8x8_t,  q, , s8, 15, 7)
      42  BUILD_TEST (uint8x16_t, uint8x8_t, q, , u8, 15, 7)
      43  /* { dg-final { scan-assembler-times "ins\\tv0.b\\\[15\\\], v1.b\\\[7\\\]" 3 } } */
      44  BUILD_TEST (poly16x8_t, poly16x4_t, q, , p16, 7, 3)
      45  BUILD_TEST (int16x8_t,  int16x4_t,  q, , s16, 7, 3)
      46  BUILD_TEST (uint16x8_t, uint16x4_t, q, , u16, 7, 3)
      47  /* { dg-final { scan-assembler-times "ins\\tv0.h\\\[7\\\], v1.h\\\[3\\\]" 3 } } */
      48  BUILD_TEST (float32x4_t, float32x2_t, q, , f32, 3, 1)
      49  BUILD_TEST (int32x4_t,   int32x2_t,   q, , s32, 3, 1)
      50  BUILD_TEST (uint32x4_t,  uint32x2_t,  q, , u32, 3, 1)
      51  /* { dg-final { scan-assembler-times "ins\\tv0.s\\\[3\\\], v1.s\\\[1\\\]" 3 } } */
      52  BUILD_TEST (float64x2_t, float64x1_t, q, , f64, 1, 0)
      53  BUILD_TEST (int64x2_t,   int64x1_t,   q, , s64, 1, 0)
      54  BUILD_TEST (uint64x2_t,  uint64x1_t,  q, , u64, 1, 0)
      55  /* { dg-final { scan-assembler-times "ins\\tv0.d\\\[1\\\], v1.d\\\[0\\\]" 3 } } */
      56  
      57  BUILD_TEST (poly8x16_t, poly8x16_t, q, q, p8, 14, 15)
      58  BUILD_TEST (int8x16_t,  int8x16_t,  q, q, s8, 14, 15)
      59  BUILD_TEST (uint8x16_t, uint8x16_t, q, q, u8, 14, 15)
      60  /* { dg-final { scan-assembler-times "ins\\tv0.b\\\[14\\\], v1.b\\\[15\\\]" 3 } } */
      61  BUILD_TEST (poly16x8_t, poly16x8_t, q, q, p16, 6, 7)
      62  BUILD_TEST (int16x8_t,  int16x8_t,  q, q, s16, 6, 7)
      63  BUILD_TEST (uint16x8_t, uint16x8_t, q, q, u16, 6, 7)
      64  /* { dg-final { scan-assembler-times "ins\\tv0.h\\\[6\\\], v1.h\\\[7\\\]" 3 } } */
      65  BUILD_TEST (float32x4_t, float32x4_t, q, q, f32, 2, 3)
      66  BUILD_TEST (int32x4_t,   int32x4_t,   q, q, s32, 2, 3)
      67  BUILD_TEST (uint32x4_t,  uint32x4_t,  q, q, u32, 2, 3)
      68  /* { dg-final { scan-assembler-times "ins\\tv0.s\\\[2\\\], v1.s\\\[3\\\]" 3 } } */
      69  BUILD_TEST (float64x2_t, float64x2_t, q, q, f64, 1, 1)
      70  BUILD_TEST (int64x2_t,   int64x2_t,   q,  q, s64, 1, 1)
      71  BUILD_TEST (uint64x2_t,  uint64x2_t,  q, q, u64, 1, 1)
      72  /* { dg-final { scan-assembler-times "ins\\tv0.d\\\[1\\\], v1.d\\\[1\\\]" 3 } } */