(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
riscv/
rvv/
base/
merge_constraint-1.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */
       3  
       4  #include "riscv_vector.h"
       5  
       6  void f (int8_t* base1,int8_t* base2,int8_t* out,int n)
       7  {
       8    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
       9    for (int i = 0; i < n; i++){
      10      v = __riscv_vmv_v_v_i8mf4 (v, 32);
      11      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
      12    }
      13    __riscv_vse8_v_i8mf4 (out, v, 32);
      14  }
      15  
      16  void f2 (int8_t* base1,int8_t* base2,int8_t* out,int n)
      17  {
      18    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
      19    for (int i = 0; i < n; i++){
      20      v = __riscv_vmv_v_x_i8mf4_tu (v, 3, 32);
      21      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
      22    }
      23    __riscv_vse8_v_i8mf4 (out, v, 32);
      24  }
      25  
      26  void f3 (int8_t* base1,int8_t* base2,int8_t* out,int n)
      27  {
      28    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
      29    vint8mf4_t v2 = __riscv_vle8_v_i8mf4 (base1 + 100, 32);
      30    vbool32_t m = __riscv_vlm_v_b32 (base1 + 200, 32);
      31    for (int i = 0; i < n; i++){
      32      v = __riscv_vmerge_vvm_i8mf4 (v, v2, m, 32);
      33      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
      34    }
      35    __riscv_vse8_v_i8mf4 (out, v, 32);
      36  }
      37  
      38  void f4 (int8_t* base1,int8_t* base2,int8_t* out,int n)
      39  {
      40    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
      41    vbool32_t m = __riscv_vlm_v_b32 (base1 + 200, 32);
      42    for (int i = 0; i < n; i++){
      43      v = __riscv_vmerge_vxm_i8mf4 (v, 3, m, 32);
      44      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
      45    }
      46    __riscv_vse8_v_i8mf4 (out, v, 32);
      47  }
      48  
      49  void f5 (int8_t* base1,int8_t* base2,int8_t* out,int n)
      50  {
      51    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
      52    vbool32_t m = __riscv_vlm_v_b32 (base1 + 200, 32);
      53    for (int i = 0; i < n; i++){
      54      v = __riscv_vmerge_vxm_i8mf4 (v, 100, m, 32);
      55      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
      56    }
      57    __riscv_vse8_v_i8mf4 (out, v, 32);
      58  }
      59  
      60  void f6 (int8_t* base1,int8_t* base2,int8_t* out,int n)
      61  {
      62    vuint8mf4_t v = __riscv_vle8_v_u8mf4 (base1 + 100, 32);
      63    for (int i = 0; i < n; i++){
      64      v = __riscv_vluxei8_v_u8mf4 (base2, v, 32);
      65      v = __riscv_vle8_v_u8mf4_tu (v, base2 + 200, 32);
      66    }
      67    __riscv_vse8_v_u8mf4 (out, v, 32);
      68  }
      69  
      70  void f7 (int8_t* base1,int8_t* base2,int8_t* out,int n)
      71  {
      72    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
      73    for (int i = 0; i < n; i++){
      74      v = __riscv_vadd_vv_i8mf4 (v, v, 32);
      75      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
      76    }
      77    __riscv_vse8_v_i8mf4 (out, v, 32);
      78  }
      79  
      80  void f8 (int8_t* base1,int8_t* base2,int8_t* out,int n)
      81  {
      82    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
      83    for (int i = 0; i < n; i++){
      84      v = __riscv_vadd_vv_i8mf4 (v, v, 32);
      85      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
      86    }
      87    __riscv_vse8_v_i8mf4 (out, v, 32);
      88  }
      89  
      90  void f9 (int8_t* base1,int8_t* base2,int8_t* out,int n)
      91  {
      92    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
      93    for (int i = 0; i < n; i++){
      94      v = __riscv_vsll_vx_i8mf4 (v, 101, 32);
      95      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
      96    }
      97    __riscv_vse8_v_i8mf4 (out, v, 32);
      98  }
      99  
     100  void f10 (int8_t* base1,int8_t* base2,int8_t* out,int n)
     101  {
     102    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
     103    for (int i = 0; i < n; i++){
     104      v = __riscv_vor_vx_i8mf4 (v, 101, 32);
     105      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
     106    }
     107    __riscv_vse8_v_i8mf4 (out, v, 32);
     108  }
     109  
     110  void f11 (int8_t* base1,int8_t* base2,int8_t* out,int n)
     111  {
     112    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
     113    vbool32_t m = __riscv_vlm_v_b32 (base1 + 200, 32);
     114    for (int i = 0; i < n; i++){
     115      v = __riscv_vadc_vvm_i8mf4 (v, v, m, 32);
     116      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
     117    }
     118    __riscv_vse8_v_i8mf4 (out, v, 32);
     119  }
     120  
     121  void f12 (int8_t* base1,int8_t* base2,int8_t* out,int n)
     122  {
     123    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
     124    vbool32_t m = __riscv_vlm_v_b32 (base1 + 200, 32);
     125    for (int i = 0; i < n; i++){
     126      v = __riscv_vsbc_vvm_i8mf4 (v, v, m, 32);
     127      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
     128    }
     129    __riscv_vse8_v_i8mf4 (out, v, 32);
     130  }
     131  
     132  void f13 (int8_t* base1,int8_t* base2,int8_t* out,int n)
     133  {
     134    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
     135    vbool32_t m = __riscv_vlm_v_b32 (base1 + 200, 32);
     136    for (int i = 0; i < n; i++){
     137      v = __riscv_vadc_vxm_i8mf4 (v, 100, m, 32);
     138      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
     139    }
     140    __riscv_vse8_v_i8mf4 (out, v, 32);
     141  }
     142  
     143  void f14 (int8_t* base1,int8_t* base2,int8_t* out,int n)
     144  {
     145    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
     146    vbool32_t m = __riscv_vlm_v_b32 (base1 + 200, 32);
     147    for (int i = 0; i < n; i++){
     148      v = __riscv_vsbc_vxm_i8mf4 (v, 100, m, 32);
     149      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
     150    }
     151    __riscv_vse8_v_i8mf4 (out, v, 32);
     152  }
     153  
     154  void f15 (int8_t* base1,int8_t* base2,int8_t* out,int n)
     155  {
     156    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
     157    for (int i = 0; i < n; i++){
     158      v = __riscv_vneg_v_i8mf4 (v, 32);
     159      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
     160    }
     161    __riscv_vse8_v_i8mf4 (out, v, 32);
     162  }
     163  
     164  void f16 (int8_t* base1,int8_t* base2,int8_t* out,int n)
     165  {
     166    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
     167    for (int i = 0; i < n; i++){
     168      v = __riscv_vsadd_vv_i8mf4 (v, v, 32);
     169      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
     170    }
     171    __riscv_vse8_v_i8mf4 (out, v, 32);
     172  }
     173  
     174  void f17 (int8_t* base1,int8_t* base2,int8_t* out,int n)
     175  {
     176    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
     177    for (int i = 0; i < n; i++){
     178      v = __riscv_vsadd_vx_i8mf4 (v, 100, 32);
     179      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
     180    }
     181    __riscv_vse8_v_i8mf4 (out, v, 32);
     182  }
     183  
     184  void f18 (int8_t* base1,int8_t* base2,int8_t* out,int n)
     185  {
     186    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
     187    for (int i = 0; i < n; i++){
     188      v = __riscv_vaadd_vv_i8mf4 (v, v, 32);
     189      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
     190    }
     191    __riscv_vse8_v_i8mf4 (out, v, 32);
     192  }
     193  
     194  void f19 (int8_t* base1,int8_t* base2,int8_t* out,int n)
     195  {
     196    vint8mf4_t v = __riscv_vle8_v_i8mf4 (base1, 32);
     197    for (int i = 0; i < n; i++){
     198      v = __riscv_vaadd_vx_i8mf4 (v, 100, 32);
     199      v = __riscv_vle8_v_i8mf4_tu (v, base2, 32);
     200    }
     201    __riscv_vse8_v_i8mf4 (out, v, 32);
     202  }
     203  
     204  /* { dg-final { scan-assembler-not {vmv1r} } } */