Skip to content

Commit ec79543

Browse files
committed
Remove the no-asm feature
Assembly-related configuration was added in 1621c6d ("Use `specialized-div-rem` 1.0.0 for division algorithms") to account for Cranelift not yet supporting assembly. This hasn't been relevant for a while so remove the unused feature here. To keep miri tests working, replace one instance of `not(feature = "no-asm")` with `not(miri)`. This is the compiler-builtins portion of rust-lang/rust#144471.
1 parent 71f73a5 commit ec79543

File tree

16 files changed

+20
-62
lines changed

16 files changed

+20
-62
lines changed

builtins-shim/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ default = ["compiler-builtins"]
3737
# implementations and also filling in unimplemented intrinsics
3838
c = ["dep:cc"]
3939

40-
# Workaround for the Cranelift codegen backend. Disables any implementations
41-
# which use inline assembly and fall back to pure Rust versions (if available).
42-
no-asm = []
43-
4440
# Workaround for codegen backends which haven't yet implemented `f16` and
4541
# `f128` support. Disabled any intrinsics which use those types.
4642
no-f16-f128 = []

builtins-test/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ utest-macros = { git = "https://github.com/japaric/utest" }
3333
[features]
3434
default = ["mangled-names"]
3535
c = ["compiler_builtins/c"]
36-
no-asm = ["compiler_builtins/no-asm"]
3736
no-f16-f128 = ["compiler_builtins/no-f16-f128"]
3837
mem = ["compiler_builtins/mem"]
3938
mangled-names = ["compiler_builtins/mangled-names"]

builtins-test/tests/lse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(decl_macro)] // so we can use pub(super)
22
#![feature(macro_metavar_expr_concat)]
3-
#![cfg(all(target_arch = "aarch64", target_os = "linux", not(feature = "no-asm")))]
3+
#![cfg(all(target_arch = "aarch64", target_os = "linux"))]
44

55
/// Translate a byte size to a Rust type.
66
macro int_ty {

ci/miri.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ targets=(
1414
)
1515
for target in "${targets[@]}"; do
1616
# Only run the `mem` tests to avoid this taking too long.
17-
cargo miri test --manifest-path builtins-test/Cargo.toml --features no-asm --target "$target" -- mem
17+
cargo miri test --manifest-path builtins-test/Cargo.toml --target "$target" -- mem
1818
done

ci/run.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ else
3434
"${test_builtins[@]}" --release
3535
"${test_builtins[@]}" --features c
3636
"${test_builtins[@]}" --features c --release
37-
"${test_builtins[@]}" --features no-asm
38-
"${test_builtins[@]}" --features no-asm --release
3937
"${test_builtins[@]}" --features no-f16-f128
4038
"${test_builtins[@]}" --features no-f16-f128 --release
4139
"${test_builtins[@]}" --benches
@@ -58,8 +56,6 @@ symcheck+=(-- build-and-check)
5856
"${symcheck[@]}" "$target" -- -p compiler_builtins --release
5957
"${symcheck[@]}" "$target" -- -p compiler_builtins --features c
6058
"${symcheck[@]}" "$target" -- -p compiler_builtins --features c --release
61-
"${symcheck[@]}" "$target" -- -p compiler_builtins --features no-asm
62-
"${symcheck[@]}" "$target" -- -p compiler_builtins --features no-asm --release
6359
"${symcheck[@]}" "$target" -- -p compiler_builtins --features no-f16-f128
6460
"${symcheck[@]}" "$target" -- -p compiler_builtins --features no-f16-f128 --release
6561

compiler-builtins/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ default = ["compiler-builtins"]
3535
# implementations and also filling in unimplemented intrinsics
3636
c = ["dep:cc"]
3737

38-
# Workaround for the Cranelift codegen backend. Disables any implementations
39-
# which use inline assembly and fall back to pure Rust versions (if available).
40-
no-asm = []
41-
4238
# Workaround for codegen backends which haven't yet implemented `f16` and
4339
# `f128` support. Disabled any intrinsics which use those types.
4440
no-f16-f128 = []

compiler-builtins/build.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,8 @@ fn configure_libm(target: &Target) {
9696
// Always use intrinsics
9797
println!("cargo:rustc-cfg=intrinsics_enabled");
9898

99-
// The arch module may contain assembly.
100-
if !cfg!(feature = "no-asm") {
101-
println!("cargo:rustc-cfg=arch_enabled");
102-
}
99+
// Always use arch-specific code
100+
println!("cargo:rustc-cfg=arch_enabled");
103101

104102
println!("cargo:rustc-check-cfg=cfg(optimizations_enabled)");
105103
if !matches!(target.opt_level.as_str(), "0" | "1") {

compiler-builtins/src/aarch64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use core::intrinsics;
44

55
intrinsics! {
66
#[unsafe(naked)]
7-
#[cfg(all(target_os = "uefi", not(feature = "no-asm")))]
7+
#[cfg(target_os = "uefi")]
88
pub unsafe extern "custom" fn __chkstk() {
99
core::arch::naked_asm!(
1010
".p2align 2",

compiler-builtins/src/arm.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg(not(feature = "no-asm"))]
2-
31
// Interfaces used by naked trampolines.
42
// SAFETY: these are defined in compiler-builtins
53
unsafe extern "C" {

compiler-builtins/src/hexagon.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg(not(feature = "no-asm"))]
2-
31
use core::arch::global_asm;
42

53
global_asm!(include_str!("hexagon/func_macro.s"), options(raw));

0 commit comments

Comments
 (0)