Skip to content

Commit

Permalink
Add test for __builtin_ia32_vperm2f128_pd256/_mm256_permute2f128_pd
Browse files Browse the repository at this point in the history
  • Loading branch information
Kriskras99 committed Oct 23, 2024
1 parent a50178d commit 2bd33e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/simd.x86_64/src/test_x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ impl PartialEq for ShuffleVectors {
b: u128,
c: u128,
d: (u128, u128),
ep: (u128, u128),
e: (u128, u128),
f: u128,
g: u128,
Expand Down
9 changes: 8 additions & 1 deletion tests/simd.x86_64/src/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ typedef struct {
__m128d c;
__m256 d;
__m256d e;
__m256d ep;
__m128i f, g, h, o;
#ifdef __AVX2__
__m256i i, j, k;
Expand Down Expand Up @@ -48,6 +49,7 @@ void zero_init_all(void) {
__m256 b;
__m128d c;
__m128i d;
__m256d ep;
__m256d e;
__m256i f;
#ifdef MMX
Expand All @@ -65,6 +67,7 @@ ShuffleVectors call_all(void) {
__m256d e = _mm256_set_pd(1.1, 2.2, 3.3, 4.4);
__m128i f = _mm_set1_epi8(123);
__m256i g = _mm256_set_epi32(14, 18, 22, 33, -11, -3, 8, 300);
__m256d h = _mm256_set_pd(5.5, 6.6, 7.7, 8.8);

ShuffleVectors sv = {
#ifdef MMX
Expand All @@ -76,6 +79,7 @@ ShuffleVectors call_all(void) {
_mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 2, 1, 0)),
_mm_shuffle_pd(b, b, (1 << 1 | 1 << 0)),
_mm256_shuffle_ps(d, d, _MM_SHUFFLE(1, 2, 2, 1)),
_mm256_permute2f128_pd(e, h, 0x31),
_mm256_shuffle_pd(e, e, (1 << 3 | 1 << 2 | 0 << 1 | 0 << 0)),
_mm_shuffle_epi32(f, _MM_SHUFFLE(1, 0, 0, 1)),
_mm_shufflehi_epi16(f, _MM_SHUFFLE(0, 1, 2, 3)),
Expand Down Expand Up @@ -112,6 +116,7 @@ ShuffleVectors call_all_used(void) {
__m256d ee = _mm256_set_pd(4.4, 3.3, 2.2, 1.1);
__m128i ff = _mm_set1_epi8(13);
__m256i gg = _mm256_set_epi32(-12, 33, 44, 100, -44, 42, -33, -100);
__m256d hh = _mm256_set_pd(5.5, 6.6, 7.7, 8.8);

#ifdef MMX
__m64 a;
Expand All @@ -120,6 +125,7 @@ ShuffleVectors call_all_used(void) {
__m128d c;
__m256 d;
__m256d e;
__m256d ep;
__m128i f, g, h, o;
__m256i i, j, k;
#ifdef MMX
Expand All @@ -140,6 +146,7 @@ ShuffleVectors call_all_used(void) {
b = _mm_shuffle_ps(aa, aa, _MM_SHUFFLE(3, 2, 1, 0));
c = _mm_shuffle_pd(bb, bb, (1 << 1 | 1 << 0));
d = _mm256_shuffle_ps(dd, dd, _MM_SHUFFLE(1, 2, 2, 1));
ep = _mm256_permute2f128_pd(ee, hh, 0x31),
e = _mm256_shuffle_pd(ee, ee, (1 << 3 | 1 << 2 | 0 << 1 | 0 << 0));
f = _mm_shuffle_epi32(ff, _MM_SHUFFLE(1, 0, 0, 1));
g = _mm_shufflehi_epi16(f, _MM_SHUFFLE(0, 1, 2, 3));
Expand Down Expand Up @@ -167,7 +174,7 @@ ShuffleVectors call_all_used(void) {
#ifdef MMX
a,
#endif
b, c, d, e, f, g, h, o,
b, c, d, e, ep, f, g, h, o,

#ifdef __AVX2__
i, j, k,
Expand Down

0 comments on commit 2bd33e1

Please sign in to comment.