GNOME Bugzilla – Bug 319482
altivec detections is broken.
Last modified: 2007-01-28 11:13:39 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; }
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.
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!
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.
Company noticed that there is a semi-colon missing after the union { .. }.
Created attachment 53769 [details] [review] and this is the patch updated with the semicolon :)
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.
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.
And altivec is used and detected as it should?
Applied, thanks for the help!
*** Bug 171796 has been marked as a duplicate of this bug. ***
Hmm, why did you change the build-time tests to look at what the build CPU can do instead of adding runtime checks?