Browse Source

Fix int32_4 bitshift intrinsics.

tags/v2.2.0
Andrew Belt 2 years ago
parent
commit
b09c58c492
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      include/simd/Vector.hpp
  2. +1
    -1
      include/simd/common.hpp

+ 2
- 2
include/simd/Vector.hpp View File

@@ -324,12 +324,12 @@ inline Vector<int32_t, 4> operator~(const Vector<int32_t, 4>& a) {


/** `a << b` */ /** `a << b` */
inline Vector<int32_t, 4> operator<<(const Vector<int32_t, 4>& a, const int& b) { inline Vector<int32_t, 4> operator<<(const Vector<int32_t, 4>& a, const int& b) {
return Vector<int32_t, 4>(_mm_slli_epi32(a.v, b));
return Vector<int32_t, 4>(_mm_sll_epi32(a.v, _mm_cvtsi32_si128(b)));
} }


/** `a >> b` */ /** `a >> b` */
inline Vector<int32_t, 4> operator>>(const Vector<int32_t, 4>& a, const int& b) { inline Vector<int32_t, 4> operator>>(const Vector<int32_t, 4>& a, const int& b) {
return Vector<int32_t, 4>(_mm_srli_epi32(a.v, b));
return Vector<int32_t, 4>(_mm_srl_epi32(a.v, _mm_cvtsi32_si128(b)));
} }






+ 1
- 1
include/simd/common.hpp View File

@@ -1,4 +1,4 @@
#pragma once #pragma once


#define SIMDE_ENABLE_NATIVE_ALIASES #define SIMDE_ENABLE_NATIVE_ALIASES
#include <simde/x86/sse3.h>
#include <simde/x86/sse4.2.h>

Loading…
Cancel
Save