Commit Graph

272 Commits

Author SHA1 Message Date
gingerBill
0bf2d01a04 Work on improving bounds checking with constant known indices and lb_add_local_generated 2026-03-16 14:06:23 +00:00
gingerBill
eecb67cb89 Implement fused nested slice chain optimizations src[a:b][c:d][e:f]... 2026-03-15 21:17:05 +00:00
gingerBill
6b2853d9f1 Improve matrix * vector code gen 2026-03-15 21:03:31 +00:00
gingerBill
12b06887a3 Remove dead code 2026-03-15 20:36:02 +00:00
gingerBill
f8f96905ae Fix typos 2026-03-15 20:27:14 +00:00
gingerBill
a56c3da149 Support select fast path for or_else 2026-03-15 20:02:48 +00:00
gingerBill
f70bceec84 Add optimization for improving side-effect-free use of a select for ternary if. 2026-03-15 19:58:57 +00:00
gingerBill
bb2e42faa6 More uses of SSA aggregation values 2026-03-15 19:49:26 +00:00
gingerBill
0dbda03890 Simplify slice creation as LLVM values 2026-03-15 19:40:57 +00:00
gingerBill
c51391f8cb Fix #5129 2026-03-15 17:15:16 +00:00
gingerBill
c6772dfd06 Merge branch 'master' into bill/fixed-capacity-dynamic-array 2026-03-15 11:41:01 +00:00
Jeroen van Rijn
27667ce36b iff -> if and only if (⟺) 2026-03-13 11:54:15 +01:00
gingerBill
a6160770ff Support compound literals for fixed capacity dynamic arrays 2026-03-12 10:03:58 +00:00
gingerBill
f1dbe9c242 [dynamic; N]T proof of concept: fixed capacity dynamic array (akin to small_array.Small_Array(N, T)) 2026-03-11 16:46:33 +00:00
bymehul
c9e55d3add fix: handle full-width bit_field literal masks 2026-03-10 23:21:19 +05:30
gingerBill
c0468446f6 Ignore const nil "optimization" and fix c: Maybe(string); c == "" bug. 2026-02-24 18:52:42 +00:00
gingerBill
63c4faca75 Fix positions for debug locations in defer, loops, and switch clauses 2026-02-02 11:19:00 +00:00
gingerBill
fde90931de Add case for completeness 2026-02-02 11:16:05 +00:00
gingerBill
3586bda6ae Use context.assertion_failure_proc with type assertions when the context is available, otherwise use a trivial trap. 2026-01-26 18:23:29 +00:00
gingerBill
0774b7465f Allow for shortcut to get feature flags from the expression directly assuming it as a file 2026-01-26 15:51:38 +00:00
gingerBill
efdb89afcb Revert dynamic literals feature check 2026-01-26 15:41:15 +00:00
gingerBill
afe4369f6e Add #+feature force-type-assert which overrides -no-type-assert on a per-file basis 2026-01-26 15:37:54 +00:00
miere43
29019d7138 Fix duplicate code emission in type assertions. 2025-12-03 21:27:38 +03:00
gingerBill
0f0c40b96d Fix -integer-division-by-zero modes and document all-bits 2025-12-01 13:11:32 +00:00
Laytan Laats
679d306d0f panic on transpose with result type in diff layout
Partially reverts 4db4841, it should behave the same as cast (which does
an implicit transpose).
2025-11-29 20:06:43 +01:00
laytan
4db4841413 fix matrix transpose with different result type
Fixes #5623
2025-11-29 12:14:06 +01:00
gingerBill
cbab97fbd7 Use memcpy for local constant slice arrays from a global constant 2025-09-28 22:50:36 +01:00
gingerBill
a974c51d57 First step towards constant unions 2025-09-28 19:52:52 +01:00
gingerBill
42b9039a1f Check for nullptr 2025-09-26 09:41:08 +01:00
gingerBill
31f0aaa62f Try to improve const union LLVM construction 2025-09-24 09:55:22 +01:00
gingerBill
549edcc0f9 Use a RwMutex instead of BlockingMutex 2025-09-10 21:00:43 +01:00
gingerBill
8df69c95c3 Add -integer-division-by-zero:all-bits 2025-08-10 18:29:08 +01:00
gingerBill
b6e0b48481 Rename block names from div to mod. 2025-08-10 17:58:46 +01:00
gingerBill
4cbcb3ace7 Add shortcut for unsigned_x/power_of_two -> unsigned_x >> log2(power_of_two) 2025-08-10 17:53:07 +01:00
gingerBill
da76c743e9 Add shortcut for division by a constant 2025-08-10 17:42:49 +01:00
gingerBill
8c1eda3e3a Handle fixed_point_div and fixed_point_div_sat 2025-08-08 11:10:01 +01:00
gingerBill
ee01643229 Add -integer-division-by-zero:self 2025-08-08 10:41:05 +01:00
gingerBill
991883d0e1 Add #+feature integer-division-by-zero:<string> 2025-08-08 10:24:44 +01:00
gingerBill
e4a0228a80 Define the behaviour of integer division by zero 2025-08-08 10:00:11 +01:00
gingerBill
f8d24923fd Fix cstring != "" 2025-08-02 13:23:20 +01:00
gingerBill
86bd9186f9 Fix string16 != "" comparison 2025-08-02 13:17:31 +01:00
gingerBill
7c281a9614 Fix [^]u16 <-> cstring16 conversions 2025-08-02 12:51:08 +01:00
gingerBill
620bf162a0 Cache const string16 in LLVM 2025-08-02 12:32:18 +01:00
gingerBill
ae02d3d02d Begin supporting string16 across the core library 2025-08-02 11:55:16 +01:00
gingerBill
2561427dd3 Add string16 and cstring16 (UTF-16 based strings) 2025-08-02 11:00:15 +01:00
Jeroen van Rijn
fab7715c35 Allow -dynamic-literals for [dynamic]T 2025-06-03 15:22:20 +02:00
Jeroen van Rijn
ab95932502 -dynamic-literals 2025-05-19 20:44:27 +02:00
gingerBill
92df892f25 Merge pull request #5064 from harold-b/hb/objc-classes
Add support for Objective-C class implementation
2025-05-08 12:58:33 +01:00
Jeroen van Rijn
8097b59e30 Also allow comparing SOA pointers against each other
This compares the data pointer *and* the index.

```odin
package scratch

import "core:fmt"

Foo :: struct {a, b: int}

main :: proc() {
    a := new(#soa[dynamic]Foo)
    a^ = make(#soa[dynamic]Foo, 12, 12)

    b := new(#soa[dynamic]Foo)
    b^ = make(#soa[dynamic]Foo, 12, 12)

    fmt.printfln("&a[0]: %p, &b[0]: %p, Same: %v", &a[0], &b[0], &a[0] == &b[0]) // Same: false
    fmt.printfln("&a[0]: %p, &b[0]: %p, Same: %v", &a[0], &b[1], &a[0] == &b[1]) // Same: false
    fmt.printfln("&a[0]: %p, &b[0]: %p, Same: %v", &a[0], &b[2], &a[0] == &b[2]) // Same: false

    fmt.printfln("&a[0]: %p, &a[1]: %p, Same: %v", &a[0], &a[1], &a[0] == &a[1]) // Same: false
    fmt.printfln("&a[1]: %p, &a[2]: %p, Same: %v", &a[1], &a[2], &a[1] == &a[2]) // Same: false
    fmt.printfln("&a[2]: %p, &a[3]: %p, Same: %v", &a[2], &a[3], &a[2] == &a[3]) // Same: false

    fmt.printfln("&a[0]: %p, &a[0]: %p, Same: %v", &a[0], &a[0], &a[0] == &a[0]) // Same: true
    fmt.printfln("&a[1]: %p, &a[1]: %p, Same: %v", &a[1], &a[1], &a[1] == &a[1]) // Same: true
    fmt.printfln("&a[2]: %p, &a[2]: %p, Same: %v", &a[2], &a[2], &a[2] == &a[2]) // Same: true
}
```
2025-05-06 15:10:08 +02:00
bogwi
904a64a45e Add support for SoaPointer nil comparison in lb_emit_comp_against_nil 2025-05-06 14:21:18 +09:00