ARM: armcc versions of bswap_16/32
Originally committed as revision 17830 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
03e3776293
commit
1e65f62e2b
@ -23,6 +23,25 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "libavutil/common.h"
|
#include "libavutil/common.h"
|
||||||
|
|
||||||
|
#ifdef __ARMCC_VERSION
|
||||||
|
|
||||||
|
#if HAVE_ARMV6
|
||||||
|
#define bswap_16 bswap_16
|
||||||
|
static av_always_inline av_const uint16_t bswap_16(uint16_t x)
|
||||||
|
{
|
||||||
|
__asm { rev16 x, x }
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define bswap_32 bswap_32
|
||||||
|
static av_always_inline av_const uint32_t bswap_32(uint32_t x)
|
||||||
|
{
|
||||||
|
return __rev(x);
|
||||||
|
}
|
||||||
|
#endif /* HAVE_ARMV6 */
|
||||||
|
|
||||||
|
#else /* __ARMCC_VERSION */
|
||||||
|
|
||||||
#if HAVE_ARMV6
|
#if HAVE_ARMV6
|
||||||
#define bswap_16 bswap_16
|
#define bswap_16 bswap_16
|
||||||
static av_always_inline av_const uint16_t bswap_16(uint16_t x)
|
static av_always_inline av_const uint16_t bswap_16(uint16_t x)
|
||||||
@ -48,4 +67,6 @@ static av_always_inline av_const uint32_t bswap_32(uint32_t x)
|
|||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __ARMCC_VERSION */
|
||||||
|
|
||||||
#endif /* AVUTIL_ARM_BSWAP_H */
|
#endif /* AVUTIL_ARM_BSWAP_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user