Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looks like GCC defines are wrong for PowerPC #341

Open
barracuda156 opened this issue May 29, 2023 · 3 comments
Open

Looks like GCC defines are wrong for PowerPC #341

barracuda156 opened this issue May 29, 2023 · 3 comments

Comments

@barracuda156
Copy link

PowerPC predominantly uses IBM long double. It seems this part is missing in gcc_long_double.hpp and a few headers which define __128bitdd for compilers (GCC on PPC uses the same type which IBM uses on AIX, not IEEE long double).

Is it so, and then these should be fixed, or am I looking in a wrong place?

@ghost
Copy link

ghost commented May 29, 2023

@barracuda156 thanks for calling this out. This is untested code as we do not have PowerPC platforms to test on, and the long double support is causing some grief in supporting it across all the different compilers and platforms.

Any guidance how to get a PowerPC setup so that we can fix this?

@barracuda156
Copy link
Author

@barracuda156 thanks for calling this out. This is untested code as we do not have PowerPC platforms to test on, and the long double support is causing some grief in supporting it across all the different compilers and platforms.

Any guidance how to get a PowerPC setup so that we can fix this?

@theo-lemurian Thank you for responding!

I believe, Linux (and possibly FreeBSD or even AIX) can be installed as Big-endian in emulation in Qemu. As an example at hand: https://blog.r-project.org/2020/05/29/testing-r-on-emulated-platforms

Linux might support both kinds of long double, GCC has switches for them: https://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html
But AFAIK, most if not all Big endian systems will use IBM long double (composed of two doubles). It should be identical across AIX, macOS PPC and whatever BSD and Linux use Big endian.

GCC should have it documented reasonably well inside /gcc/config/rs6000. IBM and Motorola manuals for PowerPC cpus had decent documentation too.

@barracuda156
Copy link
Author

P. S. Re OS support for either kind:
https://gcc.gnu.org/wiki/Ieee128PowerPC
https://www.talospace.com/2018/12/the-saga-of-power-isa-128-bit-long.html
So yes, looks like Big endian predominantly use IBM long double, some may support both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

2 participants