Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
franziskuskiefer committed May 17, 2024
1 parent 13de53d commit c0ebb12
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions polynomials-avx2/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ pub(crate) fn mm_set_epi8(
) -> __m128i {
unsafe {
_mm_set_epi8(
byte15, byte14, byte13, byte12, byte11, byte10,
byte9, byte8, byte7, byte6, byte5, byte4, byte3, byte2, byte1, byte0,
byte15, byte14, byte13, byte12, byte11, byte10, byte9, byte8, byte7, byte6, byte5,
byte4, byte3, byte2, byte1, byte0,
)
}
}
Expand Down
24 changes: 10 additions & 14 deletions polynomials-avx2/src/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,13 @@ pub(crate) fn serialize_4(vector: __m256i) -> [u8; 8] {
let adjacent_8_combined = mm256_shuffle_epi8(
adjacent_2_combined,
mm256_set_epi8(
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, 8, 4, 0, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 12, 8, 4, 0,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, 8, 4, 0, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 12, 8, 4, 0,
),
);

let combined = mm256_permutevar8x32_epi32(
adjacent_8_combined,
mm256_set_epi32(0, 0, 0, 0, 0, 0, 4, 0),
);
let combined =
mm256_permutevar8x32_epi32(adjacent_8_combined, mm256_set_epi32(0, 0, 0, 0, 0, 0, 4, 0));
let combined = mm256_castsi256_si128(combined);

mm_storeu_bytes_si128(&mut serialized[..], combined);
Expand Down Expand Up @@ -247,8 +245,8 @@ pub(crate) fn serialize_10(vector: __m256i) -> [u8; 20] {
let adjacent_8_combined = mm256_shuffle_epi8(
adjacent_4_combined,
mm256_set_epi8(
-1, -1, -1, -1, -1, -1, 12, 11, 10, 9, 8, 4, 3, 2, 1, 0, -1, -1, -1, -1, -1, -1,
12, 11, 10, 9, 8, 4, 3, 2, 1, 0,
-1, -1, -1, -1, -1, -1, 12, 11, 10, 9, 8, 4, 3, 2, 1, 0, -1, -1, -1, -1, -1, -1, 12,
11, 10, 9, 8, 4, 3, 2, 1, 0,
),
);

Expand Down Expand Up @@ -343,17 +341,15 @@ pub(crate) fn serialize_12(vector: __m256i) -> [u8; 24] {
),
);

let adjacent_4_combined = mm256_sllv_epi32(
adjacent_2_combined,
mm256_set_epi32(0, 8, 0, 8, 0, 8, 0, 8),
);
let adjacent_4_combined =
mm256_sllv_epi32(adjacent_2_combined, mm256_set_epi32(0, 8, 0, 8, 0, 8, 0, 8));
let adjacent_4_combined = mm256_srli_epi64::<8>(adjacent_4_combined);

let adjacent_8_combined = mm256_shuffle_epi8(
adjacent_4_combined,
mm256_set_epi8(
-1, -1, -1, -1, 13, 12, 11, 10, 9, 8, 5, 4, 3, 2, 1, 0, -1, -1, -1, -1, 13, 12, 11,
10, 9, 8, 5, 4, 3, 2, 1, 0,
-1, -1, -1, -1, 13, 12, 11, 10, 9, 8, 5, 4, 3, 2, 1, 0, -1, -1, -1, -1, 13, 12, 11, 10,
9, 8, 5, 4, 3, 2, 1, 0,
),
);

Expand Down

0 comments on commit c0ebb12

Please sign in to comment.