| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */ |
| 3 |
|
| 4 |
#include "riscv_vector.h" |
| 5 |
|
| 6 |
void f0 (void *base,void *out,size_t vl) |
| 7 |
{ |
| 8 |
vuint64m1_t bindex = __riscv_vle64_v_u64m1 (base, vl); |
| 9 |
vint8mf8_t v = __riscv_vluxei64_v_i8mf8(base,bindex,vl); |
| 10 |
__riscv_vse8_v_i8mf8 (out,v,vl); |
| 11 |
} |
| 12 |
|
| 13 |
void f1 (void *base,void *out,size_t vl) |
| 14 |
{ |
| 15 |
vuint64m1_t bindex = __riscv_vle64_v_u64m1 (base, vl); |
| 16 |
vint8mf8_t bindex2 = __riscv_vle8_v_i8mf8 ((void *)(base + 100), vl); |
| 17 |
vint8mf8_t v = __riscv_vluxei64_v_i8mf8_tu(bindex2,base,bindex,vl); |
| 18 |
__riscv_vse8_v_i8mf8 (out,v,vl); |
| 19 |
} |
| 20 |
|
| 21 |
void f2 (void *base,void *out,size_t vl) |
| 22 |
{ |
| 23 |
vuint64m1_t bindex = __riscv_vle64_v_u64m1 (base, vl); |
| 24 |
vint8mf8_t v = __riscv_vluxei64_v_i8mf8(base,bindex,vl); |
| 25 |
vuint64m1_t v2 = __riscv_vadd_vv_u64m1 (bindex, bindex,vl); |
| 26 |
__riscv_vse8_v_i8mf8 (out,v,vl); |
| 27 |
__riscv_vse64_v_u64m1 ((void *)out,v2,vl); |
| 28 |
} |
| 29 |
|
| 30 |
void f3 (void *base,void *out,size_t vl, int n) |
| 31 |
{ |
| 32 |
for (int i = 0; i < n; i++){ |
| 33 |
vuint64m1_t bindex = __riscv_vle64_v_u64m1 (base + 100*i, vl); |
| 34 |
vint8mf8_t v = __riscv_vluxei64_v_i8mf8(base,bindex,vl); |
| 35 |
vuint64m1_t v2 = __riscv_vadd_vv_u64m1 (bindex, bindex,vl); |
| 36 |
__riscv_vse8_v_i8mf8 (out + 100*i,v,vl); |
| 37 |
__riscv_vse64_v_u64m1 ((void *)(out + 200*i),v2,vl); |
| 38 |
} |
| 39 |
} |
| 40 |
|
| 41 |
void f4 (void *base,void *out,size_t vl) |
| 42 |
{ |
| 43 |
vuint64m1_t bindex = __riscv_vle64_v_u64m1 (base, vl); |
| 44 |
vint8mf8_t v = __riscv_vluxei64_v_i8mf8(base,bindex,vl); |
| 45 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 46 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 47 |
vuint64m1_t v2 = __riscv_vadd_vv_u64m1 (bindex, bindex,vl); |
| 48 |
__riscv_vse8_v_i8mf8 (out,v,vl); |
| 49 |
__riscv_vse64_v_u64m1 ((void *)out,v2,vl); |
| 50 |
} |
| 51 |
|
| 52 |
void f5 (void *base,void *base2,void *out,size_t vl, int n) |
| 53 |
{ |
| 54 |
vuint64m1_t bindex = __riscv_vle64_v_u64m1 (base + 100, vl); |
| 55 |
for (int i = 0; i < n; i++){ |
| 56 |
vbool64_t m = __riscv_vlm_v_b64 (base + i, vl); |
| 57 |
vint8mf8_t v = __riscv_vluxei64_v_i8mf8_m(m,base,bindex,vl); |
| 58 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 59 |
v = __riscv_vle8_v_i8mf8_tu (v, base2, vl); |
| 60 |
__riscv_vse8_v_i8mf8 (out + 100*i,v,vl); |
| 61 |
} |
| 62 |
} |
| 63 |
|
| 64 |
void f6 (void *base,void *out,size_t vl) |
| 65 |
{ |
| 66 |
vuint64m8_t bindex = __riscv_vle64_v_u64m8 (base, vl); |
| 67 |
vint8m1_t v = __riscv_vluxei64_v_i8m1(base,bindex,vl); |
| 68 |
__riscv_vse8_v_i8m1 (out,v,vl); |
| 69 |
} |
| 70 |
|
| 71 |
void f7 (void *base,void *out,size_t vl) |
| 72 |
{ |
| 73 |
vuint64m8_t bindex = __riscv_vle64_v_u64m8 (base, vl); |
| 74 |
vint8m1_t src = __riscv_vle8_v_i8m1 ((void *)(base + 100), vl); |
| 75 |
vint8m1_t v = __riscv_vluxei64_v_i8m1_tu(src,base,bindex,vl); |
| 76 |
__riscv_vse8_v_i8m1 (out,v,vl); |
| 77 |
} |
| 78 |
|
| 79 |
void f8 (void *base,void *out,size_t vl) |
| 80 |
{ |
| 81 |
vuint64m8_t bindex = __riscv_vle64_v_u64m8 (base, vl); |
| 82 |
vint8m1_t v = __riscv_vluxei64_v_i8m1(base,bindex,vl); |
| 83 |
vuint64m8_t v2 = __riscv_vadd_vv_u64m8 (bindex, bindex,vl); |
| 84 |
__riscv_vse8_v_i8m1 (out,v,vl); |
| 85 |
__riscv_vse64_v_u64m8 ((void *)out,v2,vl); |
| 86 |
} |
| 87 |
|
| 88 |
void f9 (void *base,void *out,size_t vl, int n) |
| 89 |
{ |
| 90 |
for (int i = 0; i < n; i++){ |
| 91 |
vuint64m8_t bindex = __riscv_vle64_v_u64m8 (base + 100*i, vl); |
| 92 |
vint8m1_t v = __riscv_vluxei64_v_i8m1(base,bindex,vl); |
| 93 |
vuint64m8_t v2 = __riscv_vadd_vv_u64m8 (bindex, bindex,vl); |
| 94 |
__riscv_vse8_v_i8m1 (out + 100*i,v,vl); |
| 95 |
__riscv_vse64_v_u64m8 ((void *)(out + 200*i),v2,vl); |
| 96 |
} |
| 97 |
} |
| 98 |
|
| 99 |
void f10 (void *base,void *out,size_t vl) |
| 100 |
{ |
| 101 |
vuint64m8_t bindex = __riscv_vle64_v_u64m8 (base, vl); |
| 102 |
vint8m1_t v = __riscv_vluxei64_v_i8m1(base,bindex,vl); |
| 103 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 104 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 105 |
vuint64m8_t v2 = __riscv_vadd_vv_u64m8 (bindex, bindex,vl); |
| 106 |
__riscv_vse8_v_i8m1 (out,v,vl); |
| 107 |
__riscv_vse64_v_u64m8 ((void *)out,v2,vl); |
| 108 |
} |
| 109 |
|
| 110 |
void f11 (void *base,void *base2,void *out,size_t vl, int n) |
| 111 |
{ |
| 112 |
vuint64m8_t bindex = __riscv_vle64_v_u64m8 (base + 100, vl); |
| 113 |
for (int i = 0; i < n; i++){ |
| 114 |
vbool8_t m = __riscv_vlm_v_b8 (base + i, vl); |
| 115 |
vint8m1_t v = __riscv_vluxei64_v_i8m1_m(m,base,bindex,vl); |
| 116 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 117 |
v = __riscv_vle8_v_i8m1_tu (v, base2, vl); |
| 118 |
__riscv_vse8_v_i8m1 (out + 100*i,v,vl); |
| 119 |
} |
| 120 |
} |
| 121 |
|
| 122 |
void f12 (void *base,void *out,size_t vl, int n) |
| 123 |
{ |
| 124 |
vint8mf8_t v = __riscv_vle8_v_i8mf8 ((void *)(base + 1000), vl); |
| 125 |
for (int i = 0; i < n; i++){ |
| 126 |
vuint64m1_t bindex = __riscv_vle64_v_u64m1 (base + 100*i, vl); |
| 127 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 128 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 129 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 130 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 131 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 132 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 133 |
__riscv_vse8_v_i8mf8 (out + 100*i,v,vl); |
| 134 |
} |
| 135 |
} |
| 136 |
|
| 137 |
void f13 (void *base,void *out,size_t vl, int n) |
| 138 |
{ |
| 139 |
vint8m1_t v = __riscv_vle8_v_i8m1 ((void *)(base + 1000), vl); |
| 140 |
for (int i = 0; i < n; i++){ |
| 141 |
vuint64m8_t bindex = __riscv_vle64_v_u64m8 (base + 100*i, vl); |
| 142 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 143 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 144 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 145 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 146 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 147 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 148 |
__riscv_vse8_v_i8m1 (out + 100*i,v,vl); |
| 149 |
} |
| 150 |
} |
| 151 |
|
| 152 |
void f14 (void *base,void *out,size_t vl, int n) |
| 153 |
{ |
| 154 |
for (int i = 0; i < n; i++){ |
| 155 |
vint8mf8_t v = __riscv_vle8_v_i8mf8 ((void *)(base + 1000 * i), vl); |
| 156 |
vuint64m1_t bindex = __riscv_vle64_v_u64m1 (base + 100*i, vl); |
| 157 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 158 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 159 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 160 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 161 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 162 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex,vl); |
| 163 |
__riscv_vse8_v_i8mf8 (out + 100*i,v,vl); |
| 164 |
} |
| 165 |
} |
| 166 |
|
| 167 |
void f15 (void *base,void *out,size_t vl, int n) |
| 168 |
{ |
| 169 |
for (int i = 0; i < n; i++){ |
| 170 |
vint8m1_t v = __riscv_vle8_v_i8m1 ((void *)(base + 1000 * i), vl); |
| 171 |
vuint64m8_t bindex = __riscv_vle64_v_u64m8 (base + 100*i, vl); |
| 172 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 173 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 174 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 175 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 176 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 177 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex,vl); |
| 178 |
__riscv_vse8_v_i8m1 (out + 100*i,v,vl); |
| 179 |
} |
| 180 |
} |
| 181 |
|
| 182 |
void f16 (void *base,void *out,size_t vl, int n) |
| 183 |
{ |
| 184 |
for (int i = 0; i < n; i++){ |
| 185 |
vint8mf8_t v = __riscv_vle8_v_i8mf8 ((void *)(base + 1000 * i), vl); |
| 186 |
vuint64m1_t bindex1 = __riscv_vle64_v_u64m1 (base + 100*i, vl); |
| 187 |
vuint64m1_t bindex2 = __riscv_vle64_v_u64m1 (base + 200*i, vl); |
| 188 |
vuint64m1_t bindex3 = __riscv_vle64_v_u64m1 (base + 300*i, vl); |
| 189 |
vuint64m1_t bindex4 = __riscv_vle64_v_u64m1 (base + 400*i, vl); |
| 190 |
vuint64m1_t bindex5 = __riscv_vle64_v_u64m1 (base + 500*i, vl); |
| 191 |
vuint64m1_t bindex6 = __riscv_vle64_v_u64m1 (base + 600*i, vl); |
| 192 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex1,vl); |
| 193 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex2,vl); |
| 194 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex3,vl); |
| 195 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex4,vl); |
| 196 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex5,vl); |
| 197 |
v = __riscv_vluxei64_v_i8mf8_tu(v,base,bindex6,vl); |
| 198 |
__riscv_vse8_v_i8mf8 (out + 100*i,v,vl); |
| 199 |
} |
| 200 |
} |
| 201 |
|
| 202 |
void f17 (void *base,void *out,size_t vl, int n) |
| 203 |
{ |
| 204 |
for (int i = 0; i < n; i++){ |
| 205 |
vint8m1_t v = __riscv_vle8_v_i8m1 ((void *)(base + 1000 * i), vl); |
| 206 |
vuint64m8_t bindex1 = __riscv_vle64_v_u64m8 (base + 100*i, vl); |
| 207 |
vuint64m8_t bindex2 = __riscv_vle64_v_u64m8 (base + 200*i, vl); |
| 208 |
vuint64m8_t bindex3 = __riscv_vle64_v_u64m8 (base + 300*i, vl); |
| 209 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex1,vl); |
| 210 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex2,vl); |
| 211 |
v = __riscv_vluxei64_v_i8m1_tu(v,base,bindex3,vl); |
| 212 |
__riscv_vse8_v_i8m1 (out + 100*i,v,vl); |
| 213 |
} |
| 214 |
} |
| 215 |
|
| 216 |
void f18 (void *base,void *base2,void *out,size_t vl, int n) |
| 217 |
{ |
| 218 |
vuint64m8_t bindex = __riscv_vle64_v_u64m8 (base + 100, vl); |
| 219 |
for (int i = 0; i < n; i++){ |
| 220 |
vbool8_t m = __riscv_vlm_v_b8 (base + i, vl); |
| 221 |
vuint32m4_t v = __riscv_vluxei64_v_u32m4_m(m,base,bindex,vl); |
| 222 |
vuint32m4_t v2 = __riscv_vle32_v_u32m4_tu (v, base2 + i, vl); |
| 223 |
vint8m1_t v3 = __riscv_vluxei32_v_i8m1_m(m,base,v2,vl); |
| 224 |
__riscv_vse8_v_i8m1 (out + 100*i,v3,vl); |
| 225 |
} |
| 226 |
} |
| 227 |
|
| 228 |
void f19 (void *base,void *base2,void *out,size_t vl, int n) |
| 229 |
{ |
| 230 |
vuint64m8_t bindex = __riscv_vle64_v_u64m8 (base + 100, vl); |
| 231 |
for (int i = 0; i < n; i++){ |
| 232 |
vbool8_t m = __riscv_vlm_v_b8 (base + i, vl); |
| 233 |
vuint64m8_t v = __riscv_vluxei64_v_u64m8_m(m,base,bindex,vl); |
| 234 |
vuint64m8_t v2 = __riscv_vle64_v_u64m8_tu (v, base2 + i, vl); |
| 235 |
vint8m1_t v3 = __riscv_vluxei64_v_i8m1_m(m,base,v,vl); |
| 236 |
vint8m1_t v4 = __riscv_vluxei64_v_i8m1_m(m,base,v2,vl); |
| 237 |
__riscv_vse8_v_i8m1 (out + 100*i,v3,vl); |
| 238 |
__riscv_vse8_v_i8m1 (out + 222*i,v4,vl); |
| 239 |
} |
| 240 |
} |
| 241 |
void f20 (void *base,void *out,size_t vl) |
| 242 |
{ |
| 243 |
vuint64m8_t bindex = __riscv_vle64_v_u64m8 (base, vl); |
| 244 |
asm volatile("#" :: |
| 245 |
: "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", |
| 246 |
"v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", |
| 247 |
"v18", "v19", "v20", "v21", "v22", "v23"); |
| 248 |
|
| 249 |
vint8m1_t v = __riscv_vluxei64_v_i8m1(base,bindex,vl); |
| 250 |
asm volatile("#" :: |
| 251 |
: "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", |
| 252 |
"v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", |
| 253 |
"v18", "v19", "v20", "v21", "v22", "v23", "v25", |
| 254 |
"v26", "v27", "v28", "v29", "v30", "v31"); |
| 255 |
|
| 256 |
__riscv_vse8_v_i8m1 (out,v,vl); |
| 257 |
} |
| 258 |
|
| 259 |
void f21 (void *base,void *out,size_t vl) |
| 260 |
{ |
| 261 |
vuint64m8_t bindex = __riscv_vle64_v_u64m8 (base, vl); |
| 262 |
vbool8_t m = __riscv_vlm_v_b8 (base, vl); |
| 263 |
asm volatile("#" :: |
| 264 |
: "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", |
| 265 |
"v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", |
| 266 |
"v18", "v19", "v20", "v21", "v22", "v23"); |
| 267 |
|
| 268 |
vint8m1_t v = __riscv_vluxei64_v_i8m1_m(m,base,bindex,vl); |
| 269 |
asm volatile("#" :: |
| 270 |
: "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", |
| 271 |
"v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", |
| 272 |
"v18", "v19", "v20", "v21", "v22", "v23", "v25", |
| 273 |
"v26", "v27", "v28", "v29", "v30", "v31"); |
| 274 |
|
| 275 |
__riscv_vse8_v_i8m1 (out,v,vl); |
| 276 |
} |
| 277 |
|
| 278 |
void f22 (void *base,void *out,size_t vl) |
| 279 |
{ |
| 280 |
vuint64m8_t bindex = __riscv_vle64_v_u64m8 (base, vl); |
| 281 |
asm volatile("#" :: |
| 282 |
: "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", |
| 283 |
"v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", |
| 284 |
"v18", "v19", "v20", "v21", "v22", "v23"); |
| 285 |
|
| 286 |
vint8m1_t v = __riscv_vluxei64_v_i8m1(base,bindex,vl); |
| 287 |
asm volatile("#" :: |
| 288 |
: "v0", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", |
| 289 |
"v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", |
| 290 |
"v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", |
| 291 |
"v26", "v27", "v28", "v29", "v30", "v31"); |
| 292 |
v = __riscv_vadd_vv_i8m1 (v,v,vl); |
| 293 |
asm volatile("#" :: |
| 294 |
: "v0", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", |
| 295 |
"v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", |
| 296 |
"v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", |
| 297 |
"v26", "v27", "v28", "v29", "v30", "v31"); |
| 298 |
|
| 299 |
__riscv_vse8_v_i8m1 (out,v,vl); |
| 300 |
} |
| 301 |
|
| 302 |
/* { dg-final { scan-assembler-times {vmv} 1 } } */ |
| 303 |
/* { dg-final { scan-assembler-not {csrr} } } */ |