#ifndef SOFTRVV_VSRL_H
#define SOFTRVV_VSRL_H

#include <stddef.h>

#include <type_traits>

namespace softrvv {

template <typename T>
void vsrl_vx(T *dest, T *src1, const T *src2, int32_t avl) {
  // Only low lg2(SEW) bits are used for shift
  const T low_bits_mask = sizeof(T) * 8 - 1;
  const T shift = *src2 & low_bits_mask;
  for (int32_t idx = 0; idx < avl; idx++) {
    dest[idx] = static_cast<T>(
        static_cast<typename std::make_unsigned<T>::type>(src1[idx]) >> shift);
  }
}

template <typename T>
void vsrl_vv(T *dest, T *src1, T *src2, int32_t avl) {
  // Only low lg2(SEW) bits are used for shift
  const T low_bits_mask = sizeof(T) * 8 - 1;
  for (int32_t idx = 0; idx < avl; idx++) {
    dest[idx] = static_cast<T>(
        static_cast<typename std::make_unsigned<T>::type>(src1[idx]) >>
        (src2[idx] & low_bits_mask));
  }
}

}  // namespace softrvv

#endif  // SOFTRVV_VSRL_H
