git: <machine/endian.h>: Use __builtin_bswapXY function if c++.

Rimvydas Jasinskas zrj at crater.dragonflybsd.org
Sun Mar 14 12:37:10 PDT 2021


commit 350b818353638f91b9394e9c0125bf4549b2c81f
Author: zrj <rimvydas.jasinskas at gmail.com>
Date:   Sun Mar 14 09:31:44 2021 +0000

    <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.

Summary of changes:
 sys/cpu/x86_64/include/endian.h | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/350b818353638f91b9394e9c0125bf4549b2c81f


-- 
DragonFly BSD source repository



More information about the Commits mailing list