-
Notifications
You must be signed in to change notification settings - Fork 48
Note Non-Interoperable Macros and Types #129
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
base: main
Are you sure you want to change the base?
Conversation
These are sometimes documented by specific toolchains and compilers, but I thought it would be good to have a RISC-V specific document noting they are unstable. Because they are unstable, I didn't want to put them in the psABI document -- I thought this document would be a better place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had no idea that int_fastN_t
was not of a fixed size for a given ABI. (Well, I guess we could choose to fix the size in our ABI if we so chose.)
I think [u]intmax_t
need similar handling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should mention std::hardware_destructive_interference_size
and std::hardware_constructive_interference_size
as well, the main user of __GCC_CONSTRUCTIVE_SIZE
/__GCC_DESTRUCTIVE_SIZE
I'm not a native speaker, but is "unstable" really the proper word here? When I hear "unstable type," I imagine a type that might disappear in future releases. But since all listed types are standard C/C++ types (incl. I'm not sure about adding |
Part of the reason for documenting this is because we haven't put these in the ABI -- and indeed clang/gcc disagree: https://godbolt.org/z/TYzaGaE4e And also that iirc, different clang options can give you different sizes for these. I thought that
Maybe. I recall there is something effectively ABI in some of the max types. Quick googling turns up this as relevant https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2425.pdf - which tells me The ABI does define the alignment of
I wanted to stick to the C preprocessor names, as those are what came up in the clang review review and this is a C API doc, but I can instead document the more public names.
Non-interoperable might be better as an adjective, hitting the core problem, without saying these might go away. I guess my feeling about "unstable" is that it means "the definition could change in ways that break your assumptions". This is mostly through being opposite to "stable" in the ABI world meaning "we'll try not to change this in a way that will break your assumptions". I think "compilation will work fine" is a low bar for a specification, I would hope we are writing these documents so that execution does something reasonable.
They are mentioned in the Clang documentation though: https://clang.llvm.org/docs/LanguageExtensions.html#gcc-destructive-size-and-gcc-constructive-size , and used directly by a few users: https://github.com/search?type=code&q=__GCC_CONSTRUCTIVE_SIZE (though references in I will update this PR with the following:
|
These are sometimes documented by specific toolchains and compilers, but I thought it would be good to have a RISC-V specific document noting they are unstable.
Because they are non-interoperable, I didn't want to put them in the psABI document -- I thought this document would be a better place.