fft: disable calc_interleave altivec accel on old GCC

Message ID 1375973860-16986-1-git-send-email-gseanmcg@gmail.com
State Under Review, archived
Headers show

Commit Message

Sean McGovern Aug. 8, 2013, 2:57 p.m.
---
It's not clear why versions earlier than 4.6 get this wrong, Kostya suggested
it could be due to calling conventions. I strongly recommend for powerpc users
to move to 4.6 anyways as IBM has contributed significantly to the powerpc
backend in recent versions.
---
 libavcodec/ppc/fft_altivec.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Sean McGovern Aug. 13, 2013, 6:34 p.m. | #1
On Thursday, August 8, 2013, Sean McGovern <gseanmcg@gmail.com> wrote:
> ---
> It's not clear why versions earlier than 4.6 get this wrong, Kostya
suggested
> it could be due to calling conventions. I strongly recommend for powerpc
users
> to move to 4.6 anyways as IBM has contributed significantly to the powerpc
> backend in recent versions.
> ---
>  libavcodec/ppc/fft_altivec.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libavcodec/ppc/fft_altivec.c b/libavcodec/ppc/fft_altivec.c
> index b9dd4a2..892d787 100644
> --- a/libavcodec/ppc/fft_altivec.c
> +++ b/libavcodec/ppc/fft_altivec.c
> @@ -142,7 +142,9 @@ static void imdct_calc_altivec(FFTContext *s,
FFTSample *output, const FFTSample
>  av_cold void ff_fft_init_ppc(FFTContext *s)
>  {
>  #if HAVE_GNU_AS && HAVE_ALTIVEC
> +#if !defined(__GNUC__) || AV_GCC_VERSION_AT_LEAST(4,6)
>      s->fft_calc   = ff_fft_calc_interleave_altivec;
> +#endif
>      if (s->mdct_bits >= 5) {
>          s->imdct_calc = imdct_calc_altivec;
>          s->imdct_half = imdct_half_altivec;
> --

Ping.

-- Sean McG.
Janne Grunau Aug. 15, 2013, 10:38 a.m. | #2
On 2013-08-08 10:57:40 -0400, Sean McGovern wrote:
> ---
> It's not clear why versions earlier than 4.6 get this wrong, Kostya suggested
> it could be due to calling conventions.

could be possible, see the comment in libavcodec/ppc/fft_altivec_s.S

> I strongly recommend for powerpc users
> to move to 4.6 anyways as IBM has contributed significantly to the powerpc
> backend in recent versions.

Probably nothing wrong with that

> ---
>  libavcodec/ppc/fft_altivec.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/ppc/fft_altivec.c b/libavcodec/ppc/fft_altivec.c
> index b9dd4a2..892d787 100644
> --- a/libavcodec/ppc/fft_altivec.c
> +++ b/libavcodec/ppc/fft_altivec.c
> @@ -142,7 +142,9 @@ static void imdct_calc_altivec(FFTContext *s, FFTSample *output, const FFTSample
>  av_cold void ff_fft_init_ppc(FFTContext *s)
>  {
>  #if HAVE_GNU_AS && HAVE_ALTIVEC
> +#if !defined(__GNUC__) || AV_GCC_VERSION_AT_LEAST(4,6)
>      s->fft_calc   = ff_fft_calc_interleave_altivec;
> +#endif
>      if (s->mdct_bits >= 5) {
>          s->imdct_calc = imdct_calc_altivec;
>          s->imdct_half = imdct_half_altivec;
> -- 

probably ok, I'll push if nobody complains in the next days

Janne

Patch

diff --git a/libavcodec/ppc/fft_altivec.c b/libavcodec/ppc/fft_altivec.c
index b9dd4a2..892d787 100644
--- a/libavcodec/ppc/fft_altivec.c
+++ b/libavcodec/ppc/fft_altivec.c
@@ -142,7 +142,9 @@  static void imdct_calc_altivec(FFTContext *s, FFTSample *output, const FFTSample
 av_cold void ff_fft_init_ppc(FFTContext *s)
 {
 #if HAVE_GNU_AS && HAVE_ALTIVEC
+#if !defined(__GNUC__) || AV_GCC_VERSION_AT_LEAST(4,6)
     s->fft_calc   = ff_fft_calc_interleave_altivec;
+#endif
     if (s->mdct_bits >= 5) {
         s->imdct_calc = imdct_calc_altivec;
         s->imdct_half = imdct_half_altivec;