Re: Question about linux non-standard powerpc SPE FPU

Lennart Sorensen <[email protected]>
Newsgroups gmane.linux.debian.ports.powerpc
Message-ID <[email protected]>
On Sat, Feb 15, 2025 at 01:20:23PM +0100, Martina Hřebcová wrote:
> Hi all,
> 
> I have one question about kernel / debian operation.
> 
> I have computer A1222+ with CPU P1022 ( two e500v2 cores ). It is NG Amiga
> with AmigaOS4, but linux runs here nice too.
> 
> P1022 CPU is 32-bit powerpc processor, it has no powerpc FPU but have
> embedded SPE FPU instead.  Also it has SPE SIMD unit. It has no FP or vector
> registers, instead it has GPRs extended for 64bit for FPU and SIMD
> operations. So it has different ABI than standard powerpc for floating-point
> parameter calls.
> 
> There was in past powerpcspe port of Debian. It was dropped somewhere in 
> 2016, due to excluding of SPE extension from gcc.
> 
> Debian 8+ powerpcspe snapshot from these times runs very well, with full 3D
> desktop support. There is customized kernel for A1222+, which was maintained
> by xeno74. Last version I found is 5.4. All this is normal and expected.
> 
> There are no other native powerpcspe distro ( or at least I am not hear 
> about it).
> 
> But now I tried standart powerpc Ubuntu 16.04 and also last version of
> powerpc 32-bit Void linux.
> 
> If I used custom kernel from xeno74 and standart powerpc distro, it works on
> my powerpcspe machine with different ABI.
> 
> ( So now I have in plan to install more modern Debian from snapshots, or 
> Fienix distro, which is based on modern Debian )
> 
> Please, how does it works? How is possible that powerpc code with fpu not 
> crashes?
> 
> I can imagine, that in custom kernel there are soft-float calls. But there
> shoud be some powerpc FPU emulator or what...
> 
> Please, do you have any idea?

Any software that doesn't use FPU at all should work I believe.  Any that
uses FPU would not, unless the kernel happens to be configured to emulate
an FPU.  I can't remember if powerpc ever had an option to do that.
I know some architectures in the past did at least.

Looking at the kernel config, it appears CONFIG_MATH_EMULATION exists
and may in fact do just that.

In fact I found some discussions from 8 years ago that said tha A1222 can
in fact run powerpc code with the MATH_EMULATION kernel option enabled.
It's not recommended, since the FPU performance is terrible.

I will continue to despise the A1222 even existing for the fact they
put that garbage CPU on it that is not a proper powerpc and broke all
existing compatibility of AmigaOS 4 FPU using code.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.