Fix cut and paste bug in test_change_pc
[riscv-tests.git] / mt / vvadd3.c
1 #include "stdlib.h"
2 #include "dataset.h"
3
4 void __attribute__((noinline)) vvadd(int coreid, int ncores, size_t n, const data_t* x, const data_t* y, data_t* z)
5 {
6 data_t* to = &z[coreid * (n / ncores)];
7 const data_t* from1 = &x[coreid * (n / ncores)];
8 const data_t* from2 = &y[coreid * (n / ncores)];
9 size_t count = n / ncores;
10 size_t c = (count + 7) / 8;
11 switch(count % 8) {
12 case 0: do { *to++ = *from1++ + *from2++;
13 case 7: *to++ = *from1++ + *from2++;
14 case 6: *to++ = *from1++ + *from2++;
15 case 5: *to++ = *from1++ + *from2++;
16 case 4: *to++ = *from1++ + *from2++;
17 case 3: *to++ = *from1++ + *from2++;
18 case 2: *to++ = *from1++ + *from2++;
19 case 1: *to++ = *from1++ + *from2++;
20 } while(--c > 0);
21 }
22 }