Commit Graph

26592 Commits

Author SHA1 Message Date
Jacob Young
27fe945a00 Revert "Revert "Merge pull request #17637 from jacobly0/x86_64-test-std""
This reverts commit 6f0198cadb.
2023-10-22 15:46:43 -04:00
Andrew Kelley
6f0198cadb Revert "Merge pull request #17637 from jacobly0/x86_64-test-std"
This reverts commit 0c99ba1eab, reversing
changes made to 5f92b070bf.

This caused a CI failure when it landed in master branch due to a
128-bit `@byteSwap` in std.mem.
2023-10-22 12:16:35 -07:00
Andrew Kelley
9f0359d78f Revert "Merge pull request #17657 from Snektron/spirv-recursive-ptrs"
This reverts commit b822e841cd, reversing
changes made to 0c99ba1eab.

This caused a CI failure when it landed in master branch.
2023-10-22 12:15:31 -07:00
Jan Philipp Hafer
fd2239bde9 child_process + Build: rename exec to run + all related code
Justification: exec, execv etc are unix concepts and portable version
should be called differently.

Do no touch non-Zig code. Adjust error names as well, if associated.
Closes #5853.
2023-10-22 14:47:20 -04:00
Andrew Kelley
d8c067966f
Merge pull request #17400 from joadnacer/ringbuffer-optim
std.RingBuffer: Implement mem.copy read/write
2023-10-22 13:19:22 -04:00
Jacob Young
ccc9ebf0bd std: slightly improve codegen of std.unicode.utf8ValidateSlice 2023-10-22 12:07:23 -04:00
Krzysztof Wolicki
b4d4d19958
autodoc: Add support for struct_init_empty_ref_result (#17476) 2023-10-22 16:15:56 +02:00
Krzysztof Wolicki
606f0e496e
autodoc: Display type kinds for containers (#17667) 2023-10-22 16:15:00 +02:00
Robin Voetter
b822e841cd
Merge pull request #17657 from Snektron/spirv-recursive-ptrs
spirv: recursive pointers
2023-10-22 15:35:00 +02:00
Jacob Young
0c99ba1eab
Merge pull request #17637 from jacobly0/x86_64-test-std
x86_64: start to enable `test-std` and `test-compiler-rt` testing
2023-10-22 08:06:47 -04:00
Michael Dusan
5f92b070bf libtsan: do not set PIE
This was missed in #17597 .
2023-10-22 06:02:24 -04:00
Andrew Kelley
e354aac8f2
Merge pull request #14833 from QusaiHroub/optimize_std.fs.Dir.makeOpenPath_12474
#12474: std.fs.Dir.makeOpenPath: optimize case, if path already exists
2023-10-21 23:30:47 -04:00
Andrew Kelley
7d50634e0a
Merge pull request #17545 from ziglang/more-anon-decls
migrate make_ptr_const to new anonymous decl mechanism
2023-10-21 21:38:55 -04:00
Jakub Konka
3d7c6c803b dwarf: fix false assumption that ptr-deref requires GOT-indirection 2023-10-21 21:38:41 -04:00
Jacob Young
c4fcf0e22a codegen: implement lowering aligned anon decls 2023-10-21 21:38:41 -04:00
mlugg
dd402f6d83 AstGen: omit make_ptr_const for resolve_inferred_alloc
After the previous commit, these make_ptr_const ZIR instructions are
redundant.
2023-10-21 21:38:41 -04:00
Andrew Kelley
5e1db5e478 Sema: migrate zirResolveInferredAlloc to new anon decl mechanism
This required a bug fix in zirMakePtrConst.
2023-10-21 21:38:41 -04:00
Andrew Kelley
7bab406c79 InternPool: store alignment of anon decls
Commit 5393e56500d499753dbc39704c0161b47d1e4d5c has a flaw pointed out
by @mlugg: the `ty` field of pointer values changes when comptime values
are pointer-casted. This commit introduces a new encoding which
additionally stores the "original pointer type" which is used to store
the alignment of the anonymous decl, and potentially other information
in the future such as section and pointer address space. However, this
new encoding is only used when the original pointer type differs from
the casted pointer type in a meaningful way.

I was able to make the LLVM backend and the C backend lower anonymous
decls with the appropriate alignment, however I will need some help
figuring out how to do this for the backends that lower anonymous decls
via src/codegen.zig and the wasm backend.
2023-10-21 21:38:41 -04:00
Andrew Kelley
5aa82ed477 std.elf: remove some unneeded @as 2023-10-21 21:38:41 -04:00
Andrew Kelley
ecfb18286a migrate make_ptr_const to new anonymous decl mechanism
Instead of creating Module.Decl objects, directly create InternPool
pointer values using the anon_decl Addr encoding.

The LLVM backend needed code to notice the alignment of the pointer and
lower accordingly. The other backends likely need a similar change.
2023-10-21 21:38:41 -04:00
Lee Cannon
3cd3052d4d fix std.Build.addAssembly 2023-10-21 20:46:28 -04:00
JustinWayland
c45af2af61
Fix simple doc mistakes. (#17624)
* Add missing period in Stack's description

This looks fine in the source, but looks bad when seen on the documentation website.

* Correct documentation for attachSegfaultHandler()

The description for attachSegfaultHandler() looks pretty bad without indicating that the stuff at the end is code

* Added missing 'the's in Queue.put's documentation

* Fixed several errors in Stack's documentation

`push()` and `pop()` were not styled as code

There was no period after `pop()`, which looks bad on the documentation.

* Fix multiple problems in base64.zig

Both "invalid"s in Base64.decoder were not capitalized.

Missing period in documentation of Base64DecoderWithIgnore.calcSizeUpperBound.

* Fix capitalization typos in bit_set.zig

In DynamicBitSetUnmanaged.deinit's and DynamicBitSet.deinit's documentation, "deinitializes" was uncapitalized.

* Fix typos in fifo.zig's documentation

Added a previously missing period to the end of the first line of LinearFifo.writableSlice's documentation.
Added missing periods to both lines of LinearFifo.pump's documentation.

* Fix typos in fmt.bufPrint's documentation

The starts of both lines were not capitalized.

* Fix minor documentation problems in fs/file.zig

Missing periods in documentation for Permissions.setReadOnly, PermissionsWindows.setReadOnly, MetadataUnix.created, MetadataLinux.created, and MetadataWindows.created.

* Fix a glaring typo in enums.zig

* Correct errors in fs.zig

* Fixed documentation problems in hash_map.zig

The added empty line in verify_context's documentation is needed, otherwise autodoc for some reason assumes that the list hasn't been terminated and continues reading off the rest of the documentation as if it were part of the second list item.

* Added lines between consecutive URLs in http.zig

Makes the documentation conform closer to what was intended.

* Fix wrongfully ended sentence in Uri.zig

* Handle wrongly entered comma in valgrind.zig.

* Add missing periods in wasm.zig's documentation

* Fix odd spacing in event/loop.zig

* Add missing period in http/Headers.zig

* Added missing period in io/limited_reader.zig

This isn't in the documentation due to what I guess is a limitation of autodoc, but it's clearly supposed to be. If it was, it would look pretty bad.

* Correct documentation in math/big/int.zig

* Correct formatting in math/big/rational.zig

* Create an actual link to ZIGNOR's paper.

* Fixed grammatical issues in sort/block.zig

This will not show up in the documentation currently.

* Fix typo in hash_map.zig
2023-10-21 21:24:55 +00:00
Andrew Kelley
3f4df85299 link.Elf: report file not found error 2023-10-21 22:25:39 +02:00
joadnacer
a8eb70c9d7 compress: Improve RingBuffer usage 2023-10-21 19:20:12 +01:00
joadnacer
7f9e0f1c56 std.RingBuffer: Implement more efficient read/write methods 2023-10-21 19:19:35 +01:00
Michael Bradshaw
cc56577edf Return zero for NaN-to-int lossy casts
Fixes #15038.

The goal here is to guarantee lossyCast() is panic-free and always safe.
2023-10-21 20:51:51 +03:00
Robin Voetter
6281ad91df
spirv: self-referential pointers via new fwd_ptr_type
Its a little ugly but it works.
2023-10-21 17:46:54 +02:00
Robin Voetter
6e955af8c8
spirv: make constructStruct also use self.ptrType
This completes the migration from spv.ptrType to self.ptrType.
Unfortunately this requires us to pass a list of types to
constructStruct, which also requires some extra allocations
here and there.
2023-10-21 17:46:53 +02:00
Robin Voetter
1deec09f03
spirv: improve union operations
This removes the strategy where union with different active
fields would be generated, and instead simply pointer casts
the active field type where required. This also allows removing
spv.ptrType and using self.ptrType instead, and allows caching
all union types (because there is only the canonical one).
2023-10-21 17:46:53 +02:00
Robin Voetter
5090d75e48
spirv: make load() and store() accept MemoryOptions
This struct is used to configure the load, such as to make
it volatile. Previously this was done using a single bool, but
this struct makes it shorter to write non-volatile loads (the
usual) and more clear whats going on when a volatile load is
required.
2023-10-21 17:46:52 +02:00
Robin Voetter
200bca360e
spirv: replace most use of spv.ptrType with self.ptrType
To support self-referential pointers, in the future we will
need to pass the Zig type to any pointer that is created. This
lays some ground work for that by replacing most uses of
spv.ptrType with a new ptrType function that also accepts the
Zig type. This function's contents will soon be replaced by
a version that also supports self-referential pointers.

Also fixed some bugs regarding the use of direct/indirect.
2023-10-21 17:46:50 +02:00
Jacob Young
920e9668dd x86_64: enable fixed behavior test 2023-10-21 10:55:41 -04:00
Jacob Young
70c8e7f91d x86_64: disable failing tests, enable test-compiler-rt testing 2023-10-21 10:55:41 -04:00
Jacob Young
32e85d44eb x86_64: disable failing tests, enable test-std testing 2023-10-21 10:55:41 -04:00
Jacob Young
2e6e39a700 x86_64: fix bugs and disable erroring tests 2023-10-21 10:55:41 -04:00
Jacob Young
c880644d92 x86_64: disable difficult std tests and hack around more zero-bit types 2023-10-21 10:55:41 -04:00
Jacob Young
9358a7528f x86_64: fix crashes 2023-10-21 10:55:41 -04:00
snoire
b403ca0aab std.Build: use create() instead of init() for Step.RemoveDir 2023-10-21 17:48:25 +03:00
Jakub Konka
809e7aa4fc
Merge pull request #17638 from ziglang/elf-dwarf-fixes
dwarf: decouple DWARF formats from target pointer size + misc fixes
2023-10-21 16:14:40 +02:00
Andrew Kelley
3d6e633371
Merge pull request #16840 from e4m2/rand-int
std.rand: Support integers with >64 bits in more functions
2023-10-21 05:26:19 -04:00
LordMZTE
b3aaf854cd std.os: do nothing when calling fchdir with AT_FDCWD 2023-10-21 05:13:21 -04:00
matu3ba
f335d92b28
compiler_rt: arm frsub, drsub with tests (#17629)
Tests with +-0, numbers with accuracy 0.001, 0.000001, +-max for inf.
2023-10-21 02:12:02 -07:00
Frank Denis
a5c79c7998
crypto.ff: faster exponentiation with short/public exponents (#17617)
RSA exponents are typically 3 or 65537, and public.

For those, we don't need to use conditional moves on the exponent,
and precomputing a lookup table is not worth it. So, save a few
cpu cycles and some memory for that common case.

For safety, make `powWithEncodedExponent()` constant-time by default,
and introduce a `powWithEncodedPublicExponent()` function for exponents
that are assumed to be public.

With `powWithEncodedPublicExponent()`, short (<= 36 bits) exponents
will take the fast path.
2023-10-21 02:09:43 -07:00
Ryan Liptak
fb5f69a552 Improve Dir.makePath and Dir.makeOpenPathAccessMaskW doc comments
These are not recursive functions, so 'recursively' could be misleading.
2023-10-20 23:25:43 -07:00
Ryan Liptak
63b504219d Dir.makeOpenPathAccessMaskW: Use path.ComponentIterator
See 49053cb1b4 for details

Also, fix leaking the intermediate directory handles.
2023-10-20 23:25:43 -07:00
Andrew Kelley
54a4f24ea7 build.zig: bump max_rss again
zig build-exe zig Debug aarch64-macos-none: error: memory usage peaked
at 6607110144 bytes, exceeding the declared upper bound of 6500000000
2023-10-20 23:01:05 -07:00
Andrew Kelley
c55a33e6d9 build.zig: it takes even more ram to build zig apparently
zig build-exe zig Debug aarch64-macos-none: error: memory usage peaked
at 6466420736 bytes, exceeding the declared upper bound of 6350000000
2023-10-20 22:41:20 -07:00
Andrew Kelley
8520aa585f build.zig: adjust max_rss again
Looks like the higher memory requirements come from building with a
clean cache, and affect all operating systems, not just macOS.
2023-10-20 21:56:37 -07:00
Andrew Kelley
5ec59f2a01 build.zig: building on macos takes more memory
Previous commit caused this error to be printed:

zig build-exe zig Debug aarch64-macos-none: error: memory usage peaked
at 6323765248 bytes, exceeding the declared upper bound of 5200000000
2023-10-20 21:54:27 -07:00
Andrew Kelley
1c48588fc8 build.zig: annotate max_rss for building the compiler
I observed some out-of-memory conditions happening on one of the CI
servers. This should make it avoid scheduling compiler builds at the
same time as other memory-intensive operations.
2023-10-20 21:31:49 -07:00