arm: Avoid using the movw instruction needlessly

Message ID 1312300928-53723-1-git-send-email-martin@martin.st
State Committed
Commit 9a83adaf346bc5e38183427b2bd11084c11d1c8b
Headers show

Commit Message

Martin Storsjö Aug. 2, 2011, 4:02 p.m.
From: Måns Rullgård <mans@mansr.com>

This fixes building for ARM11 without Thumb2.
---
 libavcodec/arm/ac3dsp_armv6.S |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Mans Rullgard Aug. 2, 2011, 4:12 p.m. | #1
Martin Storsjö <martin@martin.st> writes:

> From: Måns Rullgård <mans@mansr.com>
>
> This fixes building for ARM11 without Thumb2.

ARM11 never has Thumb2.  You could say something like "non-thumb2 armv6,
e.g. arm11".
Martin Storsjö Aug. 2, 2011, 4:15 p.m. | #2
On Tue, 2 Aug 2011, Måns Rullgård wrote:

> Martin Storsjö <martin@martin.st> writes:
> 
> > From: Måns Rullgård <mans@mansr.com>
> >
> > This fixes building for ARM11 without Thumb2.
> 
> ARM11 never has Thumb2.  You could say something like "non-thumb2 armv6,
> e.g. arm11".

Hmm, ok - I don't realy know, but wikipedia told me that "Thumb-2 
technology made its debut in the ARM1156 core" 
(http://en.wikipedia.org/wiki/ARM_architecture).

But anyway, ok to push it with the mesasge you suggested?

// Martin
Mans Rullgard Aug. 2, 2011, 4:20 p.m. | #3
Martin Storsjö <martin@martin.st> writes:

> On Tue, 2 Aug 2011, Måns Rullgård wrote:
>
>> Martin Storsjö <martin@martin.st> writes:
>> 
>> > From: Måns Rullgård <mans@mansr.com>
>> >
>> > This fixes building for ARM11 without Thumb2.
>> 
>> ARM11 never has Thumb2.  You could say something like "non-thumb2 armv6,
>> e.g. arm11".
>
> Hmm, ok - I don't realy know, but wikipedia told me that "Thumb-2 
> technology made its debut in the ARM1156 core" 
> (http://en.wikipedia.org/wiki/ARM_architecture).
>
> But anyway, ok to push it with the mesasge you suggested?

Gah, I'm not thinking straight today.  Of course the 1156 has t2.
Martin Storsjö Aug. 3, 2011, 8:12 a.m. | #4
On Tue, 2 Aug 2011, Måns Rullgård wrote:

> Martin Storsjö <martin@martin.st> writes:
> 
> > On Tue, 2 Aug 2011, Måns Rullgård wrote:
> >
> >> Martin Storsjö <martin@martin.st> writes:
> >> 
> >> > From: Måns Rullgård <mans@mansr.com>
> >> >
> >> > This fixes building for ARM11 without Thumb2.
> >> 
> >> ARM11 never has Thumb2.  You could say something like "non-thumb2 armv6,
> >> e.g. arm11".
> >
> > Hmm, ok - I don't realy know, but wikipedia told me that "Thumb-2 
> > technology made its debut in the ARM1156 core" 
> > (http://en.wikipedia.org/wiki/ARM_architecture).
> >
> > But anyway, ok to push it with the mesasge you suggested?
> 
> Gah, I'm not thinking straight today.  Of course the 1156 has t2.

So is the patch I posted earlier ok then?

// Martin
Mans Rullgard Aug. 3, 2011, 8:56 a.m. | #5
Martin Storsjö <martin@martin.st> writes:

> On Tue, 2 Aug 2011, Måns Rullgård wrote:
>
>> Martin Storsjö <martin@martin.st> writes:
>> 
>> > On Tue, 2 Aug 2011, Måns Rullgård wrote:
>> >
>> >> Martin Storsjö <martin@martin.st> writes:
>> >> 
>> >> > From: Måns Rullgård <mans@mansr.com>
>> >> >
>> >> > This fixes building for ARM11 without Thumb2.
>> >> 
>> >> ARM11 never has Thumb2.  You could say something like "non-thumb2 armv6,
>> >> e.g. arm11".
>> >
>> > Hmm, ok - I don't realy know, but wikipedia told me that "Thumb-2 
>> > technology made its debut in the ARM1156 core" 
>> > (http://en.wikipedia.org/wiki/ARM_architecture).
>> >
>> > But anyway, ok to push it with the mesasge you suggested?
>> 
>> Gah, I'm not thinking straight today.  Of course the 1156 has t2.
>
> So is the patch I posted earlier ok then?

Yes.

Patch

diff --git a/libavcodec/arm/ac3dsp_armv6.S b/libavcodec/arm/ac3dsp_armv6.S
index d3058ff..b6aee86 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
+        mov             r8,  #0xff0
         sub             r9,  r9,  r12                   @   - snr_offset
         mov             r11, r10
         ldrb            r10, [r4], #1                   @ band_start_tab[band++]
@@ -45,7 +45,7 @@  function ff_ac3_bit_alloc_calc_bap_armv6, export=1
         it              lt
         movlt           r9,  #0
         cmp             r10, r3                         @   - end
-        and             r9,  r9,  r8                    @   & 0x1fe0
+        and             r9,  r9,  r8, lsl #1            @   & 0x1fe0
         ite             gt
         subgt           r8,  r3,  r11
         suble           r8,  r10, r11