-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
implement VaArgSafe for f128
#161424
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?
implement VaArgSafe for f128
#161424
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -415,6 +415,50 @@ cfg_select! { | |
| #[stable(feature = "c_variadic", since = "1.99.0")] | ||
| unsafe impl VaArgSafe for f64 {} | ||
|
|
||
| // Implement `VaArgSafe` for 128-bit integers on targets where either: | ||
| // | ||
| // - clang provides `__float128` | ||
| // - `long double` is IEEE f128 on the platform. | ||
| // | ||
| // When updating this cfg, also update the tests to match. Currently this condition | ||
| // is duplicated in: | ||
| // | ||
| // - tests/ui/c-variadic/roundtrip.rs | ||
| // - tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs | ||
| cfg_select! { | ||
| any( | ||
| all(target_arch = "x86_64", not(target_vendor = "apple"), not(target_env = "msvc")), | ||
| // Clang 23 hits https://github.com/llvm/llvm-project/issues/217747. | ||
| all(target_arch = "x86", not(target_vendor = "apple"), not(target_env = "msvc")), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. clang 23 runs into an alignment bug llvm/llvm-project#217747, but GCC can handle this. |
||
| // PowerPC requires VSX - only little endian has it enabled by default. | ||
| all(target_arch = "powerpc64", target_endian = "little"), | ||
| all( | ||
| not(windows), | ||
| not(target_vendor = "apple"), | ||
| any( | ||
| target_arch = "aarch64", | ||
| target_arch = "loongarch32", | ||
| target_arch = "loongarch64", | ||
| target_arch = "mips64", | ||
| target_arch = "mips64r6", | ||
| target_arch = "riscv32", | ||
| target_arch = "riscv64", | ||
| target_arch = "s390x", | ||
| // Clang 23 on sparc hits https://github.com/llvm/llvm-project/pull/214981. | ||
| target_arch = "sparc", | ||
| target_arch = "sparc64", | ||
| target_arch = "wasm32", | ||
| target_arch = "wasm64", | ||
| ), | ||
| ), | ||
| ) => { | ||
| #[unstable_feature_bound(f128)] | ||
| #[unstable(feature = "f128", issue = "116909")] | ||
| unsafe impl VaArgSafe for f128 {} | ||
|
folkertdev marked this conversation as resolved.
|
||
| } | ||
| _ => { /* unsupported */ } | ||
| } | ||
|
Comment on lines
+428
to
+460
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is pretty sparse on background information and I'm not positive what I should be checking against, could you add a comment similar to what
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is definitely less principled. Looking into it,
Something like What I'm going for is "anywhere
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added some comments to the |
||
|
|
||
| #[stable(feature = "c_variadic", since = "1.99.0")] | ||
| unsafe impl<T> VaArgSafe for *mut T {} | ||
| #[stable(feature = "c_variadic", since = "1.99.0")] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Probably worth adding a comment here telling future developers to keep this
cfgin sync with thecfgs in the tests.View changes since the review