Browse code

arm: intreadwrite: revert 16-bit load asm to old version for gcc < 4.6

Commit adebad0 "arm: intreadwrite: fix inline asm constraints for gcc
4.6 and later" caused some older gcc versions to miscompile code.
This reverts to the old version of the code for these compilers.

Signed-off-by: Mans Rullgard <mans@mansr.com>

Mans Rullgard authored on 2012/05/04 03:14:16
Showing 1 changed files
... ...
@@ -30,7 +30,9 @@ static av_always_inline unsigned AV_RN16(const void *p)
30 30
 {
31 31
     const uint8_t *q = p;
32 32
     unsigned v;
33
-#ifdef __thumb__
33
+#if !AV_GCC_VERSION_AT_LEAST(4,6)
34
+    __asm__ ("ldrh %0, %1" : "=r"(v) : "m"(*(const uint16_t *)q));
35
+#elif defined __thumb__
34 36
     __asm__ ("ldrh %0, %1" : "=r"(v) : "m"(q[0]), "m"(q[1]));
35 37
 #else
36 38
     __asm__ ("ldrh %0, %1" : "=r"(v) : "Uq"(q[0]), "m"(q[1]));