Compare commits

..

No commits in common. "a303e50395607bbd234d594c07732a77a9a4b8e9" and "23b5a2aa0ed56846caf786922112d22687837c89" have entirely different histories.

3 changed files with 6 additions and 19 deletions

View File

@ -29,7 +29,6 @@ __m128 Norm<E>::eval() const noexcept
}
template<vector_expression E>
TNVX_INLINE
Norm<E> norm(const Expr<E>& e) noexcept
{
return { e.self() };

View File

@ -28,10 +28,10 @@ struct alignas(16) vec4 : Expr<vec4>
__m128 eval() const noexcept;
[[nodiscard]] inline
auto magnitude() const noexcept;
float magnitude() const noexcept;
[[nodiscard]] inline
auto norm() const noexcept;
vec4 norm() const noexcept;
[[nodiscard]] inline
float x() const noexcept;

View File

@ -35,29 +35,17 @@ __m128 vec4::eval() const noexcept
}
TNVX_INLINE
auto vec4::magnitude() const noexcept
float vec4::magnitude() const noexcept
{
return Magnitude<vec4>(*this);
return _mm_cvtss_f32(Magnitude<vec4>(*this).eval());
}
TNVX_INLINE
auto vec4::norm() const noexcept
vec4 vec4::norm() const noexcept
{
return Norm<vec4>(*this);
return { Norm<vec4>(*this) };
}
//TNVX_INLINE
//Magnitude<vec4> vec4::magnitude() const noexcept
//{
// return { *this };
//}
//
//TNVX_INLINE
//Norm<vec4> vec4::norm() const noexcept
//{
// return { *this };
//}
TNVX_INLINE
float vec4::x() const noexcept
{