Commit Graph
20602 Commits
Author SHA1 Message Date
Naoki MATSUMOTO 059e397ffc std.os: handle error.UnreachableAddress in send() 2022-10-17 13:10:23 +02:00
Evin Yulo f36aee93cc Give better error message for --name with folder separator 2022-10-17 13:06:06 +02:00
Jens Goldberg 1459231624 fix setsockopt returning ENODEV 2022-10-17 12:55:12 +02:00
Ali Chraghi 5127dae7a2 std.os: fix execv* doc comment 2022-10-16 11:38:22 -04:00
dananddan ca1c185eb6 std.zig: search include dir and lib dir from environment variables (#13145)
* minor fix based on feedback from @marler8997

Co-authored-by: dan <i@dan.games>
2022-10-16 11:37:35 -04:00
bfredl c750d95417 os.linux: some fixes to BPF module
- For ALU operations, src should be allowed to be an explicit Reg.
- Expose AluOp and JmpOp as public types.
  This makes code generation using BPF as a backend easier,
  as AluOp and JmpOp can be used directly as part of an IR
2022-10-16 11:36:11 -04:00
Evin Yulo b346d48572 Simplify code in std.meta.isTag 2022-10-16 11:35:27 -04:00
Meghan c37b40248c stage2: remove --verbose-mir from help menu
removed in https://github.com/ziglang/zig/commit/5f97652da8881773b823a0730e5791816668528a
2022-10-16 11:35:06 -04:00
Isaac Yonemoto 99c3578f69 adds isTag function to std.meta (#11895) 2022-10-15 14:32:05 -04:00
Andrew Kelley c0d7f64036 Merge pull request #12448 from r00ster91/ultimateascii
std.ascii: rename functions and other improvements
2022-10-15 14:28:33 -04:00
Jacob Young f9192adaba llvm: fix lowering of non-byte-aligned field pointers
* When a field starts at some bit offset within a byte you need to load
   starting from that byte and shift, not starting from the next byte,
   so a rounded-down divide is required here, not a rounded-up one.
 * Remove paragraph from doc that no longer relates to anything.

Closes #12363
2022-10-15 14:19:40 -04:00
Jacob Young c7f9833238 Module: fix early exit conditions during compilation
* `--verbose-llvm-ir` should trigger analysis and codegen
 * `-femit-asm` etc should trigger codegen even with `-fno-emit-bin`

Closes #12588
2022-10-15 14:18:35 -04:00
Jacob Young cb0e22db4e llvm: fix lowering of runtime refs to comptime-only decls
When we want a runtime pointer to a zero-bit value we use an undef
pointer, but what if we want a runtime pointer to a comptime-only value?
Normally, if `T` is a comptime-only type such as `*const comptime_int`,
then `*const T` would also be a comptime-only type, so anything
referencing a comptime-only value is usually also comptime-only, and
therefore not emitted to the executable.

However, what if instead we have a `*const anyopaque` pointing to a
comptime-only value?  Certainly, `*const anyopaque` is a runtime type,
and so we need some runtime value to store, even when it happens to be
pointing to a comptime-only value.  In this case we want to do the same
thing as we do when pointing to a zero-bit value, so we use
`hasRuntimeBits` to handle both cases instead of ignoring comptime.

Closes #12025
2022-10-15 14:17:25 -04:00
Andrew Kelley feab1ebe1b Merge pull request #12878 from gwenzek/ptx
Update Nvptx backend for Zig 0.10
2022-10-15 13:53:04 -04:00
Andrew Kelley c289794f0d nvptx: add TODO comment regarding abuse of llvm builtins 2022-10-15 10:50:02 -07:00
Guillaume Wenzek 24c749473a implement os.abort and panic for cuda 2022-10-15 10:39:19 -07:00
Guillaume Wenzek 419855c475 fix test 2022-10-15 10:39:19 -07:00
Guillaume Wenzek ac1f17f63f disable sema.addConstant 2022-10-15 10:39:19 -07:00
Guillaume Wenzek b425d88737 re-enable nvptx tests 2022-10-15 10:39:19 -07:00
Guillaume Wenzek 577f0aa54b addrSpaceCastIsValid nvptx 2022-10-15 10:39:19 -07:00
Guillaume Wenzek aad983cf40 sanitize qualified name for nvptx backend 2022-10-15 10:39:19 -07:00
Guillaume Wenzek 92a857b76c debug 2022-10-15 10:39:19 -07:00
Guillaume Wenzek 004fca2c64 restore comp when leaving flushModule 2022-10-15 10:39:19 -07:00
Guillaume Wenzek b3dc80a1e3 disable debug info for ptx<7.5 2022-10-15 10:39:19 -07:00
Guillaume Wenzek 85c6b0f0bc allow ptx kernel export 2022-10-15 10:39:19 -07:00
Andrew Kelley 65f860bef7 Merge pull request #12879 from Snektron/amdgpu-improvements
Amdgpu improvements
2022-10-15 13:36:43 -04:00
Andrew Kelley 66d6183001 Merge branch 'amdgpu-improvements' of https://github.com/Snektron/zig into Snektron-amdgpu-improvements 2022-10-15 10:36:10 -07:00
Andrew Kelley 1087e67762 Merge pull request #13108 from topolarity/llvm-lib-dir
build.zig: Forward LLVM lib/include dirs from CMake
2022-10-15 12:36:38 -04:00
Andrew Kelley 16cc65242f Merge pull request #12918 from jacobly0/math-cast-comptime-int
std.math: fix behavior relating to comptime_int arguments
2022-10-15 12:11:55 -04:00
Jacob Young 400319872b llvm: fix bug lowering aggregate_init with a byref sentinel
Closes #12972
2022-10-15 11:12:04 -04:00
xEgoist ae39e7867d Added os check for std.fs.setAsCwd() to work with windows
Due to the unavailability of fchdir in Windows, a call for setting the
CWD needs to either call chdir with the path string or call
SetCurrentDirectory.
Either way, since we are dealing with a Handle in Windows, a call for
GetFinalPathNameByHandle is necessary for getting the file path first.
2022-10-15 11:05:15 -04:00
Andrew Kelley b4e3424594 Merge pull request #13100 from topolarity/powerpc64le
stage2: Fix softfloat support for PPC64(LE)
2022-10-15 10:05:00 -04:00
Cody Tapscott a168893e00 stage1: Fix ppcle long double size
Resolves #13110
2022-10-14 13:35:10 -07:00
Ryan Liptak 8bb2e96ac3 std.os.windows: Change HKEY to *opaque {}
The definition of HKEY__ as a struct with an unused int field is only the case in the Windows headers when `STRICT` is defined. From https://learn.microsoft.com/en-us/windows/win32/winprog/enabling-strict:

> When STRICT is defined, data type definitions change as follows:
>
> -  Specific handle types are defined to be mutually exclusive; for example, you will not be able to pass an HWND where an HDC type argument is required. Without STRICT, all handles are defined as HANDLE, so the compiler does not prevent you from using one type of handle where another type is expected.

Zig's `opaque {}` already gives this benefit to us, so the usage of a struct with an unused field is unnecessary, and it was causing HKEY to have an alignment of 4, which is a problem because there are HKEY constants like HKEY_LOCAL_MACHINE (0x80000002) that are not 4-byte aligned. Without this change, the compiler would not allow something like HKEY_LOCAL_MACHINE to be defined since it enforces pointer alignment.
2022-10-14 15:23:13 -04:00
Evan Haas e4e1c21e1f i386 ABI: Fix some sizes and alignments
This makes the following changes for i386:

long long and unsigned long long have 4 byte alignment on non-Windows

f64 (double) has 4-byte alignment on non-Windows

long double is 80 bits and has 4 byte alignment on mingw

long double on android is 64 bits, not 80: https://www.uclibc.org/docs/psABI-i386.pdf

Fixes #12453
Fixes #12987
2022-10-14 15:22:00 -04:00
Ryan Liptak c8da03a0e1 Fix compile error in Dir.deleteTreeMinStackSize and add test
Follow up to #13073
2022-10-14 14:48:23 -04:00
Jacob Young 9b45dc1608 stage2: fix emitting asm and bin at the same time
This logic is copied from stage1.

Fixes #12800
2022-10-14 14:46:50 -04:00
Andrew Kelley cb257d59f9 Merge pull request #13148 from r00ster91/progressfollowup
fix(std.Progress): some follow-ups
2022-10-14 14:43:34 -04:00
r00ster91 ab4e696e1f fix: handle larger window sizes more robustly
We should now be able to handle virtually any window size gracefully.
2022-10-14 09:38:09 +02:00
Cody Tapscott 34863224c3 Re-enable mulAdd f128 tests on i386-linux 2022-10-13 12:53:30 -07:00
Cody Tapscott 1e278131e3 Re-enable @mulAdd f128 tests on aarch64-darwin
Closes #9900
2022-10-13 12:53:29 -07:00
Cody Tapscott f035437b5d Re-enable Vector f16 tests on Windows
Closes #4952
2022-10-13 12:53:20 -07:00
Cody Tapscott b8c587eb40 tests: Enable PPC64LE as a test target 2022-10-13 12:53:20 -07:00
Cody Tapscott 46fb730712 stage2: Use softfloat for f16 on MIPS targets 2022-10-13 12:53:20 -07:00
Cody Tapscott db9058e41a Disable llvm.prefetch for PowerPC
This instruction is not supported on this backend, so should
just be a noop.
2022-10-13 12:53:20 -07:00
Cody Tapscott 6e6ae8886e stage1: Add softfloat support for @reduce 2022-10-13 12:53:20 -07:00
Cody Tapscott f0d12dd82b stage2: Add softfloat support for @reduce 2022-10-13 12:53:20 -07:00
Cody Tapscott b992ea1b07 stage1: Rely on softfloat for f16 on non-arm targets 2022-10-13 12:53:20 -07:00
Cody Tapscott 37c6fcafa2 stage2 LLVM: Correct long double for WASM
Also, f16 is not supported on this backend.
2022-10-13 12:53:20 -07:00
Cody Tapscott 0d533433e2 compiler_rt: Add missing f16 functions
This change also exposes some of the existing functions under both the
PPC-style names symbols and the compiler-rt-style names, since Zig
currently lowers softfloat calls to the latter.
2022-10-13 12:53:20 -07:00