#pragma once #include #include "_vectorize.hpp" namespace glm { namespace detail { template struct compute_vec_add {}; template struct compute_vec_sub {}; template struct compute_vec_mul {}; template struct compute_vec_div {}; template struct compute_vec_mod {}; template struct compute_splat {}; template struct compute_vec_and {}; template struct compute_vec_or {}; template struct compute_vec_xor {}; template struct compute_vec_shift_left {}; template struct compute_vec_shift_right {}; template struct compute_vec_equal {}; template struct compute_vec_nequal {}; template struct compute_vec_bitwise_not {}; template struct compute_vec_add { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) { return detail::functor2::call(std::plus(), a, b); } }; template struct compute_vec_sub { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) { return detail::functor2::call(std::minus(), a, b); } }; template struct compute_vec_mul { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) { return detail::functor2::call(std::multiplies(), a, b); } }; template struct compute_vec_div { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) { return detail::functor2::call(std::divides(), a, b); } }; template struct compute_vec_mod { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) { return detail::functor2::call(std::modulus(), a, b); } }; template struct compute_vec_and { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) { vec v(a); for (length_t i = 0; i < L; ++i) v[i] &= static_cast(b[i]); return v; } }; template struct compute_vec_or { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) { vec v(a); for (length_t i = 0; i < L; ++i) v[i] |= static_cast(b[i]); return v; } }; template struct compute_vec_xor { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) { vec v(a); for (length_t i = 0; i < L; ++i) v[i] ^= static_cast(b[i]); return v; } }; template struct compute_vec_shift_left { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) { vec v(a); for (length_t i = 0; i < L; ++i) v[i] <<= static_cast(b[i]); return v; } }; template struct compute_vec_shift_right { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) { vec v(a); for (length_t i = 0; i < L; ++i) v[i] >>= static_cast(b[i]); return v; } }; template struct compute_vec_equal { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(vec const& v1, vec const& v2) { bool b = true; for (length_t i = 0; i < L; ++i) b = b && detail::compute_equal::is_iec559>::call(v1.x, v2.x); return b; } }; template struct compute_vec_nequal { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { return !compute_vec_equal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); } }; template struct compute_vec_bitwise_not { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a) { vec v(a); for (length_t i = 0; i < L; ++i) v[i] = ~v[i]; return v; } }; } }