Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix constants for imm2 and imm4 #75

Merged
merged 1 commit into from
May 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/avx/avx_vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ impl AvxVector for __m128 {
#[inline(always)]
unsafe fn transpose3_packed(rows: [Self; 3]) -> [Self; 3] {
let unpacked0 = Self::unpacklo_complex([rows[0], rows[1]]);
let blended = _mm_blend_ps(rows[0], rows[2], 0x33);
let blended = _mm_blend_ps(rows[0], rows[2], 0x03);
let unpacked2 = Self::unpackhi_complex([rows[1], rows[2]]);

[unpacked0, blended, unpacked2]
Expand All @@ -1328,7 +1328,7 @@ impl AvxVector for __m128 {
[
Self::unpacklo_complex([rows[0], rows[1]]),
Self::unpacklo_complex([rows[2], rows[3]]),
_mm_blend_ps(rows[0], rows[4], 0x33),
_mm_blend_ps(rows[0], rows[4], 0x03),
Self::unpackhi_complex([rows[1], rows[2]]),
Self::unpackhi_complex([rows[3], rows[4]]),
]
Expand Down Expand Up @@ -1576,7 +1576,7 @@ impl AvxVector for __m256d {
#[inline(always)]
unsafe fn transpose3_packed(rows: [Self; 3]) -> [Self; 3] {
let unpacked0 = Self::unpacklo_complex([rows[0], rows[1]]);
let blended = _mm256_blend_pd(rows[0], rows[2], 0x33);
let blended = _mm256_blend_pd(rows[0], rows[2], 0x03);
let unpacked2 = Self::unpackhi_complex([rows[1], rows[2]]);

[unpacked0, blended, unpacked2]
Expand All @@ -1593,7 +1593,7 @@ impl AvxVector for __m256d {
[
Self::unpacklo_complex([rows[0], rows[1]]),
Self::unpacklo_complex([rows[2], rows[3]]),
_mm256_blend_pd(rows[0], rows[4], 0x33),
_mm256_blend_pd(rows[0], rows[4], 0x03),
Self::unpackhi_complex([rows[1], rows[2]]),
Self::unpackhi_complex([rows[3], rows[4]]),
]
Expand All @@ -1614,7 +1614,7 @@ impl AvxVector for __m256d {
Self::unpacklo_complex([rows[0], rows[1]]),
Self::unpacklo_complex([rows[2], rows[3]]),
Self::unpacklo_complex([rows[4], rows[5]]),
_mm256_blend_pd(rows[0], rows[6], 0x33),
_mm256_blend_pd(rows[0], rows[6], 0x03),
Self::unpackhi_complex([rows[1], rows[2]]),
Self::unpackhi_complex([rows[3], rows[4]]),
Self::unpackhi_complex([rows[5], rows[6]]),
Expand Down Expand Up @@ -1856,11 +1856,11 @@ impl AvxVector for __m128d {

#[inline(always)]
unsafe fn swap_complex_components(self) -> Self {
_mm_permute_pd(self, 0x05)
_mm_permute_pd(self, 0x01)
}
#[inline(always)]
unsafe fn duplicate_complex_components(self) -> (Self, Self) {
(_mm_movedup_pd(self), _mm_permute_pd(self, 0x0F))
(_mm_movedup_pd(self), _mm_permute_pd(self, 0x03))
}

#[inline(always)]
Expand Down