Commit Graph

117 Commits

Author SHA1 Message Date
gingerBill
ff2d042313 Remove unneeded transmute 2024-06-29 13:54:15 +01:00
gingerBill
c88a1bef91 Add another -vet-cast check 2024-06-29 12:40:04 +01:00
gingerBill
706adb1232 Update for transmute -vet-cast 2024-06-29 12:16:43 +01:00
gingerBill
4b71c47fd5 Check for unneeded transmute with -vet-cast 2024-06-29 12:02:31 +01:00
gingerBill
55e9b8d994 Use explicit calling conventions 2024-06-29 10:48:41 +01:00
gingerBill
ee2a0c4010 Merge branch 'master' of https://github.com/odin-lang/Odin 2024-06-29 10:47:15 +01:00
gingerBill
f974002839 Use f32 operations rather than f16 in complex32 and quaternion64 to improve accuracy and performance 2024-06-29 10:47:09 +01:00
Karl Zylinski
679f9b4e41 Made default capacity of dynamic arrays more consistent.
Before this if you do `arr: [dynamic]int` and then append to arr, then it will have capacity 8.
But if you did `arr := make([dynamic]int, context.temp_allocator)` then arr would have capacity 16.

Now both `arr: [dynamic]int` and `arr := make([dynamic]int, context.temp_allocator)` will resut in arr having zero 0. The only reason to use `make` without an explicit len or cap now is because you want to set it up for a non-default allocator. After the first call to `append` it will now in both cases have capacity 8.

I also updated the documentation on the strings builder, both to reflect this, and also to fix it incorrectly saying that len would be 'max(16,len)', which wasn't true even before these changes.
2024-06-29 08:57:21 +02:00
gingerBill
a1ae6f161b Merge pull request #3502 from ARtemachka/master
Fix typo in core_builtin
2024-06-28 12:00:10 +01:00
gingerBill
f883cd5053 Initialize default context in heap_allocator_other.odin 2024-06-28 08:33:12 +01:00
Karl Zylinski
f227a40652 Replace max(8, 1) in _append_elem with just 8 and a comment. 2024-06-25 22:48:14 +02:00
gingerBill
93441a043a Make runtime.heap_alloc contextless 2024-06-25 09:38:49 +01:00
Jeroen van Rijn
91cc006e8f Fix unaligned store for rand 2024-06-20 17:54:37 +02:00
Feoramund
1dfc89567e Optimize default RNG for the common case 2024-06-20 11:27:51 -04:00
gingerBill
5dc98336a8 Merge pull request #3524 from Feoramund/freebsd-amd64-syscall-errno
Add `intrinsics.syscall_bsd`
2024-06-20 11:47:01 +01:00
Karl Zylinski
11e586494b Clarify that the arena in base:runtime shouldn't be used for anything but the default temp allocator. This is done by renaming the file in which it lives, and also by improving the comment above Arena :: struct {. This should avoid some confusion where people end up using the Arena in base:runtime because they thought it was the 'default arena'. 2024-06-18 12:48:16 +02:00
Feoramund
53140dca15 Fix default_random_generator_proc not using state 2024-06-15 12:54:30 -04:00
gingerBill
7ec17ecf98 Update core:math/rand to use context.random_generator and remove rand.Rand 2024-06-15 15:33:24 +01:00
gingerBill
318d5e4a7e Add Reset mode 2024-06-15 15:17:23 +01:00
gingerBill
eaec8a2bbf Add runtime.default_random_generator 2024-06-15 15:08:49 +01:00
gingerBill
827cb24023 Add random_generator.odin 2024-06-15 14:47:37 +01:00
gingerBill
dc4ec8638c Add runtime.Random_Generator interface 2024-06-15 14:45:57 +01:00
Feoramund
5b5402fb23 Add intrinsics.syscall_bsd
This is a BSD-style syscall that checks for a high Carry Flag as the
error state. If the CF is high, the boolean return value is false, and
if it is low (no errors) then the boolean return value is true.
2024-06-12 13:07:13 -04:00
Feoramund
50464bdce3 Use #any_int for reserve_* and resize_* procs
Resolves #3088
2024-06-10 20:51:58 -04:00
gingerBill
fa3cae2bb0 Add intrinsics.procedure_of
```odin
foo :: proc(x: $T) { fmt.println(x) }
bar :: intrinsics.procedure_of(foo(int(123))) // parameters are never ran at compile time, similar to `size_of`
bar(333) // prints 333
```
2024-06-10 15:02:34 +01:00
Feoramund
ff7fcb6d38 Add compilation-related constants
`ODIN_VERSION_HASH` is the `git` SHA hash of the commit the Odin
compiler was built with.

`ODIN_MICROARCH_STRING` is the string passed to `-microarch` when
the program was built.

`ODIN_OPTIMIZATION_MODE` is an enum value of which optimization mode was
used to build the program.
2024-06-10 03:47:20 -04:00
gingerBill
828870004b Change indentation 2024-06-09 17:15:08 +01:00
gingerBill
3a9b86628a Add @(rodata) and @(static, rodata) where appropriate 2024-06-06 15:23:52 +01:00
Laytan Laats
8455e159f5 improve orca target 2024-06-05 20:57:39 +02:00
Feoramund
b2f9f0af68 Fix some typos 2024-06-04 19:01:30 -04:00
Feoramund
97f1d12e04 Add missing Raw_* types for complex and quaternion 2024-06-03 15:41:14 -04:00
Feoramund
4e1dd4ced2 Move Raw_Complex/Quaternion types to base:runtime 2024-06-03 15:40:28 -04:00
Damian Tarnawski
451dc645df Add unreachable to base/builtin/builtin.odin 2024-05-31 21:55:40 +02:00
Laytan Laats
3a0ec3d6a8 wasm: fix target wasm64p32 runtime procs
LLVM generates calls with `i32` regardless of target, so if a call to
any of these procs was generated this failed to compile.

I opted to fix by changing from `int` to `i32` on wasm64p32 and adding
`#any_int` so existing code keeps working.
2024-05-31 16:32:27 +02:00
Feoramund
fa6e07d976 Make ODIN_OS, ODIN_BUILD_MODE comments congruent to underlying data
Sourced from `src/checker.cpp`.
2024-05-28 01:32:20 -04:00
Laytan Laats
aa72050586 wasm: enable default temp allocator
After #3592 I think it makes sense to also enable the temp allocator by default
2024-05-24 15:01:02 +02:00
gingerBill
891fefe117 Merge pull request #3592 from laytan/wasm-gpa
add a default heap/general purpose allocator for wasm to `base:runtime`
2024-05-20 10:38:09 +01:00
gingerBill
5473758467 Add intrinsics type_is_matrix_row_major & type_is_matrix_column_major 2024-05-20 10:15:21 +01:00
gingerBill
8dec4f6ed3 Merge pull request #3570 from jasonKercher/linux-arm32
Get the compiler to build and work on arm32 Linux
2024-05-20 00:05:57 +01:00
Laytan Laats
f42b1c4973 add a default heap/general purpose allocator for wasm to base:runtime 2024-05-16 23:08:40 +02:00
gingerBill
7cf62f00c3 Correct #soa RTTI usage 2024-05-16 16:30:45 +01:00
gingerBill
f9fd8f0c25 Merge pull request #3439 from andreas-jonsson/netbsd
NetBSD support
2024-05-15 10:33:52 +01:00
gingerBill
61826594c9 Add comment state to prefer virtual.Arena over runtime.Arena 2024-05-14 18:37:23 +01:00
Andreas T Jonsson
5d82f0cad5 Merge branch 'master' into netbsd 2024-05-13 09:21:32 +02:00
jasonkercher
2183140e71 arm32 now compiles and runs demo 2024-05-10 13:24:43 -04:00
gingerBill
3095f46d7e Add runtime.Typeid_Bit_Field 2024-05-10 15:50:47 +01:00
Andreas T Jonsson
b72c2edabb Merge branch 'master' into netbsd 2024-05-10 09:04:52 +02:00
gingerBill
b0f0e4d02a Add intrinsics type_bit_set_elem_type & type_bit_set_underlying_type 2024-05-09 15:47:09 +01:00
gingerBill
15f7148eae Merge pull request #3526 from laytan/target-features
Improve target features support
2024-05-05 21:50:57 +01:00
Andreas T Jonsson
7feff1c113 Merged with master 2024-05-02 09:27:46 +02:00