Less platform-specific code is better.
Use cpuid intrinsics instead of asm code #10820
pull sipa wants to merge 2 commits into bitcoin:master from sipa:20170717_cpuid changing 1 files +7 −12-
sipa commented at 11:43 PM on July 13, 2017: member
-
Use cpuid intrinsics instead of asm code a9e82f6512
- laanwj added the label Refactoring on Jul 14, 2017
-
in src/random.cpp:80 in a9e82f6512 outdated
86 | - __asm__ ("cpuid": "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) : "a"(1)); 87 | -#endif 88 | - //! When calling cpuid function #1, ecx register will have this set if RDRAND is available. 89 | - if (ecx & CPUID_F1_ECX_RDRAND) { 90 | + uint32_t eax, ebx, ecx, edx; 91 | + if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) && (ecx & CPUID_F1_ECX_RDRAND)) {
laanwj commented at 7:17 AM on July 14, 2017:Definitely an improvement...
Clarify entropy source 674848fe1cTheBlueMatt commented at 10:52 PM on July 14, 2017: memberACK 674848fe1c43fb88870cf5ba16fca4e2524da793 (I didnt actually test on other platforms, so I'm just kinda assuming they support this stuff).
gmaxwell approvedgmaxwell commented at 1:43 PM on July 16, 2017: contributorACK.
sipa merged this on Jul 16, 2017sipa closed this on Jul 16, 2017sipa referenced this in commit ef37f2033c on Jul 16, 2017PastaPastaPasta referenced this in commit 80e57d5ee2 on Jul 6, 2019PastaPastaPasta referenced this in commit 16a223f90e on Jul 8, 2019PastaPastaPasta referenced this in commit c687a28c94 on Jul 9, 2019PastaPastaPasta referenced this in commit 9053161e8f on Jul 11, 2019PastaPastaPasta referenced this in commit 0962b9520a on Jul 13, 2019PastaPastaPasta referenced this in commit b46154d5b9 on Jul 13, 2019PastaPastaPasta referenced this in commit cc9a0a8e10 on Jul 17, 2019PastaPastaPasta referenced this in commit dc9709c1c8 on Jul 17, 2019PastaPastaPasta referenced this in commit 6d856aeb43 on Jul 18, 2019barrystyle referenced this in commit 19ddbd028c on Jan 22, 2020DrahtBot locked this on Sep 8, 2021ContributorsLabels
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 09:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 09:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me