Skip to content

Commit

Permalink
[TEST] use const instead of macro for const register values
Browse files Browse the repository at this point in the history
  • Loading branch information
lamphamsy committed Dec 2, 2018
1 parent 29358aa commit d1d7a3f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
20 changes: 10 additions & 10 deletions src/simd_128.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ typedef __m128i VecType;

/* ============= Constant variable ============ */

#define F4_U32 _mm_set1_epi32(65537)
#define F4_MINUS_ONE_U32 _mm_set1_epi32(65536)
#define F3_U32 _mm_set1_epi32(257)
#define F3_MINUS_ONE_U32 _mm_set1_epi32(256)
const VecType F4_U32 = _mm_set1_epi32(65537);
const VecType F4_MINUS_ONE_U32 = _mm_set1_epi32(65536);
const VecType F3_U32 = _mm_set1_epi32(257);
const VecType F3_MINUS_ONE_U32 = _mm_set1_epi32(256);

#define F3_U16 _mm_set1_epi16(257)
#define F3_MINUS_ONE_U16 _mm_set1_epi16(256)
const VecType F3_U16 = _mm_set1_epi16(257);
const VecType F3_MINUS_ONE_U16 = _mm_set1_epi16(256);

#define ZERO (_mm_setzero_si128())
#define ONE_U16 (_mm_set1_epi16(1))
#define ONE_U32 (_mm_set1_epi32(1))
const VecType ZERO = _mm_setzero_si128();
const VecType ONE_U16 = _mm_set1_epi16(1);
const VecType ONE_U32 = _mm_set1_epi32(1);

#define MASK8_LO (_mm_set1_epi16(0x80))
const VecType MASK8_LO = _mm_set1_epi16(0x80);

/* ============= Essential Operations for SSE w/ both u16 & u32 ============ */

Expand Down
20 changes: 10 additions & 10 deletions src/simd_256.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@ typedef __m128i HalfVecType;

/* ============= Constant variable ============ */

#define F4_U32 _mm256_set1_epi32(65537)
#define F4_MINUS_ONE_U32 _mm256_set1_epi32(65536)
#define F3_U32 _mm256_set1_epi32(257)
#define F3_MINUS_ONE_U32 _mm256_set1_epi32(256)
const VecType F4_U32 = _mm256_set1_epi32(65537);
const VecType F4_MINUS_ONE_U32 = _mm256_set1_epi32(65536);
const VecType F3_U32 = _mm256_set1_epi32(257);
const VecType F3_MINUS_ONE_U32 = _mm256_set1_epi32(256);

#define F3_U16 _mm256_set1_epi16(257)
#define F3_MINUS_ONE_U16 _mm256_set1_epi16(256)
const VecType F3_U16 = _mm256_set1_epi16(257);
const VecType F3_MINUS_ONE_U16 = _mm256_set1_epi16(256);

#define ZERO (_mm256_setzero_si256())
#define ONE_U16 (_mm256_set1_epi16(1))
#define ONE_U32 (_mm256_set1_epi32(1))
const VecType ZERO = _mm256_setzero_si256();
const VecType ONE_U16 = _mm256_set1_epi16(1);
const VecType ONE_U32 = _mm256_set1_epi32(1);

#define MASK8_LO (_mm256_set1_epi16(0x80))
const VecType MASK8_LO = _mm256_set1_epi16(0x80);

/* ============= Essential Operations for AVX2 w/ both u16 & u32 ============ */

Expand Down

0 comments on commit d1d7a3f

Please sign in to comment.