implement VaArgSafe for f128 - #161424
Conversation
|
@bors try jobs=test-various,aarch64-apple-,-gnu-nopt-,x86_64-mingw-,aarch64-msvc-*,arm-android |
This comment has been minimized.
This comment has been minimized.
implement `VaArgSafe` for `f128` try-job: test-various try-job: aarch64-apple-* try-job: *-gnu-nopt-* try-job: x86_64-mingw-* try-job: aarch64-msvc-* try-job: arm-android
This comment has been minimized.
This comment has been minimized.
|
💔 Test for c9719b5 failed: CI. Failed job:
|
fdb79cb to
8a4f680
Compare
|
@bors try jobs=test-various,aarch64-apple-,-gnu-nopt-,x86_64-mingw-,aarch64-msvc-*,arm-android |
This comment has been minimized.
This comment has been minimized.
implement `VaArgSafe` for `f128` try-job: test-various try-job: aarch64-apple-* try-job: *-gnu-nopt-* try-job: x86_64-mingw-* try-job: aarch64-msvc-* try-job: arm-android
| cfg_select! { | ||
| any( | ||
| all(target_arch = "x86_64", not(target_vendor = "apple"), not(target_env = "msvc")), | ||
| all(target_arch = "x86", not(target_vendor = "apple"), not(target_env = "msvc")), |
There was a problem hiding this comment.
clang 23 runs into an alignment bug llvm/llvm-project#217747, but GCC can handle this.
|
@rustbot ready |
| cfg_select! { | ||
| any( | ||
| all(target_arch = "x86_64", not(target_vendor = "apple"), not(target_env = "msvc")), | ||
| all(target_arch = "x86", not(target_vendor = "apple"), not(target_env = "msvc")), | ||
| // BE powerpc requires vsx. | ||
| all(target_arch = "powerpc64", target_endian = "little"), | ||
| all( | ||
| not(windows), | ||
| not(target_vendor = "apple"), | ||
| any( | ||
| target_arch = "aarch64", | ||
| target_arch = "loongarch64", | ||
| target_arch = "mips64", | ||
| target_arch = "mips64r6", | ||
| target_arch = "riscv32", | ||
| target_arch = "riscv64", | ||
| target_arch = "s390x", | ||
| target_arch = "sparc64", | ||
| target_arch = "wasm32", | ||
| target_arch = "wasm64", | ||
| ), | ||
| ), | ||
| ) => { | ||
| #[unstable_feature_bound(f128)] | ||
| #[unstable(feature = "f128", issue = "116909")] | ||
| unsafe impl VaArgSafe for f128 {} | ||
| } | ||
| _ => { /* unsupported */ } | ||
| } |
There was a problem hiding this comment.
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 __int128 has?
There was a problem hiding this comment.
This one is definitely less principled. Looking into it, __float128 is not a good heuristic based on https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc.pdf:
__float128 is available on i386, x86 64, IA-64, LoongArch and hppa HP-UX, as well
as on PowerPC GNU/Linux targets that enable the vector scalar (VSX) instruction set.
Something like defined(__LDBL_MANT_DIG__) && __LDBL_MANT_DIG__ == 113 is also imperfect.
What I'm going for is "anywhere c_longdouble is IEEE f128, and whatever else works".
There was a problem hiding this comment.
I added some comments to the va_list.rs definition.
8a4f680 to
4947d1f
Compare
This comment has been minimized.
This comment has been minimized.
| // - clang provides `__float128` | ||
| // - `long double` is IEEE f128 on the platform. | ||
| cfg_select! { | ||
| any( |
There was a problem hiding this comment.
Probably worth adding a comment here telling future developers to keep this cfg in sync with the cfgs in the tests.
This comment has been minimized.
This comment has been minimized.
c04a2f3 to
3d04167
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
3d04167 to
a70355d
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
View all comments
On some platforms, especially when
long doubleis IEEE f128 on the platform.