rust/src/test/ui/simd
bors bb587b1a17 Auto merge of #80652 - calebzulawski:simd-lanes, r=nagisa
Improve SIMD type element count validation

Resolves rust-lang/stdsimd#53.

These changes are motivated by `stdsimd` moving in the direction of const generic vectors, e.g.:
```rust
#[repr(simd)]
struct SimdF32<const N: usize>([f32; N]);
```

This makes a few changes:
* Establishes a maximum SIMD lane count of 2^16 (65536).  This value is arbitrary, but attempts to validate lane count before hitting potential errors in the backend.  It's not clear what LLVM's maximum lane count is, but cranelift's appears to be much less than `usize::MAX`, at least.
* Expands some SIMD intrinsics to support arbitrary lane counts.  This resolves the ICE in the linked issue.
* Attempts to catch invalid-sized vectors during typeck when possible.

Unresolved questions:
* Generic-length vectors can't be validated in typeck and are only validated after monomorphization while computing layout.  This "works", but the errors simply bail out with no context beyond the name of the type.  Should these errors instead return `LayoutError` or otherwise provide context in some way?  As it stands, users of `stdsimd` could trivially produce monomorphization errors by making zero-length vectors.

cc `@bjorn3`
2021-02-07 22:25:14 +00:00
..
issue-17170.rs Move SIMD tests 2021-01-23 17:55:34 -05:00
issue-17170.stderr Move SIMD tests 2021-01-23 17:55:34 -05:00
issue-32947.rs Move some tests to more reasonable directories 2021-01-31 19:46:46 -03:00
issue-39720.rs Move SIMD tests 2021-01-23 17:55:34 -05:00
issue-39720.stderr Move SIMD tests 2021-01-23 17:55:34 -05:00
shuffle-not-out-of-bounds.rs Flatten arrows with further comment 2020-10-03 12:14:22 -07:00
shuffle-not-out-of-bounds.stderr Macro-expand test to cover all possible lanes 2020-10-02 19:38:56 -07:00
simd-array-trait.rs fix up tidy 2020-11-15 18:03:42 +10:00
simd-array-trait.stderr add a canary test for complex repr(simd) 2020-11-15 09:35:04 +10:00
simd-array-type.rs update tests 2020-12-26 18:24:10 +01:00
simd-generics.rs update tests 2020-12-26 18:24:10 +01:00
simd-intrinsic-float-math.rs
simd-intrinsic-float-minmax.rs Update tests to remove old numeric constants 2020-11-29 00:55:55 -05:00
simd-intrinsic-generic-arithmetic-saturating.rs update tests 2020-12-26 18:24:10 +01:00
simd-intrinsic-generic-arithmetic.rs update tests 2020-12-26 18:24:10 +01:00
simd-intrinsic-generic-bitmask.rs compiletest: ignore-endian-big, fixes #74829, fixes #74885 2020-07-31 12:58:37 +01:00
simd-intrinsic-generic-cast.rs Revert const_err lint checking of casts 2020-01-02 21:21:02 -05:00
simd-intrinsic-generic-comparison.rs Update tests to remove old numeric constants 2020-11-29 00:55:55 -05:00
simd-intrinsic-generic-elements.rs Fix maximum SIMD lane count, and expose it to other crates. Disallow SIMD vectors with non-power-of-two lengths. 2021-01-23 16:33:19 -05:00
simd-intrinsic-generic-gather.rs
simd-intrinsic-generic-reduction.rs Migrate to numeric associated consts 2020-06-10 01:35:47 +00:00
simd-intrinsic-generic-select.rs Support vectors with fewer than 8 elements for simd_select_bitmask 2020-10-03 20:35:59 +01:00
simd-size-align.rs Fix maximum SIMD lane count, and expose it to other crates. Disallow SIMD vectors with non-power-of-two lengths. 2021-01-23 16:33:19 -05:00
simd-target-feature-mixup.rs
simd-type-generic-monomorphisation-empty.rs Move SIMD tests 2021-01-23 17:55:34 -05:00
simd-type-generic-monomorphisation-empty.stderr Move SIMD tests 2021-01-23 17:55:34 -05:00
simd-type-generic-monomorphisation-oversized.rs Move SIMD tests 2021-01-23 17:55:34 -05:00
simd-type-generic-monomorphisation-oversized.stderr Move SIMD tests 2021-01-23 17:55:34 -05:00
simd-type-generic-monomorphisation-power-of-two.rs Move SIMD tests 2021-01-23 17:55:34 -05:00
simd-type-generic-monomorphisation-power-of-two.stderr Move SIMD tests 2021-01-23 17:55:34 -05:00
simd-type-generic-monomorphisation.rs Move SIMD tests 2021-01-23 17:55:34 -05:00
simd-type-generic-monomorphisation.stderr Move SIMD tests 2021-01-23 17:55:34 -05:00
simd-type.rs Move SIMD tests 2021-01-23 17:55:34 -05:00
simd-type.stderr Move SIMD tests 2021-01-23 17:55:34 -05:00