(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
aarch64/
vadd_reduc-2.c
       1  /* { dg-do compile } */
       2  /* { dg-additional-options "-O3 -std=c99" } */
       3  /* { dg-final { check-function-bodies "**" "" "" } } */
       4  
       5  #include <stdint.h>
       6  
       7  #pragma GCC target "+nosve"
       8  
       9  /*
      10  **test:
      11  **	...
      12  **	addv	s0, v0.4s
      13  **	fmov	w0, s0
      14  **	and	w1, w0, 65535
      15  **	add	w0, w1, w0, lsr 16
      16  **	lsr	w0, w0, 1
      17  **	ret
      18  */
      19  int test (uint8_t *p, uint32_t t[1][1], int n) {
      20  
      21    int sum = 0;
      22    uint32_t a0;
      23    for (int i = 0; i < 4; i++, p++)
      24      t[i][0] = p[0];
      25  
      26    for (int i = 0; i < 4; i++) {
      27      {
      28        int t0 = t[0][i] + t[0][i];
      29        a0 = t0;
      30      };
      31      sum += a0;
      32    }
      33    return (((uint16_t)sum) + ((uint32_t)sum >> 16)) >> 1;
      34  }