Skip to main content

core/intrinsics/simd/
scalable.rs

1//! Scalable vector compiler intrinsics.
2//!
3//! In this module, a "vector" is any `#[rustc_scalable_vector]`-annotated type.
4
5/// Create a tuple of two vectors.
6///
7/// `SVecTup` must be a scalable vector tuple (`#[rustc_scalable_vector]`) and `SVec` must be a
8/// scalable vector (`#[rustc_scalable_vector(N)]`). `SVecTup` must be a tuple of vectors of
9/// type `SVec`.
10///
11/// Corresponds to Clang's `__builtin_sve_svcreate2*` builtins.
12#[rustc_nounwind]
13#[rustc_intrinsic]
14pub unsafe fn sve_tuple_create2<SVec, SVecTup>(x0: SVec, x1: SVec) -> SVecTup;
15
16/// Create a tuple of three vectors.
17///
18/// `SVecTup` must be a scalable vector tuple (`#[rustc_scalable_vector]`) and `SVec` must be a
19/// scalable vector (`#[rustc_scalable_vector(N)]`). `SVecTup` must be a tuple of vectors of
20/// type `SVec`.
21///
22/// Corresponds to Clang's `__builtin_sve_svcreate3*` builtins.
23#[rustc_intrinsic]
24#[rustc_nounwind]
25pub unsafe fn sve_tuple_create3<SVec, SVecTup>(x0: SVec, x1: SVec, x2: SVec) -> SVecTup;
26
27/// Create a tuple of four vectors.
28///
29/// `SVecTup` must be a scalable vector tuple (`#[rustc_scalable_vector]`) and `SVec` must be a
30/// scalable vector (`#[rustc_scalable_vector(N)]`). `SVecTup` must be a tuple of vectors of
31/// type `SVec`.
32///
33/// Corresponds to Clang's `__builtin_sve_svcreate4*` builtins.
34#[rustc_intrinsic]
35#[rustc_nounwind]
36pub unsafe fn sve_tuple_create4<SVec, SVecTup>(x0: SVec, x1: SVec, x2: SVec, x3: SVec) -> SVecTup;
37
38/// Get one vector from a tuple of vectors.
39///
40/// `SVecTup` must be a scalable vector tuple (`#[rustc_scalable_vector]`) and `SVec` must be a
41/// scalable vector (`#[rustc_scalable_vector(N)]`). `SVecTup` must be a tuple of vectors of
42/// type `SVec`.
43///
44/// Corresponds to Clang's `__builtin_sve_svget*` builtins.
45///
46/// # Safety
47///
48/// `IDX` must be in-bounds of the tuple.
49#[rustc_intrinsic]
50#[rustc_nounwind]
51pub unsafe fn sve_tuple_get<SVecTup, SVec, const IDX: i32>(tuple: SVecTup) -> SVec;
52
53/// Change one vector in a tuple of vectors.
54///
55/// `SVecTup` must be a scalable vector tuple (`#[rustc_scalable_vector]`) and `SVec` must be a
56/// scalable vector (`#[rustc_scalable_vector(N)]`). `SVecTup` must be a tuple of vectors of
57/// type `SVec`.
58///
59/// Corresponds to Clang's `__builtin_sve_svset*` builtins.
60///
61/// # Safety
62///
63/// `IDX` must be in-bounds of the tuple.
64#[rustc_intrinsic]
65#[rustc_nounwind]
66pub unsafe fn sve_tuple_set<SVecTup, SVec, const IDX: i32>(tuple: SVecTup, x: SVec) -> SVecTup;