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

Alignment of __int128 on ILP32 #354

Open
xypron opened this issue Nov 24, 2022 · 7 comments
Open

Alignment of __int128 on ILP32 #354

xypron opened this issue Nov 24, 2022 · 7 comments

Comments

@xypron
Copy link

xypron commented Nov 24, 2022

The alignment of __int128 is only defined on LP64 but not on ILP32.

@xypron xypron changed the title Alignement of __int128 on ILP32 Alignment of __int128 on ILP32 Nov 24, 2022
@jrtc27
Copy link
Collaborator

jrtc27 commented Nov 24, 2022

Like other 32-bit architectures, there is no __int128 available on RV32

@kito-cheng
Copy link
Collaborator

The major reason is what @jrtc27 said, more detail: currently GCC and clang/LLVM are not support __int128 on ILP32, that's implementable on ILP32, but there is some ... technical issue to support that on GCC side, and no 32 bit in GCC has supported __int128, so we don't support that on both compiler now.

@xypron
Copy link
Author

xypron commented Nov 25, 2022

Standardization should not be an afterthought but should be done before implementation. So it is good to define the alignment of __int128 before it is implemented in 32bit tools.

@jrtc27
Copy link
Collaborator

jrtc27 commented Nov 25, 2022

Our policy (see policy.md) is:

  • Changes requiring compiler changes
    • Require an open source PoC implementation for GCC or LLVM, either as a patch on the mailing list/Phabricator as appropriate or in a GitHub fork
    • Require at least one GCC developer AND one LLVM developer to approve

If people want __int128 to exist on RV32 then we can standardise it, but they need to want it and be willing to support it in toolchains. We're not going to add things to the specification that aren't going to be implemented or aren't wanted.

@ptomsich
Copy link
Collaborator

__int128 will still need to be standardised for ILP32, if ILP32 is used with RV64 (e.g. to have more cache-efficient userspace binaries on a 64bit kernel).

@workingjubilee
Copy link

workingjubilee commented Feb 23, 2023

It is probably best if whatever ABI is specified for _BitInt(128) for ILP32 would be tolerable if it were also interpreted as the ABI of __int128 in the ILP32 case, per my reasoning in #300 (comment). The introduction of such a bit-precise way of saying "a 128-bit integer" would make adding it to the smaller data model an "obvious" extension.

@pellico
Copy link

pellico commented Apr 8, 2024

Having a defined ABI for __int128 would improve the interface between Rust and C

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

6 participants