Commit Graph

276 Commits

Author SHA1 Message Date
Feoramund
5b1113acb4 Ensure volatile status for all atomic operations
Fixes #2410
2025-06-20 19:43:41 -04:00
Feoramund
378e72b211 Push context onto stack before evaluating procedure parameters
Fixes #4711
2025-06-20 16:11:08 -04:00
Feoramund
9c5640886d Add @(no_sanitize_memory) proc attribute with MSan additions to base:sanitizer 2025-06-05 16:06:40 -04:00
gingerBill
d2d4ac8120 Add compress_values 2025-05-12 15:29:43 +01:00
gingerBill
23aff08556 Merge pull request #5117 from bogwi/bug/5024
Bug/5024
2025-05-09 08:35:16 +01: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
Laytan Laats
ad4866653a fix disposing builder when not created
Fixes #5128

p->builder is created in lb_begin_procedure_body, but that isn't called
if there is no body, and we were still calling dispose at that point.

Moved it into lb_end_procedure_body to match.
2025-05-07 14:39:51 +02:00
gingerBill
90a30a145a Merge pull request #5122 from Lperlind/asan-allocators
Add asan support for various allocators and stack unpoisoning
2025-05-07 10:21:16 +01:00
Lucas Perlind
83bc2d3c4a Add asan support for various allocators 2025-05-06 14:55:50 +10:00
Barinzaya
dd5b7852ce Added alternate reduce-add/reduce-mul intrinsics.
The new reduce_add/reduce_mul procs perform the corresponding arithmetic
reduction in different orders than sequential order. These alternative
orders can often offer better SIMD hardware utilization.

Two different orders are added: pair-wise (operating on pairs of
adjacent elements) or bisection-wise (operating element-wise on the
first and last N/2 elements of the vector).
2025-05-05 16:38:45 -04:00
gingerBill
36945079f8 Add intrinsics.simd_indices 2025-05-05 11:41:54 +01:00
bogwi
ee8aeea381 CHECK 1 done
Fix panic in LLVM backend when using generic procedure with default arguments

- Fixed panic in `llvm_backend_proc.cpp` when using unspecialized polymorphic procedures as defaults.
- Ensured correct type inference when generic procedures are used as default parameters.
2025-05-05 16:50:40 +09:00
gingerBill
19fe75f020 Merge pull request #5098 from laytan/fix-nan-comparisons
fix variable NaN comparisons
2025-05-02 13:00:42 +01:00
Lucas Perlind
5c73b4ef58 Add attribute @(no_sanitize_address)
The purposes of this attribute is to let procedures opt-out of being
instrumented with asan. Typically an allocator that includes 'in-band'
meta-data will be accessing poisoned values (such as tlsf).

Making asan work with these allocators becomes very challenging so
just being to ignore asan within specific allocator procedures
makes it easier to reason and removes the need to temporarily
poison and unpoison allocator data.
2025-05-01 20:42:21 +10:00
Laytan Laats
396a18efce fix variable NaN comparisons 2025-04-30 20:04:24 +02:00
Harold Brenes
f3923ed666 Fix indentations
Fix Objective-C wrapper procs not forwarding return value
2025-04-27 22:55:53 -04:00
Harold Brenes
a3de9c8de4 Add initial support for Objective-C class implementation 2025-04-20 21:53:46 -04:00
Feoramund
e13b05168c Fix syscall_bsd on NetBSD ARM64 2025-04-06 19:58:23 -04:00
gingerBill
729b6a4337 Merge pull request #4974 from harold-b/hb.fix-syscall-memory-dep
Add `~{memory}` clobber to syscall intrinsics for platforms where it was missing
2025-03-27 09:09:18 +00:00
Harold Brenes
6fda041e17 Add ~{memory} clobber to syscall intrinsics for platforms where it was not yet added.
This fixes #4972 and #4588.

As laytan asserts, there is no guarantee that a syscall will not modify memory that it just obtained from the user, or held onto via a previous syscall. Therefore this constraint should be required for all syscalls.
2025-03-26 19:25:06 -04:00
gingerBill
f3210eccaf Fix #4866 2025-03-07 09:44:18 +00:00
gingerBill
400348c925 Improve global array index to be on a per module basis 2025-02-25 15:06:13 +00:00
gingerBill
f9d85a7311 Try to make globally generated variables deterministic in name 2025-02-25 14:29:14 +00:00
gingerBill
533f82da24 Fix #4822 2025-02-24 14:11:47 +00:00
Barinzaya
4afedbc051 Added simd_extract_lsbs intrinsic as well.
Equivalent to the simd_extract_msbs intrinsic, except it extracts the
least significant bit of each element instead.
2025-02-24 08:49:57 -05:00
Barinzaya
33a3aab791 Added simd_extract_msbs intrinsic. 2025-02-24 08:39:32 -05:00
Laytan Laats
5defddffd0 reorganize tests and handle endian 2025-02-06 21:44:34 +01:00
Laytan Laats
de83ad2a25 apply abs fix to constant system too 2025-02-06 21:19:54 +01:00
Laytan Laats
b1068c7f2e improve abs() on floats for more correct and faster results 2025-02-05 21:17:48 +01:00
gingerBill
7b334d2bd9 Add #branch_location 2025-01-01 17:26:15 +00:00
Laytan Laats
c8f0d27cee compiler: remove viral #force(_no)_inline
If a procedure was marked `#force_no_inline`, any procedure calls within
it would also implicitly be. This is not expected for multiple reasons:

1. `#force(_no)_inline` on a call expr works differently than on a procedure literal.
2. Adding the attribute on it and every called proc blows up the amount
   of work for the inliner pass and may increase the time it takes.
3. Putting `#force_no_inline` on a procedure to keep executable size
   down (like we do for some map procedures), benchmark it, or find it in
   asm/ir has the added effect of slowing those procedures down significantly
   and not representing truth.
2024-12-09 19:12:42 +01:00
gingerBill
b36a81ef53 ABI change: for indirect parameters size_of <= 16, do callee stack copy 2024-12-05 10:49:39 +00:00
Laytan Laats
da1e09c95d check packed load and set alignment on all loads, not just lb_emit_load 2024-10-25 15:23:15 +02:00
Laytan Laats
603efa860a add '#caller_expression' 2024-09-14 22:13:37 +02:00
Laytan
ca6ef95b03 add support for linux_riscv64 and freestanding_riscv64 2024-08-20 14:06:40 +02:00
Laytan Laats
e3f375afd8 fix c_vararg bit_set
Fixes #4051
2024-08-11 17:00:49 +02:00
Feoramund
e27a424f4d Swap reduce_any and reduce_all
`llvm.vector.reduce.or` will return true if any lane is true.
`llvm.vector.reduce.and` will return true if all lanes are true.
2024-08-06 14:50:34 -04:00
gingerBill
f56abf3780 Add intrinsics.masked_expand_load and intrinsics.masked_compress_store 2024-08-05 14:54:09 +01:00
gingerBill
80ea4e0aeb Remove dead code 2024-08-05 14:25:33 +01:00
gingerBill
84ac56f778 Add intrinsics.simd_masked_load and intrinsics.simd_masked_store 2024-08-05 14:08:41 +01:00
gingerBill
7e701d1677 Add intrinsics.simd_gather and `intrinsics.simd_scatter 2024-08-05 13:46:24 +01:00
gingerBill
90fc52c2ee Rename add_sat -> saturating_add 2024-08-05 13:19:01 +01:00
gingerBill
9a01a13914 Add simd_reduce_any and simd_reduce_all 2024-08-05 13:13:19 +01:00
Laytan Laats
47f14dd9ea type is never a tuple here 2024-07-16 22:11:54 +02:00
Laytan Laats
853487e86c fix add_sat and sub_sat intrinsics 2024-07-16 22:07:49 +02:00
gingerBill
23ca27f40b Add intrinsics add_sat and sub_sat 2024-07-16 00:48:17 +01:00
gingerBill
1e37eaf54d Begin work for bit_set[...; [N]T] (not working) 2024-07-15 14:49:20 +01:00
gingerBill
432388ac7f Generate backing array in the case where there is no DeclInfo for the procedure body 2024-07-15 02:42:28 +01:00
gingerBill
f657055f12 Add slice variable if not exists 2024-07-14 23:36:54 +01:00
gingerBill
2e0c5fefde Reuse the slice value too for variadic parameters (LLVM >= 13) 2024-07-14 14:07:36 +01:00