Commit Graph
1243 Commits
Author SHA1 Message Date
bbodi 3feb658b8f Pass -microarch:native to the split_globals tests
Every other test in tests/issues/run.sh passes -microarch:native
through $COMMON. These two lines spell their flags out, as the test is
a directory and $COMMON has -file, and left it off. On a CI virtual
machine whose CPU is older than the default x86-64-v2, `odin test`
refuses to run without it, which fails the NetBSD job at random.
2026-10-08 16:09:21 +02:00
bbodi 1e8419d1d4 Fix core:simd/x86 AVX wrappers that did not build
Calling these failed to compile: `_mm256_round_pd` passed a u8 where
the intrinsic takes a u32, `_mm256_blend_pd` misspelt its parameter,
`_mm256_dp_ps` took its mask as an i8, `_mm_permute_ps/pd` used
SSE/SSE2 helpers without enabling them, and `_mm256_permute2f128_pd`
did not return its result.
2026-10-08 15:51:24 +02:00
bbodi 8dbbbd2d64 Fix -debug when every initial file is excluded
The debug compile unit was made from the first file of the initial
package. When build tags exclude all of its files, as for the
Windows-only tests/issues/test_issue_7547.odin on other targets, there
is none, and `odin test -debug` crashed on an out-of-bounds index.
Without `-debug` such a test builds and reports that there are no
tests to run, which `tests/issues/run.sh` relies on.

Fall back to the package's path for the compile unit's file.
2026-10-08 15:51:24 +02:00
bbodi d65a9ba9bc Keep disabled procedures whose value is taken
A procedure with `@(disabled=true)` adds no dependency where it is
used, so that the calls to it, which are removed, do not pull it in.
Taking its value, e.g. `rawptr(assert)` with `-disable-assert`, then
referenced a procedure that was never generated, and LLVM asserted
"missing procedure 'assert'".

Add the dependency for every use that is not the callee of a call.
2026-10-08 15:51:24 +02:00
bbodi 9f62e02634 Reject casts of unspecialized polymorphic procs
Casting a polymorphic procedure to `rawptr`, or to a procedure type
it cannot be specialized to, was accepted. There is no procedure to
take the address of, so the value came out nil, or the build hung, as
with `x := rawptr(avl.init_cmp)`. Assigning one to `rawptr` already
errors; make `cast` and `transmute` match. Casting to a procedure type
that specializes it still works, as assignment does.
2026-10-08 15:51:24 +02:00
bbodi 1448ac3494 Hash all bytes of string16 and cstring16 map keys
Map keys of type `string16` used `default_hasher_string`, which reads
the length as a byte count; for a `string16` it counts u16 units, so
only the first half of the key was hashed. `cstring16` keys took the
same path and were read as a pointer and a length, which crashes.

Add `default_hasher_string16` and `default_hasher_cstring16` to the
runtime and use them for the generated key hashers, which are also
what the runtime and `intrinsics.type_hasher_proc` use.
2026-10-08 15:51:24 +02:00
bbodi c0e78fc172 Bounds check constant slices of [dynamic; N]T
Slicing a `[dynamic; N]T` skipped the bounds check when both indices
were constant, as is done for fixed arrays. But its length is only
known at runtime, so `a[0:3]` with a length of 2 silently returned
stale elements. Always check against the length, as for `[dynamic]T`.
2026-10-08 15:51:24 +02:00
bbodi 3bd72688aa Fix multi-value calls in matrix and #simd literals
The checker lets a multi-value call fill several elements of a matrix
or #simd literal, as it does for arrays, but the constant part of the
literal was built as if each element were one value. A matrix literal
like `matrix[2,2]f32{three(), 4}` hit an assertion, and a #simd
literal put the constants after the call in the wrong lanes.

Skip over the values of a call when placing the constants, as the
array case already does.
2026-10-08 15:12:18 +02:00
bbodi 1e1ea828a5 Fix intrinsic signatures in core:simd/x86
`_mm_cvtsd_ss` passed two `__m128d` to `llvm.x86.sse2.cvtsd2ss`,
which takes `(<4 x float>, <2 x double>)`, so LLVM failed with
"Intrinsic has incorrect argument type". `_mm_cvtss_sd` used
`llvm.x86.sse2.cvtss2sd`, which LLVM no longer has. Both wrappers
also took the wrong operand types; use Intel's (a: __m128, b: __m128d)
and (a: __m128d, b: __m128), and express `_mm_cvtss_sd` as a lane
conversion as clang does.

`_mm_prefetch` called `llvm.prefetch` without its pointer mangling and
`__rdtscp` declared `llvm.x86.rdtscp` as taking a pointer when it
returns `{i64, i32}`; both were rejected by LLVM too.
2026-10-08 15:12:18 +02:00
bbodi 26912ceb95 Replace removed LLVM intrinsics in core:simd/x86
LLVM has dropped many x86 intrinsics in favour of generic IR, and
auto-upgrades them only when reading bitcode. Odin declares them
directly, so the calls became undefined external symbols and failed
to link, e.g. `undefined reference to llvm.x86.sse41.pmaxsb`.

Express the affected wrappers the way clang's headers now do: scalar
lane ops, simd.min/max/abs/sqrt, shuffles for the immediate blends,
masked or narrowed multiplies, conversions and an unaligned store.
`_addcarryx_*` now use `llvm.x86.addcarry.*`, as clang does.

`_mm_sqrt_ss` took an unused second argument; it now takes one, as
in Intel's definition. It could not have been used before.
2026-10-08 15:12:18 +02:00
Jeroen van Rijn a961bb5ddb Merge pull request #7818 from bbodi/fix/sha3-init-round-start
Reset keccak_round_start in _sha3.init
2026-10-08 02:51:19 -07:00
bbodi f7f3e63191 Reset keccak_round_start in _sha3.init
init left the round start untouched. A context that skipped zeroing
with `= ---`, or one reused after TurboSHAKE, kept a stale value, so
SHA-3 and SHAKE ran too few rounds and returned wrong hashes silently.
2026-10-08 11:02:47 +02:00
Jeroen van Rijn 4d09219ff4 Merge pull request #7616 from wardjm/fix/parse_int_overflow
Fixed strconv overflow noted in issue#7608.
2026-10-08 01:57:40 -07:00
Jeffrey Ward c2684b43cb Added tests from issue 7608 comments.
Fixed "_" only and no digits. Now returns an error since this is effectively passing nothing to the parser.
2026-10-07 21:28:43 -04:00
gingerBill 711f08a641 Make is_type_lock_free follow what each target lowers without library calls, and reject atomics on types which are not lock-free 2026-10-07 21:58:32 +01:00
gingerBill 403738e5cd Merge pull request #7802 from odin-lang/bill/compiler-improvements-2026-10
Flow-based Escape Analysis of Stack Memory + Show where parapoly procedures and records were instantiated in errors within them
2026-10-07 21:19:06 +01:00
gingerBill b9aa030773 Merge pull request #7812 from bplu4t2f/fix-test-7547-spurious-error
Fix spurious error in `test_issue_7547`
2026-10-07 19:04:34 +01:00
bplu4t2f 0fd160b942 Fix spurious error in test_issue_7547 2026-10-07 19:47:15 +02:00
gingerBill 6413e89d63 Merge pull request #7809 from odin-lang/bill/general-feature-improvements
General Feature Improvements
2026-10-07 17:39:07 +01:00
gingerBill b428be5b42 Add tests for @(align=N) variables and the return address intrinsics 2026-10-07 17:08:21 +01:00
gingerBill c713bede2f Stop core and tests leaving references to stack memory behind 2026-10-07 15:49:33 +01:00
gingerBill 30f80e1079 Align matrices to their largest power-of-two column/row stride, capped at 16; pad fixed capacity dynamic arrays of over-aligned elements to their full size 2026-10-07 15:40:59 +01:00
SOBEX 439485507f Fix #7798 by sorting link_names with Procedures before ForeignProcedures 2026-10-07 15:03:20 +02:00
gingerBill 238699e793 Fix test_issue_5699.odin 2026-10-07 13:37:18 +01:00
gingerBill f9676e0dcb Fix a dangling any in test_static_any 2026-10-07 13:27:38 +01:00
Jeroen van Rijn 1352d0235b Update test_issue_7779.odin
Catch leak in regression test
2026-10-07 11:15:11 +02:00
bplu4t2f 758cdd19ae Fix #7779 - Make encoding/hex behave well on errors. 2026-10-07 10:47:57 +02:00
corley 8b573fcf5e adds alignment regression tests 2026-10-07 01:38:31 +03:00
Mihail Moskov 55c6cf3dea fixes regressions at sites needing true address caused by temp copy 2026-10-06 20:21:05 +03:00
Jeroen van Rijn 3500b228f9 Merge pull request #7740 from bplu4t2f/test-7689
Fix #7689 - Incorrect debug source location at the end of if/else chains
2026-10-05 02:26:51 -07:00
gingerBill 4957867890 Update test_core_runtime.odin 2026-10-04 19:16:24 +01:00
gingerBill f05c574cae Merge pull request #7520 from Pippoosh/fix-soa-pointer-using-field
Fix #soa pointer field access through using
2026-10-04 19:01:28 +01:00
gingerBill 18aead3ba1 Merge pull request #7729 from odin-lang/bill/llvm-backend-improvements
LLVM Backend Performance Improvements to Reduce Compile Times Part 2
2026-10-04 19:01:11 +01:00
bplu4t2f 854cd0e8d8 Fix #7689 - set debug source location of if/else "done" jump to end of the respective block 2026-10-04 14:54:00 +02:00
Jeroen van Rijn 667efeb840 Merge pull request #7731 from Arthur031221/fix/timezone-utc-nanoseconds-20261004-s29
Preserve fractional timestamps in timezone conversions
2026-10-04 05:24:55 -07:00
bplu4t2f e5b8ea0d2a Add test for issue #7689 2026-10-04 14:09:47 +02:00
gingerBill 5a4b877beb Only match the missing procedure assertion in the equal procedure dependencies issue test 2026-10-03 22:33:08 +01:00
gingerBill 733c3fdea7 Add to the tests the equal procedure dependencies test 2026-10-03 22:31:40 +01:00
gingerBill b079c1a23b Merge pull request #7672 from MatzeOGH/fast_float_swar_parse
Second Part of the Fast Float Port (SWAR based scanning)
2026-10-03 22:31:02 +01:00
Arthur031221anddozn d046345202 Preserve fractional timestamps in timezone conversions
Apply timezone offsets to the normalized nanosecond timestamp.
Test fractional roundtrips, dates before 1970 and nanosecond carry.

Co-authored-by: dozn <16659513+dozn@users.noreply.github.com>
Signed-off-by: Arthur031221 <levi74108520963@gmail.com>
2026-10-04 03:39:11 +08:00
gingerBill fcab1c1887 Merge remote-tracking branch 'remotes/Odin-GitHub/master' into bill/llvm-backend-improvements 2026-10-03 15:29:46 +01:00
gingerBill ecfd651f95 Use atomics for the flags name_test 2026-10-03 15:26:49 +01:00
gingerBill 0a57d94f08 Merge pull request #7720 from odin-lang/bill/llvm-backend-improvements
LLVM Backend Performance Improvements to Reduce Compile Times Part 1
2026-10-03 15:03:39 +01:00
gingerBill 5031e2733e Add the comparison procedures of types in the type table and map keys as dependencies making the backend no longer has to create missing procedures 2026-10-03 12:38:00 +01:00
Artur Leite d8a598b1a3 Accept .Recv channels in chan.recv and chan.try_recv 2026-10-03 13:01:17 +02:00
gingerBill e5cc35c445 Lower what LLVM's fast instruction selector cannot select before emitting objects, and declare debug variables through stack slots 2026-10-03 11:02:55 +01:00
gingerBill 8b4f855fc6 Fix a union constant from a field omitted in a constant compound literal being nil 2026-10-03 09:42:26 +01:00
gingerBill f670de9e80 Define and initialize global variables in their own modules 2026-10-03 08:28:31 +01:00
Arthur031221andblob1807 093357f63e Preserve zero-initialized arrays in intrinsics.concatenate
Co-authored-by: blob1807 <12388588+blob1807@users.noreply.github.com>
2026-10-03 11:26:45 +08:00
gingerBill 3a45aaa539 Merge branch 'master' of https://github.com/odin-lang/Odin 2026-10-02 23:40:30 +01:00