mirror of
https://github.com/xmrig/xmrig.git
synced 2024-12-23 03:59:41 +00:00
Merge pull request #2216 from SChernykh/dev
Optimize cn-heavy in GCC builds
This commit is contained in:
commit
6c417eb9af
1 changed files with 11 additions and 1 deletions
|
@ -740,7 +740,17 @@ inline void cryptonight_single_hash(const uint8_t *__restrict__ input, size_t si
|
|||
if (props.isHeavy()) {
|
||||
int64_t n = ((int64_t*)&l0[interleaved_index<interleave>(idx0 & MASK)])[0];
|
||||
int64_t d = ((int32_t*)&l0[interleaved_index<interleave>(idx0 & MASK)])[2];
|
||||
int64_t q = n / (d | 0x5);
|
||||
|
||||
int64_t d5;
|
||||
|
||||
# if defined _MSC_VER
|
||||
d5 = d | 5;
|
||||
# else
|
||||
// Workaround for stupid GCC which converts to 32 bit before doing "| 5" and then converts back to 64 bit
|
||||
asm("mov %1, %0\n\tor $5, %0" : "=r"(d5) : "r"(d));
|
||||
# endif
|
||||
|
||||
int64_t q = n / d5;
|
||||
|
||||
((int64_t*)&l0[interleaved_index<interleave>(idx0 & MASK)])[0] = n ^ q;
|
||||
|
||||
|
|
Loading…
Reference in a new issue