[FFmpeg-cvslog] ARM: swap source operands in some add instructions

Mans Rullgard git at videolan.org
Fri Sep 21 14:48:52 CEST 2012


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Thu Aug  2 19:17:16 2012 +0100| [a27a690fac6d9f42464039702f8cde6777778a53] | committer: Mans Rullgard

ARM: swap source operands in some add instructions

This allows using a 16-bit opcode when generating Thumb2 code.

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a27a690fac6d9f42464039702f8cde6777778a53
---

 libavcodec/arm/ac3dsp_armv6.S |    2 +-
 libavcodec/arm/dsputil_arm.S  |    4 ++--
 libavcodec/arm/vp8_armv6.S    |    6 +++---
 libavutil/arm/asm.S           |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavcodec/arm/ac3dsp_armv6.S b/libavcodec/arm/ac3dsp_armv6.S
index f6f297a..2028d0b 100644
--- a/libavcodec/arm/ac3dsp_armv6.S
+++ b/libavcodec/arm/ac3dsp_armv6.S
@@ -32,7 +32,7 @@ function ff_ac3_bit_alloc_calc_bap_armv6, export=1
         ldrb            r4,  [r4, r2]
         add             r1,  r1,  r2,  lsl #1           @ psd + start
         add             r0,  r0,  r4,  lsl #1           @ mask + band
-        add             r4,  lr,  r4
+        add             r4,  r4,  lr
         add             r7,  r7,  r2                    @ bap + start
 1:
         ldrsh           r9,  [r0], #2                   @ mask[band]
diff --git a/libavcodec/arm/dsputil_arm.S b/libavcodec/arm/dsputil_arm.S
index dd65f70..3686bef 100644
--- a/libavcodec/arm/dsputil_arm.S
+++ b/libavcodec/arm/dsputil_arm.S
@@ -632,7 +632,7 @@ function ff_add_pixels_clamped_arm, export=1
         ldrsh           r7,  [r0, #2]
         and             r6,  r4,  #0xFF
         and             r8,  r4,  #0xFF00
-        add             r6,  r5,  r6
+        add             r6,  r6,  r5
         add             r8,  r7,  r8,  lsr #8
         mvn             r5,  r5
         mvn             r7,  r7
@@ -674,7 +674,7 @@ function ff_add_pixels_clamped_arm, export=1
         ldrsh           r7,  [r0, #10]
         and             r6,  r4,  #0xFF
         and             r8,  r4,  #0xFF00
-        add             r6,  r5,  r6
+        add             r6,  r6,  r5
         add             r8,  r7,  r8,  lsr #8
         mvn             r5,  r5
         mvn             r7,  r7
diff --git a/libavcodec/arm/vp8_armv6.S b/libavcodec/arm/vp8_armv6.S
index 1b668bc..3863dc3 100644
--- a/libavcodec/arm/vp8_armv6.S
+++ b/libavcodec/arm/vp8_armv6.S
@@ -88,7 +88,7 @@ function ff_decode_block_coeffs_armv6, export=1
 
         add             r4,  r3,  r3,  lsl #5
         sxth            r12, r11
-        add             r4,  r2,  r4
+        add             r4,  r4,  r2
         adds            r6,  r6,  r9
         add             r4,  r4,  #11
         lsl             r8,  r8,  r9
@@ -138,7 +138,7 @@ A       orrcs           r8,  r8,  r10, lsl r6
 2:
         add             r4,  r3,  r3,  lsl #5
         cmp             r3,  #16
-        add             r4,  r2,  r4
+        add             r4,  r4,  r2
         pkhtb           r11, r11, r11, asr #16
         bne             0b
         b               6b
@@ -226,7 +226,7 @@ A       orrcs           r8,  r8,  r10, lsl r6
         ldr             r1,  [sp, #4]
 4:
         add             r4,  r3,  r3,  lsl #5
-        add             r4,  r2,  r4
+        add             r4,  r4,  r2
         add             r4,  r4,  #22
         rac_get_128     r5,  r6,  r7,  r8,  r9,  r10
         it              ge
diff --git a/libavutil/arm/asm.S b/libavutil/arm/asm.S
index 7b3832a..45e4aab 100644
--- a/libavutil/arm/asm.S
+++ b/libavutil/arm/asm.S
@@ -142,7 +142,7 @@ ELF     .size   \name, . - \name
     .if \indir
         ldr             \rd, [pc, \rd]
     .else
-        add             \rd, pc,  \rd
+        add             \rd, \rd, pc
     .endif
         def_pic         \val - (.Lpic\@ + (8 >> CONFIG_THUMB)), .Lpicoff\@
 .endm



More information about the ffmpeg-cvslog mailing list