Commit Graph

276 Commits

Author SHA1 Message Date
Jeroen van Rijn
29d9a12491 Add check_all scripts 2025-06-16 22:26:24 +02:00
iarkn
3152be01b9 Add intrinsics.type_is_bit_field proc 2025-06-06 16:01:13 +02:00
Jeroen van Rijn
82dfb43663 Fix #5265 2025-06-03 11:18:11 +02:00
Feoramund
7996f89410 Show quaternion arguments in wxyz order, instead of xyzw, in mismatched type error
This is in accordance with the other error and makes sense with how
quaternions are printed with `real`/`w` coming first, then the
imaginaries, which are the `ijk`/`xyz` parts.
2025-06-01 14:36:38 -04:00
Feoramund
b70d2b156a Make quaternion untyped values convert to first typed value found
This fixes an issue (#2079) where a typed argument could cause the
construction to fail on the basis of failed untyped -> typed conversion.
2025-06-01 14:35:53 -04:00
Feoramund
705ae3f343 Fix quaternion construction causing compiler crash
Previously, a construction of `quaternion(real=0, real=1, real=2,
real=3)` could crash the compiler.
2025-06-01 13:35:22 -04:00
0xrsp
649cad2f1b add: type_integer_to_* error messages 2025-05-15 01:12:06 +09:30
0xrsp
ea806f1d5e new compiler intrinsics type_integer_to_unsigned,type_integer_to_signed 2025-05-15 01:00:40 +09:30
gingerBill
d2d5c40e76 Handle "untyped" case 2025-05-12 16:49:59 +01:00
gingerBill
d2d4ac8120 Add compress_values 2025-05-12 15:29:43 +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
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
Jeroen van Rijn
2224911aca Fix type_union_tag_offset when all members are zero sized 2025-05-05 18:09:54 +02:00
gingerBill
36945079f8 Add intrinsics.simd_indices 2025-05-05 11:41:54 +01:00
Harold Brenes
a00b91577d Prevent multiple uses of the same Objective-C class name 2025-05-03 03:09:30 -04:00
Harold Brenes
5f0b47c373 Implement all checker specification for Objective-C class implementations and objc_ivar_get intrinsic 2025-05-03 00:59:33 -04:00
Harold Brenes
2dc5653fd1 Name fixes 2025-04-30 20:31:54 -04: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
6c9c239a5e Fix styling issues 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
Jeroen van Rijn
04807309b7 Allow intrinsics.type_elem_type(simd_vector) to return the element type.
Make `type_elem_type(#simd[4]f32)` return `f32`, same as it would for `[4]f32`.
2025-04-11 21:49:48 +02:00
gingerBill
ce026ff2c4 Fix #4949 2025-03-24 13:13:25 +00:00
gingerBill
acb578f184 Fix #4962 2025-03-24 11:35:10 +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
gingerBill
fbee045023 Merge pull request #4797 from laytan/improve-abs-of-float
improve abs() on floats for more correct and faster results
2025-02-08 07:49:22 +00:00
Laytan Laats
de83ad2a25 apply abs fix to constant system too 2025-02-06 21:19:54 +01:00
korvahkh
1281303ff7 Preserve #no_nil in intrinsics.type_convert_variants_to_pointers
Previously the newly returned type would not be marked as `#no_nil`.
This caused `reflect.get_union_as_ptr_variants`
to break on `#no_nil` unions.
2025-02-03 16:08:19 -06:00
Jeroen van Rijn
7c3ce334d6 Fix #4508 for abs, min, max (#4516)
* Fix #4508 for abs, min, max and the rest of the builtins.

None of these segfault now:
```odin
package bug

main :: proc() {
	p :: proc() {}

	// _ = len(p())
	// _ = cap(p())

	// _ = size_of(p())
	// _ = align_of(p())

	// T :: struct {}
	// _ = offset_of(p())
	// _ = offset_of(T, p())
	// _ = offset_of(p(), foo)
	// _ = offset_of(p(), "")

	// _ = type_of(p())
	// _ = type_info_of(p())
	// _ = typeid_of(p())

	// A: [4]int
	// _ = swizzle(p())    //  :: proc(x: [N]T, indices: ..int) -> [len(indices)]T ---
	// _ = swizzle(A, p()) //  :: proc(x: [N]T, indices: ..int) -> [len(indices)]T ---

	// _ = complex(p(), p())
	// _ = quaternion(p(), p(), p(), p())
	// _ = quaternion(w=p(), x=p(), y=p(), z=p())

	// _ = real(p())
	// _ = imag(p())
	// _ = jmag(p())
	// _ = kmag(p())
	// _ = conj(p())

	// _ = expand_values(p())

	// _ = min(p())
	// _ = max(p())
	// _ = abs(p())
	// _ = clamp(p(), p(), p())

	// _ = soa_zip(p())
	// _ = soa_unzip(p())
}
```
2024-11-25 15:27:35 +01:00
jakubtomsu
71880eb1ff report error when builtin min/max has 1 (non-type) param 2024-11-17 21:02:30 +01:00
gingerBill
ee76acd665 Merge pull request #4427 from laytan/posix-additions
Finish sys/posix with Linux and partial Windows support & clean up other packages as a result
2024-10-30 11:43:47 +00:00
Laytan
e064f8c6be fix #load_directory including nested directories 2024-10-28 18:59:39 +01:00
Misomosi
6ef915c312 Fixes #4395 by not assuming simd returns val 2024-10-20 22:51:39 -04:00
gingerBill
53bb6c85f7 a ordered to an ordered 2024-10-02 15:48:58 +01:00
Feoramund
9456c36684 Specify integer-like only for some atomic_* intrinsics
Fixes #4256
2024-09-18 17:18:48 -04:00
Laytan Laats
603efa860a add '#caller_expression' 2024-09-14 22:13:37 +02:00
Laytan Laats
490f8c1568 add fixed point sign extend to 128 int deps 2024-09-05 15:55:55 +02:00
Jeroen van Rijn
c1cb1a3d7e Simplified #assert check 2024-08-31 19:13:37 +02:00
Jeroen van Rijn
a4ac50a5b4 Check for #assert condition to be a constant bool
Fixes #4170
2024-08-31 19:06:17 +02:00
Laytan
d299d4e1cd riscv: add an error when atomics are used without the atomics extension 2024-08-25 21:17:00 +02:00
gingerBill
d0eaf7642d Add intrinsics.type_has_shared_fields 2024-08-24 14:36:18 +01:00
Laytan
ca6ef95b03 add support for linux_riscv64 and freestanding_riscv64 2024-08-20 14:06:40 +02:00
Laytan Laats
efe68c2e24 posix: add package 2024-08-14 01:44:35 +02:00
gingerBill
f56abf3780 Add intrinsics.masked_expand_load and intrinsics.masked_compress_store 2024-08-05 14:54:09 +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
gingerBill
fd06be2243 Allow swizzle to take more arguments than the original array length 2024-08-05 12:33:02 +01:00
Laytan Laats
853487e86c fix add_sat and sub_sat intrinsics 2024-07-16 22:07:49 +02:00