diff --git a/src/simd_128.h b/src/simd_128.h index db23be43..5826bb65 100644 --- a/src/simd_128.h +++ b/src/simd_128.h @@ -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 ============ */ diff --git a/src/simd_256.h b/src/simd_256.h index 4539fc34..e8304b78 100644 --- a/src/simd_256.h +++ b/src/simd_256.h @@ -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 ============ */