diff --git a/changelog.txt b/changelog.txt index bb6c9ea..93cd749 100644 --- a/changelog.txt +++ b/changelog.txt @@ -157,7 +157,7 @@ Change log for Vector class library * constructors to make boolean vectors from their elements * constructors and = operators to broadcast boolean scalar into boolean vectors * various lookup functions improved - * operators &, |, ^, ~, etc. defined for various boolean vectors to avoid converson + * operators &, |, ^, ~, etc. defined for various boolean vectors to avoid conversion to integer vectors * nmul_add functions * mul_add etc. moved to main header files diff --git a/instrset.h b/instrset.h index ad37920..d1204ed 100644 --- a/instrset.h +++ b/instrset.h @@ -105,7 +105,7 @@ // Header files for non-vector intrinsic functions including _BitScanReverse(int), __cpuid(int[4],int), _xgetbv(int) #ifdef _MSC_VER // Microsoft compiler or compatible Intel compiler #include -#pragma warning(disable: 6323 4514 4710 4711) // Diasble annoying warnings +#pragma warning(disable: 6323 4514 4710 4711) // Disable annoying warnings #else #include // Gcc or Clang compiler #endif @@ -182,7 +182,7 @@ Additional problem: The version number is not consistent across platforms. The A different version numbers. We have to rely on __apple_build_version__ on the Mac platform: http://llvm.org/bugs/show_bug.cgi?id=12643 We have to make switches here when - hopefully - the error some day has been fixed. -We need different version checks with and whithout __apple_build_version__ +We need different version checks with and without __apple_build_version__ */ #if (defined (__clang__) || defined(__apple_build_version__)) && !defined(__INTEL_COMPILER) #define FIX_CLANG_VECTOR_ALIAS_AMBIGUITY @@ -1235,7 +1235,7 @@ constexpr uint64_t blend_flags(int const (&a)[V::size()]) { // blend_perm_indexes: return an Indexlist for implementing a blend function as // two permutations. N = vector size. // dozero = 0: let unused elements be don't care. The two permutation results must be blended -// dozero = 1: zero unused elements in each permuation. The two permutation results can be OR'ed +// dozero = 1: zero unused elements in each permutation. The two permutation results can be OR'ed // dozero = 2: indexes that are -1 or V_DC are preserved template constexpr EList blend_perm_indexes(int const (&a)[N]) { @@ -1321,7 +1321,7 @@ constexpr EList largeblock_indexes(int const (&a)[N]) { * ****************************************************************************************/ -// Make dummy blend function templates to avoid error messages when the blend funtions are not yet defined +// Make dummy blend function templates to avoid error messages when the blend functions are not yet defined template void blend2(){} template void blend4(){} template void blend8(){} @@ -1331,7 +1331,7 @@ template void blend32(){} // blend_half_indexes: return an Indexlist for emulating a blend function as // blends or permutations from multiple sources // dozero = 0: let unused elements be don't care. Multiple permutation results must be blended -// dozero = 1: zero unused elements in each permuation. Multiple permutation results can be OR'ed +// dozero = 1: zero unused elements in each permutation. Multiple permutation results can be OR'ed // dozero = 2: indexes that are -1 or V_DC are preserved // src1, src2: sources to blend in a partial implementation template diff --git a/vector_convert.h b/vector_convert.h index d6caf5b..8c51d46 100644 --- a/vector_convert.h +++ b/vector_convert.h @@ -6,7 +6,7 @@ * Project: vector class library * Description: * Header file for conversion between different vector classes with different -* sizes. Also includes verious generic template functions. +* sizes. Also includes various generic template functions. * * (c) Copyright 2012-2022 Agner Fog. * Apache License version 2.0 or later. diff --git a/vectorf128.h b/vectorf128.h index 4d8011b..1abfcee 100644 --- a/vectorf128.h +++ b/vectorf128.h @@ -140,7 +140,7 @@ class Vec4fb { but apparently the problem has come back. The aliasing of vector types has been reported on __apple_build_version__ = 8000042 We have to make switches here when - hopefully - the error some day has been fixed. - We need different version checks with and whithout __apple_build_version__ + We need different version checks with and without __apple_build_version__ */ #ifndef FIX_CLANG_VECTOR_ALIAS_AMBIGUITY // Type cast operator to convert to type Vec4ib used as Boolean for integer vectors @@ -1404,7 +1404,7 @@ static inline Vec4f exp2(Vec4i const n) { //static Vec4f exp2(Vec4f const x); // defined in vectormath_exp.h -// Control word manipulaton +// Control word manipulation // ------------------------ // The MXCSR control word has the following bits: // 0: Invalid Operation Flag diff --git a/vectori128.h b/vectori128.h index 4403c08..ec5cf43 100644 --- a/vectori128.h +++ b/vectori128.h @@ -4076,7 +4076,7 @@ static inline Vec2q operator * (Vec2q const a, Vec2q const b) { int64_t aa[2], bb[2]; a.store(aa); // split into elements b.store(bb); - return Vec2q(aa[0] * bb[0], aa[1] * bb[1]); // multiply elements separetely + return Vec2q(aa[0] * bb[0], aa[1] * bb[1]); // multiply elements separately #endif } diff --git a/vectori256.h b/vectori256.h index d96776a..34fdb91 100644 --- a/vectori256.h +++ b/vectori256.h @@ -795,7 +795,7 @@ static inline Vec32c operator >> (Vec32c const a, int b) { #endif } -// vector operator >>= : shift right artihmetic +// vector operator >>= : shift right arithmetic static inline Vec32c & operator >>= (Vec32c & a, int b) { a = a >> b; return a; @@ -1139,7 +1139,7 @@ static inline Vec32uc operator >> (Vec32uc const a, int32_t b) { return a >> (uint32_t)b; } -// vector operator >>= : shift right artihmetic +// vector operator >>= : shift right arithmetic static inline Vec32uc & operator >>= (Vec32uc & a, uint32_t b) { a = a >> b; return a; @@ -1984,7 +1984,7 @@ static inline Vec16us operator >> (Vec16us const a, int32_t b) { return a >> (uint32_t)b; } -// vector operator >>= : shift right artihmetic +// vector operator >>= : shift right arithmetic static inline Vec16us & operator >>= (Vec16us & a, uint32_t b) { a = a >> b; return a; @@ -3700,7 +3700,7 @@ static inline Vec4uq operator >> (Vec4uq const a, uint32_t b) { static inline Vec4uq operator >> (Vec4uq const a, int32_t b) { return a >> (uint32_t)b; } -// vector operator >>= : shift right artihmetic +// vector operator >>= : shift right arithmetic static inline Vec4uq & operator >>= (Vec4uq & a, uint32_t b) { a = a >> b; return a; @@ -5389,7 +5389,7 @@ static inline Vec8i operator / (Vec8i const a, Divisor_i const d) { __m256i t4 = _mm256_mul_epi32(t3,m); // 32x32->64 bit signed multiplication of odd elements __m256i t7 = _mm256_blend_epi32(t2,t4,0xAA); __m256i t8 = _mm256_add_epi32(t7,a); // add - __m256i t9 = _mm256_sra_epi32(t8,d.gets1()); // shift right artihmetic + __m256i t9 = _mm256_sra_epi32(t8,d.gets1()); // shift right arithmetic __m256i t10 = _mm256_srai_epi32(a,31); // sign of a __m256i t11 = _mm256_sub_epi32(t10,sgn); // sign of a - sign of d __m256i t12 = _mm256_sub_epi32(t9,t11); // + 1 if a < 0, -1 if d < 0 @@ -5416,7 +5416,7 @@ static inline Vec16s operator / (Vec16s const a, Divisor_s const d) { __m256i sgn = _mm256_broadcastq_epi64(d.getsign()); // broadcast sign of d __m256i t1 = _mm256_mulhi_epi16(a, m); // multiply high signed words __m256i t2 = _mm256_add_epi16(t1,a); // + a - __m256i t3 = _mm256_sra_epi16(t2,d.gets1()); // shift right artihmetic + __m256i t3 = _mm256_sra_epi16(t2,d.gets1()); // shift right arithmetic __m256i t4 = _mm256_srai_epi16(a,15); // sign of a __m256i t5 = _mm256_sub_epi16(t4,sgn); // sign of a - sign of d __m256i t6 = _mm256_sub_epi16(t3,t5); // + 1 if a < 0, -1 if d < 0 diff --git a/vectori256e.h b/vectori256e.h index 4b9eff9..36fe359 100644 --- a/vectori256e.h +++ b/vectori256e.h @@ -564,7 +564,7 @@ static inline Vec32c operator >> (Vec32c const a, int b) { return Vec32c(a.get_low() >> b, a.get_high() >> b); } -// vector operator >>= : shift right artihmetic +// vector operator >>= : shift right arithmetic static inline Vec32c & operator >>= (Vec32c & a, int b) { a = a >> b; return a; @@ -839,7 +839,7 @@ static inline Vec32uc operator >> (Vec32uc const a, int32_t b) { return a >> (uint32_t)b; } -// vector operator >>= : shift right artihmetic +// vector operator >>= : shift right arithmetic static inline Vec32uc & operator >>= (Vec32uc & a, uint32_t b) { a = a >> b; return a; @@ -1566,7 +1566,7 @@ static inline Vec16us operator >> (Vec16us const a, int b) { return a >> (uint32_t)b; } -// vector operator >>= : shift right artihmetic +// vector operator >>= : shift right arithmetic static inline Vec16us & operator >>= (Vec16us & a, uint32_t b) { a = a >> b; return a; @@ -3007,7 +3007,7 @@ static inline Vec4uq operator >> (Vec4uq const a, int32_t b) { return a >> (uint32_t)b; } -// vector operator >>= : shift right artihmetic +// vector operator >>= : shift right arithmetic static inline Vec4uq & operator >>= (Vec4uq & a, uint32_t b) { a = a >> b; return a; diff --git a/vectori512.h b/vectori512.h index 97ec144..f12a375 100644 --- a/vectori512.h +++ b/vectori512.h @@ -1180,7 +1180,7 @@ static inline Vec8uq operator >> (Vec8uq const a, uint32_t b) { static inline Vec8uq operator >> (Vec8uq const a, int32_t b) { return a >> (uint32_t)b; } -// vector operator >>= : shift right artihmetic +// vector operator >>= : shift right arithmetic static inline Vec8uq & operator >>= (Vec8uq & a, uint32_t b) { a = a >> b; return a; @@ -1993,7 +1993,7 @@ static inline Vec16i operator / (Vec16i const a, Divisor_i const d) { __m512i t2 = _mm512_srli_epi64(t1,32); // dword of even index results __m512i t7 = _mm512_mask_mov_epi32(t2, 0xAAAA, t4); // blend two results __m512i t8 = _mm512_add_epi32(t7,a); // add - __m512i t9 = _mm512_sra_epi32(t8,d.gets1()); // shift right artihmetic + __m512i t9 = _mm512_sra_epi32(t8,d.gets1()); // shift right arithmetic __m512i t10 = _mm512_srai_epi32(a,31); // sign of a __m512i t11 = _mm512_sub_epi32(t10,sgn); // sign of a - sign of d __m512i t12 = _mm512_sub_epi32(t9,t11); // + 1 if a < 0, -1 if d < 0 diff --git a/vectori512e.h b/vectori512e.h index 1e04df1..0b391b8 100644 --- a/vectori512e.h +++ b/vectori512e.h @@ -1649,7 +1649,7 @@ static inline Vec8uq operator >> (Vec8uq const a, int32_t b) { return a >> (uint32_t)b; } -// vector operator >>= : shift right artihmetic +// vector operator >>= : shift right arithmetic static inline Vec8uq & operator >>= (Vec8uq & a, uint32_t b) { a = a >> b; return a; diff --git a/vectori512s.h b/vectori512s.h index 1902e7d..2fea08b 100644 --- a/vectori512s.h +++ b/vectori512s.h @@ -1546,7 +1546,7 @@ static inline Vec64c permute64(Vec64c const a) { EList u = {{0}}; // list to return for (int i = 0; i < 64; i += 2) { // loop through even indexes uint16_t ix = indexs[i] & 63; - // source bytes with odd position are in opposite 16-bit word becase of 32-bit rotation + // source bytes with odd position are in opposite 16-bit word because of 32-bit rotation u.a[i>>1] = ((ix >> 1) ^ (ix & 1)) | (((ix & 1) ^ 1) << 5); } return u; @@ -2077,7 +2077,7 @@ static inline Vec32s operator / (Vec32s const a, Divisor_s const d) { __m512i sgn = _mm512_broadcastq_epi64(d.getsign()); // broadcast sign of d __m512i t1 = _mm512_mulhi_epi16(a, m); // multiply high signed words __m512i t2 = _mm512_add_epi16(t1,a); // + a - __m512i t3 = _mm512_sra_epi16(t2,d.gets1()); // shift right artihmetic + __m512i t3 = _mm512_sra_epi16(t2,d.gets1()); // shift right arithmetic __m512i t4 = _mm512_srai_epi16(a,15); // sign of a __m512i t5 = _mm512_sub_epi16(t4,sgn); // sign of a - sign of d __m512i t6 = _mm512_sub_epi16(t3,t5); // + 1 if a < 0, -1 if d < 0