blob: f87aec6834fa9bb091e17b2a44611570410e164a [file] [log] [blame]
#ifndef SOFTRVV_VMACC_H
#define SOFTRVV_VMACC_H
#include <stddef.h>
#include <stdint.h>
namespace softrvv {
template <typename T1, typename T2>
void vmacc_vx(T1 *vd, const T2 *rs1, const T2 *vs2, int32_t avl) {
for (int32_t idx = 0; idx < avl; idx++) {
vd[idx] = (*rs1 * vs2[idx]) + vd[idx];
}
}
template <typename T1, typename T2>
void vmacc_vv(T1 *vd, T2 *vs1, const T2 *vs2, int32_t avl) {
for (int32_t idx = 0; idx < avl; idx++) {
vd[idx] = (vs1[idx] * vs2[idx]) + vd[idx];
}
}
template <typename T1, typename T2>
void vnmsac_vv(T1 *vd, T2 *vs1, const T2 *vs2, int32_t avl) {
for (int32_t idx = 0; idx < avl; idx++) {
vd[idx] = -(vs1[idx] * vs2[idx]) + vd[idx];
}
}
template <typename T1, typename T2>
void vnmsac_vx(T1 *vd, const T2 *rs1, const T2 *vs2, int32_t avl) {
for (int32_t idx = 0; idx < avl; idx++) {
vd[idx] = -(*rs1 * vs2[idx]) + vd[idx];
}
}
} // namespace softrvv
#endif // SOFTRVV_VMACC_H