No description provided.
Use compiler byteswap functions if available #14329
pull DesWurstes wants to merge 2 commits into bitcoin:master from DesWurstes:patch-2 changing 2 files +22 −1-
DesWurstes commented at 3:19 PM on September 26, 2018: contributor
-
Check for builtin swap functions 6c2f30ddd5
-
Add byteswap functions c6fadc9eee
-
practicalswift commented at 7:43 AM on September 27, 2018: contributor
What would be the appropriate benchmark for this change?
-
sipa commented at 11:55 AM on September 27, 2018: member
I believe this won't have any effect. Modern compilers recognize the pattern used in the current code as byteswapping, and will use an appropriate native operation for it if available. I think it's likely the binary output is in fact identical before and after.
That said, it's probably more clear and reliable to use the builtin when available.
-
DesWurstes commented at 1:41 PM on September 27, 2018: contributor
I've experimented: GCC can see that pattern since 4.5 and Clang can see it since 3.0. MSVC still can't recognize
bswap64.So, closing it.
- DesWurstes closed this on Sep 27, 2018
- MarcoFalke locked this on Sep 8, 2021
Contributors