After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 319482 - altivec detections is broken.
altivec detections is broken.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
0.8.6
Other Linux
: Normal major
: 0.8.7
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 171796 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-10-22 15:19 UTC by Koop Mast
Modified: 2007-01-28 11:13 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
Fix altivec detection. (1.79 KB, patch)
2005-10-22 17:10 UTC, Koop Mast
none Details | Review
and this is the patch updated with the semicolon :) (1.79 KB, patch)
2005-10-22 18:16 UTC, Benjamin Otte (Company)
none Details | Review

Description Koop Mast 2005-10-22 15:19:53 UTC
Version details: 0.8.6.2

The code down below is from the gst-ffmpeg configure to look for hardware
altivec support. On a G4 this program runs like expected, exit without problems.
On a G3 it core dumps. But the funny part is that configure on that same 
G3 says:

--------------------------------
checking for fast integer types... yes
checking altivec.h usability... yes
checking altivec.h presence... yes
checking for altivec.h... yes
checking for support of Motorola Altivec API... yes  <== should be no.
checking for localtime_r... yes
--------------------------------
Smells like a logic bug somewhere.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
/* cc -maltivec -mabi=altivec -o altivec altivec-test.c */
#include <altivec.h>

int
main ()
{
  vector signed int v1, v2, v3;
  v1 = vec_add(v2,v3);
  return 0;
}
Comment 1 Ronald Bultje 2005-10-22 15:30:11 UTC
Can you change:

(line279)
  AC_MSG_CHECKING(for MMI instruction set)
  AC_TRY_RUN([
    int main () {
      __asm__ ("lq \$2, 0(\$2)");
      return 0;
    }
  ],[ HAVE_MMI=yes && AC_MSG_RESULT(yes) ],[
    HAVE_MMI=no && AC_MSG_RESULT(no) ])

(line307)
    # See does our compiler support Motorola AltiVec C API
    AC_MSG_CHECKING(for support of Motorola Altivec API)
    AC_TRY_RUN([
        $ALT_H
        int main () {
          vector signed int v1, v2, v3;
          v1 = vec_add(v2,v3);
          return 0;
        }
      ],[ HAVE_ALTIVEC=yes && AC_MSG_RESULT(yes) ],[
        HAVE_ALTIVEC=no && AC_MSG_RESULT(no) ])

(line334)
    AC_MSG_CHECKING(for support of IWMMXT optimizations)
    AC_TRY_RUN([
        int main () {
          __asm__ __volatile__ ("wunpckelub wr6, wr4");
          return 0;
        }
      ],[ HAVE_IWMMXT=yes && AC_MSG_RESULT(yes) ],[
        HAVE_IWMMXT=no && AC_MSG_RESULT(no) ])

and see if that fixes it? Thanks. I don't have a G3 myself so I can only suggest
patches, not run them.
Comment 2 Koop Mast 2005-10-22 16:01:58 UTC
According to config.log the net line is used for compiling:
-----------------------------------------------------------------------------
root@mac:/usr/src # gcc -o conftest -g -O2 -maltivec -mabi=altivec  -maltivec
-mabi=altivec  altivec.c
root@mac:/usr/src # ./conftest
-----------------------------------------------------------------------------
See no problem, now lets try with out the -02.
-----------------------------------------------------------------------------
root@mac:/usr/src # gcc -o conftest -g -maltivec -mabi=altivec  -maltivec
-mabi=altivec  altivec.c
root@mac:/usr/src # ./conftest Illegal instruction
-----------------------------------------------------------------------------
Funny!
Comment 3 Koop Mast 2005-10-22 17:10:32 UTC
Created attachment 53768 [details] [review]
Fix altivec detection.

This patch includes the changes above in #1 and a change as discussed on irc
about #2.
Comment 4 Koop Mast 2005-10-22 18:14:51 UTC
Company noticed that there is a semi-colon missing after the union { .. }.
Comment 5 Benjamin Otte (Company) 2005-10-22 18:16:15 UTC
Created attachment 53769 [details] [review]
and this is the patch updated with the semicolon :)
Comment 6 Ronald Bultje 2005-10-22 22:01:29 UTC
And he also noticed that it works fine on a g3 now, yay! I'll want some g4 data
to confirm that it doesn't break altivec on them, after that I'll apply.
Comment 7 Koop Mast 2005-10-24 09:12:44 UTC
It works on this G4, playback has some hickups in the video part and this box
has non-working audio but the picture is as it should be.
Comment 8 Ronald Bultje 2005-10-24 13:14:27 UTC
And altivec is used and detected as it should?
Comment 9 Ronald Bultje 2005-10-24 13:49:58 UTC
Applied, thanks for the help!
Comment 10 Ronald Bultje 2005-10-24 13:51:01 UTC
*** Bug 171796 has been marked as a duplicate of this bug. ***
Comment 11 Loïc Minier 2007-01-28 11:13:39 UTC
Hmm, why did you change the build-time tests to look at what the build CPU can do instead of adding runtime checks?