Skip to content

Commit 80a524d

Browse files
authored
Reorganize and refactor source tree (#324)
With RFC 2325 looking close to being accepted, I took a crack at reorganizing this repository to being more amenable for inclusion in libstd/libcore. My current plan is to add stdsimd as a submodule in rust-lang/rust and then use `#[path]` to include the modules directly into libstd/libcore. Before this commit, however, the source code of coresimd/stdsimd themselves were not quite ready for this. Imports wouldn't compile for one reason or another, and the organization was also different than the RFC itself! In addition to moving a lot of files around, this commit has the following major changes: * The `cfg_feature_enabled!` macro is now renamed to `is_target_feature_detected!` * The `vendor` module is now called `arch`. * Under the `arch` module is a suite of modules like `x86`, `x86_64`, etc. One per `cfg!(target_arch)`. * The `is_target_feature_detected!` macro was removed from coresimd. Unfortunately libcore has no ability to export unstable macros, so for now all feature detection is canonicalized in stdsimd. The `coresimd` and `stdsimd` crates have been updated to the planned organization in RFC 2325 as well. The runtime bits saw the largest amount of refactoring, seeing a good deal of simplification without the core/std split.
1 parent b01b28f commit 80a524d

Some content is hidden

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

123 files changed

+1843
-2042
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ matrix:
2424
- env: DOCUMENTATION
2525
install: true
2626
script: ci/dox.sh
27-
- script: cargo test --manifest-path stdsimd-verify/Cargo.toml
27+
- script: cargo test --manifest-path crates/stdsimd-verify/Cargo.toml
2828
install: true
2929
- env: RUSTFMT=On TARGET=x86_64-unknown-linux-gnu NO_ADD=1
3030
script: |

Cargo.toml

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,8 @@
1-
[package]
2-
name = "stdsimd"
3-
version = "0.0.3"
4-
authors = ["Andrew Gallant <[email protected]>"]
5-
description = "SIMD support in Rust's standard library."
6-
documentation = "https://docs.rs/stdsimd"
7-
homepage = "https://github.com/rust-lang-nursery/stdsimd"
8-
repository = "https://github.com/rust-lang-nursery/stdsimd"
9-
readme = "README.md"
10-
keywords = ["std", "simd", "intrinsics"]
11-
categories = ["hardware-support"]
12-
license = "MIT/Apache-2.0"
13-
141
[workspace]
15-
members = ["stdsimd-verify"]
16-
17-
[badges]
18-
travis-ci = { repository = "rust-lang-nursery/stdsimd" }
19-
appveyor = { repository = "rust-lang-nursery/stdsimd" }
20-
is-it-maintained-issue-resolution = { repository = "rust-lang-nursery/stdsimd" }
21-
is-it-maintained-open-issues = { repository = "rust-lang-nursery/stdsimd" }
22-
maintenance = { status = "experimental" }
23-
24-
[dependencies]
25-
coresimd = { version = "0.0.3", path = "coresimd/" }
26-
27-
[dev-dependencies]
28-
auxv = "0.3.3"
29-
quickcheck = "0.6"
30-
rand = "0.4"
2+
members = [
3+
"crates/stdsimd-verify",
4+
"crates/stdsimd",
5+
]
316

327
[profile.release]
338
debug = true
@@ -36,10 +11,3 @@ opt-level = 3
3611
[profile.bench]
3712
debug = 1
3813
opt-level = 3
39-
40-
[features]
41-
# Internal-usage only: denies all warnings.
42-
strict = [ "coresimd/strict" ]
43-
# Internal-usage only: enables only those intrinsics supported by Intel's
44-
# Software Development Environment (SDE).
45-
intel_sde = [ "coresimd/intel_sde" ]

ci/dox.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ dox() {
2222
rm -rf target/doc/$arch
2323
mkdir target/doc/$arch
2424

25-
cargo build --target $target
25+
cargo build --target $target --manifest-path crates/stdsimd/Cargo.toml
2626

2727
rustdoc --target $target \
28-
-o target/doc/$arch coresimd/src/lib.rs \
28+
-o target/doc/$arch crates/coresimd/src/lib.rs \
2929
--crate-name coresimd \
3030
--library-path target/$target/debug/deps
3131
rustdoc --target $target \
32-
-o target/doc/$arch src/lib.rs \
32+
-o target/doc/$arch crates/stdsimd/src/lib.rs \
3333
--crate-name stdsimd \
34-
--library-path target/$target/debug/deps
34+
--library-path target/$target/debug/deps \
35+
--extern cfg_if=`ls target/$target/debug/deps/libcfg_if-*.rlib` \
36+
--extern libc=`ls target/$target/debug/deps/liblibc-*.rlib`
3537
}
3638

3739
dox i686 i686-unknown-linux-gnu

ci/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ echo "OBJDUMP=${OBJDUMP}"
2323

2424
cargo_test() {
2525
cmd="cargo test --target=$TARGET --features $FEATURES $1"
26-
cmd="$cmd -p coresimd -p stdsimd"
26+
cmd="$cmd -p coresimd -p stdsimd --manifest-path crates/stdsimd/Cargo.toml"
2727
cmd="$cmd -- $2"
2828
$cmd
2929
}

coresimd/LICENSE-APACHE

Lines changed: 0 additions & 1 deletion
This file was deleted.

coresimd/LICENSE-MIT

Lines changed: 0 additions & 1 deletion
This file was deleted.

coresimd/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

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

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

55
#[cfg(test)]
66
use stdsimd_test::assert_instr;
7-
use simd_llvm::simd_add;
8-
use v128::f64x2;
7+
use coresimd::simd_llvm::simd_add;
8+
use coresimd::v128::f64x2;
99

1010
/// Vector add.
1111
#[inline]
@@ -41,8 +41,8 @@ pub unsafe fn vaddd_u64(a: u64, b: u64) -> u64 {
4141

4242
#[cfg(test)]
4343
mod tests {
44-
use super::f64x2;
45-
use aarch64::neon;
44+
use simd::f64x2;
45+
use coresimd::aarch64::neon;
4646
use stdsimd_test::simd_test;
4747

4848
#[simd_test = "neon"]

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

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

5858
#[cfg(test)]
5959
mod tests {
60-
use aarch64::v8;
60+
use coresimd::aarch64::v8;
6161

6262
#[test]
6363
fn _rev_u64() {
File renamed without changes.

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
#[cfg(test)]
44
use stdsimd_test::assert_instr;
55

6-
use simd_llvm::simd_add;
7-
8-
use v64::{f32x2, i16x4, i32x2, i8x8, u16x4, u32x2, u8x8};
9-
use v128::{f32x4, i16x8, i32x4, i64x2, i8x16, u16x8, u32x4, u64x2, u8x16};
6+
use coresimd::simd_llvm::simd_add;
7+
use coresimd::v64::*;
8+
use coresimd::v128::*;
109

1110
/// Vector add.
1211
#[inline]
@@ -216,7 +215,7 @@ pub unsafe fn vrsqrte_f32(a: f32x2) -> f32x2 {
216215
mod tests {
217216
use stdsimd_test::simd_test;
218217
use simd::*;
219-
use arm::neon;
218+
use coresimd::arm::neon;
220219

221220
#[simd_test = "neon"]
222221
unsafe fn vadd_s8() {

coresimd/src/arm/v6.rs renamed to coresimd/arm/v6.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub unsafe fn _rev_u32(x: u32) -> u32 {
2525

2626
#[cfg(test)]
2727
mod tests {
28-
use arm::v6;
28+
use coresimd::arm::v6;
2929

3030
#[test]
3131
fn _rev_u16() {

coresimd/src/arm/v7.rs renamed to coresimd/arm/v7.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extern "C" {
5050

5151
#[cfg(test)]
5252
mod tests {
53-
use arm::v7;
53+
use coresimd::arm::v7;
5454

5555
#[test]
5656
fn _clz_u8() {

0 commit comments

Comments
 (0)