[SCM] libav/experimental: AVR32: inline asm for bswap.h

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:50:11 UTC 2013


The following commit has been merged in the experimental branch:
commit e482c2e2fbae77876ab9b9efb1082ee30dd1aaba
Author: Måns Rullgård <mans at mansr.com>
Date:   Mon Aug 17 00:15:51 2009 +0000

    AVR32: inline asm for bswap.h
    
    Originally committed as revision 19664 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavutil/sh4/bswap.h b/libavutil/avr32/bswap.h
similarity index 77%
copy from libavutil/sh4/bswap.h
copy to libavutil/avr32/bswap.h
index db8e07e..8aad052 100644
--- a/libavutil/sh4/bswap.h
+++ b/libavutil/avr32/bswap.h
@@ -16,33 +16,29 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-/**
- * @file libavutil/sh4/bswap.h
- * byte swapping routines
- */
-
-#ifndef AVUTIL_SH4_BSWAP_H
-#define AVUTIL_SH4_BSWAP_H
+#ifndef AVUTIL_AVR32_BSWAP_H
+#define AVUTIL_AVR32_BSWAP_H
 
 #include <stdint.h>
 #include "config.h"
 #include "libavutil/common.h"
 
+#if HAVE_INLINE_ASM
+
 #define bswap_16 bswap_16
 static av_always_inline av_const uint16_t bswap_16(uint16_t x)
 {
-    __asm__("swap.b %0,%0" : "+r"(x));
+    __asm__ ("swap.bh %0" : "+r"(x));
     return x;
 }
 
 #define bswap_32 bswap_32
 static av_always_inline av_const uint32_t bswap_32(uint32_t x)
 {
-    __asm__("swap.b %0,%0\n"
-            "swap.w %0,%0\n"
-            "swap.b %0,%0\n"
-            : "+r"(x));
+    __asm__ ("swap.b  %0" : "+r"(x));
     return x;
 }
 
-#endif /* AVUTIL_SH4_BSWAP_H */
+#endif /* HAVE_INLINE_ASM */
+
+#endif /* AVUTIL_AVR32_BSWAP_H */
diff --git a/libavutil/bswap.h b/libavutil/bswap.h
index 8c7514d..52811e7 100644
--- a/libavutil/bswap.h
+++ b/libavutil/bswap.h
@@ -32,6 +32,8 @@
 
 #if   ARCH_ARM
 #   include "arm/bswap.h"
+#elif ARCH_AVR32
+#   include "avr32/bswap.h"
 #elif ARCH_BFIN
 #   include "bfin/bswap.h"
 #elif ARCH_SH4

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list