> On 6 Jun 2023, at 15:17, Reimar Döffinger <reimar.doeffin...@gmx.de> wrote:
> 
>> Disable altivec for everyone doesn't seem a good compromise to me, I'm
>> going to build twice on powerpc and let the user decide which one to use
> 
> To be clear: as MPlayer has no hand-written altivec, I I expect only a maybe 
> 5-10% or so degradation (pure guess), the most performance critical stuff in 
> FFmpeg should not be affected.

So, funny thing. I installed debian-ppc on qemu g3 emulated system.
What did I find out:
- xfce4 crashes with illegal instruction
- ffmpeg does not crash, but only because it is built with --disable-altivec 
which makes it basically unusably slow on e.g. G4 systems.
So there is no winning.

So for practical purposes, you can just as well compile MPlayer with 
--disable-altivec, since FFmpeg is compiled this way the speed of MPlayer won't 
make a relevant difference.

On the details what goes on here (skip if you do not like rants):
What is the source of all these issues? gcc
In the past, -maltivec was used to just enable support for altivec intrinsics.
However gcc then changed and generated Altivec instructions even from plain C 
code.
While that makes sense in a way, it meant code everywhere broke on non-altivec 
systems.
This includes FFmpeg.
For packages important enough/depending on maintainer, the "solution" was to 
disable altivec completely, making these programs vastly slower on Altivec 
enabled computers.
Others like xfce4 and MPlayer only work on PPC systems with Altivec.
Without extensive code and build system changes, this seems now an unsolvable 
situation.
Unless someone adds an option like -faltivec that Apple had, which allows the 
intrinsics but not compiler generation of altivec instructions (I think gcc 
maintainers at one point said they could not do that).
clang has both -faltivec and -maltivec, but neither are properly documented, so 
who knows if they would help here or not.
Either way, without someone EXTREMELY motivated, this seems not solvable 
(switching to clang with -faltivec if it were to work just MIGHT have a chance).
I guess it's a lesson in not buying into architectures where the creators don't 
have their shit together enough to get even the basics right - and 
upstreamed... (I guess it's mostly solved by PPC being as good as dead now).
(don't get me wrong, I still sometimes boot my old MacMini with G4 and update 
to latest Debian, but I think the ISA is just dead at this point, 
unfortunately).

Sorry for the long rant,
Reimar

Reply via email to