10714 Commits

Author SHA1 Message Date
Andrew Kelley
a62c8d36d5 std.fs.Dir.statFile rework
* revert changes to Module because the error set is consistent across
   operating systems.
 * remove duplicated Stat.fromSystem code and use a less redundant name.
 * make fs.Dir.statFile follow symlinks, and avoid pointless control
   flow through the posix layer.
2022-12-14 14:26:02 -07:00
Philippe Pittoli
f65cdef7c8 std.fs.Dir.statFile: use fstatat
This avoids extra syscalls.
2022-12-14 14:11:59 -07:00
Veikka Tuominen
bc97a5662d Sema: display cimport errors from clang 2022-12-14 14:08:22 +02:00
Veikka Tuominen
886fa455fa Sema: avoid analyzing functions which failed when inlining 2022-12-14 14:08:21 +02:00
Veikka Tuominen
e6588857df Sema: fix memory management of union enum tag int tag
This likely went unnoticed due to all power of two integer types being special cased.

Closes #13812
2022-12-14 14:08:21 +02:00
Veikka Tuominen
927d20b46b Sema: implement missing stage1 errors 2022-12-14 14:08:21 +02:00
IntegratedQuantum
0b4461d97b
Fix tautological big_int tests. 2022-12-14 00:29:25 +00:00
Andrew Kelley
6378644d4e
Merge pull request #13907 from Vexu/call-merge
Remove `stack` option from `@call`
2022-12-13 18:15:18 -05:00
Veikka Tuominen
65270cdc33
Merge pull request #12298 from r00ster91/debugerror
std.debug: handle some possible errors and resolve low-hanging TODOs
2022-12-14 00:42:31 +02:00
Andrew Kelley
9be5323e93 add zig objcopy subcommand
This commit moves the logic from `std.build.InstallRawStep` into `zig
objcopy`. The options here are limited, but we can add features as
needed.

closes #9261

New issues can be opened for specific objcopy flag support.
2022-12-13 15:37:52 -05:00
Andrew Kelley
2e66b3be6e
Merge pull request #13910 from Luukdegram/wasm-simd 2022-12-13 14:11:22 -05:00
Veikka Tuominen
08b2d491bc update usages of @call 2022-12-13 13:14:20 +02:00
Veikka Tuominen
7b2a936173 remove stack option from @call 2022-12-13 12:52:21 +02:00
r00ster91
d8b4588d5f fix(terminal): handle some possible errors and resolve TODOs 2022-12-13 09:11:30 +01:00
Cody Tapscott
25d3713b07 stage2: Teach Liveness that safety checks do not modify memory
This change adds to Liveness a simple pattern match for the
try-like `.condbr` blocks emitted by Sema's safety checks. This
allows us to determine that these do not modify memory, which
permits us to elide additional loads in the backend.

As @Vexu points out in the main issue, this is probably not a
complete solution on its own. We'll still want a way to reliably
narrow the load/copy when performing several consecutive accesses,
such as `foo.arr[x][y].z`

Resolves https://github.com/ziglang/zig/issues/12215
2022-12-12 18:48:10 -05:00
Luuk de Gram
355b5929b2
wasm: splat for vector elements divisible by 8
This implements `@splat` for vectors where the element type is
divisible by 8 and a power of two. This is fairly simple as we can
store the values directly within the virtual stack. But for
all other sizes, we must first shift and bitwise-or the values
before we can store them to fit them like a packed-struct, rather
than an array.
2022-12-12 17:42:00 +01:00
Luuk de Gram
c6d654f73b
wasm: implement the 'splat' instruction part 1
This implements `airSplat` for the native WebAssembly backend when
the features 'simd128' or 'relaxed-simd' are enabled. The commit
supports splat where the value lives in the linear memory segment,
as well as on the stack. This saves a lot of instruction cost.
When it detects the element type is not 8, 16, 32 or 64 bits,
the backend will instead use the same strategy as if the features
where disabled.
2022-12-12 17:42:00 +01:00
Luuk de Gram
db06eed7a3
codegen: implement generating vector values 2022-12-12 17:41:59 +01:00
Luuk de Gram
63b69e2c55
wasm: load+store simd immediate values
This implements loading and storing immediate values representing
a vector with exactly 128 bits. When the vector does not equal to
128 bits, or when the simd128 or relaxed-simd features are disabled
the value will be treated as an array instead.
2022-12-12 17:41:59 +01:00
Lee Cannon
4efdbd3044 update TracyAllocator for new Allocator changes 2022-12-11 15:02:44 -05:00
IntegratedQuantum
15a6336bb4
Add a helpful note when using ** on number types. (#13871) 2022-12-11 14:41:42 -05:00
Andrew Kelley
cffbb32d31
Merge pull request #13872 from koachan/sparc64-codegen
stage2: sparc64: Some Air lowerings + skip unbuildable tests
2022-12-10 15:10:21 -05:00
Andrew Kelley
023b597ab4
Merge pull request #13370 from r00ster91/newascii
std.ascii: remove LUT and deprecations
2022-12-10 14:53:41 -05:00
Andrew Kelley
ac0488430f Compilation: revert asking for exclusive locks on cache hits
We definitely want a shared lock on a cache hit. Without this, we get a
deadlock when Zig is asked to compile the same C source file multiple
times as part of the same compilation.

This is a partial revert of 8ccb9a6ad327a4d7fbc321b33d4aa66a27a1f5ee.

cc @kcbanner
2022-12-10 14:34:30 -05:00
Koakuma
644593ab18 stage2: sparc64: Implement airMinMax 2022-12-10 21:32:00 +07:00
Koakuma
b4b7a404cf stage2: sparc64: Implement airBitReverse 2022-12-10 21:31:59 +07:00
Koakuma
a369e8af9e stage2: sparc64: Add more types for genTypedValue 2022-12-10 21:31:59 +07:00
Jacob Young
fc6d7d2799 CBE: fix compiling for aarch64-windows
These bugs were triggered in the C backend by aarch64-specific code in
os/windows.zig.  Intentionally not updating zig1.wasm yet because of
upcoming changes and since aarch64-windows is not tested on master yet.
2022-12-10 09:15:40 -05:00
Koakuma
e9204f84ad stage2: sparc64: Log generated function name for debug purposes 2022-12-10 21:11:14 +07:00
Koakuma
fb9357f06c stage2: sparc64: Implement atomic ops 2022-12-10 21:11:14 +07:00
Koakuma
219b5f0ad6 stage2: sparc64: Implement stack argument 2022-12-10 21:11:14 +07:00
Koakuma
a72362f395 stage2: sparc64: Implement airWrapErrUnionPayload 2022-12-10 21:11:14 +07:00
Koakuma
1b5b9eb365 stage2: sparc64: Add extra note about stack_offset MCV 2022-12-10 21:11:14 +07:00
Koakuma
57616debf9 stage2: sparc64: Implement airTrunc 2022-12-10 21:11:14 +07:00
Koakuma
ef532ada8a stage2: sparc64: Implement airSplat 2022-12-10 21:11:14 +07:00
Koakuma
4687bc2730 stage2: sparc64: Implement airUnionInit 2022-12-10 21:11:14 +07:00
Koakuma
0bc936685b stage2: sparc64: Implement airErrorName 2022-12-10 21:11:14 +07:00
Koakuma
4ddedb3885 stage2: sparc64: Implement get/setUnionTag 2022-12-10 21:11:14 +07:00
Andrew Kelley
7637ac584f
Merge pull request #13821 from Vexu/eliminate-bound-fn
Eliminate `BoundFn` type from the language
2022-12-10 06:14:57 -05:00
Andrew Kelley
02b221051a fix aarch64-windows-gnu libc
We were missing some math functions. After this enhancement I verified
that I was able to cross-compile ninja.exe for aarch64-windows and
produce a viable binary.
2022-12-10 03:06:17 -05:00
Veikka Tuominen
9d93b2ccf1 Eliminate BoundFn type from the language
Closes #9484
2022-12-09 20:37:18 -07:00
Veikka Tuominen
5831b68341 AstGen: add check for missing builtin argument
Closes #13817
2022-12-09 20:37:18 -07:00
r00ster91
37b1707370 DepTokenizer.printUnderstandableChar: consider space printable
This makes the function consider space to be printable as well (because it is)
and simplifies that function.
2022-12-09 21:57:17 +01:00
r00ster91
6b7d9b34e8 api(std.ascii): remove deprecated decls 2022-12-09 21:57:17 +01:00
Jakub Konka
f7fea080b2 macho+zld: skip atomless synthetic globals in dead_strip
They are implicitly marked live.
2022-12-09 21:12:38 +01:00
Jakub Konka
182751ba27 Revert "coff: specify default base path for relative source paths in pdb" 2022-12-09 14:16:44 +01:00
Jakub Konka
4d640f9bb9 dwarf: resolve all relative paths when generating include_dirs and file_names lists 2022-12-09 14:16:44 +01:00
Jakub Konka
bda5180b2c llvm: resolve all relative paths when creating DIFiles
This will make stack traces and debugging experience more consistent
in the sense that the presence of source lines in stack traces will
not be dependent on the current working directory of the running process.
2022-12-09 14:16:44 +01:00
Jakub Konka
9735953ae2 wasm: implement moving debug_line program when header too big 2022-12-09 09:24:25 +01:00
Jakub Konka
742aa94280 dsym: hint linker when file range copy is not necessary 2022-12-09 09:24:25 +01:00