[FFmpeg-cvslog] replace movw instruction in ac3dsp_armv6.S

pin xue git at videolan.org
Sun Apr 10 04:01:13 CEST 2011


ffmpeg | branch: master | pin xue <pinxue at gmail.com> | Sat Apr  9 16:05:11 2011 +0800| [05c062e9da370c60f48e433308cccbf7e7aea7fe] | committer: Michael Niedermayer

replace movw instruction in ac3dsp_armv6.S

AS      libavcodec/arm/ac3dsp_armv6.o
ffmpeg-src/libavcodec/arm/ac3dsp_armv6.S: Assembler messages:
ffmpeg-src/libavcodec/arm/ac3dsp_armv6.S:40: Error: selected processor
does not support `movw r8,#0x1fe0'
make[1]: *** [libavcodec/arm/ac3dsp_armv6.o] Error 1

MOVW is ARMv7 way to load constant:
   * movw, or move wide, will move a 16-bit constant into a register,
implicitly zeroing the top 16 bits of the target register.
   * movt, or move top, will move a 16-bit constant into the top half
of a given register without altering the bottom 16 bits
To load 32 bit constant, movw  lower16; movt upper16; is better than
ldr if available, because:
While this approach takes two instructions, it does not require any
extra space to store the constant so both the movw/movt method and the
ldr method will end up using the same amount of memory. Memory
bandwidth is precious in and the movw/movt approach avoids an extra
read on the data side, not to mention the read could have missed the
cache.

But here it is armv6 optimization, so that we have to use ldr.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/arm/ac3dsp_armv6.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/arm/ac3dsp_armv6.S b/libavcodec/arm/ac3dsp_armv6.S
index 7f01add..002f20f 100644
--- a/libavcodec/arm/ac3dsp_armv6.S
+++ b/libavcodec/arm/ac3dsp_armv6.S
@@ -37,7 +37,7 @@ function ff_ac3_bit_alloc_calc_bap_armv6, export=1
         ldrb            r10, [r4], #1
 1:
         ldrsh           r9,  [r0], #2                   @ mask[band]
-        movw            r8,  #0x1fe0
+        ldr           r8,  =0x1fe0
         sub             r9,  r9,  r12                   @   - snr_offset
         mov             r11, r10
         ldrb            r10, [r4], #1                   @ band_start_tab[band++]



More information about the ffmpeg-cvslog mailing list