Skip to content

Commit 0eba65f

Browse files
committed
rust: x86: remove -3dnow{,a} from target features
LLVM 19 is dropping support for 3DNow! in commit f0eb5587ceeb ("Remove support for 3DNow!, both intrinsics and builtins. (#96246)"): Remove support for 3DNow!, both intrinsics and builtins. (#96246) This set of instructions was only supported by AMD chips starting in the K6-2 (introduced 1998), and before the "Bulldozer" family (2011). They were never much used, as they were effectively superseded by the more-widely-implemented SSE (first implemented on the AMD side in Athlon XP in 2001). This is being done as a predecessor towards general removal of MMX register usage. Since there is almost no usage of the 3DNow! intrinsics, and no modern hardware even implements them, simple removal seems like the best option. Thus we should avoid passing these to the backend, since otherwise we get a diagnostic about it: '-3dnow' is not a recognized feature for this target (ignoring feature) '-3dnowa' is not a recognized feature for this target (ignoring feature) We could try to disable them only up to LLVM 19 (not the C side one, but the one used by `rustc`, which may be built with a range of LLVMs). However, to avoid more complexity, we can likely just remove them altogether. According to Nikita [2]: > I don't think it's needed because LLVM should not generate 3dnow > instructions unless specifically asked to, using intrinsics that > Rust does not provide in the first place. Thus do so, like Rust did for one of their builtin targets [3]. For those curious: Clang will warn only about trying to enable them (`-m3dnow{,a}`), but not about disabling them (`-mno-3dnow{,a}`), so there is no change needed there. Cc: Nikita Popov <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: [email protected] Link: llvm/llvm-project@f0eb558 [1] Link: rust-lang/rust#127864 (comment) [2] Link: rust-lang/rust#127864 [3] Closes: #1094 Tested-by: Benno Lossin <[email protected]> Tested-by: Alice Ryhl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent d734422 commit 0eba65f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/generate_rust_target.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ fn main() {
162162
"data-layout",
163163
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
164164
);
165-
let mut features = "-3dnow,-3dnowa,-mmx,+soft-float".to_string();
165+
let mut features = "-mmx,+soft-float".to_string();
166166
if cfg.has("MITIGATION_RETPOLINE") {
167167
features += ",+retpoline-external-thunk";
168168
}
@@ -179,7 +179,7 @@ fn main() {
179179
"data-layout",
180180
"e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128",
181181
);
182-
let mut features = "-3dnow,-3dnowa,-mmx,+soft-float".to_string();
182+
let mut features = "-mmx,+soft-float".to_string();
183183
if cfg.has("MITIGATION_RETPOLINE") {
184184
features += ",+retpoline-external-thunk";
185185
}

0 commit comments

Comments
 (0)