738 Commits

Author SHA1 Message Date
Amanieu d'Antras
fff3c73f11 Mark more arm_shared intrinsics and types as stable in docs
This is a follow-up to #1345 where these appeared as unstable in the
standard library docs because they are only stabilized for ARM. They
were missed in the original PR.
2023-03-24 23:27:24 +01:00
Luca Barbato
e82aebe756 core_arch: Unbreak powerpc64 tests 2023-03-24 23:27:08 +01:00
Taiki Endo
fe04ca5624 core_arch: Update cmpxchg16b docs and fix feature name
- Fix a typo in the feature name
- Update docs to reflect changes in behavior on invalid ordering in
  stabilized PR: invalid ordering is no longer UB, just causes panic as
  well as compare_exchange
2023-03-19 16:09:29 +01:00
Alex Crichton
be861579df wasm32: Add relaxed simd instructions
This commit adds intrinsics to the `wasm32` to support the [relaxed SIMD
proposal][proposal]. These are added with the same naming conventions of
existing simd-related intrinsics for wasm which is similar to the
instruction name but matches sign in a few places.

This additionally updates Wasmtime to execute tests with support for the
relaxed simd proposal. No release has been made yet so this uses the
`dev` release, and I can make a PR in April when the support in Wasmtime
has been released to an official release. The `wasmprinter` crate is
also updated to understand these instruction opcodes as well.

Documentation has been added for all intrinsics, but tests have only
been added for some of them so far. I hope to follow-up later with more
tests.

[proposal]: https://github.com/WebAssembly/relaxed-simd
2023-03-19 16:08:18 +01:00
Kathryn Long
a63313212b Stabilize f16c intrinsics 2023-03-12 20:19:54 +01:00
Amanieu d'Antras
644e8f8900 Replace associated const hacks with inline consts
Fixes #1368
2023-03-05 18:00:21 +01:00
Taiki Endo
c7daba316e Re-add #![feature(target_feature_11)]
We removed this in 307c42fbf4bdfdda2c46fdc1d330cc61d96b5182, but the
stabilization was reverted in https://github.com/rust-lang/rust/pull/108654.
2023-03-05 17:02:26 +01:00
Taiki Endo
169d8d8c48 Fix stable_features warnings
```
warning: the feature `cmpxchg16b_target_feature` has been stable since 1.69.0-nightly and no longer requires an attribute to enable
  --> crates/core_arch/src/lib.rs:24:5
   |
24 |     cmpxchg16b_target_feature,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(stable_features)]` on by default

warning: the feature `target_feature_11` has been stable since 1.69.0-nightly and no longer requires an attribute to enable
  --> crates/core_arch/src/lib.rs:34:5
   |
34 |     target_feature_11,
   |     ^^^^^^^^^^^^^^^^^
```
2023-03-01 18:56:19 +01:00
Taiki Endo
a9681a2ca6 Merge core_arch/tests/cpu-detection.rs to std_detect/tests/cpu-detection.rs
Except for the recently added `x86_deprecated` test,
`core_arch/tests/cpu-detection.rs` is a subset of
`std_detect/tests/cpu-detection.rs`.
2023-03-01 18:53:20 +01:00
Kuba Jaroszewski
56faab71f8 Fix typo 2023-02-23 12:51:14 +01:00
Артём Павлов
0301eced58 Update Intel Intrinsics Guide links 2023-02-18 20:34:16 +01:00
bwmf2
1c18225f32 Fix typo 2023-02-18 20:02:17 +01:00
Felix
217a7d106a
update the URL of Intel CPUID reference book (#1376) 2023-02-07 15:17:59 +01:00
Urgau
8048734108 Remove obsolete cfg for nvptx
Following to the compiler MCP 496
(https://github.com/rust-lang/compiler-team/issues/496)
2023-01-22 18:20:30 +00:00
Jacob Bramley
262d7c77bf Don't declare f16c_target_feature.
f16c_target_feature was recently stabilised.

This fixes a warning that results in a CI failure (due to `-D
stable-features`) with current nightly Rust.
2023-01-22 15:38:02 +00:00
Ralf Jung
5afa869e0a use inline const for last simd_shuffle argument 2023-01-10 00:23:14 +00:00
Jacob Bramley
4364634d74 Remove some trailing whitespace. 2023-01-09 15:08:12 +00:00
Jacob Bramley
665e33f3be Match Neon test features to their intrinsics.
The tests can run if and only if the target_features for the
corresponding intrinsics are detected at run-time, so make sure that the
tests have an appropriate `simd_test()`.

This fixes some failures due to tests running when they shouldn't. For
example, some tests would fail on hardware that lacks "fcma".
2023-01-09 15:08:12 +00:00
Jacob Bramley
f966d451b5 Decouple TargetFeature strings.
"arm" and "aarch64" support different sets of `target_feature` and
`simd_test` arguments, and for "arm", the set of features that can be
dynamically detected is different again. Restructure the generator code
to allow this to be expressed accurately (in future patches).

This implementation preserves the way that target features are specified
for shared intrinsics, because this has an impact on the generated
documentation. In particular, rustdoc cannot look inside
`cfg_attr(target_arch = ...)` tests, so we use unconditional
`target_feature` attributes where possible.
2023-01-09 15:08:12 +00:00
Nugine
284e7768c9
Resolve old FIXME comments (#1364) 2023-01-06 11:52:12 +00:00
Nugine
ee060659d9
Stabilize cmpxchg16b instrinsic (#1358)
Resolves https://github.com/rust-lang/stdarch/issues/827
2023-01-05 17:52:56 +00:00
Ruben De Smet
755a95168f
Move vector combine intrisics to arm/neon.rs (#1363) 2022-12-11 18:09:13 +00:00
Amanieu d'Antras
f6f1ec11fa
Fix typo in LLVM intrinsic names (#1362)
Fixes https://github.com/rust-lang/stdarch/issues/1361
2022-11-28 03:11:45 +00:00
Caleb Zulawski
0b2b195544
Rename misleading features (#1355) 2022-11-21 20:56:45 +00:00
Nugine
128cb1c6a7
Use simd intrinsics for max and min (#1357) 2022-11-21 20:55:44 +00:00
Nugine
83cd38d056
Fix undefined behavior in movemask_epi8 (#1354)
Fixes https://github.com/rust-lang/stdarch/issues/1347
2022-11-16 18:15:48 +00:00
Amanieu d'Antras
75127705cc
Remove workaround for old LLVM issue (#1353)
Fixes https://github.com/rust-lang/stdarch/issues/794
2022-11-16 15:57:12 +00:00
Amanieu d'Antras
c80d9794e0
Don't require AVX512 for 128/256-bit GFNI & VPCLMULQDQ intrinsics (#1349) 2022-10-30 01:56:06 +01:00
Amanieu d'Antras
55f9fcda26
Don't require AVX512 for 256-bit VAES intrinsics (#1348) 2022-10-27 19:51:16 +01:00
Amanieu d'Antras
eea72e2ed7
Mark arm_shared intrinsics as stable on all target except ARM (#1345) 2022-10-25 20:18:19 +01:00
Amanieu d'Antras
9707fba048
Fix undefined behavior in SSE4.2 test (#1341) 2022-10-25 20:18:02 +01:00
Yuri Astrakhan
81c221f058
Edition 2021, apply clippy::uninlined_format_args fix (#1339) 2022-10-25 20:17:23 +01:00
Rageking8
90f618d8dd
Fix dupe word typos (#1344) 2022-10-25 15:01:34 +01:00
Chris Wailes
13d20910b7
Update the Android Docker files to Ubuntu 22.04 (#1338) 2022-10-04 09:19:36 +01:00
Jacob Bramley
8a944e5a5f
Add HWCAP2 support for AArch64 Linux. (#1335) 2022-09-22 05:31:46 +01:00
luojia65
e0e9e96c1d crate: use target feature v1.1 2022-09-13 05:03:04 +02:00
luojia65
a49ca40768 riscv: P extension intrinsics for packed SIMD (part 1)
Implement by inline assembly for now, uses `pure, nomem, nostack` for
all packed simd arithmetic instructions. Uses `inlateout` when it
requires using the same register for input and output, use `lateout`
for all output registers.

This commit also includes a rearrangement of shared risc-v architecture
module to improve documents. It also includes a doc test fix, gate sm3/4
and use explict sm3/4 instruction under rustc target feature.
2022-09-13 05:03:04 +02:00
Tobias Bengtsson
ee67399527 Fix documentation of __m256bh and __m512bh structs 2022-09-12 22:20:43 +02:00
Artyom Pavlov
23ec6d7dd0 Use mov and xchg instead of movl(q) and xchgl(q) 2022-09-08 13:08:39 +02:00
Artyom Pavlov
ef7ae083b7 Remove late specifiers in __cpuid_count 2022-09-08 13:08:39 +02:00
bjorn3
fc51fc4da4 Remove simd_shuffle<n> usage in favor of simd_shuffle
This slightly reduces the amount of intrinsics codegen backends need to implement.
2022-09-06 03:36:27 +02:00
bjorn3
1536639d42 Use simd_bitmask intrinsic in a couple of places 2022-09-05 23:38:14 +02:00
Tomasz Miąsko
64e9268deb Fix links in documentation of cmpxchg16b 2022-08-23 15:51:52 +02:00
Amanieu d'Antras
e79701c56e Properly fix vext intrinsic tests
This was previously done as part of #1326, but it modified generated
code without fixing the root issue in neon.spec.
2022-08-22 23:46:15 +02:00
Maybe Waffle
1a2eac5986 Replace some calls to pointer::offset with add and sub 2022-08-22 22:41:21 +02:00
Amanieu d'Antras
82cb569895 Tweak constant for ARM vext instruction tests 2022-08-20 22:18:54 +02:00
Amanieu d'Antras
53d56091c6 Use llvm.ppc.altivec.lvx intrinsic for vec_ld
The `vec_ld` intrinsic is expected to automatically round the given
address down to a 16-byte boundary.
2022-08-20 22:18:54 +02:00
psvri
8119ecd492 Adding doc links for arm neon intrinsics 2022-08-12 19:51:56 +02:00
psvri
40668050cf Adding doc links for arm crypto and aes intrinsics 2022-08-12 17:27:12 +02:00
Amanieu d'Antras
c01441b696 Remove instruction tests for __mmask* intrinsics
We generate normal scalar code for these, not specific intructions.
2022-08-12 17:26:16 +02:00