Skip to content

Commit

Permalink
LibCrypto: Remove FIXMEs regarding possible optimizations in SHA{1,256}
Browse files Browse the repository at this point in the history
These do not bring any noticeable (>0.5%) performance improvements.
  • Loading branch information
DanShaders authored and nico committed Jul 12, 2024
1 parent 16a2511 commit 9bbadf7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
6 changes: 0 additions & 6 deletions Userland/Libraries/LibCrypto/Hash/SHA1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ template<>
auto sha_rnds4 = []<int i> [[SHA_TARGET]] (u32x4 a, u32x4 b) { return bit_cast<u32x4>(__builtin_ia32_sha1rnds4(bit_cast<i32x4>(a), bit_cast<i32x4>(b), i)); };

auto group = [&]<int i_group> [[SHA_TARGET]] () {
//" // FIXME: Trailing quote to fix syntax highlighting, somethings off with function like attributes and templated lambdas in VsCode
// FIXME: Test if unrolling the loop is worth it
// GCC: #pragma GCC unroll(5)
// Clang: #pragma unroll
for (size_t i_pack = 0; i_pack != 5; ++i_pack) {
size_t i_msg = i_group * 5 + i_pack;
if (i_msg < 4) {
Expand Down Expand Up @@ -155,8 +151,6 @@ decltype(SHA1::transform_dispatched) SHA1::transform_dispatched = [] {
return &SHA1::transform_impl<CPUFeatures::X86_SHA | CPUFeatures::X86_SSE42>;
}

// FIXME: Investigate if more target clones (avx) make sense

return &SHA1::transform_impl<CPUFeatures::None>;
}();

Expand Down
2 changes: 0 additions & 2 deletions Userland/Libraries/LibCrypto/Hash/SHA2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ decltype(SHA256::transform_dispatched) SHA256::transform_dispatched = [] {
return &SHA256::transform_impl<CPUFeatures::X86_SHA | CPUFeatures::X86_SSE42>;
}

// FIXME: Investigate if more target clones (avx) make sense

return &SHA256::transform_impl<CPUFeatures::None>;
}();

Expand Down

0 comments on commit 9bbadf7

Please sign in to comment.