Skip to content

default

simd_allones function

template <typename Tout, size_t N>
simd<Tout, N> simd_allones() CMT_NOEXCEPT

Returns vector with all ones

Source code
template <typename Tout, size_t N>
KFR_INTRINSIC simd<Tout, N> simd_allones() CMT_NOEXCEPT
{
    not_optimized(CMT_FUNC_SIGNATURE);
    simd_array<Tout, N> x{};
    KFR_COMPONENTWISE(x.val[i] = special_constants<Tout>::allones());
    return from_simd_array(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/impl/backend_generic.hpp#L1162

simd_bitcast function

template <typename Tout, typename Tin, size_t N,
          size_t Nout = (sizeof(Tin) * N / sizeof(Tout))
#ifdef CMT_COMPILER_IS_MSVC
              ,
          KFR_ENABLE_IF((Nout == 1 || N == 1) &&
                        !std::is_same_v<Tout, Tin>)
#else
              ,
          KFR_ENABLE_IF(Nout == 1 || N == 1)
#endif
          >
simd<Tout, Nout>
simd_bitcast(simd_cvt_t<Tout, Tin, N>,
             const simd<Tin, N> &x) CMT_NOEXCEPT

Converts input vector to vector with subtype Tout

Source code
template <typename Tout, typename Tin, size_t N, size_t Nout = (sizeof(Tin) * N / sizeof(Tout))
#ifdef CMT_COMPILER_IS_MSVC
                                                     ,
          KFR_ENABLE_IF((Nout == 1 || N == 1) && !std::is_same_v<Tout, Tin>)
#else
                                                     ,
          KFR_ENABLE_IF(Nout == 1 || N == 1)
#endif
          >
KFR_INTRINSIC simd<Tout, Nout> simd_bitcast(simd_cvt_t<Tout, Tin, N>, const simd<Tin, N>& x) CMT_NOEXCEPT
{
    not_optimized(CMT_FUNC_SIGNATURE);
    return bitcast_anything<simd<Tout, Nout>>(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/impl/backend_generic.hpp#L1180

template <typename Tout, typename Tin, size_t N,
          size_t Nout = (sizeof(Tin) * N / sizeof(Tout))
#ifdef CMT_COMPILER_IS_MSVC
              ,
          KFR_ENABLE_IF(Nout > 1 && N > 1 &&
                        !std::is_same_v<Tout, Tin>)
#else
              ,
          KFR_ENABLE_IF(Nout > 1 && N > 1)
#endif
          >
simd<Tout, Nout>
simd_bitcast(simd_cvt_t<Tout, Tin, N>,
             const simd<Tin, N> &x) CMT_NOEXCEPT

Converts input vector to vector with subtype Tout

Source code
template <typename Tout, typename Tin, size_t N, size_t Nout = (sizeof(Tin) * N / sizeof(Tout))
#ifdef CMT_COMPILER_IS_MSVC
                                                     ,
          KFR_ENABLE_IF(Nout > 1 && N > 1 && !std::is_same_v<Tout, Tin>)
#else
                                                     ,
          KFR_ENABLE_IF(Nout > 1 && N > 1)
#endif
          >
KFR_INTRINSIC simd<Tout, Nout> simd_bitcast(simd_cvt_t<Tout, Tin, N>, const simd<Tin, N>& x) CMT_NOEXCEPT
{
    constexpr size_t Nlow = prev_poweroftwo(N - 1);
    return simd_concat<Tout, Nlow * Nout / N, (N - Nlow) * Nout / N>(
        simd_bitcast(simd_cvt_t<Tout, Tin, Nlow>{},
                     unwrap_bit_value(simd_shuffle(simd_t<Tin, N>{}, x, csizeseq<Nlow>, overload_auto))),
        simd_bitcast(
            simd_cvt_t<Tout, Tin, N - Nlow>{},
            unwrap_bit_value(simd_shuffle(simd_t<Tin, N>{}, x, csizeseq<N - Nlow, Nlow>, overload_auto))));
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/impl/backend_generic.hpp#L1196

simd_convert function

template <typename Tout, typename Tin,
          KFR_ENABLE_IF(!std::is_same<Tout, Tin>::value)>
simd<Tout, 1>
simd_convert(simd_cvt_t<Tout, Tin, 1>,
             const simd<Tin, 1> &x) CMT_NOEXCEPT

Converts input vector to vector with subtype Tout

Source code
template <typename Tout, typename Tin, KFR_ENABLE_IF(!std::is_same<Tout, Tin>::value)>
KFR_INTRINSIC simd<Tout, 1> simd_convert(simd_cvt_t<Tout, Tin, 1>, const simd<Tin, 1>& x) CMT_NOEXCEPT
{
    return simd_make(cometa::ctype<Tout>, static_cast<Tout>(x));
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/impl/backend_generic.hpp#L1414

template <typename Tout, typename Tin, size_t N>
simd<Tout, N>
simd_convert(simd_cvt_t<Tout, Tin, N>,
             const simd<Tin, N> &x) CMT_NOEXCEPT

Converts input vector to vector with subtype Tout

Source code
template <typename Tout, typename Tin, size_t N>
KFR_INTRINSIC simd<Tout, N> simd_convert(simd_cvt_t<Tout, Tin, N>, const simd<Tin, N>& x) CMT_NOEXCEPT
{
    constexpr size_t Nlow = prev_poweroftwo(N - 1);
    return simd_concat<Tout, Nlow, N - Nlow>(
        simd_convert(simd_cvt_t<Tout, Tin, Nlow>{},
                     simd_shuffle(simd_t<Tin, N>{}, x, csizeseq<Nlow>, overload_auto)),
        simd_convert(simd_cvt_t<Tout, Tin, N - Nlow>{},
                     simd_shuffle(simd_t<Tin, N>{}, x, csizeseq<N - Nlow, Nlow>, overload_auto)));
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/impl/backend_generic.hpp#L1421

template <typename T, size_t N>
const simd<T, N> &
simd_convert(simd_cvt_t<T, T, N>,
             const simd<T, N> &x) CMT_NOEXCEPT

Converts input vector to vector with subtype Tout

Source code
template <typename T, size_t N>
KFR_INTRINSIC const simd<T, N>& simd_convert(simd_cvt_t<T, T, N>, const simd<T, N>& x) CMT_NOEXCEPT
{
    return x;
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/impl/backend_generic.hpp#L1433

simd_undefined function

template <typename Tout, size_t N>
simd<Tout, N> simd_undefined() CMT_NOEXCEPT

Returns vector with undefined value

Source code
template <typename Tout, size_t N>
KFR_INTRINSIC simd<Tout, N> simd_undefined() CMT_NOEXCEPT
{
    not_optimized(CMT_FUNC_SIGNATURE);
    simd<Tout, N> x;
    return x;
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/impl/backend_generic.hpp#L1145

simd_zeros function

template <typename Tout, size_t N>
simd<Tout, N> simd_zeros() CMT_NOEXCEPT

Returns vector with all zeros

Source code
template <typename Tout, size_t N>
KFR_INTRINSIC simd<Tout, N> simd_zeros() CMT_NOEXCEPT
{
    not_optimized(CMT_FUNC_SIGNATURE);
    return from_simd_array<Tout, N>({ Tout() });
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/impl/backend_generic.hpp#L1154


Auto-generated from sources, Revision , https://github.com/kfrlib/kfr/blob//include/kfr/