Skip to content

Commit ae1cfb6

Browse files
committed
Rip out core::arch wrappers
1 parent c2eb44d commit ae1cfb6

18 files changed

Lines changed: 13 additions & 5439 deletions

File tree

fearless_simd/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ std = []
2626
# Use floating point implementations from libm
2727
libm = ["dep:libm"]
2828

29-
# Include safe wrappers for (some) target feature specific intrinsics,
30-
# beyond the basic SIMD operations abstracted on all platforms
31-
safe_wrappers = []
32-
3329
# Force the "fallback" SIMD level to be supported
3430
# This is primarily used for tests
3531
force_support_fallback = []

fearless_simd/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ The following crate [feature flags](https://doc.rust-lang.org/cargo/reference/fe
151151
- `std` (enabled by default): Get floating point functions from the standard library (likely using your target's libc).
152152
Also allows using [`Level::new`] on all platforms, to detect which target features are enabled.
153153
- `libm`: Use floating point implementations from [libm].
154-
- `safe_wrappers`: Include safe wrappers for (some) target feature specific intrinsics,
155-
beyond the basic SIMD operations abstracted on all platforms.
156154
- `force_support_fallback`: Force scalar fallback, to be supported, even if your compilation target has a better baseline.
157155

158156
At least one of `std` and `libm` is required; `std` overrides `libm`.

fearless_simd/examples/play.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,10 @@ fn foo<S: Simd>(simd: S, x: f32) -> f32 {
3030
simd.splat_f32x4(x).sqrt()[0]
3131
}
3232

33-
// currently requires `safe_wrappers` feature
34-
fn do_something_on_neon(_level: Level) -> f32 {
35-
#[cfg(all(feature = "safe_wrappers", target_arch = "aarch64"))]
36-
if let Some(neon) = _level.as_neon() {
37-
return neon.vectorize(
38-
#[inline(always)]
39-
|| {
40-
let v = neon.neon.vdupq_n_f32(42.0);
41-
neon.neon.vgetq_lane_f32::<0>(v)
42-
},
43-
);
44-
}
45-
0.0
46-
}
47-
4833
fn main() {
4934
let level = Level::new();
5035
let x = level.dispatch(Foo);
5136
let y = dispatch!(level, simd => foo(simd, 42.0));
52-
let z = do_something_on_neon(level);
5337

54-
println!("level = {level:?}, x = {x}, y = {y}, z = {z}");
38+
println!("level = {level:?}, x = {x}, y = {y}");
5539
}

fearless_simd/examples/srgb.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,6 @@
88

99
use fearless_simd::{Level, dispatch, f32x4, prelude::*};
1010

11-
// This block shows how to use safe wrappers for compile-time enforcement
12-
// of using valid SIMD intrinsics.
13-
#[cfg(feature = "safe_wrappers")]
14-
#[inline(always)]
15-
fn copy_alpha<S: Simd>(a: f32x4<S>, b: f32x4<S>) -> f32x4<S> {
16-
// #[cfg(target_arch = "x86_64")]
17-
// if let Some(avx2) = a.simd.level().as_avx2() {
18-
// return avx2
19-
// .sse4_1
20-
// ._mm_blend_ps::<8>(a.into(), b.into())
21-
// .simd_into(a.simd);
22-
// }
23-
#[cfg(target_arch = "aarch64")]
24-
if let Some(neon) = a.simd.level().as_neon() {
25-
return neon
26-
.neon
27-
.vcopyq_laneq_f32::<3, 3>(a.into(), b.into())
28-
.simd_into(a.simd);
29-
}
30-
let mut result = a;
31-
result[3] = b[3];
32-
result
33-
}
34-
35-
// This block lets the example compile without safe wrappers.
36-
#[cfg(not(feature = "safe_wrappers"))]
3711
#[inline(always)]
3812
fn copy_alpha<S: Simd>(a: f32x4<S>, b: f32x4<S>) -> f32x4<S> {
3913
#[cfg(target_arch = "aarch64")]

fearless_simd/src/core_arch/aarch64/mod.rs

Lines changed: 1 addition & 4049 deletions
Large diffs are not rendered by default.

fearless_simd/src/core_arch/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2024 the Fearless_SIMD Authors
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
33

4-
//! Access to architecture-specific intrinsics.
4+
//! Architecture-specific SIMD proof tokens.
55
66
#![expect(
77
missing_docs,

0 commit comments

Comments
 (0)