Commit graph

35218 commits

Author SHA1 Message Date
Jacob Young
a744fbd22f x86_64: fix ~/! miscomps 2025-09-27 18:30:52 -04:00
Jacob Young
d79b3cc134 target: x86_64 backend can build compiler rt with coff
Without allowing this, the references to `compiler_rt.dll` emitted by
the coff linker will prevent the executable from running.
2025-09-27 18:30:52 -04:00
Jacob Young
b206b0626a x86_64: fix @floatFromInt miscomps 2025-09-27 18:30:52 -04:00
mlugg
237e8a5a7a tests: fix redundant target in matrix
Because -fno-llvm is now the default on x86_64-linux, this target was
exactly equivalent to one specified earlier in the matrix. This was
probably just missed when doing the work to enable the self-hosted
backend by default for x86_64.
2025-09-27 18:30:52 -04:00
mlugg
611c38e6da x86_64: fix unencodable rem lowerings
The memory operand might use one of the extended GPRs R8 through R15 and
hence require a REX prefix, but having a REX prefix makes the high-byte
register AH unencodeable as the src operand. This latent bug was exposed
by this branch, presumably because `select` now happens to be putting
something in an extended GPR instead of a legacy GPR.

In theory this could be fixed with minimal cost by introducing a way to
communicate to `select` that neither the destination memory nor the
other temporary can be in an extended GPR. However, I just went for the
simple solution which comes at a cost of one trivial instruction: copy
the remainder from AH to AL, and *then* copy AL to the destination.
2025-09-27 18:30:52 -04:00
mlugg
77fca1652f x86_64: fix miscompilation of mul on vectors of large ints 2025-09-27 18:30:52 -04:00
mlugg
0c476191a4 x86_64: generate better constant memcpy code
`rep movsb` isn't usually a great idea here. This commit makes the logic
which tentatively existed in `genInlineMemcpy` apply in more cases, and
in particular applies it to the "new" backend logic. Put simply, all
copies of 128 bytes or fewer will now attempt this path first,
where---provided there is an SSE register and/or a general-purpose
register available---we will lower the operation using a sequence of 32,
16, 8, 4, 2, and 1 byte copy operations.

The feedback I got on this diff was "Push it to master and if it
miscomps I'll revert it" so don't blame me when it explodes
2025-09-27 18:30:52 -04:00
Alex Rønne Petersen
1b0bde0d8d
Merge pull request #25373 from mneumann/fix-dragonfly-bootstrap
Fix DragonFly bootstrap
2025-09-27 20:05:40 +02:00
Alex Rønne Petersen
032df7202a
ci: remove -Dskip-translate-c from riscv64-linux scripts
This no longer exists and caused the build to fail.
2025-09-27 18:39:03 +02:00
Alex Rønne Petersen
1f7ee99b35 musl: add missing fenv C dummy functions for loongarch64-linux-muslsf
https://www.openwall.com/lists/musl/2025/09/27/1

closes #25367
2025-09-27 17:13:29 +02:00
Alex Rønne Petersen
b7ab625409
Merge pull request #25362 from alexrp/aro-valist
`aro`: `TypeStore`: synchronize `__va_list_tag` logic with Zig's `std.builtin.VaList`
2025-09-27 12:57:47 +02:00
Michael Neumann
035219132b lib/std/c: sync "struct stat" for DragonFly
* Add missing functions like ISDIR() or ISREG(). This is required to
  build the zig compiler

* Use octal notation for the S_ constants. This is how it is done for
  ".freebsd" and it is also the notation used by DragonFly in
  "sys/stat.h"

* Reorder S_ constants in the same order as ".freebsd" does. Again, this
  follows the ordering within "sys/stat.h"
2025-09-27 10:00:40 +02:00
Michael Neumann
19703a5db9 bootstrap: Add support for DragonFly 2025-09-27 10:00:36 +02:00
Ryan Liptak
b1a0a4e03b Update descriptions of -f[no-]error-tracing to match the actual behavior
Before https://github.com/ziglang/zig/pull/18160, error tracing defaulted to true in ReleaseSafe, but that is no longer the case. These option descriptions were never updating accordingly.
2025-09-26 14:01:17 -07:00
Alex Rønne Petersen
e98630aacf
aro: TypeStore: synchronize __va_list_tag logic with Zig's std.builtin.VaList
https://github.com/Vexu/arocc/pull/893

closes #25361
2025-09-26 16:24:59 +02:00
Alex Rønne Petersen
d16ff4d049
std.builtin: define VaList as *u8 for uefi 2025-09-26 16:20:24 +02:00
Alex Rønne Petersen
6ca52c00d9
std.builtin: remove dead powerpc-darwin handling for VaList 2025-09-26 16:20:24 +02:00
Alex Rønne Petersen
033d251626
std.builtin: define VaList for arc, csky, lanai, m68k, msp430, nvptx, ve, xcore 2025-09-26 16:20:24 +02:00
Alex Rønne Petersen
44c80fc6dc
std.builtin: sort VaList prongs a bit 2025-09-26 16:20:24 +02:00
Alex Rønne Petersen
4c798bb0bd
std.builtin: define VaList as struct { __ap: *anyopaque } for Arm per AAPCS 2025-09-26 16:20:15 +02:00
Andrew Kelley
e0dc2e4e3f
Merge pull request #25342 from ziglang/fuzz-limit
fuzzing: implement limited fuzzing
2025-09-26 05:28:46 -07:00
Andrew Kelley
3b365a1f9b
Merge pull request #25351 from ziglang/chomp
std.mem: introduce cut functions; rename "index of" to "find"
2025-09-26 01:45:07 -07:00
Andrew Kelley
ad80a8b552 issue template: translate-c tracked by separate project 2025-09-25 20:36:58 -07:00
Alex Rønne Petersen
be24821464
ci: remove superfluous -Dtarget=native-native-none in x86_64-freebsd scripts 2025-09-26 02:41:28 +02:00
Andrew Kelley
52a13f6a7f web ui: fix not sending initial context sometimes
This would cause the web ui to crash in js or wasm.
2025-09-25 17:16:41 -07:00
Andrew Kelley
2da8ec9865 fuzzing: fix off-by-one in limit count 2025-09-25 17:16:10 -07:00
Andrew Kelley
98253bc0ee Compilation: --debug-rt always Debug
--debug-rt previously would make rt libs match the root module. Now they
are always debug when --debug-rt is passed. This includes compiler-rt,
fuzzer lib, and others.
2025-09-25 17:15:47 -07:00
Alex Rønne Petersen
86077fe6bd compiler: move self-hosted backends from src/arch to src/codegen 2025-09-26 02:02:07 +02:00
Alex Rønne Petersen
212715f62d
test: remove pie test case from test-standalone
We already have test/cases/pie_linux.zig covering this.
2025-09-26 01:33:38 +02:00
Alex Rønne Petersen
459ad8c8e6
ci: stop passing -Dskip-translate-c -Dno-langref on loongarch64-linux
No longer necessary since we've stopped using Clang for this.
2025-09-26 01:33:38 +02:00
Alex Rønne Petersen
17f9a25924
test: remove -Dskip-translate-c from test-standalone
No longer necessary since we've stopped using Clang for this.
2025-09-26 01:33:26 +02:00
Andrew Kelley
2a88a6a456
Merge pull request #24497 from ziglang/aro-translate-c
compiler: update aro and translate-c to latest; delete clang translate-c
2025-09-25 14:18:49 -07:00
Andrew Kelley
14e227d8a6 std.mem: add cutLast and cutScalarLast 2025-09-25 11:38:38 -07:00
Andrew Kelley
97bef50dc3 std.mem: rename all "index of" functions
Moving towards our function naming convention of having one word per
concept and constructing function names out of concatenated concepts.
In `std.mem` the concepts are:
* "find" - return index of substring
* "pos" - starting index parameter
* "last" - search from the end
* "linear" - simple for loop rather than fancy algo
* "scalar" - substring is a single element
2025-09-25 11:28:58 -07:00
Andrew Kelley
3411b5e499 std.mem: add cut and cutScalar and example usage 2025-09-25 11:11:46 -07:00
Andrew Kelley
dd2f1cbebf std.mem: rename chomp to cut 2025-09-25 10:54:28 -07:00
Andrew Kelley
ccaf82d243 CLI: simpler semantics for prefixed integer args 2025-09-25 10:50:41 -07:00
Andrew Kelley
513389bc5b CLI: exploit std.mem.chompPrefix
fixes a bug in how -fstructured-cfg and -fno-structured-cfg are handled.
2025-09-25 10:50:41 -07:00
Andrew Kelley
ac4d79e322 std.mem: introduce chompPrefix and chompSuffix 2025-09-25 10:50:41 -07:00
Loris Cro
9bb0b43ea3 implement review suggestions 2025-09-25 18:20:19 +02:00
Alex Rønne Petersen
a73f246b29
std.Thread: disable test on armeb in addition to thumbeb
Same falky failure on both. See ed7ff0b693.
2025-09-25 17:49:47 +02:00
Alex Rønne Petersen
dd4be26f53 libc-test: disable daemon-failure.c
It's flaky in that systems with a high FD limit will get an unexpected ENOMEM
error from daemon(), failing the test.
2025-09-25 12:57:56 +02:00
Jacob Young
6257f4abb7 x86_64: improve support for large enums
Closes #25247
2025-09-24 21:20:27 -07:00
Andrew Kelley
5f763b7dc5 resinator: work around error VARARGS not implemented for this compiler 2025-09-24 21:04:46 -07:00
Zhenming-Lin
99323a4da1 improve impl of __floorh, __floorx, __ceilh and __ceilx 2025-09-24 20:57:25 -07:00
Andrew Kelley
41e5331c08 resinator: fix compile errors 2025-09-24 20:35:01 -07:00
Veikka Tuominen
d83c76eb5a update aro & translate-c 2025-09-24 20:01:19 -07:00
Andrew Kelley
e05073b9e4 aro does not have -mmacos version flags or -Wno-overriding-option 2025-09-24 20:01:19 -07:00
Andrew Kelley
3764f7b0f2 compiler: disable InternPool.debug_state as it is unsound
There can be more than one InternPool instance active at the same time.
2025-09-24 20:01:19 -07:00
Andrew Kelley
aa92c237e9 aro does not have a pragma-pack warning 2025-09-24 20:01:19 -07:00