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

Support for ppc32 BE? #270

Closed
barracuda156 opened this issue Nov 23, 2022 · 11 comments
Closed

Support for ppc32 BE? #270

barracuda156 opened this issue Nov 23, 2022 · 11 comments

Comments

@barracuda156
Copy link
Contributor

barracuda156 commented Nov 23, 2022

@simonbyrne Is it possible to add support for PowerPC BE, in particular ppc32? Primarily interested in macOS PPC, but also considering FreeBSD.

UPD. It seems that BE should be supported, despite not being mentioned in README (the code below has both little- and big-endian cases):

#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__

@kargl
Copy link
Contributor

kargl commented Nov 23, 2022

You don't need to use openlibm on FreeBSD. FreeBSD's libm is already BE aware. In addition, most of openlibm is derived from FreeBSD's libm.

@barracuda156
Copy link
Contributor Author

You don't need to use openlibm on FreeBSD. FreeBSD's libm is already BE aware. In addition, most of openlibm is derived from FreeBSD's libm.

@kargl Thank you. Do you think that implementation of feenableexcept and fedisableexcept from openlibm can be borrowed to be used on Darwin PPC?
fenv.h on MacOS does not have those, but they are needed for support of IEEE arithmetic in Fortran. (That is how I ended up here, looking for a suitable implementation.)

@kargl
Copy link
Contributor

kargl commented Nov 23, 2022

I've never used Darwin, so don't know. Looking at /usr/src/lib/msun/powerpc/fenv.h on FreeBSD shows the functions are declared as inline function and there is a lot of assembly. I suspect this a case of just grab the file and try it.

Edited: I just looked at openlibm_fenv_powerpc.h. It is identical to FreeBSD's header above.

@afxgroup
Copy link

I can confirm it is working since I'm using it in amigaos4 clib2 that is fully powerpc BE

@ViralBShah
Copy link
Member

Presumably #276 addresses this?

@barracuda156
Copy link
Contributor Author

Presumably #276 addresses this?

@ViralBShah Allow me until this weekend. I will return to that likely missed __ppc64__ define and also this issue. Need to sort some other stuff first.

@afxgroup
Copy link

Anyone has tried to compile it on e500v1 with SPE?

@barracuda156
Copy link
Contributor Author

I can confirm it is working since I'm using it in amigaos4 clib2 that is fully powerpc BE

@afxgroup Somewhat on a side note, could you say in Amiga target supports ieee_arithmetic in gfortran and if yes, then how specifically?

@afxgroup
Copy link

Unforunately we don't have a working gfortran and I can't test it

@barracuda156
Copy link
Contributor Author

Unforunately we don't have a working gfortran and I can't test it

@afxgroup Oh. What’s wrong with it though? Have you filed a bug report with GCC Bugzilla?

@afxgroup
Copy link

I don't think there is something wrong. I our toolchain is disabled. I could try to compile it. But then what do you need to be tested?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants