Commit Graph

671 Commits

Author SHA1 Message Date
Feoramund
b7de15caa3 Clarify strconv.append_* to strconv.write_* 2025-06-05 16:56:00 -04:00
Feoramund
36b41ce163 Let compound literal array be broadcast to a struct field of arrays
Fixes #4364

Patch courtesy of @cribalik
2025-06-05 07:48:10 -04:00
Laytan Laats
9eefa2006e encoding/cbor: support simd vectors 2025-06-04 22:00:02 +02:00
Laytan Laats
85224b21e6 encoding/cbor: support the matrix type 2025-06-04 21:51:12 +02:00
Jeroen van Rijn
82dfb43663 Fix #5265 2025-06-03 11:18:11 +02:00
Laytan Laats
f94fc992d7 fix swizzle in for in statement
Fixes #1730
2025-06-02 20:30:48 +02:00
Jeroen van Rijn
a0f0e9e778 -vet 2025-05-31 20:30:02 +02:00
Jeroen van Rijn
890e923051 Vectorize strings.prefix_length.
Also add `strings.common_prefix`.
2025-05-31 20:24:21 +02:00
Feoramund
edbd247972 Use time.Stopwatch in core:bytes benchmark
This should result in a clearer idea of how fast the procedures are
running, as the loop can run without going back and forth to the system
for the time.
2025-05-29 16:35:26 -04:00
Feoramund
4e49fb4f82 Add benchmarks for runtime.memory_* comparison procedures 2025-05-29 16:35:26 -04:00
Feoramund
b15a665898 Add tests for runtime.memory_* comparison procedures 2025-05-29 16:34:07 -04:00
Feoramund
35b157ac83 Fix multiline RegEx iteration
In `.Multiline` mode:

- `^` is now defined to assert the start of the string or that a "\n" or
  "\r" rune was parsed on last VM dispatch.

- `$` is now defined to consume a newline sequence of "\n", "\r", or
  "\r\n" or to assert the end of the string.
2025-05-26 14:48:45 -04:00
Laytan Laats
478c923e2c fix another type alias issue with mini cycle 2025-05-26 19:48:28 +02:00
Feoramund
5d01acc04f Add more RegEx tests 2025-05-24 07:42:04 -04:00
Feoramund
37d6491300 Remove Global RegEx flag, default to unanchored patterns 2025-05-24 07:42:04 -04:00
Feoramund
fedb9efb41 Make RegEx VM restartable and fix iterator infinite loop 2025-05-24 07:23:04 -04:00
Laytan Laats
c35a45e823 fix global and static any
Fixes #4627
2025-05-17 16:49:30 +02:00
0xrsp
ea806f1d5e new compiler intrinsics type_integer_to_unsigned,type_integer_to_signed 2025-05-15 01:00:40 +09:30
Jeroen van Rijn
30388cada3 Fix os2.clean_path on Windows 2025-05-11 15:35:52 +02:00
Laytan Laats
ebc63a7355 add hexfloat (0h) parsing to strconv 2025-05-10 15:11:52 +02:00
gingerBill
19fe75f020 Merge pull request #5098 from laytan/fix-nan-comparisons
fix variable NaN comparisons
2025-05-02 13:00:42 +01:00
Laytan Laats
d2f8cb1306 adds the cases of #5043 and #5097 to the CI 2025-04-30 20:13:21 +02:00
Laytan Laats
396a18efce fix variable NaN comparisons 2025-04-30 20:04:24 +02:00
Jeroen van Rijn
062a3c2fae Fix parsing of CDATA tags (#5059)
Fixes #5054
2025-04-19 20:25:44 +02:00
Jeroen van Rijn
678fa897f5 signbit -> sign_bit in tests/core/math 2025-04-15 16:20:49 +02:00
mtarik34b
1d2adbb3c6 Remove reference to git issue 2025-04-15 05:26:36 +02:00
mtarik34b
313d7d84bc Ensure NaN != any_float_value evaluates to true for constant NaN values 2025-04-15 05:00:36 +02:00
Jeroen van Rijn
0fc141db5d core:mem/tlsf: Add early-out in OOM logic
This implementation doesn't allow for out-of-band allocations to be passed through, as it's not designed to
track those. Nor is it able to signal those allocations then need to be freed on the backing allocator,
as opposed to regular allocations handled for you when you `destroy` the TLSF instance.

So if we're asked for more than we're configured to grow by, we can fail with an OOM error early, without adding a new pool.
2025-04-14 20:40:05 +02:00
Jeroen van Rijn
beee27dec0 Allow core:mem/tlsf to automatically add new pools.
New features:
- If TLSF can't service an allocation made on it, and it's initialized with `new_pool_size` > 0, it will ask the backing allocator for additional memory.

- `estimate_pool_size` can tell you what size your initial (and `new_pool_size`) ought to be if you want to make `count` allocations of `size` and `alignment`, or in its other form, how much backing memory is needed for `count` allocations of `type` and its corresponding size and alignment.
2025-04-14 19:49:55 +02:00
Jeroen van Rijn
7088284ff4 Refactor core:mem/tlsf, add free_all support.
TODO: Allow the TLSF allocator to add additional pools when it would ordinarily OOM
      by calling its backing allocator.
2025-04-14 17:13:27 +02:00
Jeroen van Rijn
0a97e01827 Add tests for type_elem_type on SIMD vectors 2025-04-11 23:31:02 +02:00
Barinzaya
bbaec119e5 Added tests for math.nextafter. 2025-04-07 16:27:41 -04:00
Jeroen van Rijn
a5e513567b Optimize regex match iterator.
Reuse virtual machine and capture groups between matches.
2025-04-07 14:58:41 +02:00
Jeroen van Rijn
9a2b6c01aa Return loop index in regex iterator. 2025-04-06 21:45:37 +02:00
Jeroen van Rijn
66077add33 {.Glboal} implicit in regex allocator. 2025-04-06 21:13:02 +02:00
Jeroen van Rijn
918d57fe01 Keep -vet happy. 2025-04-06 14:24:17 +02:00
Jeroen van Rijn
cdc56dc691 Add iterator for core:text/regex.
Usage:
```odin
haystack := `xxfoobarxfoobarxx`
pattern  := `f(o)ob(ar)`

it := regex.create_iterator(haystack, pattern, {.Global}) or_return
defer regex.destroy(it)

for capture in regex.match(&it) {
	fmt.println(capture)
}
```
2025-04-06 14:19:14 +02:00
Jeroen van Rijn
8d283cefa0 Merge pull request #5007 from laytan/net-errors-overhaul
net: rework errors to be cross-platform
2025-04-05 17:53:10 +02:00
Laytan Laats
ff7d55a8e1 net: rework errors to be cross-platform 2025-04-05 17:35:19 +02:00
Jeroen van Rijn
843467bb8f Fix #5004
Fixes constant NaN to constant NaN comparisons.
2025-04-05 14:47:30 +02:00
gingerBill
4a595f9dac Merge pull request #4954 from Feoramund/os2-path
Add new path API for `os2`
2025-03-24 11:19:21 +00:00
Yawning Angel
f3f5fbd373 test/benchmarks/crypto: Improve benchmarks
- Use text/table for results
- Add more benchmarks
2025-03-23 19:14:33 +09:00
Yawning Angel
b220df60b8 core:crypto/deoxysii: Initial import 2025-03-23 19:14:33 +09:00
Yawning Angel
c2786a6dd5 core/crypto/aegis: Initial import 2025-03-23 19:14:33 +09:00
Yawning Angel
9fdcc4e39a core/crypto/x448: Initial import 2025-03-23 19:14:33 +09:00
Feoramund
3525e71739 Add tests for new os2 path API 2025-03-21 19:14:15 -04:00
Feoramund
4e7f54c565 Decouple usage of filepath from os2 2025-03-21 19:14:15 -04:00
gingerBill
539e9bd2e3 Merge pull request #4836 from laytan/fix-wrong-out-of-memory
fix wrong out of memory in edge cases, just try allocate from block for one source of truth
2025-03-20 17:20:26 +00:00
gingerBill
bb429696f8 Merge pull request #4877 from laytan/os2-additions
os/os2: recursive directory walker, expose errors in read_directory, file clone
2025-02-28 14:37:47 +00:00
Feoramund
6054b921db Add tests for new safe to_cstring 2025-02-27 18:54:38 -05:00