Commit Graph
8157 Commits
Author SHA1 Message Date
gingerBill 587f030cbf Remove use of do 2026-08-18 18:23:42 +01:00
gingerBill 65ddd08984 Merge branch 'master' into bill/rexcode 2026-08-18 18:23:03 +01:00
gingerBill 9870cd4c36 Merge pull request #7271 from odin-lang/bill/inline-asm
`asm` templates
2026-08-18 19:19:40 +02:00
Jeroen van Rijn 6b661becae Merge pull request #7375 from thetarnav/remove-inline-keywords-core-odin
Remove `inline` and `no_inline` keywords from `core:odin`
2026-08-18 19:03:00 +02:00
thetarnav f1bbd8fe49 Remove inline and no_inline keywords from core:odin
Odin uses `#force_inline` and `#force_no_inline` directives, not
keywords.
The cpp parser does not define them as keywords:
/home/thetarnav/Projects/odin/src/tokenizer.cpp:86
Nor does the grammar spec: https://odin-lang.org/spec/grammar/#keywords
2026-08-18 18:25:22 +02:00
Nick Aversano 54b818e9a7 fix FILE_NOTIFY_INFORMATION struct member casing 2026-08-18 11:19:10 -04:00
gingerBill 14184744ee Add missing x86.clobber_forms.bin 2026-08-18 15:13:37 +01:00
gingerBill 6e17e7a2de Add missing x86 instructions 2026-08-18 13:19:23 +01:00
gingerBill 8d33a47fab Improve comment for the CLOBBER_TABLE 2026-08-18 11:54:45 +01:00
gingerBill 18df1ed23e Correct clobber_table.odin 2026-08-18 11:44:35 +01:00
gingerBill 80d7f6462a Minor clean up 2026-08-18 11:33:49 +01:00
gingerBill 35ae861ff6 Use number rather than enum 2026-08-18 11:28:54 +01:00
gingerBill 8e807fb7aa Use new clobber forms in check_asm.cpp 2026-08-18 11:23:20 +01:00
gingerBill b1b08c13c0 Update clobber table to encode the clobbering for each of the forms 2026-08-18 11:20:30 +01:00
Jeroen van Rijn 7140c5bccb Fix #7365
Fixes #7365
2026-08-18 01:53:55 +02:00
Ruan ad8cfbeb73 Fix slice.simple_equal misbehaviour on empty slice with non-nil data
Before this change, the following code:

```odin
package strconcat

import "core:fmt"
import "core:slice"

main :: proc() {
	a: [1]u8
	s1: []u8 = {}
	s2: []u8 = a[:0]

	fmt.printfln("s1={} len(s1)={} raw_data(s1)={}", s1, len(s1), raw_data(s1))
	fmt.printfln("s2={} len(s2)={} raw_data(s2)={}", s2, len(s2), raw_data(s2))
	fmt.printfln("equal(s1, s2):        {}", slice.equal(s1, s2))
	fmt.printfln("simple_equal(s1, s2): {}", slice.simple_equal(s1, s2))
}
```

Produced the following output on my machine:

```
s1=[] len(s1)=0 raw_data(s1)=<nil>
s2=[] len(s2)=0 raw_data(s2)=0x7FFFED64F74F
equal(s1, s2):        true
simple_equal(s1, s2): false
```

This commit fixes simple_equal's behaviour to match that of equal.
2026-08-17 22:38:40 +02:00
gingerBill a2bcf3177a Improve error messages for register class printing 2026-08-17 21:10:24 +01:00
gingerBill 8f2a4346fc Handle _SSE edge cases 2026-08-17 19:31:38 +01:00
gingerBill e2e4a61003 Remove suffixes 2026-08-17 19:29:42 +01:00
pav 2c7b3e6780 fix slice.get doing unnecessary bounds check 2026-08-17 18:40:12 +02:00
gingerBill db94c5a6cb Begin work in %flags.zf et al 2026-08-17 12:25:17 +01:00
gingerBill 344e8afa36 #clobber cc -> #clobber flags 2026-08-17 12:10:08 +01:00
gingerBill 1f2234a4b2 Merge branch 'master' into bill/inline-asm 2026-08-17 11:44:14 +01:00
Samuel Elgozi 4a08f5c48a mem: Preserve alignment when reusing Dynamic_Arena blocks 2026-08-17 00:21:50 +03:00
Jeroen van Rijn a9b7d3dfc6 Fix #7350 2026-08-16 18:08:17 +02:00
FlāviusandClaude Opus 5 b54c60b76a rexcode: the x86 test suite could fail and the build said PASS
Found by accident, and worse than the bug that found it. Five deliberately
broken decode cases came back green through `build.lua --test --isa x86`, while
running the same suite directly reported "253/258 PASSED, 5 FAILED".

Two independent holes, both open, so neither backstopped the other:

  - the x86 test binary ended at `print_summary()` and never called `os.exit`,
    so it exited 0 no matter how many cases failed;
  - `do_test` looked for the words "N failed" in the output, and the x86
    harness prints "N FAILED" — a lowercase-only Lua pattern, so the largest
    suite in the tree was exempt from its own gate.

The exit code is the check that should have been load-bearing, so the harness
sets it. The output match stays as a backstop for a suite that forgets to, and
is now case-insensitive.

How long this has been true is not knowable from here — every x86 regression
since the pattern was written would have been reported as PASS.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Riok9vMpkLmo78wsVKJHhz
2026-08-16 12:05:52 -04:00
FlāviusandClaude Opus 5 3e3eec090d x86: +r decoding was legacy-only, so BSWAP could not be read back
`bswap` is `0F C8+rd` — the register rides in the opcode's low three bits, like
`push`/`pop`/`xchg`/`mov`, but behind an escape byte. The decoder's retry at the
+r base opcode was gated on `esc == .NONE`, so only the register-0 forms
(`0F C8` = bswap eax, `48 0F C8` = bswap rax) landed on a table entry directly;
the other seven registers came back INVALID_OPCODE. Emission was always correct
— every `bswap` this compiler has ever produced runs — but a disassembly
containing one stopped dead, which is how it surfaced: three functions in
sigil's JIT corpus disassembled to a header with no instructions under it.

The table was never the problem. BSWAP is in `tablegen/encoding_table.odin` and
in the generated decode table, exactly where it should be.

Fixing the gate meant looking at why the retry existed twice. There is a correct
+r handler further down, carrying comments that describe two bugs already found
and fixed in it — "scan ALL entries, not just the first", "scan for the sized
register rather than assuming op0" — and the copy inside the retry had received
neither, plus a third of its own. So the retry now re-runs only the LOOKUP and
falls through to the single handler, which fixes two more instruction families
that were equally undecodable:

  - `xchg rAX, r` (90+rd): 0x90's run sorts NOP ahead of XCHG, and the copy
    tested only the first entry for a +r form, so every `xchg rAX, r` was
    rejected.
  - `push bx` / `pop bx` / `mov cx, imm` (any +r under 0x66): the copy passed
    `prefix` where the legacy row wants 0, since for legacy opcodes 0x66 is
    operand size rather than part of the opcode's identity.

Two supporting changes. The shared handler's default answer is now the first +r
entry rather than `idx.start`, so a fall-through at 0x90 cannot answer NOP for
an `xchg`. And a base-opcode retry that does not land on a +r form is now an
error rather than a fall-through: decoding 0x0E as the 0x08 entry (OR) would be
a wrong instruction reported confidently, which is worse than an unknown byte.

Verified three ways. Every opcode in every escape map was decoded before and
after: 154 combinations changed, every one of them INVALID -> valid, and nothing
that already decoded decodes differently. All 24 BSWAP encodings and all 96
legacy +r encodings were diffed against llvm-mc's disassembly and agree
operand-for-operand. Six new decode-only cases pin the three families; five of
them fail without this change.

(Two remaining differences from llvm-mc are deliberate and documented here:
implicit accumulators are left unmaterialized so a short form re-encodes to the
short form, and `48 90` reads as `xchg rax` rather than `nop`.)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Riok9vMpkLmo78wsVKJHhz
2026-08-16 12:05:42 -04:00
Jeroen van Rijn cc7d6764d3 Merge pull request #7349 from TheRadischen/merge_sort
improved stable sort | from insertion_sort to merge_rotate
2026-08-16 16:03:57 +02:00
TheRadischen 7d9367e3b4 morestyle improvements mybe this is it? 2026-08-16 15:24:55 +02:00
TheRadischen 0b0778f981 morestyle improvements mybe this is it? 2026-08-16 15:24:19 +02:00
TheRadischen 1a70315797 style_corrections 2026-08-16 15:09:12 +02:00
TheRadischen 9757fed9f9 changed_to_tabs 2026-08-16 14:28:38 +02:00
TheRadischen d8177f7716 adjusted_smallsort_threshhold 2026-08-16 13:33:32 +02:00
TheRadischen 4c945c995a added_back_where 2026-08-16 12:58:23 +02:00
TheRadischen df54692a9b addedtest 2026-08-16 12:22:25 +02:00
Jeroen van Rijn 3eeda58634 Merge pull request #7344 from kalsprite/simd_builtin_diagnostics
simd: enforce the `#simd` construction rules and stop two crashes
2026-08-16 12:17:39 +02:00
TheRadischen 267c745ac7 rotate_merge 2026-08-16 12:07:09 +02:00
mo 4e0a71c24c Add non-allocating hex.decode_into_buffer
Also minor fixes to documentation of hex.decode().

Adds tests of the new procedure with buffers the correct size, larger,
and too small.
2026-08-16 19:48:19 +12:00
kalsprite 69fb453e51 redecl type; pairwise guard 2026-08-15 22:02:06 -07:00
Alexander Zhura 64a5887f83 Impl simd arm neon logical 2026-08-14 22:01:59 +03:00
Jeroen van Rijn 24e973ceb2 Merge pull request #7275 from alexthed1rk/impl-simd-arm-neon-table-lookup-ext
Impl simd arm neon extended table lookup
2026-08-14 20:09:08 +02:00
diego ac7110e098 Remove unused variable in fixed-point write procedure 2026-08-14 13:21:03 +02:00
gingerBill 08f3be70cf Add helper methods to the asm_tables_amd64.cpp 2026-08-12 21:18:10 +01:00
gingerBill dbe5761bb0 Minor change 2026-08-12 16:19:58 +01:00
gingerBill 5eb0239474 Utilize triple quote strings within the C++ asm table generation 2026-08-12 16:09:18 +01:00
gingerBill 43f078aedc Infer asm #side_effects where possible from the mnemonics 2026-08-12 14:52:37 +01:00
gingerBill b32846bb35 Minor change to implies_side_effects 2026-08-12 14:16:10 +01:00
gingerBill 2300a48782 Infer #clobber memory and #clobber cc from the mnemonics directly 2026-08-12 12:45:48 +01:00
gingerBill b9a7ed9942 Add amd64 clobber table to asm_tables_amd64.cpp 2026-08-12 11:33:07 +01:00
gingerBill 6bd2fd7e8b Add clobber table for x86 2026-08-12 11:25:03 +01:00