(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
aarch64/
bfloat16_scalar_1.c
       1  /* { dg-do assemble { target { aarch64*-*-* } } } */
       2  /* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
       3  /* { dg-add-options arm_v8_2a_bf16_neon }  */
       4  /* { dg-additional-options "-O3 --save-temps -std=gnu90" } */
       5  /* { dg-final { check-function-bodies "**" "" } } */
       6  
       7  #include <arm_bf16.h>
       8  
       9  /*
      10  **stacktest1:
      11  **	sub	sp, sp, #16
      12  **	str	h0, \[sp, 14\]
      13  **	ldr	h0, \[sp, 14\]
      14  **	add	sp, sp, 16
      15  **	ret
      16  */
      17  bfloat16_t stacktest1 (bfloat16_t __a)
      18  {
      19    volatile bfloat16_t b = __a;
      20    return b;
      21  }
      22  
      23  /*
      24  **bfloat_mov_ww:
      25  **	mov	v1.h\[0\], v2.h\[0\]
      26  **	ret
      27  */
      28  void bfloat_mov_ww (void)
      29  {
      30    register bfloat16_t x asm ("h2");
      31    register bfloat16_t y asm ("h1");
      32    asm volatile ("" : "=w" (x));
      33    y = x;
      34    asm volatile ("" :: "w" (y));
      35  }
      36  
      37  /*
      38  **bfloat_mov_rw:
      39  **	dup	v1.4h, w1
      40  **	ret
      41  */
      42  void bfloat_mov_rw (void)
      43  {
      44    register bfloat16_t x asm ("w1");
      45    register bfloat16_t y asm ("h1");
      46    asm volatile ("" : "=r" (x));
      47    y = x;
      48    asm volatile ("" :: "w" (y));
      49  }
      50  
      51  /*
      52  **bfloat_mov_wr:
      53  **	umov	w1, v1.h\[0\]
      54  **	ret
      55  */
      56  void bfloat_mov_wr (void)
      57  {
      58    register bfloat16_t x asm ("h1");
      59    register bfloat16_t y asm ("w1");
      60    asm volatile ("" : "=w" (x));
      61    y = x;
      62    asm volatile ("" :: "r" (y));
      63  }
      64  
      65  /*
      66  **bfloat_mov_rr:
      67  **	mov	w1, w2
      68  **	ret
      69  */
      70  void bfloat_mov_rr (void)
      71  {
      72    register bfloat16_t x asm ("w2");
      73    register bfloat16_t y asm ("w1");
      74    asm volatile ("" : "=r" (x));
      75    y = x;
      76    asm volatile ("" :: "r" (y));
      77  }
      78  
      79  /*
      80  **bfloat_mov_rm:
      81  **	strh	w2, \[x0\]
      82  **	ret
      83  */
      84  void bfloat_mov_rm (bfloat16_t *ptr)
      85  {
      86     register bfloat16_t x asm ("w2");
      87     asm volatile ("" : "=r" (x));
      88     *ptr = x;
      89  }
      90  
      91  /*
      92  **bfloat_mov_mr:
      93  **	ldrh	w2, \[x0\]
      94  **	ret
      95  */
      96  void bfloat_mov_mr (bfloat16_t *ptr)
      97  {
      98     register bfloat16_t y asm ("w2");
      99     y = *ptr;
     100     asm volatile ("" :: "r" (y));
     101  }
     102