[1/2] arm: Don't use an armv6t2-only function on plain armv6

Message ID 1312199319-7388-1-git-send-email-martin@martin.st
State Superseded
Headers show

Commit Message

Martin Storsjö Aug. 1, 2011, 11:48 a.m.
This fixes building for iPhone 2G/3G (with --cpu=arm1176jzf-s).
---
 libavcodec/arm/ac3dsp_armv6.S |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Comments

Kostya Shishkov Aug. 1, 2011, 12:11 p.m. | #1
On Mon, Aug 01, 2011 at 02:48:38PM +0300, Martin Storsjö wrote:
> This fixes building for iPhone 2G/3G (with --cpu=arm1176jzf-s).
> ---
>  libavcodec/arm/ac3dsp_armv6.S |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/libavcodec/arm/ac3dsp_armv6.S b/libavcodec/arm/ac3dsp_armv6.S
> index d3058ff..3703f15 100644
> --- a/libavcodec/arm/ac3dsp_armv6.S
> +++ b/libavcodec/arm/ac3dsp_armv6.S
> @@ -37,7 +37,11 @@ function ff_ac3_bit_alloc_calc_bap_armv6, export=1
>          ldrb            r10, [r4], #1
>  1:
>          ldrsh           r9,  [r0], #2                   @ mask[band]
> +#if CONFIG_ARMV6T2
>          movw            r8,  #0x1fe0
> +#else
> +        ldr             r8,  =0x1fe0
> +#endif
>          sub             r9,  r9,  r12                   @   - snr_offset
>          mov             r11, r10
>          ldrb            r10, [r4], #1                   @ band_start_tab[band++]
> -- 

Don't we have a macro for that?
Mans Rullgard Aug. 1, 2011, 1:10 p.m. | #2
Martin Storsjö <martin@martin.st> writes:

> This fixes building for iPhone 2G/3G (with --cpu=arm1176jzf-s).
> ---
>  libavcodec/arm/ac3dsp_armv6.S |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/libavcodec/arm/ac3dsp_armv6.S b/libavcodec/arm/ac3dsp_armv6.S
> index d3058ff..3703f15 100644
> --- a/libavcodec/arm/ac3dsp_armv6.S
> +++ b/libavcodec/arm/ac3dsp_armv6.S
> @@ -37,7 +37,11 @@ function ff_ac3_bit_alloc_calc_bap_armv6, export=1
>          ldrb            r10, [r4], #1
>  1:
>          ldrsh           r9,  [r0], #2                   @ mask[band]
> +#if CONFIG_ARMV6T2
>          movw            r8,  #0x1fe0
> +#else
> +        ldr             r8,  =0x1fe0
> +#endif

Use the mov32 macro from asm.S.

Patch

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