-
Notifications
You must be signed in to change notification settings - Fork 165
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
Define _BitInt
ABI
#300
Comments
Thanks for remind that! we will take a look after 1.0 release! |
Notes for x86-64 ABI and current implementation status for open source toolchain: x86-64 ABI for
|
Some more context:
Further links:
|
Hello, I am raising the concern that I had with the System V x86-64 psABI specification here, in advance of this being specified at all. Namely: on a platform that has already specified Obviously, this concern mostly applies to the RV64-related ABIs, but to them it applies especially so, on account of the question of stack alignment. I merely took an initial reading and I am not sure I fully and correctly have calculated the cases where this will actually cause a concern for the LP64D ABI's parameter passing algorithm, so it is possible this is not a real issue for arguments, even for a very large set of function parameters. However, it still seems like it would be awkward for programmers if pointers to |
Any news on this. It would be useful to get an ABI defined soon on this and then support for _BitInt can be added to GCC. |
@pinskia thanks for the reminder, will post draft proposal soon :) |
`_BitInt (N)` is the type defined in C23, allow user to define an arbitrary-sized integer type, where N is a postive integer larger than zero. This proposal defined the size and alignment of _BitInt, and define the unused bits as unspecified which is same as x86-64 and AArch64. For the calling convention part, we keep unused bits as unspecified. Ref: - ISO/IEC WG14 N2763: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2763.pdf - [AArch64] Rationale Document for ABI related to the C23 _BitInt type. https://github.com/ARM-software/abi-aa/tree/main/design-documents/bit-precise-types.rst - AAPCS64 for _BitInt(N) ARM-software/abi-aa@d621417 - x86-64 ABI for _BitInt(N) https://gitlab.com/x86-psABIs/x86-64-ABI/-/commit/8ca45392570e96920f8a15d903d6122f6d263cd0 Fix #300
C23 (current draft: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2912.pdf ) defines "bit-precise integer types": types
_BitInt(N)
andunsigned _BitInt(N)
with a given width. The RISC-V ABI needs to define the ABI for these types; see the x86_64 ABI https://gitlab.com/x86-psABIs/x86-64-ABI for an example.This means specifying the size, alignment and representation for objects of those types (including whether there are any requirements on the values of padding bits in the in-memory representation), and the interface for argument passing and return (including, again, any requirements on padding bits - both padding bits up to the size of an object of that type, and any further padding beyond that within the size of a register or stack slot used for argument passing or return).
The text was updated successfully, but these errors were encountered: