Skip to content

Commit 7ea5922

Browse files
committed
Refactor stdsimd
This commit: * renames `coresimd` to `core_arch` and `stdsimd` to `std_detect` * `std_detect` does no longer depend on `core_arch` - it is a freestanding `no_std` library that only depends on `core` - it is renamed to `std_detect` * moves the top-level coresimd and stdsimd directories into the appropriate crates/... directories - this simplifies creating crate.io releases of these crates * moves the top-level `coresimd` and `stdsimd` sub-directories into their corresponding crates in `crates/{core_arch, std_detect}`.
1 parent 0b1f0e9 commit 7ea5922

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+566
-818
lines changed

Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
[workspace]
22
members = [
33
"crates/stdsimd-verify",
4-
"crates/stdsimd",
4+
"crates/core_arch",
5+
"crates/std_detect",
6+
"examples/"
57
]
68
exclude = [
79
"crates/wasm-assert-instr-tests"

README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ and `libstd`.
1111
The easiest way to use it is just to import it via `use std::arch`.
1212

1313
The `std::arch` component for `x86` is available in stable Rust. The `std::arch`
14-
components for other architectures and the `std::simd` component require nightly
15-
Rust.
14+
components for other architectures requires nightly Rust. The `std::simd`
15+
component now lives in the
16+
[`packed_simd`](https://github.com/rust-lang-nursery/packed_simd) crate.
1617

1718
Using `stdsimd` master branch is not recommended. It requires nightly Rust, it
1819
only works with particular Rust nightly versions, and it can (and does) break
@@ -21,7 +22,8 @@ often. If you need to use `stdsimd` master branch, you can add it to your
2122

2223
```toml
2324
#[dependencies]
24-
stdsimd = { git = "https://github.com/rust-lang-nursery/stdsimd.git" }
25+
core_arch = { git = "https://github.com/rust-lang-nursery/stdsimd.git" }
26+
std_detect = { git = "https://github.com/rust-lang-nursery/stdsimd.git" }
2527
```
2628

2729
# Documentation

ci/dox.sh

+6-5
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@ dox() {
2222
rm -rf "target/doc/${arch}"
2323
mkdir "target/doc/${arch}"
2424

25-
cargo build --verbose --target "${target}" --manifest-path crates/stdsimd/Cargo.toml
25+
cargo build --verbose --target "${target}" --manifest-path crates/core_arch/Cargo.toml
26+
cargo build --verbose --target "${target}" --manifest-path crates/std_detect/Cargo.toml
2627

2728
rustdoc --verbose --target "${target}" \
28-
-o "target/doc/${arch}" crates/coresimd/src/lib.rs \
29-
--crate-name coresimd \
29+
-o "target/doc/${arch}" crates/core_arch/src/lib.rs \
30+
--crate-name core_arch \
3031
--library-path "target/${target}/debug/deps"
3132
rustdoc --verbose --target "${target}" \
32-
-o "target/doc/${arch}" crates/stdsimd/src/lib.rs \
33-
--crate-name stdsimd \
33+
-o "target/doc/${arch}" crates/std_detect/src/lib.rs \
34+
--crate-name std_detect \
3435
--library-path "target/${target}/debug/deps" \
3536
--extern cfg_if="$(ls target/"${target}"/debug/deps/libcfg_if-*.rlib)" \
3637
--extern libc="$(ls target/"${target}"/debug/deps/liblibc-*.rlib)"

ci/run.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ cargo_test() {
6060
cmd="$cmd ${subcmd} --target=$TARGET $1"
6161
if [ "$NOSTD" = "1" ]
6262
then
63-
cmd="$cmd -p coresimd"
63+
cmd="$cmd -p core_arch"
6464
else
65-
cmd="$cmd -p coresimd -p stdsimd"
65+
cmd="$cmd -p core_arch -p std_detect -p stdsimd_examples"
6666
fi
6767
cmd="$cmd -- $2"
6868
if [ "$NORUN" != "1" ]
@@ -109,4 +109,12 @@ case ${TARGET} in
109109
;;
110110
*)
111111
;;
112+
112113
esac
114+
115+
# Test examples
116+
(
117+
cd examples
118+
cargo test
119+
echo test | cargo run --release hex
120+
)

coresimd/mod.rs

-184
This file was deleted.

crates/coresimd/Cargo.toml crates/core_arch/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[package]
2-
name = "coresimd"
2+
name = "core_arch"
33
version = "0.1.3"
44
authors = [
55
"Alex Crichton <[email protected]>",
66
"Andrew Gallant <[email protected]>",
77
"Gonzalo Brito Gadeschi <[email protected]>",
88
]
99
description = "SIMD support in Rust's core library."
10-
documentation = "https://docs.rs/stdsimd"
10+
documentation = "https://docs.rs/core_arch"
1111
homepage = "https://github.com/rust-lang-nursery/stdsimd"
1212
repository = "https://github.com/rust-lang-nursery/stdsimd"
1313
readme = "README.md"
14-
keywords = ["core", "simd", "intrinsics"]
14+
keywords = ["core", "simd", "arch", "intrinsics"]
1515
categories = ["hardware-support", "no-std"]
1616
license = "MIT/Apache-2.0"
1717

@@ -24,7 +24,7 @@ maintenance = { status = "experimental" }
2424

2525
[dev-dependencies]
2626
stdsimd-test = { version = "0.*", path = "../stdsimd-test" }
27-
stdsimd = { version = "0.1.3", path = "../stdsimd" }
27+
std_detect = { version = "0.1.3", path = "../std_detect" }
2828

2929
[target.wasm32-unknown-unknown.dev-dependencies]
3030
wasm-bindgen-test = "=0.2.19"
File renamed without changes.
File renamed without changes.

coresimd/aarch64/crc.rs crates/core_arch/src/aarch64/crc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ pub unsafe fn __crc32cd(crc: u32, data: u64) -> u32 {
8787

8888
#[cfg(test)]
8989
mod tests {
90-
use coresimd::aarch64::*;
91-
use coresimd::simd::*;
90+
use core_arch::aarch64::*;
91+
use core_arch::simd::*;
9292
use std::mem;
9393
use stdsimd_test::simd_test;
9494

coresimd/aarch64/crypto.rs crates/core_arch/src/aarch64/crypto.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use coresimd::arm::uint32x4_t;
2-
use coresimd::arm::uint8x16_t;
1+
use core_arch::arm::uint32x4_t;
2+
use core_arch::arm::uint8x16_t;
33

44
#[allow(improper_ctypes)]
55
extern "C" {
@@ -164,8 +164,8 @@ pub unsafe fn vsha256su1q_u32(
164164

165165
#[cfg(test)]
166166
mod tests {
167-
use coresimd::aarch64::*;
168-
use coresimd::simd::*;
167+
use core_arch::aarch64::*;
168+
use core_arch::simd::*;
169169
use std::mem;
170170
use stdsimd_test::simd_test;
171171

File renamed without changes.

0 commit comments

Comments
 (0)