• Rémi Denis-Courmont's avatar
    lavu/riscv: byte-swap operations · df205704
    Rémi Denis-Courmont authored
    If the target supports the Basic bit-manipulation (Zbb) extension, then
    the REV8 instruction is available to reverse byte order.
    
    Note that this instruction only exists at the "XLEN" register size,
    so we need to right shift the result down to the data width.
    
    If Zbb is not supported, then this patchset does nothing. Support for
    run-time detection is left for the future. Currently, there are no
    bits in auxv/ELF HWCAP for Z-extensions, so there are no clean ways to
    do this.
    df205704
bswap.h 2.83 KB