-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Tracking issue for 128-bit integer support (RFC 1504) #35118
Comments
Is |
That's a good point, I don't see any reason why it shouldn't be allowed. |
The return type of the |
Intrinsics are stuff internal to the compiler, therefore changes to them doesn’t need discussion in the RFCs. |
I know, I just wanted to mention it here since I didn't see enums discussed in the RFC. |
i128 and u128 support Adds support for 128-bit integers. Rebased version of #35954 , with additional improvements. Thanks @nagisa for mentoring this PR! Some of the problems that were resolved: * [x] Confirm that intrinsics work on 32 bit platforms and fix them if needed * Wait for #37906 to get fixed, so that work on intrinsics can be completed *(worked around by merging the PR on my local setup)* * [x] Investigate and fix linkcheck failure [plugin-breaking-change] cc #35118
How should FFI with this type be handled? Is there any standard ABI support for these types? AFAICT, the answer is "no", which means this type should be FFI-unsafe, and the FFI unsafety lint should be updated to reject |
cc @est31 |
On Windows there is most definitely no standard i128 yet because the standard compiler (msvc) does not support |
It depends on the architecture. SysV defines the ABI for 64 bit architectures. For x86, its most likely its not defined. Same goes for windows: it should in theory be defined for 64 bit (just sadly nobody adheres to it, its a gigantic mess), but not on x86. This directly maps the support of the i128 type in C, and I think generally it makes little sense to have FFI for types that don't exist in C. |
bug report in llvm about the x86_64 ABI problems: https://llvm.org/bugs/show_bug.cgi?id=31362 |
Also one in GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78799 |
Stabilize 128-bit integers 🎉 cc rust-lang#35118 EDIT: This should be merged only after the following have been merged: - [x] rust-lang/compiler-builtins#236 - [x] rust-lang/book#1230
Stabilize 128-bit integers 🎉 cc #35118 EDIT: This should be merged only after the following have been merged: - [x] rust-lang/compiler-builtins#236 - [x] rust-lang/book#1230
I think this is done 🎉 |
Could someone update the OP too create more check boxes for repr128? |
I think that is fixed, although not in the nicest way. I closed the issue. |
@ebfull see my comment here: #35118 (comment) i128 works on the entire x86 family as well as the ARM family. This covers all of the tier 1 platforms. What you are doing in zkcrypto/pairing#80 is exactly what I wanted to prevent by blocking stabilisation until all platforms support i128 lol, but people thought otherwise. |
@est31 I'm not doing zkcrypto/pairing#80 until it works on all platforms, which I mention in that issue. In the mean time all I will do is remove the |
@ebfull not blaming you. I'm partially blaming myself, thought that lowering worked already. Partially I'm blaming those people who decided to stabilize before all platforms support it. And the backend vendors who refuse to take {u,i}128 seriously. Sadly, this is more of a "stable beta" release of i128 than an arrival of a feature that can be relied upon. |
It would be nice if there was a (documented) way to set a cargo feature as the default on a given architecture. From what I can tell this isn't quite possible, since the architecture-selection code happens with The motivation is that even if |
You can set cfg flags from the build script.
…On Sun, Apr 1, 2018 at 7:19 PM, Henry de Valence ***@***.***> wrote:
It would be nice if there was a (documented) way to set a cargo feature as
the default on a given architecture. From what I can tell this isn't quite
possible, since the architecture-selection code happens with #[cfg(...)]s
while the crate is being compiled, by which point the crate's features are
already selected. Am I missing something?
The motivation is that even if u128s are available, it may not be
desirable to use them, unless they actually correspond to instructions
available on that platform.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#35118 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC3n0sF6mXohDEJzN0dV2ggaYT631BTks5tkWB7gaJpZM4JYhaE>
.
|
@mark-i-m any developments re. |
Not that I'm aware of... but I just did the stabilization. I'm not sure if if anyone has claimed ownership of that task yet... |
Nothing has changed re EDIT: That, or if days suddenly become 48-hour long. |
Closing this in favor of the targeted issue #56071 since all remaining work has been done. |
Tracking issue for rust-lang/rfcs#1504.
cc @Amanieu
Blocking stabilization:
Interaction with FFI? (Tracking issue for 128-bit integer support (RFC 1504) #35118 (comment))- rustc: Flag {i,u}128 as unsafe for FFI #44261separately feature gate- rustc: Separately feature gate repr(i128) #44262repr(i128)
repr128
featureThe text was updated successfully, but these errors were encountered: