forked from trcrsired/fast_io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trcrsired:master' into master
- Loading branch information
Showing
18 changed files
with
8,209 additions
and
1,212 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
1,302 changes: 1,302 additions & 0 deletions
1,302
benchmark/0012.isa/sha512_loongarch64_clang_nosimd.s
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#pragma once | ||
|
||
namespace fast_io | ||
{ | ||
|
||
template <::std::integral char_type> | ||
struct basic_bsd_arc4random | ||
{ | ||
public: | ||
using input_char_type = char_type; | ||
constexpr void close() noexcept | ||
{} | ||
}; | ||
|
||
template <::std::integral char_type> | ||
inline constexpr basic_bsd_arc4random<char_type> input_stream_ref_define(basic_bsd_arc4random<char_type> barc4) noexcept | ||
{ | ||
return barc4; | ||
} | ||
|
||
using bsd_arc4random = basic_bsd_arc4random<char>; | ||
|
||
template <::std::integral char_type> | ||
inline constexpr void input_stream_require_secure_clear_define(basic_bsd_arc4random<char_type>) noexcept | ||
{ | ||
} | ||
|
||
#if !defined(__GLIBC__) || (defined(__GLIBC__) && __GLIBC_PREREQ(2,36)) | ||
namespace details | ||
{ | ||
|
||
inline void bsd_arc4random_read_all_bytes_define_impl(::std::byte *first, ::std::byte *last) noexcept | ||
{ | ||
::fast_io::noexcept_call(arc4random_buf, first, static_cast<::std::size_t>(last-first)); | ||
} | ||
|
||
} | ||
|
||
template <::std::integral char_type> | ||
inline void read_all_bytes_underflow_define(basic_bsd_arc4random<char_type>, ::std::byte *first, | ||
::std::byte *last) noexcept | ||
{ | ||
::fast_io::details::bsd_arc4random_read_all_bytes_define_impl(first, last); | ||
} | ||
|
||
#else | ||
|
||
namespace details | ||
{ | ||
[[__gnu__::__weak__]] | ||
extern void glibc_arc4random_buf(void *, size_t) noexcept __asm__("arc4random_buf"); | ||
|
||
inline ::std::byte* bsd_arc4random_read_some_bytes_define_impl(::std::byte* first, ::std::byte* last) | ||
{ | ||
constexpr auto *glibc_arc4random_bufptr{::fast_io::details::glibc_arc4random_buf}; | ||
if (glibc_arc4random_bufptr==nullptr) | ||
{ | ||
return ::fast_io::details::linux_getrandom_read_some_bytes_define_impl(0,first,last); | ||
} | ||
else | ||
{ | ||
glibc_arc4random_bufptr(first,static_cast<::std::size_t>(last-first)); | ||
return last; | ||
} | ||
} | ||
} | ||
|
||
template <::std::integral char_type> | ||
inline ::std::byte* read_some_bytes_underflow_define(basic_bsd_arc4random<char_type>, ::std::byte *first, | ||
::std::byte *last) | ||
{ | ||
return ::fast_io::details::bsd_arc4random_read_some_bytes_define_impl(first, last); | ||
} | ||
|
||
#endif | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters