diff --git a/include/simd/vector.hpp b/include/simd/vector.hpp index 8508e7dc..566b26a2 100644 --- a/include/simd/vector.hpp +++ b/include/simd/vector.hpp @@ -152,7 +152,7 @@ inline Vector::Vector(Vector a) { } inline Vector::Vector(Vector a) { - v = _mm_cvtps_epi32(a.v); + v = _mm_cvttps_epi32(a.v); } inline Vector Vector::cast(Vector a) { @@ -346,6 +346,16 @@ inline Vector operator~(const Vector& a) { return a ^ Vector::mask(); } +/** `a << b` */ +inline Vector operator<<(const Vector& a, const int& b) { + return Vector(_mm_slli_epi32(a.v, b)); +} + +/** `a >> b` */ +inline Vector operator>>(const Vector& a, const int& b) { + return Vector(_mm_srli_epi32(a.v, b)); +} + // Typedefs