366 Commits

Author SHA1 Message Date
Linus Färnstrand
e0533a30d3 Stop importing int/float modules 2020-04-04 09:51:11 -07:00
Makoto Kato
d5d3117b9b
Support crc32 even if on arm32 (#834)
CRC32 is supported on A32 and T32.
2020-03-30 16:38:23 +01:00
Linus Färnstrand
b852344de5
Replace module MIN/MAX and min/max_value() with assoc consts (#843) 2020-03-29 17:08:21 +01:00
Amanieu d'Antras
c554b42b2a
Fix CI (#845)
* Use ubuntu 18.04 instead of 18.10 for MIPS CI

* Fix WASM CI
2020-03-29 15:15:59 +01:00
Makoto Kato
09ef01ade1
Add crypto target feature detection to arm32 (#833) 2020-03-29 12:28:17 +01:00
Jack O'Connor
e367bcd7f9
re-stabilize the AVX-512 features that were stabilized in Rust 1.27.0 (#842)
* re-stabilize the AVX-512 features that were stabilized in Rust 1.27.0

https://github.com/rust-lang/stdarch/pull/739 added per-feature
stabilization of runtime CPU feature detection. In so doing, it
de-stabilized some detection features that had been stable since Rust
1.27.0, breaking some published crates (on nightly). This commit
re-stabilizes the subset of AVX-512 detection features that were
included in 1.27.0 (that is, the pre-Ice-Lake subset). Other instruction
sets (MMX in particular) remain de-stabilized, pending a decision about
whether should ever stabilize them.

See https://github.com/rust-lang/rust/issues/68905.

* add a comment explaining feature detection stability

* adjust stabilizations to match most recent proposal

https://github.com/rust-lang/rust/issues/68905#issuecomment-595376319
2020-03-19 14:29:50 +00:00
Tyg13
9ab5dc0873
Remove unnecessary parens. (#839) 2020-01-30 13:15:36 +01:00
Aleksey Kladov
0bd16446db Fix race condition in feature cache on 32 platforms (#837)
* Fix race condition in feature cache on 32 platforms

If we observe that the second word is initialized, we can't really
assume that the first is initialized as well. So check each word
separately.

* Use stronger atomic ordering

Better SeqCst than sorry!

* Use two caches on x64 for simplicity
2020-01-28 21:53:17 +01:00
Luca Barbato
1601ce4f2f Add Icelake avx512 features (#838)
* Add Icelake avx512 features

As documented in https://software.intel.com/sites/default/files/managed/c5/15//architecture-instruction-set-extensions-programming-reference.pdf

* Sort the avx512 feature checks by bit

* Unbreak macos

Force nightly.
2020-01-26 13:10:29 -06:00
Yuki Okushi
c8c587d0cd Use issue = "none" instead of "0" 2019-12-27 11:25:13 +01:00
Oliver Scherer
43d49b6247 Update simd_llvm.rs 2019-12-20 23:31:51 +01:00
Oliver Scherer
5548609204 Add const unstability attributes
These are needed for rustc to be able to correctly handle stability of constness of intrinsics. Without either `rustc_const_unstable` or `rustc_const_stable` an intrinsic is not const evaluable at all.
2019-12-20 23:31:51 +01:00
bjorn3
c8249c76c4 Revert mmx changes
On i586 the simd_* intrinsics don't compile to MMX instructions, even
with `#[target_feature(enable = "mmx")]`.
2019-12-18 17:41:21 +01:00
bjorn3
ea51d868ec Rustfmt 2019-12-18 17:41:21 +01:00
bjorn3
0aa5e29724 Revert _mm_{min,max}_ps changes and add explanation why 2019-12-18 17:41:21 +01:00
bjorn3
2112972a64 Use <i64>::swap_bytes instead of llvm.bswap.i64 2019-12-18 17:41:21 +01:00
bjorn3
61693f3b53 Remove some unused llvm intrinsic declarations 2019-12-18 17:41:21 +01:00
bjorn3
c7e16bcebe Use <i32>::swap_bytes instead of llvm.bswap.i32 2019-12-18 17:41:21 +01:00
bjorn3
35fc3c36e3 Use simd_* in x86/avx2.rs where possible 2019-12-18 17:41:21 +01:00
bjorn3
fb84f79ce7 Use simd_* in x86/avx.rs where possible 2019-12-18 17:41:21 +01:00
bjorn3
c5572ec1f6 Use simd_* in x86/sse41.rs where possible 2019-12-18 17:41:21 +01:00
bjorn3
4da22d5120 Use simd_saturating_* in x86/sse2.rs where possible 2019-12-18 17:41:21 +01:00
bjorn3
039944d366 Use simd_fmin and simd_fmax for _mm_min_ps and _mm_max_ps 2019-12-18 17:41:21 +01:00
bjorn3
4de364cfb4 Use simd_* in x86/mmx.rs where possible 2019-12-18 17:41:21 +01:00
bjorn3
1c38869538 Add missing simd platform intrinsics 2019-12-18 17:41:21 +01:00
bjorn3
a4cd918dff Use simd_fma where possible 2019-12-18 17:41:21 +01:00
bjorn3
8c643df017 Use simd_floor and simd_ceil where possible 2019-12-18 17:41:21 +01:00
bjorn3
1ac2f13d76 Use simd_fsqrt where possible 2019-12-18 17:41:21 +01:00
bjorn3
dd65ed38db Require prefix of instruction line to be the expected instruction
`rsqrtps %xmm0,%xmm1` used to match `sqrtps` without leading `r`.
2019-12-18 17:41:21 +01:00
Makoto Kato
f5783f5193 Run-time feature detection for Aarch64 on Windows. 2019-12-11 12:24:03 +01:00
Makoto Kato
51c3295de1 Fix unused import: mem::transmute
When building on aarch64, the following warning occurs.

```
warning: unused import: `mem::transmute`
 --> crates/core_arch/src/arm/neon.rs:3:38
  |
3 | use crate::{core_arch::simd_llvm::*, mem::transmute};
  |                                      ^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default
```
2019-12-06 12:17:56 +01:00
Makoto Kato
cca9a86637 Add CRC32 detection to arm32
armv8 has 32-bit mode, but it can use crc32 instruction sets even if 32-bit.
2019-12-02 19:23:05 +01:00
ecstatic-morse
7c56404f1a Add #[rustc_args_required_const] to simd_shuffle
Currently, these have to be special-cased in the promotion logic for rustc.
2019-10-30 10:29:15 +01:00
Taiki Endo
5c1430079b Format with rustfmt 2019-10-26 18:46:57 +02:00
Taiki Endo
8f07ba7489 Update proc-macro2, syn, and quote to 1.0 2019-10-26 18:46:57 +02:00
Mateusz Mikuła
ed27e2fccd Replace rustfmt::skip custom inner attribute with rustfmt.toml 2019-10-26 18:46:22 +02:00
Alex Crichton
036b6348d9 Remove need for #[macro_use] with cfg-if
Modernizes usage of `cfg_if!` slightly
2019-10-10 12:43:27 +02:00
Taiki Endo
cd7aa7720a Remove azure pipelines badges 2019-10-10 12:42:41 +02:00
Taiki Endo
204c648633 Remove const_str_as_bytes feature gate 2019-10-10 12:41:08 +02:00
gnzlbg
128aa330ea Feature::from_str is not always needed 2019-09-18 12:09:07 +02:00
gnzlbg
579e4cc655 std_detect_env_override should be disabled by default 2019-09-18 12:09:07 +02:00
gnzlbg
88fe414dd3 These items do not need to be public 2019-09-18 12:09:07 +02:00
Luca Barbato
5bec3383c9 Drop the features test for now 2019-09-18 09:03:42 +02:00
Luca Barbato
a4dddb4b2f Unbreak non-x86 2019-09-18 09:03:42 +02:00
Luca Barbato
e0d42221ff Implement a fallback for the No-op Feature 2019-09-17 20:59:31 +02:00
Luca Barbato
8cad95c8ab Move the tests away from the code 2019-09-17 19:22:18 +02:00
Luca Barbato
efd19f4a13 Add a test for the env_override 2019-09-17 19:22:18 +02:00
Luca Barbato
b70d574394 Make the test function smaller 2019-09-17 19:22:18 +02:00
Luca Barbato
ee35b1848e Simplify the std imports 2019-09-17 19:22:18 +02:00
Luca Barbato
33688eaa10 Remove the FIXME about the cache size checks
And leave a NOTE.
2019-09-17 19:22:18 +02:00