19#ifndef AVUTIL_RISCV_BSWAP_H
20#define AVUTIL_RISCV_BSWAP_H
27#if defined (__GNUC__) || defined (__clang__)
28#define av_bswap16 __builtin_bswap16
32#if HAVE_RV && !defined(__riscv_zbb)
33 if (!__builtin_constant_p(x) &&
39 ".option arch, +zbb\n"
41 ".option pop" :
"=r" (y) :
"r" (x));
42 return y >> (__riscv_xlen - 32);
45 return __builtin_bswap32(x);
47#define av_bswap32 av_bswap32_rv
52#if HAVE_RV && !defined(__riscv_zbb)
53 if (!__builtin_constant_p(x) &&
59 ".option arch, +zbb\n"
61 ".option pop" :
"=r" (y) :
"r" (x));
62 return y >> (__riscv_xlen - 64);
65 return __builtin_bswap64(x);
67#define av_bswap64 av_bswap64_rv
__asm__(".macro parse_r var r\n\t" "\\var = -1\n\t" _IFC_REG(0) _IFC_REG(1) _IFC_REG(2) _IFC_REG(3) _IFC_REG(4) _IFC_REG(5) _IFC_REG(6) _IFC_REG(7) _IFC_REG(8) _IFC_REG(9) _IFC_REG(10) _IFC_REG(11) _IFC_REG(12) _IFC_REG(13) _IFC_REG(14) _IFC_REG(15) _IFC_REG(16) _IFC_REG(17) _IFC_REG(18) _IFC_REG(19) _IFC_REG(20) _IFC_REG(21) _IFC_REG(22) _IFC_REG(23) _IFC_REG(24) _IFC_REG(25) _IFC_REG(26) _IFC_REG(27) _IFC_REG(28) _IFC_REG(29) _IFC_REG(30) _IFC_REG(31) ".iflt \\var\n\t" ".error \"Unable to parse register name \\r\"\n\t" ".endif\n\t" ".endm")
Macro definitions for various function/variable attributes.
static av_const bool ff_rv_zbb_support(void)
static av_always_inline av_const uint32_t av_bswap32_rv(uint32_t x)