Justus Klausecker
d0586da18e
Sema: Improve comptime arithmetic undef handling
...
This commit expands on the foundations laid by https://github.com/ziglang/zig/pull/23177
and moves even more `Sema`-only functionality from `Value`
to `Sema.arith`. Specifically all shift and bitwise operations,
`@truncate`, `@bitReverse` and `@byteSwap` have been moved and
adapted to the new rules around `undefined`.
Especially the comptime shift operations have been basically
rewritten, fixing many open issues in the process.
New rules applied to operators:
* `<<`, `@shlExact`, `@shlWithOverflow`, `>>`, `@shrExact`: compile error if any operand is undef
* `<<|`, `~`, `^`, `@truncate`, `@bitReverse`, `@byteSwap`: return undef if any operand is undef
* `&`, `|`: Return undef if both operands are undef, turn undef into actual `0xAA` bytes otherwise
Additionally this commit canonicalizes the representation of
aggregates with all-undefined members in the `InternPool` by
disallowing them and enforcing the usage of a single typed
`undef` value instead. This reduces the amount of edge cases
and fixes a bunch of bugs related to partially undefined vecs.
List of operations directly affected by this patch:
* `<<`, `<<|`, `@shlExact`, `@shlWithOverflow`
* `>>`, `@shrExact`
* `&`, `|`, `~`, `^` and their atomic rmw + reduce pendants
* `@truncate`, `@bitReverse`, `@byteSwap`
2025-08-12 16:33:57 +02:00
..
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-07-16 10:27:40 -07:00
2024-04-25 00:09:24 -07:00
2025-07-07 22:43:53 -07:00
2024-04-25 00:09:24 -07:00
2025-07-26 12:06:43 +02:00
2025-07-26 12:06:43 +02:00
2025-07-26 12:06:43 +02:00
2024-10-29 17:52:55 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-05-05 09:42:51 -04:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-07-14 17:34:52 +01:00
2025-01-28 04:23:13 +00:00
2025-01-28 04:23:13 +00:00
2025-01-28 04:23:13 +00:00
2025-01-28 04:23:13 +00:00
2025-01-28 04:23:13 +00:00
2025-01-28 04:23:13 +00:00
2024-05-05 09:42:51 -04:00
2025-02-22 21:01:44 +00:00
2024-10-19 19:21:33 +01:00
2024-05-05 09:42:51 -04:00
2024-04-25 00:09:24 -07:00
2024-05-05 09:42:51 -04:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-03-05 03:01:43 +00:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-07-07 22:43:53 -07:00
2025-07-07 22:43:53 -07:00
2024-05-05 09:42:51 -04:00
2025-07-16 10:27:40 -07:00
2025-07-14 17:32:50 +01:00
2024-08-28 08:39:59 +01:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-02-22 21:01:44 +00:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-04-15 19:19:23 -07:00
2025-02-22 21:01:44 +00:00
2024-04-25 00:09:24 -07:00
2024-08-28 08:39:59 +01:00
2024-05-05 09:42:51 -04:00
2024-05-05 09:42:51 -04:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-07-01 23:03:15 +02:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-05-05 09:42:51 -04:00
2024-04-25 00:09:24 -07:00
2025-02-22 21:01:44 +00:00
2024-05-05 09:42:51 -04:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-05-10 13:56:01 -07:00
2024-04-25 00:09:24 -07:00
2024-06-08 12:39:11 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-05-05 09:42:51 -04:00
2024-05-05 09:42:51 -04:00
2024-05-05 09:42:51 -04:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-07-22 12:30:19 +02:00
2024-04-25 00:09:24 -07:00
2024-07-09 14:25:42 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-05-05 09:42:51 -04:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-08-12 16:33:57 +02:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-03-05 03:01:43 +00:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-08-28 08:39:59 +01:00
2024-07-21 01:26:21 -07:00
2024-08-28 08:39:59 +01:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-08-28 08:39:59 +01:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-05-05 09:42:51 -04:00
2025-05-30 01:11:00 +00:00
2025-06-06 23:42:14 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-02-22 21:01:44 +00:00
2024-04-25 00:09:24 -07:00
2024-05-05 09:42:51 -04:00
2024-08-28 08:39:59 +01:00
2024-05-05 09:42:51 -04:00
2024-05-05 09:42:51 -04:00
2024-08-28 08:39:59 +01:00
2024-04-25 00:09:24 -07:00
2025-06-01 12:10:57 +01:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-03-26 11:52:52 +01:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-07-11 08:17:43 +02:00
2024-04-25 00:09:24 -07:00
2024-05-05 09:42:51 -04:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-03-05 03:01:43 +00:00
2024-04-25 00:09:24 -07:00
2024-08-28 08:39:59 +01:00
2024-04-25 00:09:24 -07:00
2024-10-12 20:59:12 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-07-15 18:18:38 +00:00
2024-08-28 08:39:59 +01:00
2024-07-29 16:07:12 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-08-14 10:29:45 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-02-22 21:01:44 +00:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-07-21 00:32:50 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-03-06 07:26:19 +01:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-05-05 09:42:51 -04:00
2024-11-13 15:35:16 -08:00
2024-09-12 20:06:49 -07:00
2024-09-12 20:06:49 -07:00
2025-08-05 09:56:02 -07:00
2024-04-25 00:09:24 -07:00
2024-05-05 09:42:51 -04:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-09-10 20:28:40 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-06-08 12:39:11 -07:00
2024-04-25 00:09:24 -07:00
2024-05-05 09:42:51 -04:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-05-05 09:42:51 -04:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-08-11 15:52:49 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2025-02-22 21:01:44 +00:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-05-05 09:42:51 -04:00
2024-04-25 00:09:24 -07:00
2024-04-25 00:09:24 -07:00
2024-09-12 16:01:23 +01:00
2024-09-12 16:01:23 +01:00
2024-04-25 00:09:24 -07:00