Commit Graph

18883 Commits

Author SHA1 Message Date
gingerBill
09204e8982 Correct risc-v aliases 2026-08-20 19:48:30 +01:00
gingerBill
7a7bfea0bd Begin work on pseudo mnemonics in the checker 2026-08-20 19:12:44 +01:00
gingerBill
cfb8a109b6 Begin work on pseudo-aliases 2026-08-20 17:51:47 +01:00
gingerBill
43ff42bf33 Add asm_tables_riscv.cpp 2026-08-20 14:44:10 +01:00
gingerBill
84f9bc76f9 Mockout inline asm for riscv 2026-08-20 14:42:42 +01:00
gingerBill
1009ab0c62 Add riscv.clobber_forms.bin 2026-08-20 11:45:50 +01:00
gingerBill
f3899c1825 rexcode: riscv INSTRUCTION_TABLE which includes the clobber information 2026-08-20 11:43:26 +01:00
gingerBill
21f48c9a9b Merge branch 'master' of https://github.com/odin-lang/Odin 2026-08-20 11:08:18 +01:00
gingerBill
2ebc25001d Add missing risc-v instructions to rexcode 2026-08-20 11:08:03 +01:00
Jeroen van Rijn
366107c852 Merge pull request #7403 from karl-zylinski/fix/os-error-zero-comparison
Remove the `os.Error == 0` compatibility hack
2026-08-20 12:07:59 +02:00
Karl Zylinski
a1fb44f4d1 Remove the os.Error == 0 compatibility hack
The hack made `0` legal against `os.Error` by blanking the constant's
`ExactValue` via `update_untyped_expr_value`, which is a silent no-op when
the expression has not been registered as an untyped expression yet. Since
#7087, `check_expr_base` calls `convert_to_typed` before `add_untyped` runs,
so the blanking is lost and the backend receives a constant typed `os.Error`
still holding integer `0` with no variant type, tripping
`GB_ASSERT_MSG(value_type != nullptr)` in `lb_const_value`.

Also drop the redundant `operand->mode = Addressing_Invalid;` before the
union `convert_untyped_error` call, which revives the `Did you want 'nil'?`
hint, and guard that hint on `type_has_nil` and an Integer/Float zero.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 11:45:50 +02:00
gingerBill
b82fa18cb3 Fix typo 2026-08-20 10:16:34 +01:00
gingerBill
5d873a4b8c Update assert 2026-08-20 09:58:32 +01:00
gingerBill
63918fe1fe Remove debug code 2026-08-20 09:54:50 +01:00
gingerBill
ce6ad239bf Merge pull request #7362 from odin-lang/bill/rexcode
`core:rexcode` improvements
2026-08-20 10:54:07 +02:00
gingerBill
baae2636b8 Add support for x86 mnenomics in and out 2026-08-20 09:53:28 +01:00
gingerBill
4e0fe5cf4f Allow parsing of asm instructions being a keyword 2026-08-20 09:37:34 +01:00
gingerBill
73bb97ceb4 Merge pull request #7394 from mfbulut/fix/or-else-diverging-single
Fix or_else diverging with single return value
2026-08-20 10:30:59 +02:00
Jeroen van Rijn
00a03e72b5 Merge pull request #7400 from kalsprite/union_slice_assert
backend: only reuse a compound literal's storage for a variable of its type
2026-08-20 03:38:09 +02:00
Jeroen van Rijn
6695ca537d Merge pull request #7087 from korvahkh/const-union-fixes
Implement fixes for constant unions
2026-08-20 03:35:36 +02:00
Jeroen van Rijn
e551ef5f15 Merge pull request #7397 from kalsprite/union_ternary_phi
backend: a union constant in a ternary or  builds an ill-typed phi
2026-08-20 03:24:04 +02:00
Jeroen van Rijn
9e493d4958 Merge pull request #7399 from kalsprite/complex_type_hint
check_builtin: `complex` and `quaternion` take their type from their arguments
2026-08-20 03:21:59 +02:00
korvahkh
feb008ab6e Add tests for constant unions 2026-08-19 20:16:51 -05:00
korvahkh
f97274fd0a Fix #7135
We have to handle unpacked structs in
llvm_const_named_struct
2026-08-19 20:13:00 -05:00
korvahkh
92ec71fa75 Prevent underflow of union padding 2026-08-19 20:13:00 -05:00
korvahkh
02246ac6fd Implement fixes for constant unions
Note that with this commit, casting through
multiply-nested unions is forbidden, e.g.
```
U :: union {int, V}
V :: union {bool}
x: U = true
```
does not compile.
(Previously the compiler would simply crash)

This is to avoid situations where adding variants
can lead to unexpected changes in the value.

For example if `U` is changed to have a `bool`
variant of its own:
```
U :: union {int, bool, V}
```
Then `x: U = true` would equal
`U(true)` instead of `U(V(true))`.

Single-variant unions are exempt, primarily to
improve the ergonomics of `Maybe` in cases like:
```
x: Maybe(union{int, bool}) = 1
```

Fix #6100
Fix #6699
Fix #6895
Fix #6896
Fix #6897
Fix #7036
Fix #7083
Fix #7091
2026-08-19 20:12:56 -05:00
kalsprite
8d890cc705 fix typo 2026-08-19 18:04:34 -07:00
kalsprite
bc2649bacd backend: only reuse a compound literal's storage for a variable of its type 2026-08-19 17:53:34 -07:00
kalsprite
f360a37ccd cmplx & quat take type from args 2026-08-19 17:36:50 -07:00
Jeroen van Rijn
7f80c7093a Merge pull request #7396 from kalsprite/union_const_backend
peel union constant to its variant
2026-08-20 01:51:05 +02:00
kalsprite
a13a4b418d backend: a union constant in a ternary or builds an ill-typed phi 2026-08-19 16:45:58 -07:00
kalsprite
cf5f181228 peel union constant to its variant 2026-08-19 16:30:37 -07:00
Jeroen van Rijn
97b5078ad5 Merge pull request #7395 from kalsprite/diagnostic_format_checking
diagnostics: let compiler check error() fmt strings + fixes
2026-08-20 01:14:41 +02:00
kalsprite
f84735af42 missed site 2026-08-19 15:50:55 -07:00
kalsprite
f17c86d936 diagnostics: let compiler check error() fmt strings + fixes 2026-08-19 15:39:39 -07:00
Mustafa Furkan Bulut
8f111671e6 Merge branch 'odin-lang:master' into fix/or-else-diverging-single 2026-08-20 00:58:05 +03:00
Mustafa Furkan Bulut
581d20c606 Allow 'or_else' in diverging single-return 2026-08-20 00:57:10 +03:00
gingerBill
6defecf436 Merge pull request #7392 from kalsprite/asm_extend_mnemonics
amd64 asm: extend family emits mnemonic that doesnt exist
2026-08-19 23:54:37 +02:00
gingerBill
b2f47a1ba0 Merge pull request #7393 from kalsprite/asm_two_operand
asm: multi-instruction template computed with one operand twice
2026-08-19 23:53:54 +02:00
kalsprite
40a64a9dbb move test to build specific 2026-08-19 14:39:12 -07:00
kalsprite
26ae28dfb7 asm: multi-instruction template computed with one operand twice 2026-08-19 14:32:03 -07:00
Jeroen van Rijn
8aa0ce7291 Merge pull request #7391 from kalsprite/codegen_worker_exit
codegen worker must not exit process with running siblings
2026-08-19 23:09:26 +02:00
kalsprite
b9983105bd amd64 asm: extend family emits mnemonic that doesnt exist 2026-08-19 14:03:56 -07:00
Jeroen van Rijn
bd1a2dc7f0 Merge pull request #7390 from kalsprite/selfref_bitfield_hang
a self-referential bit_field hangs the compiler
2026-08-19 22:55:34 +02:00
kalsprite
cd8fc51efc codegen worker must not exit process with running siblings 2026-08-19 13:44:32 -07:00
kalsprite
389416c3ef a self-referential hangs the compiler 2026-08-19 13:27:49 -07:00
Jeroen van Rijn
43d44e5942 Merge pull request #7388 from kalsprite/thread_pool_shutdown_wakeup
thread_pool: an exiting worker must not leave  published
2026-08-19 21:25:47 +02:00
kalsprite
239ced8731 thread_pool: an exiting worker must not leave published 2026-08-19 12:09:20 -07:00
Jeroen van Rijn
b7944229e5 Merge pull request #7385 from kalsprite/bit_field_value_range
bitfield: a constant is range-checked only while it is untyped
2026-08-19 20:48:58 +02:00
Jeroen van Rijn
2c3a7f4502 Merge pull request #7370 from kalsprite/base_prefix_digit_count
big_int: a base prefix with only digit separators has no digits
2026-08-19 20:43:00 +02:00