Commit Graph

104 Commits

Author SHA1 Message Date
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
Laytan Laats
25f1d0906d compiler: improve target features support 2024-05-02 00:59:52 +02:00
gingerBill
5c1201fa42 Fix #3459 2024-04-30 09:10:00 +01:00
Andreas T Jonsson
9a008d10f3 Merge branch 'master' into netbsd 2024-04-25 22:04:40 +02:00
gingerBill
214537b420 Improve codegen for bit_field [N]T compound literals 2024-04-24 17:01:09 +01:00
gingerBill
059175de3b Do not print column of a runtime.Source_Code_Location if the column == 0 2024-04-19 13:32:55 +01:00
gingerBill
5c52f3cf2f Add ODIN_NO_BOUNDS_CHECK 2024-04-18 11:13:44 +01:00
gingerBill
889cd5461c Add @(optimization_mode="size") to runtime.print_type 2024-04-18 11:00:47 +01:00
gingerBill
6127339c56 Add #force_no_inline to many of the runtime print procedures 2024-04-18 10:59:02 +01:00
Chris
6dcf38b85b Correct copy_from_string docs 2024-04-16 21:36:54 +01:00
Andreas T Jonsson
4558f3992a Initial commit of NetBSD port 2024-04-16 14:27:29 +02:00
gingerBill
6c38ae3658 Remove #optional_ok from docs 2024-04-11 15:24:08 +01:00
Jeroen van Rijn
8a6a3e883c Merge pull request #3406 from laytan/bit-field-core-parser
add bit_field to `core:odin`
2024-04-10 03:12:40 +02:00