diff intreadwrite.h @ 728:1fa3820b1a84 libavutil

ARM asm for AV_RN*() ARMv6 and later support unaligned loads and stores for single word/halfword but not double/multiple. GCC is ignorant of this and will always use bytewise accesses for unaligned data. Casting to an int32_t pointer is dangerous since a load/store double or multiple instruction might be used (this happens with some code in FFmpeg). Implementing the AV_[RW]* macros with inline asm using only supported instructions gives fast and safe unaligned accesses. ARM RVCT does the right thing with generic code. This gives an overall speedup of up to 10%.
author mru
date Sat, 18 Apr 2009 00:00:28 +0000
parents 98b64f65be0d
children 753953ed8ff0
line wrap: on
line diff
--- a/intreadwrite.h	Sat Apr 18 00:00:22 2009 +0000
+++ b/intreadwrite.h	Sat Apr 18 00:00:28 2009 +0000
@@ -29,6 +29,9 @@
  * defined, even if these are implemented as inline functions.
  */
 
+#if   ARCH_ARM
+#   include "arm/intreadwrite.h"
+#endif
 
 /*
  * Define AV_[RW]N helper macros to simplify definitions not provided