Commit Graph

32 Commits

Author SHA1 Message Date
Jakub Beránek
b535003608 Remove std-detect dev dependency in core_arch 2025-07-07 21:50:45 +00:00
sayantn
bc9e29d9be Replace cfg(stdarch_intel_sde) with STDARCH_TEST_SKIP_FUNCTION 2025-04-20 21:39:39 +00:00
Eric Huss
699a872630 Update all crates to Rust 2024 2025-02-09 12:31:33 -08:00
Yuri Astrakhan
11f975e51d Add all crates to workspace
I am not certain why some crates are missing - it might be by accident or on purpose, so feel free to reject.  This makes sure no crate is missed by accident,
and also removed the non-existent `wasm-assert-instr-tests` crate.

P.S. Also, added some crate-level lints, but perhaps these should be added to all crates in the workspace?
2024-09-30 13:23:20 -04:00
Sayantan Chakraborty
959c49f0d0 Use Cargo.toml lints instead of a build script 2024-09-22 18:19:47 -04:00
ziyizhang-1
50cd4ef0c5 initial commit to enable amx
AMX Intrinsics:

amx-tile:
  - _tile_loadconfig
  - _tile_storeconfig
  - _tile_loadd
  - _tile_release
  - _tile_stored
  - _tile_stream_loadd
  - _tile_zero
amx-int8:
  - _tile_dpbssd
  - _tile_dpbsud
  - _tile_dpbusd
  - _tile_dpbuud
amx-bf16:
  - _tile_dpbf16ps
amx-fp16
  - _tile_dpfp16ps
amx-complex
  - _tile_cmmimfp16ps
  - _tile_cmmrlfp16ps
2024-08-03 19:02:09 +01:00
Yuri Astrakhan
81c221f058 Edition 2021, apply clippy::uninlined_format_args fix (#1339) 2022-10-25 20:17:23 +01:00
Urgau
e4d28b2c5c Remove useless conditional compilation (#1308) 2022-06-10 00:14:17 +01:00
Alex Touchet
626654b486 Use SPDX license format and update packed_simd crate link (#1297) 2022-03-17 10:55:51 +00:00
Mara Bos
685e8d906d Remove references to the crates on crates.io.
They haven't been published in years. This removes the suggestion that
the crates on crates.io are actively updated/maintained.
2021-08-12 00:24:32 +01:00
Joshua Nelson
7f7ca407ff Replace cfg(dox) with cfg(doc) (#920)
`dox` has to be set explicitly, but `doc` is set whenever rustdoc runs.
This simplifies the doc process to `cargo doc` and means bootstrap can
stop passing `--cfg dox` when documenting crates.
2020-09-29 23:57:19 +01:00
Alex Crichton
770964adac Update and revamp wasm32 SIMD intrinsics (#874)
Lots of time and lots of things have happened since the simd128 support
was first added to this crate. Things are starting to settle down now so
this commit syncs the Rust intrinsic definitions with the current
specification (https://github.com/WebAssembly/simd). Unfortuantely not
everything can be enabled just yet but everything is in the pipeline for
getting enabled soon.

This commit also applies a major revamp to how intrinsics are tested.
The intention is that the setup should be much more lightweight and/or
easy to work with after this commit.

At a high-level, the changes here are:

* Testing with node.js and `#[wasm_bindgen]` has been removed. Instead
  intrinsics are tested with Wasmtime which has a nearly complete
  implementation of the SIMD spec (and soon fully complete!)

* Testing is switched to `wasm32-wasi` to make idiomatic Rust bits a bit
  easier to work with (e.g. `panic!)`

* Testing of this crate's simd128 feature for wasm is re-enabled. This
  will run on CI and both compile and execute intrinsics. This should
  bring wasm intrinsics to the same level of parity as x86 intrinsics,
  for example.

* New wasm intrinsics have been added:
  * `iNNxMM_loadAxA_{s,u}`
  * `vNNxMM_load_splat`
  * `v8x16_swizzle`
  * `v128_andnot`
  * `iNNxMM_abs`
  * `iNNxMM_narrow_*_{u,s}`
  * `iNNxMM_bitmask` - commented out until LLVM is updated to LLVM 11
  * `iNNxMM_widen_*_{u,s}` - commented out until
    bytecodealliance/wasmtime#1994 lands
  * `iNNxMM_{max,min}_{u,s}`
  * `iNNxMM_avgr_u`

* Some wasm intrinsics have been removed:
  * `i64x2_trunc_*`
  * `f64x2_convert_*`
  * `i8x16_mul`

* The `v8x16.shuffle` instruction is exposed. This is done through a
  `macro` (not `macro_rules!`, but `macro`). This is intended to be
  somewhat experimental and unstable until we decide otherwise. This
  instruction has 16 immediate-mode expressions and is as a result
  unsuited to the existing `constify_*` logic of this crate. I'm hoping
  that we can game out over time what a macro might look like and/or
  look for better solutions. For now, though, what's implemented is the
  first of its kind in this crate (an architecture-specific macro), so
  some extra scrutiny looking at it would be appreciated.

* Lots of `assert_instr` annotations have been fixed for wasm.

* All wasm simd128 tests are uncommented and passing now.

This is still missing tests for new intrinsics and it's also missing
tests for various corner cases. I hope to get to those later as the
upstream spec itself gets closer to stabilization.

In the meantime, however, I went ahead and updated the `hex.rs` example
with a wasm implementation using intrinsics. With it I got some very
impressive speedups using Wasmtime:

    test benches::large_default  ... bench:     213,961 ns/iter (+/- 5,108) = 4900 MB/s
    test benches::large_fallback ... bench:   3,108,434 ns/iter (+/- 75,730) = 337 MB/s
    test benches::small_default  ... bench:          52 ns/iter (+/- 0) = 2250 MB/s
    test benches::small_fallback ... bench:         358 ns/iter (+/- 0) = 326 MB/s

or otherwise using Wasmtime hex encoding using SIMD is 15x faster on 1MB
chunks or 7x faster on small <128byte chunks.

All of these intrinsics are still unstable and will continue to be so
presumably until the simd proposal in wasm itself progresses to a later
stage. Additionaly we'll still want to sync with clang on intrinsic
names (or decide not to) at some point in the future.

* wasm: Unconditionally expose SIMD functions

This commit unconditionally exposes SIMD functions from the `wasm32`
module. This is done in such a way that the standard library does not
need to be recompiled to access SIMD intrinsics and use them. This,
hopefully, is the long-term story for SIMD in WebAssembly in Rust.

It's unlikely that all WebAssembly runtimes will end up implementing
SIMD so the standard library is unlikely to use SIMD any time soon, but
we want to make sure it's easily available to folks! This commit enables
all this by ensuring that SIMD is available to the standard library,
regardless of compilation flags.

This'll come with the same caveats as x86 support, where it doesn't make
sense to call these functions unless you're enabling simd support one
way or another locally. Additionally, as with x86, if you don't call
these functions then the instructions won't show up in your binary.

While I was here I went ahead and expanded the WebAssembly-specific
documentation for the wasm32 module as well, ensuring that the current
state of SIMD/Atomics are documented.
2020-07-18 13:32:52 +01:00
Taiki Endo
cd7aa7720a Remove azure pipelines badges 2019-10-10 12:42:41 +02:00
gnzlbg
00e10f12ce Update badges 2019-08-13 18:04:22 +02:00
gnzlbg
686b813f5d Update repo name 2019-07-09 01:37:07 +02:00
gnzlbg
127f13f10f Fix assert_instr tests 2019-07-08 22:58:19 +02:00
gnzlbg
e0d085132a Update wasm-bindgen-test 2019-05-09 20:49:45 +02:00
Alex Crichton
7215eb4613 Hook tests up to node.js
We can even test some of the functions!
2019-04-25 17:19:51 +02:00
gnzlbg
2da1e6bfa9 Enable edition=2018 for core_arch 2019-04-18 07:28:07 +02:00
gnzlbg
503b3f641e Bump patch versions 2019-04-17 14:49:15 +02:00
gnzlbg
a177055824 Test Rust2018 builds 2019-02-23 01:14:07 +01:00
gnzlbg
1fb5f768a9 Bump versions of core_arch and std_detect 2019-02-18 17:49:32 +01:00
gnzlbg
e56de7344f Fix wasm32 build job 2019-02-14 03:45:57 +01:00
gnzlbg
333784b5ef Fix libcore build 2019-02-12 01:02:07 +01:00
gnzlbg
586c0ae423 Fix docs.rs rustdoc arguments 2019-01-30 13:56:59 +01:00
gnzlbg
0b3f69246c Bump core_arch and std_detect versions 2019-01-30 13:46:41 +01:00
gnzlbg
d5ef055ba9 Fix building docs for all targets on docs.rs and re-export the arch module 2019-01-30 13:46:41 +01:00
gnzlbg
25197fca7b Update readme and dependencies 2019-01-30 11:27:23 +01:00
gnzlbg
72d929bed6 Bump core_arch and std_detect patch version 2019-01-30 11:27:23 +01:00
gnzlbg
3e0f1f754a Update description of core_arch and std_detect 2019-01-30 10:40:16 +01:00
gnzlbg
e627b1ac4a Update versions of core_arch and std_detect for release 2019-01-22 18:49:24 +01:00
gnzlbg
11c624e488 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}`.
2019-01-22 17:04:25 +01:00