diff --git a/README.md b/README.md index cd22cbc..8154bf4 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,7 @@ git clone https://rcxpony.name/rcxpony/yggm.git && cd yggm cmake -B build && cmake --build build -j$(nproc) build/yggm -t 10 ``` +# ToDo +- [x] Support for avx2 +- [ ] Support for sse4 +# \ No newline at end of file diff --git a/sources/main.cpp b/sources/main.cpp index 8d95e08..11f8908 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -89,18 +89,7 @@ void getRawAddress(int lErase, Key& InvertedPublicKey, Address& rawAddr) { _mm256_storeu_si256(reinterpret_cast<__m256i*>(inverted), chunk); } [[nodiscard]] inline unsigned char zeroCounter(unsigned int x) noexcept { -#if defined(__GNUC__) || defined(__clang__) - if (x == 0) - return 32; - return static_cast(__builtin_clz(x)); -#else - unsigned char zeros = 0; - for (uint32_t mask = 0x80000000; mask; mask >>= 1) { - if (x & mask) break; - zeros++; - } - return zeros; -#endif + return x == 0 ? 32 : static_cast(__builtin_clz(x)); } [[nodiscard]] inline unsigned char getZeros(const Key& value) noexcept { unsigned char leadZeros = 0; @@ -146,7 +135,7 @@ void miner_thread() noexcept { conf.high = ones; bitwiseInverse(keys.PublicKey, inv); getRawAddress(ones, inv, rawAddr); - printf("\nIPv6:\t%s/%d\nPK:\t%s\nSK:\t%s\n", getAddress(rawAddr), ones, keyToString(keys.PublicKey).c_str(), keyToString(keys.PrivateKey).c_str()); + printf("\nIPv6:\t%s\nPK:\t%s\nSK:\t%s\n", getAddress(rawAddr), keyToString(keys.PublicKey).c_str(), keyToString(keys.PrivateKey).c_str()); } } }