Stuart Cook
c33d51b9d8
Rollup merge of #147355 - sayantn:masked-loads, r=RalfJung,bjorn3
...
Add alignment parameter to `simd_masked_{load,store}`
This PR adds an alignment parameter in `simd_masked_load` and `simd_masked_store`, in the form of a const-generic enum `core::intrinsics::simd::SimdAlign`. This represents the alignment of the `ptr` argument in these intrinsics as follows
- `SimdAlign::Unaligned` - `ptr` is unaligned/1-byte aligned
- `SimdAlign::Element` - `ptr` is aligned to the element type of the SIMD vector (default behavior in the old signature)
- `SimdAlign::Vector` - `ptr` is aligned to the SIMD vector type
The main motive for this is stdarch - most vector loads are either fully aligned (to the vector size) or unaligned (byte-aligned), so the previous signature doesn't cut it.
Now, stdarch will mostly use `SimdAlign::Unaligned` and `SimdAlign::Vector`, whereas portable-simd will use `SimdAlign::Element`.
- [x] `cg_llvm`
- [x] `cg_clif`
- [x] `miri`/`const_eval`
## Alternatives
Using a const-generic/"const" `u32` parameter as alignment (and we error during codegen if this argument is not a power of two). This, although more flexible than this, has a few drawbacks
- If we use an const-generic argument, then portable-simd somehow needs to pass `align_of::<T>()` as the alignment, which isn't possible without GCE
- "const" function parameters are just an ugly hack, and a pain to deal with in non-LLVM backends
We can remedy the problem with the const-generic `u32` parameter by adding a special rule for the element alignment case (e.g. `0` can mean "use the alignment of the element type), but I feel like this is not as expressive as the enum approach, although I am open to suggestions
cc `@workingjubilee` `@RalfJung` `@BoxyUwU`
2025-11-05 10:59:18 +11:00
..
2025-11-02 16:20:06 +01:00
2025-10-05 03:07:51 -04:00
2025-07-22 14:28:48 +02:00
2025-09-13 16:06:22 -07:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-09-05 20:44:49 -04:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-10-10 20:14:23 -04:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-10-19 09:28:39 -07:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-09-27 21:25:57 +02:00
2025-10-08 20:14:24 +02:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-07-28 11:58:38 +00:00
2025-11-04 02:30:59 +05:30
2025-07-22 14:28:48 +02:00
2025-09-11 16:13:32 -07:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-10-25 22:53:52 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-09-09 21:54:54 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-08-15 16:42:21 +00:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-09-01 13:45:00 +07:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-08-15 16:56:11 +00:00
2025-07-22 14:28:48 +02:00
2025-07-26 01:02:29 +02:00
2025-08-08 21:59:28 -07:00
2025-07-22 14:28:48 +02:00
2025-08-21 11:07:25 +01:00
2025-07-22 14:28:48 +02:00
2025-08-01 18:38:22 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-10-13 16:52:12 +00:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-29 11:20:23 -07:00
2025-07-22 14:28:48 +02:00
2025-10-09 20:24:45 -07:00
2025-07-22 14:28:48 +02:00
2025-10-10 20:14:23 -04:00
2025-09-16 11:49:20 -07:00
2025-09-16 11:49:20 -07:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-23 11:23:36 +00:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-09-13 16:06:22 -07:00
2025-08-11 12:39:23 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-10-02 14:55:50 +08:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-27 14:42:07 +03:00
2025-10-03 08:08:22 +08:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-10-28 23:07:04 +01:00
2025-11-02 16:20:06 +01:00
2025-09-05 20:44:49 -04:00
2025-07-22 14:28:48 +02:00
2025-07-29 18:59:09 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-29 11:20:23 -07:00
2025-07-22 14:28:48 +02:00
2025-10-23 00:38:28 +00:00
2025-10-23 00:38:28 +00:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-11-03 19:36:42 +00:00
2025-11-02 16:20:06 +01:00
2025-08-06 18:01:07 +00:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-09-23 10:21:17 +02:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-10-10 20:14:23 -04:00
2025-09-16 11:49:20 -07:00
2025-08-21 11:07:25 +01:00
2025-07-22 14:28:48 +02:00
2025-09-21 20:37:51 -04:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-08-15 16:42:21 +00:00
2025-07-22 14:28:48 +02:00
2025-08-11 22:00:41 +00:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-03 08:12:16 -06:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-09-16 11:49:20 -07:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-09-23 10:59:29 +00:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-10-31 16:12:30 -07:00
2025-07-22 14:28:48 +02:00
2025-08-20 19:08:16 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-08-18 19:37:13 +00:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-10-31 16:12:30 -07:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-10-31 16:12:30 -07:00
2025-09-16 11:49:20 -07:00
2025-10-31 16:12:30 -07:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-10-31 16:12:30 -07:00
2025-08-21 11:07:25 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-09-16 11:49:20 -07:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-11-02 16:20:06 +01:00
2025-09-16 11:49:20 -07:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-29 11:20:23 -07:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-08-18 19:37:13 +00:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-09-16 11:49:20 -07:00
2025-09-11 16:13:32 -07:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-09-26 13:32:03 -04:00
2025-07-22 14:28:48 +02:00
2025-08-20 17:08:46 +01:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-09-26 13:32:03 -04:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00
2025-10-30 15:13:32 +03:00
2025-07-22 14:28:48 +02:00
2025-07-22 14:28:48 +02:00