Jakub Konka
2e1fc0dd14
handle visionos target OS tag in the compiler
...
* rename .xros to .visionos as agreed in the tracking issue
* add support for VisionOS platform in the MachO linker
2024-05-09 15:04:15 +02:00
Jonathan Marler
a96b78c170
add std.zip and support zip files in build.zig.zon
...
fixes #17408
Helpful reviewers/testers include Joshe Wolfe, Auguste Rame, Andrew
Kelley and Jacob Young.
Co-authored-by: Joel Gustafson <joelg@mit.edu>
2024-05-03 16:58:53 -04:00
Andrew Kelley
4dc50151c4
std.mem.indexOfSentinel: valgrind integration
...
this code returns false positives in Valgrind, so we fall back to the
other implementation when running in valgrind.
see #17717
2024-03-21 15:01:57 -07:00
Andrew Kelley
33428fc6aa
std.mem.indexOfScalarPos: valgrind integration
...
this code returns false positives in Valgrind, so we fall back to the
other implementation when running in valgrind.
see #17717
2024-03-21 14:35:37 -07:00
Andrew Kelley
12191c8a22
std: promote tests to doctests
...
Now these show up as "example usage" in generated documentation.
2024-03-21 14:11:46 -07:00
garrisonhh
1ddd0691c6
std.mem: use destructurable tuple for indexOfMinMax return type
2024-03-15 16:40:51 +02:00
Tristan Ross
099f3c4039
std.builtin: make container layout fields lowercase
2024-03-11 07:09:07 -07:00
Techatrix
9727931fda
fix integer overflow in indexOfPosLinear when needle.len > haystack.len
2024-02-25 12:07:12 +01:00
Andrew Kelley
06d0c58305
std.mem: take advantage of length-based slicing
2024-02-23 02:37:10 -07:00
e4m2
8d56e472c9
Replace std.rand references with std.Random
2024-02-08 15:21:35 +01:00
Robin Voetter
3ef5b80d2c
std: use simple eqlBytes for spirv
...
The SPIR-V backend doesn't support the advanced
eqlBytes yet, and when it does, it likely that it
will be detrimental.
2024-02-04 19:08:57 +01:00
Tristan Ross
9fce1d1ab1
mem: add byteswap array support ( #17959 )
...
also make byteswap work with enums
2024-01-14 21:06:31 -05:00
Andrew Kelley
e025ad7b46
std.mem: fix simd.suggestVectorLength merge conflict
...
Commits
2f8e4347b1f9c2bf093ac48a636576c22359c1ff and
6a32d58876995f18b35ffd89b8875a99417c29cf had a conflict that was
undetected by source control.
2024-01-09 18:20:53 -07:00
Andrew Kelley
6a32d58876
Merge pull request #18318 from castholm/simd-segfault
...
Rename `simd.suggestVectorSize` to clarify intent and fix related segfault
2024-01-09 17:13:58 -08:00
David Rubin
2f8e4347b1
Optimized std.mem.eql with SIMD ( #18389 )
...
* optimized memeql
* add `sched_setaffinity` to `std.os.linux`
Co-authored-by: Protty <45520026+kprotty@users.noreply.github.com>
Co-authored-by: Ryan Liptak <squeek502@hotmail.com>
2024-01-09 02:50:22 -05:00
xdBronch
6ebeb85abd
speed up sliceTo when end == sentinel
2024-01-04 17:54:56 +02:00
Carl Ã…stholm
85869f8225
Correct expected/actual parameter order of some assertions
2024-01-03 21:20:49 +01:00
Carl Ã…stholm
4c1da0912a
Fix compile errors from the expectEqual change
2024-01-03 21:20:48 +01:00
Carl Ã…stholm
564b1da214
Change < to <= in indexOfSentinel SIMD path
2024-01-01 16:25:17 +01:00
Carl Ã…stholm
59ac0d1eed
Deprecate suggestVectorSize in favor of suggestVectorLength
...
The function returns the vector length, not the byte size of the vector or the bit size of individual elements. This distinction is very important and some usages of this function in the stdlib operated under these incorrect assumptions.
2024-01-01 16:18:57 +01:00
Carl Ã…stholm
781c3a985c
Prevent reading over a page boundary in mem.indexOfSentinel
...
The size of the slice element was not correctly taken into account when determining whether a read would cross a page boundary.
2024-01-01 16:18:57 +01:00
David Rubin
1e42a3de89
Remove all usages of std.mem.copy and remove std.mem.set ( #18143 )
2023-11-29 16:03:02 -05:00
Andrew Kelley
d5e21a4f1a
std: remove meta.trait
...
In general, I don't like the idea of std.meta.trait, and so I am
providing some guidance by deleting the entire namespace from the
standard library and compiler codebase.
My main criticism is that it's overcomplicated machinery that bloats
compile times and is ultimately unnecessary given the existence of Zig's
strong type system and reference traces.
Users who want this can create a third party package that provides this
functionality.
closes #18051
2023-11-22 13:24:27 -05:00
mlugg
51595d6b75
lib: correct unnecessary uses of 'var'
2023-11-19 09:55:07 +00:00
Jacob Young
509be7cf1f
x86_64: fix std test failures
2023-11-03 23:18:21 -04:00
Andrew Kelley
3fc6fc6812
std.builtin.Endian: make the tags lower case
...
Let's take this breaking change opportunity to fix the style of this
enum.
2023-10-31 21:37:35 -04:00
Jacob Young
149200aac5
mem: delete readIntSlice and writeIntSlice
...
After deleting all potentially incorrect usages, there were no more
remaining.
2023-10-31 21:37:35 -04:00
Jacob Young
d890e81761
mem: fix ub in writeInt
...
Use inline to vastly simplify the exposed API. This allows a
comptime-known endian parameter to be propogated, making extra functions
for a specific endianness completely unnecessary.
2023-10-31 21:37:35 -04:00
Andrew Kelley
49b9e1e69b
std.mem.minMax: make it return a tuple
...
this is a breaking change
2023-10-28 10:14:15 -07:00
Jacob Young
b0cf620fe3
x86_64: fix cond_br
2023-10-27 03:33:49 -04:00
Jacob Young
98cd378208
x86_64: fix behavior of getValue
...
Old behavior renamed to `getValueIfFree`.
2023-10-26 21:45:58 -04:00
Jacob Young
b55377a5ab
x86_64: pass more tests
...
* 128-bit integer multiplication with overflow
* more instruction encodings used by std inline asm
* implement the `try_ptr` air instruction
* follow correct stack frame abi
* enable full panic handler
* enable stack traces
2023-10-25 04:28:30 -04:00
mlugg
f2814caaf0
Sema: don't allow undef values through resolveDefinedValue in typeof block
...
This logic is not correct in most cases. If any instruction needs to
operate with different semantics within `@TypeOf`, it should be made to
do so explicitly.
This broke a line in `std.mem`: I have opted to fix this in std for now,
since as far as I know it's not yet been discussed which operations (if
any) should be special-cased like this within `@TypeOf`.
2023-10-24 14:28:34 +01:00
Jacob Young
8f69e977f1
x86_64: implement 128-bit builtins
...
* `@clz`
* `@ctz`
* `@popCount`
* `@byteSwap`
* `@bitReverse`
* various encodings used by std
2023-10-23 22:42:18 -04:00
Jacob Young
fe93332ba2
x86_64: implement enough to pass unicode tests
...
* implement vector comparison
* implement reduce for bool vectors
* fix `@memcpy` bug
* enable passing std tests
2023-10-23 22:42:18 -04:00
Jacob Young
27fe945a00
Revert "Revert "Merge pull request #17637 from jacobly0/x86_64-test-std""
...
This reverts commit 6f0198cadbe29294f2bf3153a27beebd64377566.
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 0c99ba1eab63865592bb084feb271cd4e4b0357e, reversing
changes made to 5f92b070bf284f1493b1b5d433dd3adde2f46727.
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
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
Andrew Kelley
b171a6f25d
Package.Fetch: normalize path separators in symlinks
...
closes #17549
2023-10-16 16:47:47 -07:00
joadnacer
7b9165b375
std.mem: Improve writeIntSlice performance
2023-10-16 08:49:05 -04:00
Veikka Tuominen
c919e9a280
std.simd: return comptime_int from suggestVectorSize
2023-10-13 16:58:05 +03:00
Karl Seguin
75b48ef503
std.mem: use indexOfScalarPos when indexOf is called where needle.len == 1
...
When `std.mem.indexOf` is called with a single-item needle, use `indexOfScalarPos` which is significantly faster than the more general `indexOfPosLinear`. This can be done without introducing overhead to normal cases (where `needle.len > 1`).
2023-10-09 16:50:16 +03:00
Jay Petacat
d8bfbbbf25
std.mem.zeroes: Zero out entire extern union, including padding
...
Fixes #17258
2023-10-01 02:39:05 -07:00
Marc Tiehuis
08635f08a9
fix indexOfSentinel alignment for types larger than 1 byte
2023-09-30 22:15:47 +13:00
Marc Tiehuis
5b5da0ef8c
std.mem: check backend vector support for indexOfSentinel/indexOfScalarPos
2023-09-30 21:22:12 +13:00
Marc Tiehuis
cd766513fe
std.mem: add vectorized indexOfScalarPos and indexOfSentinel
...
These are an order of magnitude quicker than the previous
implementations:
A relative comparison of each, measuring scanning a 1G file.
Reading 1G (1.0000000009313226GiB)
std.mem.sliceTo: 281.232ms
vectorized.sliceTo: 24.769ms
strlen: 24.291ms
std.indexOfScalar: 229.016ms
vectorized.indexOfScalar: 24.685ms
memchr: 24.958ms
2023-09-30 21:19:43 +13:00
Karl Seguin
599641357c
std.mem: use for loop instead of while in indexOf* to reduce bound checking
2023-09-28 15:40:08 +00:00
Jay Petacat
37398ed2a5
std: Reactivate skipped tests w.r.t. llvm/llvm-project#55522
2023-09-27 01:37:25 +03:00
Andrew Kelley
5b8af7a2a9
skip regressed LLVM 17 std lib test on powerpc
...
Tracked by #16951
2023-09-19 09:37:53 -07:00