From 4ab6377c5f8cb9d56fbaad9d91e11f30c83cc550 Mon Sep 17 00:00:00 2001 From: "James D. Mitchell" Date: Sun, 29 Oct 2023 17:01:39 +0000 Subject: [PATCH] Formatting --- include/hpcombi/epu.hpp | 12 +++++++++--- include/hpcombi/epu_impl.hpp | 30 +++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/include/hpcombi/epu.hpp b/include/hpcombi/epu.hpp index 3f99db02..0276dc62 100644 --- a/include/hpcombi/epu.hpp +++ b/include/hpcombi/epu.hpp @@ -157,7 +157,9 @@ inline const VectGeneric<16> &as_VectGeneric(const epu8 &v) { /** Test whether all the entries of a #HPCombi::epu8 are zero */ inline bool is_all_zero(epu8 a) noexcept { return simde_mm_testz_si128(a, a); } /** Test whether all the entries of a #HPCombi::epu8 are one */ -inline bool is_all_one(epu8 a) noexcept { return simde_mm_testc_si128(a, Epu8(0xFF)); } +inline bool is_all_one(epu8 a) noexcept { + return simde_mm_testc_si128(a, Epu8(0xFF)); +} /** Equality of #HPCombi::epu8 */ inline bool equal(epu8 a, epu8 b) noexcept { @@ -167,11 +169,15 @@ inline bool equal(epu8 a, epu8 b) noexcept { inline bool not_equal(epu8 a, epu8 b) noexcept { return !equal(a, b); } /** Permuting a #HPCombi::epu8 */ -inline epu8 permuted(epu8 a, epu8 b) noexcept { return simde_mm_shuffle_epi8(a, b); } +inline epu8 permuted(epu8 a, epu8 b) noexcept { + return simde_mm_shuffle_epi8(a, b); +} /** Left shifted of a #HPCombi::epu8 inserting a 0 * @warning we use the convention that the 0 entry is on the left ! */ -inline epu8 shifted_right(epu8 a) noexcept { return simde_mm_bslli_si128(a, 1); } +inline epu8 shifted_right(epu8 a) noexcept { + return simde_mm_bslli_si128(a, 1); +} /** Right shifted of a #HPCombi::epu8 inserting a 0 * @warning we use the convention that the 0 entry is on the left ! */ diff --git a/include/hpcombi/epu_impl.hpp b/include/hpcombi/epu_impl.hpp index d89ef989..c7369458 100644 --- a/include/hpcombi/epu_impl.hpp +++ b/include/hpcombi/epu_impl.hpp @@ -188,16 +188,20 @@ inline bool is_sorted(epu8 a) noexcept { inline epu8 sorted(epu8 a) noexcept { return network_sort(a, sorting_rounds); } -inline epu8 sorted8(epu8 a) noexcept { return network_sort(a, sorting_rounds8); } -inline epu8 revsorted(epu8 a) noexcept { return network_sort(a, sorting_rounds); } +inline epu8 sorted8(epu8 a) noexcept { + return network_sort(a, sorting_rounds8); +} +inline epu8 revsorted(epu8 a) noexcept { + return network_sort(a, sorting_rounds); +} inline epu8 revsorted8(epu8 a) noexcept { return network_sort(a, sorting_rounds8); } -inline epu8 sort_perm(epu8 &a) noexcept{ +inline epu8 sort_perm(epu8 &a) noexcept { return network_sort_perm(a, sorting_rounds); } -inline epu8 sort8_perm(epu8 &a) noexcept{ +inline epu8 sort8_perm(epu8 &a) noexcept { return network_sort_perm(a, sorting_rounds8); } @@ -297,7 +301,9 @@ inline uint8_t horiz_sum_ref(epu8 v) noexcept { res += v[i]; return res; } -inline uint8_t horiz_sum_gen(epu8 v) noexcept { return as_VectGeneric(v).horiz_sum(); } +inline uint8_t horiz_sum_gen(epu8 v) noexcept { + return as_VectGeneric(v).horiz_sum(); +} inline uint8_t horiz_sum4(epu8 v) noexcept { return partial_sums_round(v)[15]; } inline uint8_t horiz_sum3(epu8 v) noexcept { auto sr = summing_rounds; @@ -330,7 +336,9 @@ inline uint8_t horiz_max_ref(epu8 v) noexcept { res = std::max(res, v[i]); return res; } -inline uint8_t horiz_max_gen(epu8 v) noexcept { return as_VectGeneric(v).horiz_max(); } +inline uint8_t horiz_max_gen(epu8 v) noexcept { + return as_VectGeneric(v).horiz_max(); +} inline uint8_t horiz_max4(epu8 v) noexcept { return partial_max_round(v)[15]; } inline uint8_t horiz_max3(epu8 v) noexcept { auto sr = summing_rounds; @@ -363,7 +371,9 @@ inline uint8_t horiz_min_ref(epu8 v) noexcept { res = std::min(res, v[i]); return res; } -inline uint8_t horiz_min_gen(epu8 v) noexcept { return as_VectGeneric(v).horiz_min(); } +inline uint8_t horiz_min_gen(epu8 v) noexcept { + return as_VectGeneric(v).horiz_min(); +} inline uint8_t horiz_min4(epu8 v) noexcept { return partial_min_round(v)[15]; } inline uint8_t horiz_min3(epu8 v) noexcept { auto sr = mining_rounds; @@ -498,13 +508,15 @@ inline std::string to_string(HPCombi::epu8 const &a) { } template <> struct equal_to { - bool operator()(const HPCombi::epu8 &lhs, const HPCombi::epu8 &rhs) const noexcept { + bool operator()(const HPCombi::epu8 &lhs, + const HPCombi::epu8 &rhs) const noexcept { return HPCombi::equal(lhs, rhs); } }; template <> struct not_equal_to { - bool operator()(const HPCombi::epu8 &lhs, const HPCombi::epu8 &rhs) const noexcept { + bool operator()(const HPCombi::epu8 &lhs, + const HPCombi::epu8 &rhs) const noexcept { return HPCombi::not_equal(lhs, rhs); } };