(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
arm/
bfloat16_simd_1_1.c
       1  /* { dg-do assemble { target { arm*-*-* } } } */
       2  /* { dg-require-effective-target arm_hard_ok } */
       3  /* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
       4  /* { dg-add-options arm_v8_2a_bf16_neon }  */
       5  /* { dg-additional-options "-O3 --save-temps -std=gnu90 -mfloat-abi=hard" } */
       6  /* { dg-final { check-function-bodies "**" "" } } */
       7  
       8  #include <arm_neon.h>
       9  
      10  /*
      11  **stacktest1:
      12  **	...
      13  **	vst1.16	{d[0-9]+\[[0-9]+\]}, \[r[0-9]+\]
      14  **	vld1.16	{d[0-9]+\[[0-9]+\]}, \[r[0-9]+\]
      15  **	...
      16  **	bx	lr
      17  */
      18  bfloat16_t stacktest1 (bfloat16_t __a)
      19  {
      20    volatile bfloat16_t b = __a;
      21    return b;
      22  }
      23  
      24  /*
      25  **stacktest2:
      26  **	...
      27  **	vstr	d[0-9]+, \[sp\]
      28  **	vldr	d[0-9]+, \[sp\]
      29  **	...
      30  **	bx	lr
      31  */
      32  bfloat16x4_t stacktest2 (bfloat16x4_t __a)
      33  {
      34    volatile bfloat16x4_t b = __a;
      35    return b;
      36  }
      37  
      38  /*
      39  **stacktest3:
      40  **	...
      41  **	vst1.64	{d[0-9]+-d[0-9]+}, \[sp:[0-9]+\]
      42  **	vld1.64	{d[0-9]+-d[0-9]+}, \[sp:[0-9]+\]
      43  **	...
      44  **	bx	lr
      45  */
      46  bfloat16x8_t stacktest3 (bfloat16x8_t __a)
      47  {
      48    volatile bfloat16x8_t b = __a;
      49    return b;
      50  }
      51  
      52  /*  Test compilation of __attribute__ vectors of 8, 16, 32, etc. BFloats.  */
      53  typedef bfloat16_t v8bf __attribute__((vector_size(16)));
      54  typedef bfloat16_t v16bf __attribute__((vector_size(32)));
      55  typedef bfloat16_t v32bf __attribute__((vector_size(64)));
      56  typedef bfloat16_t v64bf __attribute__((vector_size(128)));
      57  typedef bfloat16_t v128bf __attribute__((vector_size(256)));
      58  
      59  v8bf stacktest4 (v8bf __a)
      60  {
      61    volatile v8bf b = __a;
      62    return b;
      63  }
      64  
      65  v16bf stacktest5 (v16bf __a)
      66  {
      67    volatile v16bf b = __a;
      68    return b;
      69  }
      70  
      71  v32bf stacktest6 (v32bf __a)
      72  {
      73    volatile v32bf b = __a;
      74    return b;
      75  }
      76  
      77  v64bf stacktest7 (v64bf __a)
      78  {
      79    volatile v64bf b = __a;
      80    return b;
      81  }
      82  
      83  v128bf stacktest8 (v128bf __a)
      84  {
      85    volatile v128bf b = __a;
      86    return b;
      87  }
      88  
      89  /* Test use of constant values to assign values to vectors.  */
      90  
      91  typedef bfloat16_t v2bf __attribute__((vector_size(4)));
      92  v2bf c2 (void) { return (v2bf) 0x12345678; }