From 59c6723f7dfb2266eae45c3b2ddd377872a7a113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Fri, 26 May 2023 03:26:16 +0200 Subject: [PATCH] Bring back CpuOptLevel x86_64_v1 (#1590) * Allow CpuOptLevel x86_64 Let's not force people to upgrade to x86_64_v2 yet. Default is unchanged (x86_64_v2). * target-cpu changes * x86, and an old one at that? ew. --------- Co-authored-by: James Hodgkinson --- libs/profiles/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/profiles/src/lib.rs b/libs/profiles/src/lib.rs index fc79c588e..3e5efca86 100644 --- a/libs/profiles/src/lib.rs +++ b/libs/profiles/src/lib.rs @@ -9,6 +9,7 @@ enum CpuOptLevel { none, native, neon_v8, + x86_64_legacy, // don't use this it's the oldest and worst. unless you've got a really old CPU, in which case, sorry? x86_64_v2, x86_64_v3, } @@ -31,6 +32,7 @@ impl std::fmt::Display for CpuOptLevel { CpuOptLevel::none => write!(f, "none"), CpuOptLevel::native => write!(f, "native"), CpuOptLevel::neon_v8 => write!(f, "neon_v8"), + CpuOptLevel::x86_64_legacy => write!(f, "x86_64"), CpuOptLevel::x86_64_v2 => write!(f, "x86_64_v2"), CpuOptLevel::x86_64_v3 => write!(f, "x86_64_v3"), } @@ -66,6 +68,7 @@ pub fn apply_profile() { CpuOptLevel::neon_v8 => { println!("cargo:rustc-env=RUSTFLAGS=-Ctarget-features=+neon,+fp-armv8") } + CpuOptLevel::x86_64_legacy => println!("cargo:rustc-env=RUSTFLAGS=-Ctarget-cpu=x86-64"), CpuOptLevel::x86_64_v2 => println!("cargo:rustc-env=RUSTFLAGS=-Ctarget-cpu=x86-64-v2"), CpuOptLevel::x86_64_v3 => println!("cargo:rustc-env=RUSTFLAGS=-Ctarget-cpu=x86-64-v3"), }