• Rémi Denis-Courmont's avatar
    riscv/bswap: use compiler builtins · 7dcb5e1a
    Rémi Denis-Courmont authored
    av_bswapXX() are used in context that expect exact size types, notably
    variable arguments to av_log(). On Linux RV64, uint_fast32_t is an
    unsigned long, so the current inline assembler does not work properly.
    
    Since GCC and Clang gained their byte-swap built-ins before they
    supported RISC-V, we can simply defer to them. As an added bonus, the
    compiler can do instruction scheduling, which it couldn't with the Zbb
    inline assembler.
    7dcb5e1a
bswap.h 1.07 KB