| 1 |
#include <stdint-gcc.h> |
| 2 |
|
| 3 |
#define VROL_VV(SEW, S, T) \ |
| 4 |
__attribute__ ((noipa))\ |
| 5 |
void autovect_vrol_vv_##S##SEW (T *out, T *op1, T *op2, int n){\ |
| 6 |
for(int i=0; i<n; i++){ \ |
| 7 |
op2[i] = op2[i] & (SEW-1);\ |
| 8 |
out[i]= (op1[i] << op2[i]) | (op1[i] >> (SEW - op2[i]));\ |
| 9 |
}\ |
| 10 |
} |
| 11 |
|
| 12 |
#define VROR_VV(SEW, S, T) \ |
| 13 |
__attribute__ ((noipa))\ |
| 14 |
void autovect_vror_vv_##S##SEW (T *out, T *op1, T *op2, int n){\ |
| 15 |
for(int i=0; i<n; i++){ \ |
| 16 |
op2[i] = op2[i] & (SEW-1);\ |
| 17 |
out[i]= (op1[i] >> op2[i]) | (op1[i] << (SEW - op2[i]));\ |
| 18 |
}\ |
| 19 |
} |
| 20 |
|
| 21 |
VROL_VV(8, u, uint8_t) |
| 22 |
VROL_VV(16, u, uint16_t) |
| 23 |
VROL_VV(32, u, uint32_t) |
| 24 |
VROL_VV(64, u, uint64_t) |
| 25 |
|
| 26 |
VROR_VV(8, u, uint8_t) |
| 27 |
VROR_VV(16, u, uint16_t) |
| 28 |
VROR_VV(32, u, uint32_t) |
| 29 |
VROR_VV(64, u, uint64_t) |