Skip to content

Commit 2aeefe2

Browse files
authored
Unrolled build for rust-lang#113053
Rollup merge of rust-lang#113053 - RalfJung:x86_32-float, r=workingjubilee add notes about non-compliant FP behavior on 32bit x86 targets Based on ton of prior discussion (see all the issues linked from rust-lang/unsafe-code-guidelines#237), the consensus seems to be that these targets are simply cursed and we cannot implement the desired semantics for them. I hope I properly understood what exactly the extent of the curse is here, let's make sure people with more in-depth FP knowledge take a close look! In particular for the tier 3 targets I have no clue which target is affected by which particular variant of the x86_32 FP curse. I assumed that `i686` meant SSE is used so the "floating point return value" is the only problem, while everything lower (`i586`, `i386`) meant x87 is used. I opened rust-lang#114479 to concisely describe and track the issue. Cc `@workingjubilee` `@thomcc` `@chorman0773` `@rust-lang/opsem` Fixes rust-lang#73288 Fixes rust-lang#72327
2 parents 4f75af9 + df911df commit 2aeefe2

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

src/doc/rustc/src/platform-support.md

+26-21
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ All tier 1 targets with host tools support the full standard library.
3333
target | notes
3434
-------|-------
3535
`aarch64-unknown-linux-gnu` | ARM64 Linux (kernel 4.1, glibc 2.17+) [^missing-stack-probes]
36-
`i686-pc-windows-gnu` | 32-bit MinGW (Windows 7+) [^windows-support]
37-
`i686-pc-windows-msvc` | 32-bit MSVC (Windows 7+) [^windows-support]
38-
`i686-unknown-linux-gnu` | 32-bit Linux (kernel 3.2+, glibc 2.17+)
36+
`i686-pc-windows-gnu` | 32-bit MinGW (Windows 7+) [^windows-support] [^x86_32-floats-return-ABI]
37+
`i686-pc-windows-msvc` | 32-bit MSVC (Windows 7+) [^windows-support] [^x86_32-floats-return-ABI]
38+
`i686-unknown-linux-gnu` | 32-bit Linux (kernel 3.2+, glibc 2.17+) [^x86_32-floats-return-ABI]
3939
`x86_64-apple-darwin` | 64-bit macOS (10.12+, Sierra+)
4040
`x86_64-pc-windows-gnu` | 64-bit MinGW (Windows 7+) [^windows-support]
4141
`x86_64-pc-windows-msvc` | 64-bit MSVC (Windows 7+) [^windows-support]
@@ -47,7 +47,10 @@ target | notes
4747

4848
[^windows-support]: Only Windows 10 currently undergoes automated testing. Earlier versions of Windows rely on testing and support from the community.
4949

50+
[^x86_32-floats-return-ABI]: Due to limitations of the C ABI, floating-point support on `i686` targets is non-compliant: floating-point return values are passed via an x87 register, so NaN payload bits can be lost. See [issue #114479][x86-32-float-issue].
51+
5052
[77071]: https://github.com/rust-lang/rust/issues/77071
53+
[x86-32-float-issue]: https://github.com/rust-lang/rust/issues/114479
5154

5255
## Tier 1
5356

@@ -150,12 +153,12 @@ target | std | notes
150153
`armv7r-none-eabi` | * | Bare ARMv7-R
151154
`armv7r-none-eabihf` | * | Bare ARMv7-R, hardfloat
152155
`asmjs-unknown-emscripten` | ✓ | asm.js via Emscripten
153-
`i586-pc-windows-msvc` | * | 32-bit Windows w/o SSE
154-
`i586-unknown-linux-gnu` | ✓ | 32-bit Linux w/o SSE (kernel 3.2, glibc 2.17)
155-
`i586-unknown-linux-musl` | ✓ | 32-bit Linux w/o SSE, MUSL
156-
[`i686-linux-android`](platform-support/android.md) | ✓ | 32-bit x86 Android
157-
`i686-unknown-freebsd` | ✓ | 32-bit FreeBSD
158-
`i686-unknown-linux-musl` | ✓ | 32-bit Linux with MUSL
156+
`i586-pc-windows-msvc` | * | 32-bit Windows w/o SSE [^x86_32-floats-x87]
157+
`i586-unknown-linux-gnu` | ✓ | 32-bit Linux w/o SSE (kernel 3.2, glibc 2.17) [^x86_32-floats-x87]
158+
`i586-unknown-linux-musl` | ✓ | 32-bit Linux w/o SSE, MUSL [^x86_32-floats-x87]
159+
[`i686-linux-android`](platform-support/android.md) | ✓ | 32-bit x86 Android [^x86_32-floats-return-ABI]
160+
`i686-unknown-freebsd` | ✓ | 32-bit FreeBSD [^x86_32-floats-return-ABI]
161+
`i686-unknown-linux-musl` | ✓ | 32-bit Linux with MUSL [^x86_32-floats-return-ABI]
159162
[`i686-unknown-uefi`](platform-support/unknown-uefi.md) | * | 32-bit UEFI
160163
[`loongarch64-unknown-none`](platform-support/loongarch-none.md) | * | | LoongArch64 Bare-metal (LP64D ABI)
161164
[`loongarch64-unknown-none-softfloat`](platform-support/loongarch-none.md) | * | | LoongArch64 Bare-metal (LP64S ABI)
@@ -195,6 +198,8 @@ target | std | notes
195198
`x86_64-unknown-redox` | ✓ | Redox OS
196199
[`x86_64-unknown-uefi`](platform-support/unknown-uefi.md) | * | 64-bit UEFI
197200

201+
[^x86_32-floats-x87]: Floating-point support on `i586` targets is non-compliant: the `x87` registers and instructions used for these targets do not provide IEEE-754-compliant behavior, in particular when it comes to rounding and NaN payload bits. See [issue #114479][x86-32-float-issue].
202+
198203
[Fortanix ABI]: https://edp.fortanix.com/
199204

200205
## Tier 3
@@ -264,18 +269,18 @@ target | std | host | notes
264269
`bpfel-unknown-none` | * | | BPF (little endian)
265270
`csky-unknown-linux-gnuabiv2` | ✓ | | C-SKY abiv2 Linux(little endian)
266271
`hexagon-unknown-linux-musl` | ? | |
267-
`i386-apple-ios` | ✓ | | 32-bit x86 iOS
268-
[`i586-pc-nto-qnx700`](platform-support/nto-qnx.md) | * | | 32-bit x86 QNX Neutrino 7.0 RTOS |
269-
`i686-apple-darwin` | ✓ | ✓ | 32-bit macOS (10.12+, Sierra+)
270-
`i686-pc-windows-msvc` | * | | 32-bit Windows XP support
271-
[`i686-pc-windows-gnullvm`](platform-support/pc-windows-gnullvm.md) | ✓ | ✓ |
272-
`i686-unknown-haiku` | ✓ | ✓ | 32-bit Haiku
273-
[`i686-unknown-hurd-gnu`](platform-support/hurd.md) | ✓ | ✓ | 32-bit GNU/Hurd
274-
[`i686-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | NetBSD/i386 with SSE2
275-
[`i686-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 32-bit OpenBSD
276-
`i686-uwp-windows-gnu` | ? | |
277-
`i686-uwp-windows-msvc` | ? | |
278-
`i686-wrs-vxworks` | ? | |
272+
`i386-apple-ios` | ✓ | | 32-bit x86 iOS [^x86_32-floats-return-ABI]
273+
[`i586-pc-nto-qnx700`](platform-support/nto-qnx.md) | * | | 32-bit x86 QNX Neutrino 7.0 RTOS [^x86_32-floats-return-ABI]
274+
`i686-apple-darwin` | ✓ | ✓ | 32-bit macOS (10.12+, Sierra+) [^x86_32-floats-return-ABI]
275+
`i686-pc-windows-msvc` | * | | 32-bit Windows XP support [^x86_32-floats-return-ABI]
276+
[`i686-pc-windows-gnullvm`](platform-support/pc-windows-gnullvm.md) | ✓ | ✓ | [^x86_32-floats-return-ABI]
277+
`i686-unknown-haiku` | ✓ | ✓ | 32-bit Haiku [^x86_32-floats-return-ABI]
278+
[`i686-unknown-hurd-gnu`](platform-support/hurd.md) | ✓ | ✓ | 32-bit GNU/Hurd [^x86_32-floats-return-ABI]
279+
[`i686-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | NetBSD/i386 with SSE2 [^x86_32-floats-return-ABI]
280+
[`i686-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 32-bit OpenBSD [^x86_32-floats-return-ABI]
281+
`i686-uwp-windows-gnu` | ? | | [^x86_32-floats-return-ABI]
282+
`i686-uwp-windows-msvc` | ? | | [^x86_32-floats-return-ABI]
283+
`i686-wrs-vxworks` | ? | | [^x86_32-floats-return-ABI]
279284
[`m68k-unknown-linux-gnu`](platform-support/m68k-unknown-linux-gnu.md) | ? | | Motorola 680x0 Linux
280285
`mips-unknown-linux-uclibc` | ✓ | | MIPS Linux with uClibc
281286
[`mips64-openwrt-linux-musl`](platform-support/mips64-openwrt-linux-musl.md) | ? | | MIPS64 for OpenWrt Linux MUSL

0 commit comments

Comments
 (0)