(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
riscv/
rvv/
vsetvl/
avl_single-49.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-march=rv32gcv -mabi=ilp32 -fno-schedule-insns -fno-schedule-insns2" } */
       3  
       4  #include "riscv_vector.h"
       5  
       6  void f (int8_t * restrict in, int8_t * restrict out, int n, int n2)
       7  {
       8    size_t vl;
       9    asm volatile ("li %0, 101" :"=r" (vl)::"memory");
      10    for (int i = 0 ; i < n2; i++) {
      11      vint8mf8_t v = __riscv_vle8_v_i8mf8 (in + 800 + i, vl);
      12      __riscv_vse8_v_i8mf8 (out + 800 + i, v, vl);
      13    }
      14  
      15    for (int i = 0 ; i < n * n; i++)
      16      out[i] = out[i] + out[i];
      17    
      18    for (int i = 0 ; i < n * n * n; i++)
      19      out[i] = out[i] * out[i];
      20  
      21    for (int i = 0 ; i < n * n * n * n; i++)
      22      out[i] = out[i] * out[i];
      23    
      24    asm volatile ("li %0, 102" :"=r" (vl)::"memory");
      25    for (int i = 0 ; i < n * n * n * n; i++) {
      26      vint8mf8_t v = __riscv_vle8_v_i8mf8 (in + 900 + i, vl);
      27      __riscv_vse8_v_i8mf8 (out + 900 + i, v, vl);
      28    }
      29  }
      30  
      31  /* { dg-final { scan-assembler-times {vsetvli\s+zero,\s*[a-x0-9]+,\s*e8,\s*mf8,\s*t[au],\s*m[au]} 2 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */
      32  /* { dg-final { scan-assembler-times {vsetvli} 2 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */