about summary refs log tree commit diff
path: root/src/test/ui/simd
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-3754/+0
2022-10-10suggest candidates for unresolved importSparrowLii-0/+5
2022-10-03Ignore fuchsia on two compiler testsAndrew Pollack-0/+1
2022-09-17Rollup merge of #98441 - calebzulawski:simd_as, r=oli-obkDylan DPC-0/+33
Implement simd_as for pointers Expands `simd_as` (and `simd_cast`) to handle pointer-to-pointer, pointer-to-integer, and integer-to-pointer conversions. cc ``@programmerjake`` ``@thomcc``
2022-07-22Auto merge of #99491 - workingjubilee:sync-psimd, r=workingjubileebors-7/+8
Sync in portable-simd subtree r? `@ghost`
2022-07-22Add simd_cast_ptr, simd_expose_addr, and simd_from_exposed_addr intrinsicsCaleb Zulawski-0/+33
2022-07-20Introduce core::simd trait imports in testsJubilee Young-7/+8
2022-07-19feat: omit suffixes in const generics (e.g. `1_i32`)Artur Sinila-12/+12
Closes #99255
2022-07-01Shorten def_span for more items.Camille GILLOT-6/+6
2022-05-25suggest `extern crate foo` when failing to resolve `use foo`Takayuki Maeda-0/+2
fix ci error
2022-01-27pub use std::simd::StdFloat;Jubilee Young-12/+37
Make available the remaining float intrinsics that require runtime support from a platform's libm, and thus cannot be included in a no-deps libcore, by exposing them through a sealed trait, `std::simd::StdFloat`. We might use the trait approach a bit more in the future, or maybe not. Ideally, this trait doesn't stick around, even if so. If we don't need to intermesh it with std, it can be used as a crate, but currently that is somewhat uncertain.
2022-01-04Add pointer-sized integer testsCaleb Zulawski-0/+14
2022-01-04Add simd_as intrinsicCaleb Zulawski-0/+34
2022-01-04Allow isize/usize in simd_castCaleb Zulawski-0/+21
2021-11-22`#![feature(inline_const)]` is no longer incompleteGary Guo-1/+0
2021-11-13Auto merge of #89167 - workingjubilee:use-simd, r=MarkSimulacrumbors-0/+83
pub use core::simd; A portable abstraction over SIMD has been a major pursuit in recent years for several programming languages. In Rust, `std::arch` offers explicit SIMD acceleration via compiler intrinsics, but it does so at the cost of having to individually maintain each and every single such API, and is almost completely `unsafe` to use. `core::simd` offers safe abstractions that are resolved to the appropriate SIMD instructions by LLVM during compilation, including scalar instructions if that is all that is available. `core::simd` is enabled by the `#![portable_simd]` nightly feature tracked in https://github.com/rust-lang/rust/issues/86656 and is introduced here by pulling in the https://github.com/rust-lang/portable-simd repository as a subtree. We built the repository out-of-tree to allow faster compilation and a stochastic test suite backed by the proptest crate to verify that different targets, features, and optimizations produce the same result, so that using this library does not introduce any surprises. As these tests are technically non-deterministic, and thus can introduce overly interesting Heisenbugs if included in the rustc CI, they are visible in the commit history of the subtree but do nothing here. Some tests **are** introduced via the documentation, but these use deterministic asserts. There are multiple unsolved problems with the library at the current moment, including a want for better documentation, technical issues with LLVM scalarizing and lowering to libm, room for improvement for the APIs, and so far I have not added the necessary plumbing for allowing the more experimental or libm-dependent APIs to be used. However, I thought it would be prudent to open this for review in its current condition, as it is both usable and it is likely I am going to learn something else needs to be fixed when bors tries this out. The major types are - `core::simd::Simd<T, N>` - `core::simd::Mask<T, N>` There is also the `LaneCount` struct, which, together with the SimdElement and SupportedLaneCount traits, limit the implementation's maximum support to vectors we know will actually compile and provide supporting logic for bitmasks. I'm hoping to simplify at least some of these out of the way as the compiler and library evolve.
2021-11-12Test core::simd worksJubilee Young-0/+83
These tests just verify some basic APIs of core::simd function, and guarantees that attempting to access the wrong things doesn't work. The majority of tests are stochastic, and so remain upstream, but a few deterministic tests arrive in the subtree as doc tests.
2021-11-06Disable bitmask test on big endianCaleb Zulawski-0/+1
2021-11-06Allow simd_select_bitmask to take byte arraysCaleb Zulawski-17/+39
2021-11-06Allow simd_bitmask to return byte arraysCaleb Zulawski-10/+38
2021-10-15Bless testsCameron Steffen-6/+6
2021-10-10Auto merge of #89541 - workingjubilee:abbrev-shufvec-t, r=Mark-Simulacrumbors-189/+1208
Cleanup src/test/ui/{simd,simd-intrinsic} Initial motivation was to simplify a huge macro expansion using a tuple, since we can just use an array in `#[repr(simd)]` now for the same result. But also, several tests were going unnoticed during development of SIMD intrinsics because people kept looking in the wrong directory, and many are basically run-pass vs. build-fail versions of the same tests, so let's keep them close together and simplify their names, so they're easier to sift through.
2021-10-04Re-bless src/test/ui/simdJubilee Young-84/+84
2021-10-04Rearrange test/ui/{simd,simd-intrinsic}Jubilee Young-0/+1149
Mostly test/ui/simd-intrinsic -> test/ui/simd/intrinsic Intrinsics-per-se tests moved into that folder Repetitive names were cut short. Duplicate names given -pass annotations.
2021-10-04Use arrays over tuples in SIMD testsJubilee Young-182/+52
Simd([u8; 64]) is now valid for repr(simd), so simplify tests with huge tuples instead. This also found some completely untested code, so let's just ditch that.
2021-09-27Update issue-89193.rsGeorge O'Hara-4/+2
2021-09-27Issue 89193George O'Hara-0/+53
2021-09-16Fix shuffle index constant not being monomorphized.Caleb Zulawski-0/+40
2021-09-11Allow simd_shuffle to accept vectors of any lengthCaleb Zulawski-1/+41
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-4/+4
2021-08-03Allow generic SIMD array element typeCaleb Zulawski-15/+61
2021-06-10std: Stabilize wasm simd intrinsicsAlex Crichton-2/+0
This commit performs two changes to stabilize Rust support for WebAssembly simd intrinsics: * The stdarch submodule is updated to pull in rust-lang/stdarch#1179. * The `wasm_target_feature` feature gate requirement for the `simd128` feature has been removed, stabilizing the name `simd128`. This should conclude the FCP started on #74372 and... Closes #74372
2021-06-05Auto merge of #85919 - workingjubilee:simd-ptrs-are-valid, r=petrochenkovbors-0/+122
Allow raw pointers in SIMD types Closes #85915 by loosening the strictness in typechecking and adding a test to guarantee it passes. This still might be too strict, as references currently do pass monomorphization, but my understanding is that they are not guaranteed to be "scalar" in the same way.
2021-06-03wasm: Make simd types passed via indirection againAlex Crichton-0/+33
This commit updates wasm target specs to use `simd_types_indirect: true` again. Long ago this was added since wasm simd types were always translated to `v128` under-the-hood in LLVM, meaning that it didn't matter whether that target feature was enabled or not. Now, however, `v128` is conditionally used in codegen depending on target features enabled, meaning that it's possible to get linker errors about different signatures in code that correctly uses simd types. The fix is the same as for all other platforms, which is to pass the type indirectly.
2021-06-02test for more SIMD monomorphization errorsJacob Lifshay-0/+55
build-fail test for simd type with an element type that's a wide pointer test for SIMD element type of optional nonnull ptr to extern type test that wide ptr simd element type of *mut [u8] fails
2021-06-01Allow raw pointers in SIMD typesJubilee Young-0/+67
2021-05-27Test THIR unsafeck for unsafe ops in closuresLeSeulArtichaut-0/+2
2021-05-13Auto merge of #85110 - RalfJung:no-rustc_args_required_const, r=oli-obkbors-9/+11
Remove rustc_args_required_const attribute Now that stdarch no longer needs it (thanks `@Amanieu!),` we can kill the `rustc_args_required_const` attribute. This means that lifetime extension of references to temporaries is the only remaining job that promotion is performing. :-) r? `@oli-obk` Fixes https://github.com/rust-lang/rust/issues/69493
2021-05-13fix test suiteRalf Jung-9/+11
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-6/+6
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-04-14Add more SIMD math.h intrinsicsJubilee Young-8/+19
LLVM supports many functions from math.h in its IR. Many of these have single-instruction variants on various platforms. So, let's add them so std::arch can use them. Yes, exact comparison is intentional: rounding must always return a valid integer-equal value, except for inf/NAN.
2021-04-03Remove redundant `ignore-tidy-linelength` annotationsSimon Jakobi-8/+6
This is step 2 towards fixing #77548. In the codegen and codegen-units test suites, the `//` comment markers were kept in order not to affect any source locations. This is because these tests cannot be automatically `--bless`ed.
2021-03-22Update the minimum external LLVM to 10Josh Stone-1/+0
2021-03-19Add simd_neg platform intrinsicSparrowLii-0/+7
2021-03-02Fix UI errorsErin Power-9/+3
2021-03-02Revert non-power-of-two vector restrictionErin Power-35/+2
2021-02-07Auto merge of #80652 - calebzulawski:simd-lanes, r=nagisabors-102/+232
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-01-31Move some tests to more reasonable directoriesCaio-0/+24
2021-01-23Move SIMD testsCaleb Zulawski-5/+202
2021-01-23Fix maximum SIMD lane count, and expose it to other crates. Disallow SIMD ↵Caleb Zulawski-97/+30
vectors with non-power-of-two lengths.