blob: 144141ef7f64771144b3821ebb6c74d39c96f149 [file] [log] [blame]
#ifndef SOFTRVV_VSUB_H
#define SOFTRVV_VSUB_H
#include <stddef.h>
namespace softrvv {
template <typename T>
void vsub_vx(T *dest, T *src1, const T *src2, int32_t avl) {
for (int idx = 0; idx < avl; idx++) {
dest[idx] = src1[idx] - *src2;
}
}
template <typename T>
void vsub_vv(T *dest, T *src1, T *src2, int32_t avl) {
for (int32_t idx = 0; idx < avl; idx++) {
dest[idx] = src1[idx] - src2[idx];
}
}
template <typename T>
void vrsub_vx(T *dest, T *src1, const T *src2, int32_t avl) {
for (int32_t idx = 0; idx < avl; idx++) {
dest[idx] = *src2 - src1[idx];
}
}
} // namespace softrvv
#endif // SOFTRVV_VSUB_H