]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
ARM: armcc versions of bswap_16/32
authormru <mru@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Thu, 5 Mar 2009 21:20:10 +0000 (21:20 +0000)
committermru <mru@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Thu, 5 Mar 2009 21:20:10 +0000 (21:20 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17830 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavutil/arm/bswap.h

index 65c73c5ccbd75185526ba8bf54080c82c0f74538..d19f9723291486126bc97c9a5b6ea181101f63f7 100644 (file)
 #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 */