29 Commits

Author SHA1 Message Date
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
459afa7a59 Fix clippy issues 2019-04-17 14:20:42 +02:00
gnzlbg
eac0c6c8c1 Migrate clippy lints to tool lints 2019-04-17 14:20:42 +02:00
Paolo Teti
86a62c6865 ACLE/SIMD32: add ssub8 and usub8
- add `ssub8` and `usub8`
- bump instruction limit to 29
2019-02-27 23:47:50 +01:00
Jorge Aparicio
c78520a8da assert_instr: bump instruction limit for simd32 2019-02-18 19:29:13 +01:00
Alexander Regueiro
a16a30d796 Various cosmetic improvements. 2019-02-18 15:29:36 +01:00
Alex Crichton
cf738b0d36
Attempt to fix tests on master (#662)
* Attempt to fix tests on master

* Make all doctests use items from the real `std` rather than this
  crate, it's just easier
* Handle debuginfo weirdness by flagging functions as `no_mangle` that
  we're looking for instructions within.

* Handle double undescores in symbol names
2019-01-30 15:11:35 -08:00
Alex Crichton
9c4e418fe0 Add a x86_64::cmpxchg16b intrinsic
This intrinsic isn't actually specified by Intel, but it's something
gated with CPUID and can otherwise be a useful thing to have when
building primitives!

There exists an `AtomicU128` type in the standard library but it's only
exposed currently (and it's unstable) when a platform fully supports
128-bit atomics. The x86_64 architecture does not support it *unless*
the `cmpxchg16b` instruction is available, and it isn't always available!

This commit is also a proposal for how we can include support for
128-bit atomics in the standard library on relevant platforms. I'm
thinking that we'll expose this one low-level intrinsic in
`std::arch::x86_64`, and then if desired a crate on crates.io can build
`AtomicU128` from this API.

In any case this is all unstable regardless!
2019-01-02 16:55:53 +01:00
Alex Crichton
cb921381c4
Rewrite simd128 and wasm support (#620)
* Update representation of `v128`
* Rename everything with new naming convention of underscores and no
  modules/impls
* Remove no longer necessary `wasm_simd128` feature
* Remove `#[target_feature]` attributes (use `#[cfg]` instead)
* Update `assert_instr` tests
* Update some implementations as LLVM has evolved
* Allow some more esoteric syntax in `#[assert_instr]`
* Adjust the safety of APIs where appropriate
* Remove macros in favor of hand-coded implementations
* Comment out the tests for now as there's no known runtime for these
  yet
2018-12-13 20:17:30 -06:00
Alex Crichton
5a45175fe1
Run rustfmt on stable, delete rustfmt.toml (#619)
This commit switches CI to running `rustfmt` on the stable compiler (as
rustfmt is stable now!). Additionally it deletes `rustfmt.toml` to
ensure we're following the same style as the rest of the ecosystem.
2018-12-13 17:26:22 -06:00
gnzlbg
eee3d5e6f0 fix clippy and shellcheck issues 2018-11-11 12:37:44 +01:00
Kaz Wesley
7fda54f9bc fix _mm_castsi128_pd and _mm_castpd_si128 impls (#581)
* fix _mm_castsi128_pd and _mm_castpd_si128 impls

The _mm_castX_Y SSE intrinsics are "reinterpreting" casts; LLVM's
simd_cast is a "converting" cast. Replace simd_cast with mem::transmute.
Fixes #55249

* Temporarily pin CI

* Fix i686 segfaults

* Fix wasm CI

Output of `wasm2wat` has changed!

* Fix AppVeyor with an older nightly
2018-10-23 18:10:54 +02:00
gnzlbg
c9afe0e684 only require wasm dependencies when targetting wasm 2018-09-12 19:56:41 +02:00
gnzlbg
1b9d8bb0ef Add environment variable STDSIMD_ASSERT_INSTR_LIMIT to control the instruction limit 2018-09-12 16:34:18 +02:00
Alex Crichton
274b91093d Tighten wasm-bindgen version dependency
No need to pick up new features right now as it's tied to what we're downloading
in the docker container
2018-09-06 16:43:59 -07:00
Alex Crichton
c1965d33a8
Rename wasm32 memory intrinsics (#560)
The official name of the memory intrinsics has changed to `memory.size` and
`memory.grow`, so let's reflect that with our naming as well! Additionally they
have an argument of which memory to operate on with LLVM and must always be zero
currently.
2018-09-06 15:34:05 -07:00
Alex Crichton
bd9f2b6314 Remove declaration of stable attributes 2018-08-27 10:04:25 -07:00
gnzlbg
3daebfbc0b Add wasm32 simd128 intrinsics (#549)
* Add wasm32 simd128 intrinsics

* test wasm32 simd128 instructions

* Run wasm tests like all other tests

* use modules instead of types to access wasm simd128 interpretations

* generate docs for wasm32-unknown-unknown

* fix typo

* Enable #[assert_instr] on wasm32

* Shell out to Node's `execSync` to execute `wasm2wat` over our wasm file
* Parse the wasm file line-by-line, looking for various function markers and
  such
* Use the `elem` section to build a function pointer table, allowing us to map
  exactly from function pointer to a function
* Avoid losing debug info (the names section) in release mode by stripping
  `--strip-debug` from `rust-lld`.

* remove exclude list from Cargo.toml

* fix assert_instr for non-wasm targets

* re-format assert-instr changes

* add crate that uses assert_instr

* Fix instructions having extra quotes

* Add assert_instr for wasm memory intrinsics

* Remove hacks for git wasm-bindgen

* add wasm_simd128 feature

* make wasm32 build correctly

* run simd128 tests on ci

* remove wasm-assert-instr-tests
2018-08-15 09:20:33 -07:00
gnzlbg
dafc8d9fbd remove unused features; formatting 2018-08-14 17:23:01 +02:00
Paolo Teti
f0eb5e1b3b ARM DSP: add Quad/Double add/sub with exchange and select bytes intrinsics (#532)
- Quad 8-bit addition/subtraction
- Double 8-bit addition/subtraction
- Saturating Add and Subtract with Exchange and
  Saturating Subtract and Add with Exchange, signed
- Select bytes based on GE bits

This patch bump the `assert_instr` limit to 22 (from 20) instead of
add a lots of exception for all DSP intrinsics.
2018-07-21 10:51:18 -05:00
Paolo Teti
e0504ce54a Add few ARM DSP Intrinsics (#529)
* Add few ARM DSP Intrinsics

- Signed saturating add/sub
- Saturating four 8-bit integer add/sub
- Saturating two 8-bit integer add/sub

The intent is mainly to setup the module and to add all
the rest in the future.

Listed intrinsics are available on Cortex-M too (+dsp is required
on some model except for M4).

* Arm DSP: rebase and remove portable vector types

Rebase everything on top of master since the portable vector types
have been removed.
2018-07-20 11:54:52 -05:00
Alex Crichton
f3cb25b8f9
Fix compile on latest nightly (#527)
The `proc_macro` feature has stabilized in the compiler and usage of it largely
needs to switch to `use_extern_macros` now.
2018-07-17 09:30:18 -05:00
dependabot[bot]
df3fac4bfb Update lazy_static requirement to 1.0
Updates the requirements on [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) to permit the latest version.
- [Release notes](https://github.com/rust-lang-nursery/lazy-static.rs/releases)
- [Commits](https://github.com/rust-lang-nursery/lazy-static.rs/commits/v1.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-07-06 21:46:33 +00:00
gnzlbg
e70ae5558f add CI for Android 2018-06-23 16:09:27 +02:00
gnzlbg
c3d273c980 reformat with latest rustfmt 2018-06-15 14:40:34 +02:00
Luca Barbato
85cae45e64 Bump rustc_demangle version
Otherwise some objdump output would not parse correctly.
2018-05-23 18:16:14 +02:00
Luca Barbato
9888c6ce82 Update proc macro2 (#455)
* Update to proc_macro2 0.4 and related

* Update to proc_macro2 0.4 and related

* Update to proc_macro2 0.4 and related

* Add proc_macro_gen feature

* Update to the new rustfmt cli

* A few proc-macro2 stylistic updates

* Disable RUST_BACKTRACE by default

* Allow rustfmt failure for now

* Disable proc-macro2 nightly feature in verify-x86

Currently this causes bugs on nightly due to upstream rustc bugs, this should be
temporary

* Attempt to thwart mergefunc

* Use static relocation model on i686
2018-05-21 13:37:41 -05:00
gnzlbg
56d9a42a2f add tests for endian-dependent behavior (#394)
* add tests for endian-dependent behavior

* format
2018-03-22 11:09:01 -05:00
Alex Crichton
39b5ec91ae
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.
2018-02-18 10:07:35 +09:00