0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib
Justus Klausecker 047df44d71 cbe: fix switch statements on large types
`switch` statements on types >128bits are now lowered to conditionals.
This is necessary because Zig lowers integers with more than 128 bits to
bigints, which are not 'native' integers and thus cannot be used as case
values.
128-bit integers get special treatment because Zig will emit actual 128bit
ints if they are supported by the target. They still *may* be lowered to
bigints though, e.g. for 32-bit targets or MSVC. To solve this, this commit
adds a bunch of switch macros to `zig.h` which will either resolve to an
actual `switch` statement or to conditionals. The `if` statements this
approach can generate are not as optimal as they could be but I think this
is a good trade-off since the generated `switch` statements are still the
same as the ones generated for smaller integers. Also the macros result
in pretty readable code.
History 2026-03-18 15:47:18 +01:00
..
build-web fuzzer ui: remove wrong optimized float mode 2026-03-11 21:26:00 -04:00
c libzigc: Remove qemu-riscv comment 2026-03-17 23:33:10 +01:00
compiler zig build fmt 2026-03-12 17:44:03 -04:00
compiler_rt compiler_rt: optimize udivmod large-divisor case with trial quotient 2026-03-05 20:22:19 +01:00
docs Revert "Fix #20283" 2026-03-08 18:41:21 -07:00
include remove all IBM AIX and z/OS support 2025-10-29 14:25:51 +01:00
init rework fuzz testing to be smith based 2026-02-13 22:12:19 -05:00
libc libzigc: Implement tanhf 2026-03-17 23:33:10 +01:00
libcxx libcxx: use compiler's _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION when set 2025-11-14 02:02:59 +01:00
libcxxabi remove all IBM AIX and z/OS support 2025-10-29 14:25:51 +01:00
libtsan remove all IBM AIX and z/OS support 2025-10-29 14:25:51 +01:00
libunwind remove all IBM AIX and z/OS support 2025-10-29 14:25:51 +01:00
std feat: remove kernel32.CreateThread, implement ntdll.NtCreateThreadEx inside WindowsThreadImpl (#31519) 2026-03-17 23:06:55 +01:00
c.zig libzigc: posix_{fadvise, fallocate}, fallocate 2026-03-14 22:04:43 +01:00
compiler_rt.zig std: different mechanism for disabling network dependency 2026-03-08 19:20:34 -07:00
fuzzer.zig libfuzzer: use error.SkipZigTest 2026-03-11 21:14:46 -04:00
ubsan_rt.zig std: different mechanism for disabling network dependency 2026-03-08 19:20:34 -07:00
zig.h cbe: fix switch statements on large types 2026-03-18 15:47:18 +01:00