[PATCH] PPC runtime altivec detection via mfspr
Hello, attached patch adds altivec detection via the mfspr. Unfortunately, there is no way to detect if mfspr is available, neither is there a configure flag to manually enable/disable runtime cpudetection. So as a (temporary) hack I made the code conditional on MPlayer's RUNTIME_CPUDETECT. I agree this is ugly, and for ffmpeg we could just as well put it under #elif 0. I just think it might be nice to have this code in because it seems e.g. Debian could use it without any problems, whereas on my test system it would always crash. Of course, if someone wrote a proper ffmpeg configure part for it that would be nice as well... Opinions? Greetings, Reimar D?ffinger
Hello, On Nov 15, 2007 11:51 AM, Reimar D?ffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
Hello, attached patch adds altivec detection via the mfspr. Unfortunately, there is no way to detect if mfspr is available, neither is there a configure flag to manually enable/disable runtime cpudetection. So as a (temporary) hack I made the code conditional on MPlayer's RUNTIME_CPUDETECT. I agree this is ugly, and for ffmpeg we could just as well put it under #elif 0. I just think it might be nice to have this code in because it seems e.g. Debian could use it without any problems, whereas on my test system it would always crash. Of course, if someone wrote a proper ffmpeg configure part for it that would be nice as well... Opinions?
Runtime CPU detection is under Linux only right? I guess it's quite implicit, since on OSX, the OS provides an syscall (or smth like that) for AltiVec support detection... Other than that, I don't have an opinion regarding your patch. I just regret that it's required to do some hacks to detect PPC CPU features, when on x86, the same thing is very simple. Guillaume -- A soldier will fight long and hard for a bit of colored ribbon. -- Napoleon Bonaparte
Reimar D?ffinger wrote:
Opinions?
We could just have it + the other os dependant checks grouped and have runtime checks disabled by default and disable if the target cpu has altivec support. lu -- Luca Barbato Gentoo/linux Gentoo/PPC http://dev.gentoo.org/~lu_zero
Hello, On Thu, Nov 15, 2007 at 11:51:01AM +0100, Reimar D?ffinger wrote:
attached patch adds altivec detection via the mfspr. Unfortunately, there is no way to detect if mfspr is available, neither is there a configure flag to manually enable/disable runtime cpudetection. So as a (temporary) hack I made the code conditional on MPlayer's RUNTIME_CPUDETECT. I agree this is ugly, and for ffmpeg we could just as well put it under #elif 0. I just think it might be nice to have this code in because it seems e.g. Debian could use it without any problems, whereas on my test system it would always crash. Of course, if someone wrote a proper ffmpeg configure part for it that would be nice as well... Opinions?
Not real feedback, so I applied it finally. We can still try to find some proper solution (or revert if someone minds a lot)... Greetings, Reimar D?ffinger
participants (3)
-
lu_zero@gentoo.org -
poirierg@gmail.com -
Reimar.Doeffinger@stud.uni-karlsruhe.de