summaryrefslogtreecommitdiff
path: root/libavutil/arm/bswap.h
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2009-03-05 21:20:10 +0000
committerMåns Rullgård <mans@mansr.com>2009-03-05 21:20:10 +0000
commit1e65f62e2b15f087e14d62f567266994f1a9ec59 (patch)
tree2fd66ad14b1295c9777ea862919000ee16473dbc /libavutil/arm/bswap.h
parent03e3776293f7e40f10b8dee8e97679f84a8fef36 (diff)
ARM: armcc versions of bswap_16/32
Originally committed as revision 17830 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/arm/bswap.h')
-rw-r--r--libavutil/arm/bswap.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/libavutil/arm/bswap.h b/libavutil/arm/bswap.h
index 65c73c5ccb..d19f972329 100644
--- a/libavutil/arm/bswap.h
+++ b/libavutil/arm/bswap.h
@@ -23,6 +23,25 @@
#include "config.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
#define bswap_16 bswap_16
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;
}
+#endif /* __ARMCC_VERSION */
+
#endif /* AVUTIL_ARM_BSWAP_H */