435 Commits
Author SHA1 Message Date
CMDRZero 64e4f9db8f Implement partially ordered operator precedence 2026-10-22 12:21:43 +02:00
Jacob Young b2d0675f90 Type: make c_longdouble an invalid type without x87
Also invert `xclang_flags` loop nesting which will make it easier to
translate features to something without `-Xclang` in the future.
2026-10-20 15:47:57 -04:00
Jacob Young 7c17f4c4b3 math: simplify code 2026-10-08 01:15:20 +02:00
Alex Rønne Petersen 02e4f536d4 extend test disables in c32b526783 to cbe
https://codeberg.org/ziglang/zig/issues/36765
2026-09-06 00:02:54 +02:00
Alex Rønne Petersen c32b526783 disable some float tests that are failing on aarch64-netbsd
https://codeberg.org/ziglang/zig/issues/36765
2026-09-05 20:35:51 +02:00
Jacob Young 97ced1272d std.math.float: evaluate some constants at comptime
QEMU can mistranslate this code, but since it can be evaluated at
comptime anyway, force comptime eval as both a workaround for the
mistranslation and because it is a desirable change anyway.
2026-08-03 21:04:04 -04:00
Jacob Young 3b8913a321 llvm: enable passing tests
Closes #10875
Closes #12396
Closes #20680
Closes #25734
Closes #30854
Closes #35519
2026-07-27 14:44:41 -04:00
Jacob Young b425e68694 llvm: update for compiler_rt abi changes
Closes #12602
Closes #21234
Closes #35899
Closes #36127
2026-07-27 14:38:34 -04:00
Jacob Young 865f329e4f cbe: update for compiler_rt abi changes
* `tools/generate_c_size_and_align_checks.zig`: superceded by any cbe
   output artifact
 * `cTypePreferredAlignment`: no uses, if brought back, cbe should be
   updated to verify `__alignof`

Closes #19991
Closes #20881
Closes #35523
2026-07-27 14:35:12 -04:00
Jacob Young a242b0be88 compiler_rt: change float abi so it can become compatible with cbe 2026-07-27 14:35:12 -04:00
Andrew Kelley ae4e835a66 std.lang: rename OptimizeMode to Optimize
and remove "release" from the enum tag names.

no functional change, however, despite the addition of
backwards-compatibile declarations in this patch, it is breaking because
expressions that use `==` or `!=` operators will not able to use the
deprecated names.

I predict these names to survive until the 1.0 tag without any more
breakage.
2026-07-20 17:26:50 -07:00
Justus Klausecker 69a26976ed zig fmt
Converts usages of `@intFromEnum` and `@enumFromInt` to instead use the
new `@backingInt` and `@fromBackingInt` builtins.
2026-07-17 23:30:26 +02:00
Pavel Verigo e42cb3b236 std.math.big: update divCeil add tests 2026-07-08 01:52:46 +02:00
Pavel Verigo efcaf6a72d lib: use @divCeil 2026-07-06 20:49:09 +02:00
f810faa828 compiler: implement @divCeil builtin
Co-authored-by: riverbl <94326797+riverbl@users.noreply.github.com>
Co-authored-by: Ratakor <ratakor@disroot.org>
2026-07-06 20:13:46 +02:00
Pavel Verigo ba5420896d Enable std tests for wasm backend again + enable field reordering
Additionally remove some skips, closes #30575
2026-06-29 13:22:20 +02:00
Huang Zhichao 9f0a38ac81 libzigc: log1p, log1pf 2026-05-31 09:21:02 +02:00
Andrew Kelley 9ad29fbc6c disable failing tests revealed by this branch
See #35517
See #35518
See #35519
See #35520
See #35521
See #35522
See #35523
See #35537
2026-05-29 15:32:27 -07:00
Alex Rønne Petersen 3b41518c14 std: disable some tests that fail on sparc64 2026-05-18 21:39:34 +02:00
Alex Rønne Petersen 72966e2a7b disable some tests that fail on x86_64-macos
These might be Rosetta 2 bugs, but I have no way to actually check since we no
longer have any native x86_64-macos CI machines.
2026-05-09 08:49:34 +02:00
Linus Groh 991f56fd6b std.meta: Remove Int in favor of @Int 2026-05-03 21:42:06 +01:00
Matthew Lugg fdac89d6cd remove uses of array multiplication
In preparation for its removal as accepted in
https://github.com/ziglang/zig/issues/24738.
2026-04-30 08:57:51 +01:00
Matthew Lugg 213c4fc25f lib,test: remove uses of i0
In preparation for its removal, as accepted in
https://github.com/ziglang/zig/issues/1593.
2026-04-30 08:57:51 +01:00
mihael 764760df62 libzigc/math: Implement rintl, lrintl (#31791)
It's a fairly straightforward port of `musl`'s `rintl`, like `rint` and `rintf` were. `libc-test` tests for `rintl` are uncommented since they're now passing.

I've also covered special cases for `rint` with tests, and broke down the current `rint` and `modf` test declarations into multiple -- so each libc function get its own test declaration at the very least.

Contributes to #30978

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31791
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-27 16:48:55 +02:00
Alex Rønne Petersen fc56124fac std: re-enable some tests on s390x
closes https://github.com/ziglang/zig/issues/25957
2026-04-26 21:22:31 +02:00
Alex Rønne Petersen bd12a5a6e1 std: re-enable a bunch of tests that now pass
closes https://github.com/ziglang/zig/issues/21893
closes https://github.com/ziglang/zig/issues/23806
closes https://github.com/ziglang/zig/issues/23807
closes https://github.com/ziglang/zig/issues/24191
closes https://codeberg.org/ziglang/zig/issues/30220
2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 51a6a5a2a6 Revert "std.math.modf: disable vector test on LoongArch with LSX"
This reverts commit 35d2b1e99a.

The bug was fixed in LLVM 22.
2026-04-25 21:54:48 +02:00
Jacob Young 1552bc7ad0 x86_64: fix mir rmi signedness 2026-04-10 23:23:33 +02:00
TemariVirus e498550952 std.math.pow: organise and add special case tests
Added tests for special cases which were previously untested.
Updated comments to use the same language as IEEE 754-2008.
2026-03-16 15:42:35 +08:00
TemariVirus 06d9ab7121 std.math.pow: fix wrong answer for large even exponents 2026-03-16 15:32:09 +08:00
Matthew Lugg 510ea6f61f type resolution progress 2026-03-10 10:26:07 +00:00
hemisputnik 74f361a5ce std.math.big.int: address log2/log10 reviews
There were good reviews made after #31365 was merged, so this commit
addresses them separately.

1. Assert that the number is greater than zero
2. Use `constants` instead of calculating constants manually
3. Use `Const.bitCountAbs` for log2
2026-03-01 20:34:17 +01:00
hemisputnik bd6f512f0c std.math.big.int: add log10 2026-02-28 20:16:32 +02:00
hemisputnik 925f82da09 std.math.big.int: add log2 2026-02-28 04:15:19 +02:00
hemisputnik 2f8e660805 std.math.log10: handle comptime_int inputs correctly
also add a few tests for comptime types

fixes #31333
2026-02-25 18:57:58 +01:00
lzm-build 51509fe63b std.math.acos/asin: Add @Vector(?,f32) and @Vector(?,f64) support 2026-02-14 16:57:05 +08:00
lzm-build ef13a373bc fix assertion argument order in acos/asin/atan 2026-02-14 13:33:55 +08:00
Andrew Kelley 12e6ac2e8f std.math.atan: simplify type logic 2026-02-13 12:25:53 -08:00
lzm-build 8901d38b7d std.math.atan: Add @Vector(?,f32) and @Vector(?,f64) support 2026-02-13 12:20:53 -08:00
kj4tmp@gmail.com 004872baec zig libc: acosf: fix fp exceptions
some fp exceptions are prohibited by zig test-libc (libc-test).
Promoting to f64 prevents vectorization of some floating point
divisions. The vectorization has unused lanes which contain zero. On
division the lanes containing zero are divided and trigger the INVALID
fp flags.
2026-02-13 11:30:19 -08:00
Pivok d0b39c7f2b libzigc: hypot (#31104)
First time contribution.

Implements hypot for libzigc #30978.

Commands i run:
```
$ stage3/bin/zig build -p stage4 -Denable-llvm -Dno-lib

$ stage4/bin/zig build test-libc -Dlibc-test-path=../../libc-test -Dtest-filter=hypot --summary line -fqemu -fwasmtime
Build Summary: 725/737 steps succeeded (12 skipped)
```

I also changed std.math.hypot becuase some libc-tests raised fp exceptions. Example:
```
../../libc-test/src/math/special/hypot.h:8: bad fp exception: RN hypot(0x1p-1074,0x0p+0)=0x1p-1074, want 0 got INEXACT|UNDERFLOW
../../libc-test/src/math/special/hypot.h:9: bad fp exception: RN hypot(0x1p-1074,-0x0p+0)=0x1p-1074, want 0 got INEXACT|UNDERFLOW
```

I also run this command as a quick sanity check:
```
$ stage4/bin/zig build test-std -Dtest-filter=hypot -Dtest-target-filter=x86_64-linux-musl --summary line
Build Summary: 5/5 steps succeeded; 136/136 tests passed
```

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31104
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: Pivok <pivoc@protonmail.com>
Co-committed-by: Pivok <pivoc@protonmail.com>
2026-02-05 21:57:32 +01:00
lzm-build ccd82ae7cc Add f16, f80 and f128 support for atan 2026-01-30 06:20:14 +01:00
lzm-build 757ec185f0 Add f16, f80 and f128 support for acos and asin (#30997)
The software impl of `acos` and `asin` depends on the `sqrt` op. Since support for `sqrt` in `f16`, `f80`, and `f128` has been added, the impl of `acos` and `asin` for `f16`, `f80`, and `f128` is now being supplemented.

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30997
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: lzm-build <3575188313@qq.com>
Co-committed-by: lzm-build <3575188313@qq.com>
2026-01-28 23:33:35 +01:00
rpkak e6ac1b77f0 libzigc: test and fix acos 2026-01-20 18:02:15 +01:00
Aaron Ang 9db3e23e80 std.math.big: require sufficient capacity for aliased params 2025-12-27 20:38:33 +01:00
Alex Rønne Petersen aa0249d74e Merge pull request 'std.ascii: rename indexOf functions to find' (#30101) from adria/zig:indexof-find into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30101
Reviewed-by: Andrew Kelley <andrewrk@noreply.codeberg.org>
Reviewed-by: mlugg <mlugg@noreply.codeberg.org>
2025-12-22 12:50:46 +01:00
Alex Rønne Petersen 647866dd63 std.math: disable hypot tests on non-Debug powerpc64
https://github.com/llvm/llvm-project/issues/171869
2025-12-16 06:23:11 +01:00
Adrià Arrufat 02c5f05e2f std: replace usages of std.mem.indexOf with std.mem.find 2025-12-05 14:31:27 +01:00
unplanned 688af04725 math.big: stronger asserts to reduce risks of aliasing 2025-12-04 10:28:42 +01:00
unplanned 73e82332d0 big.Mutable.setString optimization and simplification 2025-12-04 10:28:31 +01:00