1663 Commits

Author SHA1 Message Date
Eric Huss
2d74744885 Apply unsafe_attr_outside_unsafe 2025-02-09 10:53:07 -08:00
Eric Huss
8a765059b0 Apply rust_2024_incompatible_pat 2025-02-09 10:04:29 -08:00
Eric Huss
64e9ca74a8 Apply missing_unsafe_on_extern 2025-02-09 09:12:30 -08:00
Folkert de Vries
fe2acd4184 some doc changes 2025-02-07 22:42:27 +00:00
Folkert de Vries
6adb9dec75 add vec_splats for s390x 2025-02-07 22:42:27 +00:00
Folkert de Vries
55d37bd777 add vec_abs for s390x 2025-02-07 22:42:27 +00:00
Folkert de Vries
9be5f9b5f6 add vec_max and vec_min for s390x 2025-02-07 22:42:27 +00:00
Folkert de Vries
950229cd7d add vec_sub and vec_mul for s390x 2025-02-07 22:42:27 +00:00
Folkert de Vries
7f6d35d196 implement VectorAdd for s390x 2025-02-07 22:42:27 +00:00
sayantn
c6f32bca9d Small refactorings in x86-intel.rs
remove `PRINT_MISSING_LISTS` as it was unused
rename `PRINT_MISSING_LISTS_MARKDOWN`
2025-02-07 22:09:48 +00:00
sayantn
efb7cf80b9 Move all x86 std_detect tests to x86-specific.rs to reduce duplication 2025-02-07 22:09:48 +00:00
sayantn
e6ea3dc21c Remove CSR accessing tests as they are immediate UB 2025-02-07 22:09:48 +00:00
sayantn
b7036c26db Fix names of several tests
Rewrote `_mm_cvtps_ph` and `_mm_cvtph_ps` tests
2025-02-07 22:09:48 +00:00
Jacob Bramley
039f322e18 Consistently use the latest itertools. 2025-02-03 21:15:41 +00:00
Jacob Bramley
bd598f3be3 Update stdarch-gen-arm path generation.
Fix both the instructions for how to regenerate each `generated.rs`, and
the logic for inferring the correct output path from each input
`.spec.yml`.
2025-02-03 21:15:41 +00:00
Jacob Bramley
81035da551 Fix usage of proc_macro2::Punct.
Restructure stdarch-gen-arm to use `Group`s with `Delimiter`s rather
than ad-hoc `Punct`s.

`Punct` should only be used to represent specific characters, and never
for bracket-like characters. Recent versions of `Punct::new` check this
with an assertion.

Note that there doesn't appear to be a way to emit a line break for
formatting reasons — `Punct::new('\n', ...)` no longer works — so this
also removes all blank lines between functions in the generated files.
2025-01-29 17:44:31 +00:00
Folkert de Vries
96576234db implement VectorAdd for s390x 2025-01-20 14:48:56 +00:00
Folkert de Vries
48bbd53d19 basic infra for s390x vector intrinsics 2025-01-20 14:48:56 +00:00
Folkert de Vries
b5babcfac2 add is_s390x_feature_detected 2025-01-16 20:39:13 +00:00
James Barford-Evans
a1be13aeeb refactor - remove Sized as it is implicit 2025-01-16 14:29:19 +00:00
James Barford-Evans
ebd0c622cd remove - relaxing if size 2025-01-16 14:29:19 +00:00
James Barford-Evans
56f7baadc9 fix: always inline signed conversions 2025-01-16 14:29:19 +00:00
James Barford-Evans
f283e449b1 PR feedback & pipeline 2025-01-16 14:29:19 +00:00
James Barford-Evans
28cb01cd6a Remove old ARM intrinsic generator 2025-01-16 14:29:19 +00:00
James Barford-Evans
57b6779050 Generator supports creating neon instructions from YAML 2025-01-16 14:29:19 +00:00
Luca Vizzarro
03e4f2636e Generator for SVE intrinsics.
Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
Co-authored-by: Jacob Bramley <jacob.bramley@arm.com>
Co-authored-by: Luca Vizzarro <Luca.Vizzarro@arm.com>
Co-authored-by: Adam Gemmell <adam.gemmell@arm.com>
2025-01-16 14:29:19 +00:00
Adam Gemmell
9e24b307df Add SVE support to stdarch-verify
Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
Co-authored-by: Jacob Bramley <jacob.bramley@arm.com>
Co-authored-by: Luca Vizzarro <Luca.Vizzarro@arm.com>
2025-01-16 14:29:19 +00:00
Satoshi Tanda
17422c6089 Fix typo and prettify comment 2024-12-29 10:44:14 +00:00
sayantn
a19239f298 Remove 2 unused intrinsics 2024-12-27 11:23:44 +00:00
sayantn
4da1071b68 Remove v64.rs as it was superseded by simd.rs 2024-12-27 11:23:44 +00:00
sayantn
3a3146a56c Refactor the as_* functions in x86 2024-12-27 11:23:44 +00:00
WANG Rui
75ec201457 core_arch: Add LoongArch basic intrinsics 2024-12-23 22:28:34 +00:00
Laine Taffin Altman
dbdcef3f3c Expand feature detection on AArch64 Darwin
This reflects the currently available set of sysctl values as of macOS 15, on 2024-12-21.  Features not (yet) exposed by `is_aarch64_feature_detected` have been left in comments to document their existence for the future.
2024-12-23 10:54:10 +00:00
sayantn
96154fbde8 Fix _mm*_mask_cmp_ep*_mask bug with IMM3=7 2024-12-21 12:02:41 +00:00
daxpedda
9ea6010f16 Fix Wasm f*_sqrt() doc 2024-12-21 12:02:28 +00:00
sayantn
a635da83d7 Make assert_instr stricter 2024-12-21 10:12:32 +00:00
Martin Liska
728b35dfbb Remove buffers in tests for {f,}xsave{c,}{64,}
Fixes: #1672
2024-12-13 15:07:48 +00:00
Sayantan Chakraborty
5d3879f558 assert_instr for AMX 2024-12-12 16:56:01 +00:00
Sayantan Chakraborty
139b2ad3e3 Use core::intrinsics::fmaf16 instead of LLVM intrinsic 2024-12-12 16:56:01 +00:00
Sayantan Chakraborty
0b0b7e6fe1 Cleanup: remove redundant target features
Make target feature verification stricter
2024-12-12 16:56:01 +00:00
daxpedda
69efcbdb54 Add numeric instructions for Wasm not available in core 2024-12-12 16:53:36 +00:00
aaishwarymishra@gmail.com
b3bdc662d8 Fix incorrect documentation for _mm_loadu_si64 function 2024-12-09 03:02:48 +00:00
Alex Crichton
745ebd5362 wasm: Add missing #[target_feature] to simd ctors
This is a resubmission of #1609 which was ruled optional but not
necessary at the time but it's now necessary. These weren't originally
applied as they weren't allowed in a `const` context but that's no
longer applicable. At the same time though be sure to add some small
tests to ensure that these intrinsics can be used in a `const` context.
2024-12-02 16:28:24 +00:00
Martin Liska
a1e78aca2f Fix test-case 2024-11-30 23:07:21 +00:00
Martin Liska
0601aa385b Fix and document _mmX_alignr_epiX family of intrinsics 2024-11-30 23:07:21 +00:00
Martin Liska
1d10adfa38 Fix implementation of _mm256_alignr_epi8<16>
The function is supposed to return first argument for IMM8 == 8.
2024-11-30 23:07:21 +00:00
Martin Liska
6d24a9f72b Fix signature of _mm512_store{u,}_si512.
Simiarly to other functions for `mm` and `mm256` register widths, the
first argument should be a pointer to the pointer type. See e.g.
`_mm256_store_si256` function.
2024-11-30 21:35:13 +00:00
Ralf Jung
358aee539b remove rustc_allow_const_fn_unstable feature gate 2024-11-30 21:34:02 +00:00
Nicholas Nethercote
ddf10db1a3 Fix the features macro.
The first rule of the `features` macro looks like this:
```
macro_rules! features {
    (
      @TARGET: $target:ident;
      @CFG: $cfg:meta;
      @MACRO_NAME: $macro_name:ident;
      @MACRO_ATTRS: $(#[$macro_attrs:meta])*
      $(@BIND_FEATURE_NAME: $bind_feature:tt; $feature_impl:tt; $(#[$deprecate_attr:meta];)?)*
      $(@NO_RUNTIME_DETECTION: $nort_feature:tt; )*
      $(@FEATURE: #[$stability_attr:meta] $feature:ident: $feature_lit:tt;
          $(without cfg check: $feature_cfg_check:literal;)?
          $(implied by target_features: [$($target_feature_lit:tt),*];)?
          $(#[$feature_comment:meta])*)*
    ) => {
```
Notice all the `tt` specifiers. They are used because they are forwarded
to another macro. Only `ident`, `lifetime`, and `tt` specifiers can be
forwarded this way.

But there is an exception: `$feature_lit:tt`, which was added recently.
In theory it should cause an error like this:
```
error: no rules expected `literal` metavariable
   --> /home/njn/dev/rust3/library/stdarch/crates/std_detect/src/detect/macros.rs:54:91
    |
51  | /         macro_rules! $macro_name {
52  | |             $(
53  | |                 ($feature_lit) => {
54  | |                     $crate::detect_feature!($feature, $feature_lit $(, without cfg check: $feature_cfg_check)? ...
    | |                                                                                           ^^^^^^^^^^^^^^^^^^ no rules expected this token in macro call
...   |
88  | |             };
89  | |         }
    | |_________- in this expansion of `is_x86_feature_detected!`
    |
   ::: std/tests/run-time-detect.rs:145:27
    |
145 |       println!("tsc: {:?}", is_x86_feature_detected!("tsc"));
    |                             ------------------------------- in this macro invocation
    |
note: while trying to match keyword `true`
   --> /home/njn/dev/rust3/library/stdarch/crates/std_detect/src/detect/macros.rs:12:55
    |
12  |     ($feature:tt, $feature_lit:tt, without cfg check: true) => {
    |                                                       ^^^^
    = note: captured metavariables except for `:tt`, `:ident` and `:lifetime` cannot be compared to other tokens
    = note: see <https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment> for more information
```
(The URL at the end of the error has more details about this forwarding
limitation.)

In practice it doesn't cause this error. I'm not sure why, but the
existing macro implementation in rustc is far from perfect, so it's
believable that it does the wrong thing here.

Why does this matter? Because https://github.com/rust-lang/rust/pull/124141
is modifying the macro implementation, and when that PR is applied the
error *does* occur. (It's one of several cases I have found where the
existing compiler accepts code it shouldn't, but #124141 causes that
code to be rejected.)

Fortunately the fix is simple: replace the `literal` specifier with `tt`.
2024-11-30 21:32:50 +00:00
Tobias Decking
4d2911ba4b Rework SIMD zeroing 2024-11-30 00:05:40 +00:00