changeset 674:d27f2ec2810b libavutil

ARM: armcc versions of bswap_16/32
author mru
date Thu, 05 Mar 2009 21:20:10 +0000
parents 8537f54fa704
children 361d5a76087d
files arm/bswap.h
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/arm/bswap.h	Fri Feb 27 08:12:41 2009 +0000
+++ b/arm/bswap.h	Thu Mar 05 21:20:10 2009 +0000
@@ -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 @@
     return x;
 }
 
+#endif /* __ARMCC_VERSION */
+
 #endif /* AVUTIL_ARM_BSWAP_H */