<machine/endian.h>: Use __builtin_bswapXY function if c++.
authorzrj <rimvydas.jasinskas@gmail.com>
Sun, 14 Mar 2021 09:31:44 +0000 (09:31 +0000)
committerzrj <rimvydas.jasinskas@gmail.com>
Sun, 14 Mar 2021 19:40:15 +0000 (21:40 +0200)
commit350b818353638f91b9394e9c0125bf4549b2c81f
tree48541397c84330e3893b9c0b4e7dbf919ee7d059
parent9b1c08e5ca6e018d53e7ff69bd0c5b09c7d3ed0b
<machine/endian.h>: Use __builtin_bswapXY function if c++.

 There builtins seem to be supported since gcc 4.8.  In theory we could
 use them for C code too, but for now limit this to c++ so to help
 compilers to deal with fun what is constexpr, lambdas, templates, etc.
 Generally, this reduces amount of debug code created through the
 __word_swap_foo() expansions too.

 Note: g++8 implements __word_swap_foo_var() with a bit different asm.
sys/cpu/x86_64/include/endian.h