@@ -289,6 +289,20 @@ not possible for these types to be used with generic functions or traits.
289289See
290290[ * Trait implementations and generic instantiation* ] [ trait-implementations-and-generic-instantiation ] .
291291
292+ ## Changing vector lengths at runtime
293+ [ changing-vector-lengths-at-runtime ] : #changing-vector-lengths-at-runtime
294+
295+ It is possible to change the vector length at runtime using a
296+ [ ` prctl() ` ] [ prctl ] call to the Linux kernel, or via similar mechanisms in other
297+ operating systems.
298+
299+ Doing so would require that ` vscale ` change, which Rust will not supported.
300+
301+ ` prctl ` or similar must only be used to set up the vector length for child
302+ processes, not to change the vector length of the current process. As Rust
303+ cannot prevent users from doing this, it will be documented as undefined
304+ behaviour, consistent with C and C++.
305+
292306## Implementing ` rustc_scalable_vector `
293307[ implementing-rustc_scalable_vector ] : #implementing-rustc_scalable_vector
294308
@@ -314,13 +328,6 @@ result in register sizes of 128, 256, 512, 1024 or 2048 and 4, 8, 16, 32, or 64
314328The ` N ` in the ` #[rustc_scalable_vector(N)] ` determines the ` element_count ` used
315329in the LLVM type for a scalable vector.
316330
317- While it is possible to change the vector length at runtime using a
318- [ ` prctl() ` ] [ prctl ] call to the kernel, this would require that ` vscale ` change,
319- which is unsupported. ` prctl ` must only be used to set up the vector length for
320- child processes, not to change the vector length of the current process. As Rust
321- cannot prevent users from doing this, it will be documented as undefined
322- behaviour, consistent with C and C++.
323-
324331Tuples in RISC-V's V Extension lower to target-specific types in LLVM rather
325332than generic scalable vector types, so ` rustc_scalable_vector ` will not
326333initially support RVV tuples (see
0 commit comments