Commit Graph

33 Commits

Author SHA1 Message Date
Adrian Friedli cf12e290fd enable msa feature for mips in codegen tests 2025-04-29 10:20:25 +02:00
Ralf Jung 216fac3c23 wasm, arm, x86-without-SSE need simd to be explicitly enabled 2025-04-23 14:01:08 +02:00
bors 71b68da1bd Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxu
Fix breakage when running compiletest with `--test-args=--edition=2015`

Compiletest has an `--edition` flag to change the default edition tests are run with. Unfortunately no test suite successfully executes when that flag is passed. If the edition is set to something greater than 2015 the breakage is expected, since the test suite currently supports only edition 2015 (Ferrous Systems will open an MCP about fixing that soonish). Surprisingly, the test suite is also broken if `--edition=2015` is passed to compiletest. This PR focuses on fixing the latter.

This PR fixes the two categories of failures happening when `--edition=2015` is passed:

* Some edition-specific tests set their edition through `//@ compile-flags` instead of `//@ edition`. Compiletest doesn't parse the compile flags, so it would see no `//@ edition` and add another `--edition` flag, leading to a rustc error.
* Compiletest would add the edition after `//@ compile-flags`, while some tests depend on flags passed to `//@ compile-flags` being the last flags in the rustc invocation.

Note that for the first category, I opted to manually go and replace all `//@ compile-flags` setting an edition with an explicit `//@ edition`. We could've changed compiletest to instead check whether an edition was set in `//@ compile-flags`, but I thought it was better to enforce a consistent way to set the edition in tests.

I also added the edition to the stamp, so that changing `--edition` results in tests being re-executed.

r? `@jieyouxu`
2025-04-11 10:53:45 +00:00
Stuart Cook 45ebc4060b Rollup merge of #137447 - folkertdev:simd-extract-insert-dyn, r=scottmcm
add `core::intrinsics::simd::{simd_extract_dyn, simd_insert_dyn}`

fixes https://github.com/rust-lang/rust/issues/137372

adds `core::intrinsics::simd::{simd_extract_dyn, simd_insert_dyn}`, which contrary to their non-dyn counterparts allow a non-const index. Many platforms (but notably not x86_64 or aarch64) have dedicated instructions for this operation, which stdarch can emit with this change.

Future work is to also make the `Index` operation on the `Simd` type emit this operation, but the intrinsic can't be used directly. We'll need some MIR shenanigans for that.

r? `@ghost`
2025-04-11 13:31:43 +10:00
Folkert de Vries 59c55339af add simd_insert_dyn and simd_extract_dyn 2025-04-10 21:22:07 +02:00
Pietro Albini cd371b90e2 replace //@ compile-flags: --edition with //@ edition 2025-04-10 09:56:37 +02:00
Scott McMurray 50d0ce1b42 Ensure swap_nonoverlapping is really always untyped 2025-04-09 09:09:37 -07:00
Folkert de Vries 038f4e2ff6 use the right feature in codegen tests 2025-02-27 12:23:00 +01:00
Folkert de Vries d8a067b931 remove most simd_ intrinsic declaration in tests
instead, we can just import the intrinsics from core
2025-02-27 12:22:59 +01:00
Scott McMurray 6f9cfd694d Rework OperandRef::extract_field to stop calling to_immediate_scalar on things which are already immediates
That means it stops trying to truncate things that are already `i1`s.
2025-02-19 12:03:40 -08:00
Ralf Jung 803feb5dc6 x86-sse2 ABI: use SSE registers for floats and SIMD 2025-02-18 16:11:41 +01:00
Jubilee Young 3c0c9b6770 tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
Scott McMurray d2309c2a9d Ban non-array SIMD 2024-09-09 19:39:43 -07:00
sayantn 2cde11f2d1 Chore: add x86_amx_intrinsics feature flag to core/lib.rs and remove issue-120720-reduce-nan.rs 2024-08-04 03:08:18 +05:30
Ralf Jung 2f2031d2b2 simd packed types: update outdated check, extend codegen test 2024-06-08 21:38:32 +02:00
Jubilee Young 9987363b7e Test codegen for repr(packed,simd) -> repr(simd) 2024-06-02 20:15:15 -07:00
Jubilee ca9dd62c05 Rollup merge of #125311 - calebzulawski:repr-packed-simd-intrinsics, r=workingjubilee
Make repr(packed) vectors work with SIMD intrinsics

In #117116 I fixed `#[repr(packed, simd)]` by doing the expected thing and removing padding from the layout.  This should be the last step in providing a solution to rust-lang/portable-simd#319
2024-06-02 05:06:47 -07:00
Jubilee Young 5c32f84048 Test codegen for repr(packed,simd) 2024-06-02 04:13:35 -07:00
Nicholas Nethercote 72800d3b89 Run rustfmt on tests/codegen/.
Except for `simd-intrinsic/`, which has a lot of files containing
multiple types like `u8x64` which really are better when hand-formatted.

There is a surprising amount of two-space indenting in this directory.

Non-trivial changes:
- `rustfmt::skip` needed in `debug-column.rs` to preserve meaning of the
  test.
- `rustfmt::skip` used in a few places where hand-formatting read more
  nicely: `enum/enum-match.rs`
- Line number adjustments needed for the expected output of
  `debug-column.rs` and `coroutine-debug.rs`.
2024-05-31 15:56:43 +10:00
klensy d97ed2d349 fix few typo in filecheck annotations 2024-05-11 13:10:24 +03:00
DianQK ec359f7d9f Restore the test checks for wider_reduce_into_iter
The current minimum support is for LLVM 17.
2024-03-28 21:28:45 +08:00
Erik Desjardins 96a72676d1 use [N x i8] for byval/sret types
This avoids depending on LLVM's struct types to determine the size of
the byval/sret slot.
2024-03-05 18:54:45 -05:00
Ralf Jung c1d0e489e5 fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
Ben Kimock 2f3c0b9859 Ignore less tests in debug builds 2024-02-23 18:04:01 -05:00
许杰友 Jieyou Xu (Joe) 6e48b96692 [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
Ralf Jung 07b6240947 remove simd_reduce_{min,max}_nanless 2024-02-21 20:50:47 +01:00
Ben Kimock cc73b71e8e Add "algebraic" versions of the fast-math intrinsics 2024-02-20 12:39:03 -05:00
Caleb Zulawski 4d9607869a Update std::simd usage and test outputs 2023-11-26 09:02:25 -05:00
Ben Kimock d32d9238cf Emit #[inline] on derive(Debug) 2023-11-09 10:40:55 -05:00
scottmcm e300847864 Add a wishlist FIXME 2023-10-06 07:05:09 +00:00
DianQK 910674f1c4 Only check for successful vectorization on wider_reduce_into_iter
Different vectorization results are due to different LLVM versions.
2023-09-24 09:49:39 +08:00
DianQK d30f210e5d Increasing the SIMD size improves the vectorization possibilities
Change the simd-wide-sum.rs to pass the LLVM main branching test.
2023-09-21 12:36:12 +08:00
Jubilee Young 45c284cd98 tests/codegen/*simd*.rs -> simd/*simd* 2023-07-29 18:34:41 -07:00