Skip to content

Commit c5d384e

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 b9857f5 commit c5d384e

Some content is hidden

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

115 files changed

+478
-745
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[workspace]
22
members = [
33
"crates/stdsimd-verify",
4-
"crates/stdsimd",
4+
"crates/core_arch",
5+
"crates/std_detect",
56
]
67
exclude = [
78
"crates/wasm-assert-instr-tests"

README.md

Lines changed: 5 additions & 3 deletions
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

coresimd/mod.rs

Lines changed: 0 additions & 184 deletions
This file was deleted.

crates/coresimd/Cargo.toml renamed to crates/core_arch/Cargo.toml

Lines changed: 4 additions & 4 deletions
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 renamed to crates/core_arch/src/aarch64/crc.rs

Lines changed: 2 additions & 2 deletions
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 renamed to crates/core_arch/src/aarch64/crypto.rs

Lines changed: 4 additions & 4 deletions
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.

coresimd/aarch64/neon.rs renamed to crates/core_arch/src/aarch64/neon.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
// FIXME: replace neon with asimd
66

7-
use coresimd::arm::*;
8-
use coresimd::simd_llvm::*;
7+
use core_arch::arm::*;
8+
use core_arch::simd_llvm::*;
99
#[cfg(test)]
1010
use stdsimd_test::assert_instr;
1111

@@ -894,7 +894,7 @@ pub unsafe fn vtbl4_p8(a: poly8x8x4_t, b: uint8x8_t) -> poly8x8_t {
894894
#[target_feature(enable = "neon")]
895895
#[cfg_attr(test, assert_instr(tbx))]
896896
pub unsafe fn vtbx1_s8(a: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t {
897-
use coresimd::simd::i8x8;
897+
use core_arch::simd::i8x8;
898898
let r = vqtbx1_s8(a, vcombine_s8(b, ::mem::zeroed()), ::mem::transmute(c));
899899
let m: int8x8_t = simd_lt(c, ::mem::transmute(i8x8::splat(8)));
900900
simd_select(m, r, a)
@@ -906,7 +906,7 @@ pub unsafe fn vtbx1_s8(a: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t {
906906
#[target_feature(enable = "neon")]
907907
#[cfg_attr(test, assert_instr(tbx))]
908908
pub unsafe fn vtbx1_u8(a: uint8x8_t, b: uint8x8_t, c: uint8x8_t) -> uint8x8_t {
909-
use coresimd::simd::u8x8;
909+
use core_arch::simd::u8x8;
910910
let r = vqtbx1_u8(a, vcombine_u8(b, ::mem::zeroed()), c);
911911
let m: int8x8_t = simd_lt(c, ::mem::transmute(u8x8::splat(8)));
912912
simd_select(m, r, a)
@@ -918,7 +918,7 @@ pub unsafe fn vtbx1_u8(a: uint8x8_t, b: uint8x8_t, c: uint8x8_t) -> uint8x8_t {
918918
#[target_feature(enable = "neon")]
919919
#[cfg_attr(test, assert_instr(tbx))]
920920
pub unsafe fn vtbx1_p8(a: poly8x8_t, b: poly8x8_t, c: uint8x8_t) -> poly8x8_t {
921-
use coresimd::simd::u8x8;
921+
use core_arch::simd::u8x8;
922922
let r = vqtbx1_p8(a, vcombine_p8(b, ::mem::zeroed()), c);
923923
let m: int8x8_t = simd_lt(c, ::mem::transmute(u8x8::splat(8)));
924924
simd_select(m, r, a)
@@ -957,7 +957,7 @@ pub unsafe fn vtbx2_p8(a: poly8x8_t, b: poly8x8x2_t, c: uint8x8_t) -> poly8x8_t
957957
#[target_feature(enable = "neon")]
958958
#[cfg_attr(test, assert_instr(tbx))]
959959
pub unsafe fn vtbx3_s8(a: int8x8_t, b: int8x8x3_t, c: int8x8_t) -> int8x8_t {
960-
use coresimd::simd::i8x8;
960+
use core_arch::simd::i8x8;
961961
let r = vqtbx2_s8(
962962
a,
963963
int8x16x2_t(vcombine_s8(b.0, b.1), vcombine_s8(b.2, ::mem::zeroed())),
@@ -973,7 +973,7 @@ pub unsafe fn vtbx3_s8(a: int8x8_t, b: int8x8x3_t, c: int8x8_t) -> int8x8_t {
973973
#[target_feature(enable = "neon")]
974974
#[cfg_attr(test, assert_instr(tbx))]
975975
pub unsafe fn vtbx3_u8(a: uint8x8_t, b: uint8x8x3_t, c: uint8x8_t) -> uint8x8_t {
976-
use coresimd::simd::u8x8;
976+
use core_arch::simd::u8x8;
977977
let r = vqtbx2_u8(
978978
a,
979979
uint8x16x2_t(vcombine_u8(b.0, b.1), vcombine_u8(b.2, ::mem::zeroed())),
@@ -989,7 +989,7 @@ pub unsafe fn vtbx3_u8(a: uint8x8_t, b: uint8x8x3_t, c: uint8x8_t) -> uint8x8_t
989989
#[target_feature(enable = "neon")]
990990
#[cfg_attr(test, assert_instr(tbx))]
991991
pub unsafe fn vtbx3_p8(a: poly8x8_t, b: poly8x8x3_t, c: uint8x8_t) -> poly8x8_t {
992-
use coresimd::simd::u8x8;
992+
use core_arch::simd::u8x8;
993993
let r = vqtbx2_p8(
994994
a,
995995
poly8x16x2_t(vcombine_p8(b.0, b.1), vcombine_p8(b.2, ::mem::zeroed())),
@@ -1576,8 +1576,8 @@ pub unsafe fn vqtbx4q_p8(a: poly8x16_t, t: poly8x16x4_t, idx: uint8x16_t) -> pol
15761576

15771577
#[cfg(test)]
15781578
mod tests {
1579-
use coresimd::aarch64::*;
1580-
use coresimd::simd::*;
1579+
use core_arch::aarch64::*;
1580+
use core_arch::simd::*;
15811581
use std::mem;
15821582
use stdsimd_test::simd_test;
15831583

coresimd/aarch64/v8.rs renamed to crates/core_arch/src/aarch64/v8.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub unsafe fn _cls_u64(x: u64) -> u64 {
5252

5353
#[cfg(test)]
5454
mod tests {
55-
use coresimd::aarch64::v8;
55+
use core_arch::aarch64::v8;
5656

5757
#[test]
5858
fn _rev_u64() {
File renamed without changes.
File renamed without changes.

coresimd/arm/dsp.rs renamed to crates/core_arch/src/arm/dsp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,8 @@ pub unsafe fn usad8a(a: int8x4_t, b: int8x4_t, c: u32) -> u32 {
392392

393393
#[cfg(test)]
394394
mod tests {
395-
use coresimd::arm::*;
396-
use coresimd::simd::*;
395+
use core_arch::arm::*;
396+
use core_arch::simd::*;
397397
use std::mem;
398398
use stdsimd_test::simd_test;
399399

File renamed without changes.

coresimd/arm/neon.rs renamed to crates/core_arch/src/arm/neon.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! ARMv7 NEON intrinsics
22
3-
use coresimd::simd_llvm::*;
3+
use core_arch::simd_llvm::*;
44
#[cfg(test)]
55
use stdsimd_test::assert_instr;
66

@@ -992,8 +992,8 @@ pub unsafe fn vtbx4_p8(a: poly8x8_t, b: poly8x8x4_t, c: uint8x8_t) -> poly8x8_t
992992

993993
#[cfg(test)]
994994
mod tests {
995-
use coresimd::arm::*;
996-
use coresimd::simd::*;
995+
use core_arch::arm::*;
996+
use core_arch::simd::*;
997997
use std::mem;
998998
use stdsimd_test::simd_test;
999999

0 commit comments

Comments
 (0)