save
This commit is contained in:
395
zsh/.local/share/nvim/mason/packages/ols/builtin/builtin.odin
Normal file
395
zsh/.local/share/nvim/mason/packages/ols/builtin/builtin.odin
Normal file
@@ -0,0 +1,395 @@
|
||||
package ols_builtin
|
||||
|
||||
// Procedures
|
||||
|
||||
|
||||
@builtin len :: proc(array: Array_Type) -> int ---
|
||||
@builtin cap :: proc(array: Array_Type) -> int ---
|
||||
|
||||
@builtin size_of :: proc($T: typeid) -> int ---
|
||||
@builtin align_of :: proc($T: typeid) -> int ---
|
||||
@builtin type_of :: proc(x: expr) -> type ---
|
||||
@builtin type_info_of :: proc($T: typeid) -> ^runtime.Type_Info ---
|
||||
@builtin typeid_of :: proc($T: typeid) -> typeid ---
|
||||
|
||||
@builtin offset_of_selector :: proc(selector: $T) -> uintptr ---
|
||||
@builtin offset_of_member :: proc($T: typeid, member: $M) -> uintptr ---
|
||||
|
||||
@builtin offset_of :: proc{offset_of_selector, offset_of_member}
|
||||
|
||||
@builtin offset_of_by_string :: proc($T: typeid, member: string) -> uintptr ---
|
||||
|
||||
@builtin swizzle :: proc(x: [N]T, indices: ..int) -> [len(indices)]T ---
|
||||
|
||||
@builtin complex :: proc(real, imag: Float) -> Complex_Type ---
|
||||
@builtin quaternion :: proc(real, imag, jmag, kmag: Float) -> Quaternion_Type --- // fields must be named
|
||||
@builtin real :: proc(value: Complex_Or_Quaternion) -> Float ---
|
||||
@builtin imag :: proc(value: Complex_Or_Quaternion) -> Float ---
|
||||
@builtin jmag :: proc(value: Quaternion) -> Float ---
|
||||
@builtin kmag :: proc(value: Quaternion) -> Float ---
|
||||
@builtin conj :: proc(value: Complex_Or_Quaternion) -> Complex_Or_Quaternion ---
|
||||
|
||||
@builtin min :: proc(values: ..T) -> T ---
|
||||
@builtin max :: proc(values: ..T) -> T ---
|
||||
@builtin abs :: proc(value: T) -> T ---
|
||||
@builtin clamp :: proc(value, minimum, maximum: T) -> T ---
|
||||
|
||||
@builtin unreachable :: proc() -> ! ---
|
||||
|
||||
@(private="file") _raw_data_slice :: proc(value: []$E) -> [^]E ---
|
||||
@(private="file") _raw_data_dynamic :: proc(value: [dynamic]$E) -> [^]E ---
|
||||
@(private="file") _raw_data_array :: proc(value: ^[$N]$E) -> [^]E ---
|
||||
@(private="file") _raw_data_simd :: proc(value: ^#simd[$N]$E) -> [^]E ---
|
||||
@(private="file") _raw_data_string :: proc(value: string) -> [^]byte ---
|
||||
// raw_data is a built-in procedure which returns the underlying data of a built-in data type as a Multi-Pointer.
|
||||
@builtin raw_data :: proc{_raw_data_slice, _raw_data_dynamic, _raw_data_array, _raw_data_simd, _raw_data_string}
|
||||
|
||||
/*
|
||||
This is interally from the compiler
|
||||
*/
|
||||
|
||||
|
||||
@builtin
|
||||
Odin_Arch_Type :: enum int {
|
||||
Unknown,
|
||||
amd64,
|
||||
i386,
|
||||
arm32,
|
||||
arm64,
|
||||
wasm32,
|
||||
wasm64p32,
|
||||
riscv64,
|
||||
}
|
||||
|
||||
/*
|
||||
An `enum` value indicating the target's CPU architecture.
|
||||
Possible values are: `.amd64`, `.i386`, `.arm32`, `.arm64`, `.wasm32`, `.wasm64p32`, and `.riscv64`.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_ARCH: Odin_Arch_Type
|
||||
|
||||
/*
|
||||
A `string` indicating the target's CPU architecture.
|
||||
Possible values are: "amd64", "i386", "arm32", "arm64", "wasm32", "wasm64p32", "riscv64".
|
||||
*/
|
||||
@builtin
|
||||
ODIN_ARCH_STRING: string
|
||||
|
||||
@builtin
|
||||
Odin_Build_Mode_Type :: enum int {
|
||||
Executable,
|
||||
Dynamic,
|
||||
Static,
|
||||
Object,
|
||||
Assembly,
|
||||
LLVM_IR,
|
||||
}
|
||||
|
||||
/*
|
||||
An `enum` value indicating the type of compiled output, chosen using `-build-mode`.
|
||||
Possible values are: `.Executable`, `.Dynamic`, `.Static`, `.Object`, `.Assembly`, and `.LLVM_IR`.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_BUILD_MODE: Odin_Build_Mode_Type
|
||||
|
||||
/*
|
||||
A `string` containing the name of the folder that contains the entry point,
|
||||
e.g. for `%ODIN_ROOT%/examples/demo`, this would contain `demo`.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_BUILD_PROJECT_NAME: string
|
||||
|
||||
/*
|
||||
An `i64` containing the time at which the executable was compiled, in nanoseconds.
|
||||
This is compatible with the `time.Time` type, i.e. `time.Time{_nsec=ODIN_COMPILE_TIMESTAMP}`
|
||||
*/
|
||||
@builtin
|
||||
ODIN_COMPILE_TIMESTAMP: int
|
||||
|
||||
/*
|
||||
`true` if the `-debug` command line switch is passed, which enables debug info generation.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_DEBUG: bool
|
||||
|
||||
/*
|
||||
`true` if the `-default-to-nil-allocator` command line switch is passed,
|
||||
which sets the initial `context.allocator` to an allocator that does nothing.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_DEFAULT_TO_NIL_ALLOCATOR: bool
|
||||
|
||||
/*
|
||||
`true` if the `-default-to-panic-allocator` command line switch is passed,
|
||||
which sets the initial `context.allocator` to an allocator that panics if allocated from.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_DEFAULT_TO_PANIC_ALLOCATOR: bool
|
||||
|
||||
/*
|
||||
`true` if the `-disable-assert` command line switch is passed,
|
||||
which removes all calls to `assert` from the program.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_DISABLE_ASSERT: bool
|
||||
|
||||
/*
|
||||
An `string` indicating the endianness of the target.
|
||||
Possible values are: "little" and "big".
|
||||
*/
|
||||
@builtin
|
||||
ODIN_ENDIAN_STRING: string
|
||||
|
||||
@builtin
|
||||
Odin_Endian_Type :: enum int {
|
||||
Unknown,
|
||||
Little,
|
||||
Big,
|
||||
}
|
||||
|
||||
/*
|
||||
An `enum` value indicating the endianness of the target.
|
||||
Possible values are: `.Little` and `.Big`.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_ENDIAN: Odin_Endian_Type
|
||||
|
||||
@builtin
|
||||
Odin_Error_Pos_Style_Type :: enum int {
|
||||
Default = 0,
|
||||
Unix = 1,
|
||||
}
|
||||
|
||||
/*
|
||||
An `enum` value set using the `-error-pos-style` switch, indicating the source location style used for compile errors and warnings.
|
||||
Possible values are: `.Default` (Odin-style) and `.Unix`.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_ERROR_POS_STYLE: Odin_Error_Pos_Style_Type
|
||||
|
||||
/*
|
||||
`true` if the `-foreign-error-procedures` command line switch is passed,
|
||||
which inhibits generation of runtime error procedures, so that they can be in a separate compilation unit.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_FOREIGN_ERROR_PROCEDURES: bool
|
||||
|
||||
/*
|
||||
A `string` describing the microarchitecture used for code generation.
|
||||
If not set using the `-microarch` command line switch, the compiler will pick a default.
|
||||
Possible values include, but are not limited to: "sandybridge", "x86-64-v2".
|
||||
*/
|
||||
@builtin
|
||||
ODIN_MICROARCH_STRING: string
|
||||
|
||||
/*
|
||||
An `int` value representing the minimum OS version given to the linker, calculated as `major * 10_000 + minor * 100 + revision`.
|
||||
If not set using the `-minimum-os-version` command line switch, it defaults to `0`, except on Darwin, where it's `11_00_00`.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_MINIMUM_OS_VERSION: int
|
||||
|
||||
/*
|
||||
`true` if the `-no-bounds-check` command line switch is passed, which disables bounds checking at runtime.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_NO_BOUNDS_CHECK: bool
|
||||
|
||||
/*
|
||||
`true` if the `-no-crt` command line switch is passed, which inhibits linking with the C Runtime Library, a.k.a. LibC.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_NO_CRT: bool
|
||||
|
||||
/*
|
||||
`true` if the `-no-entry-point` command line switch is passed, which makes the declaration of a `main` procedure optional.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_NO_ENTRY_POINT: bool
|
||||
|
||||
/*
|
||||
`true` if the `-no-rtti` command line switch is passed, which inhibits generation of full Runtime Type Information.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_NO_RTTI: bool
|
||||
|
||||
/*
|
||||
`true` if the `-no-type-assert` command line switch is passed, which disables type assertion checking program wide.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_NO_TYPE_ASSERT: bool
|
||||
|
||||
@builtin
|
||||
Odin_Optimization_Mode :: enum int {
|
||||
None = -1,
|
||||
Minimal = 0,
|
||||
Size = 1,
|
||||
Speed = 2,
|
||||
Aggressive = 3,
|
||||
}
|
||||
|
||||
/*
|
||||
An `enum` value indicating the optimization level selected using the `-o` command line switch.
|
||||
Possible values are: `.None`, `.Minimal`, `.Size`, `.Speed`, and `.Aggressive`.
|
||||
|
||||
If `ODIN_OPTIMIZATION_MODE` is anything other than `.None` or `.Minimal`, the compiler will also perform a unity build,
|
||||
and `ODIN_USE_SEPARATE_MODULES` will be set to `false` as a result.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_OPTIMIZATION_MODE: Odin_Optimization_Mode
|
||||
|
||||
@builtin
|
||||
Odin_OS_Type :: enum int {
|
||||
Unknown,
|
||||
Windows,
|
||||
Darwin,
|
||||
Linux,
|
||||
Essence,
|
||||
FreeBSD,
|
||||
OpenBSD,
|
||||
NetBSD,
|
||||
Haiku,
|
||||
WASI,
|
||||
JS,
|
||||
Orca,
|
||||
Freestanding,
|
||||
}
|
||||
|
||||
/*
|
||||
An `enum` value indicating what the target operating system is.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_OS: Odin_OS_Type
|
||||
|
||||
/*
|
||||
A `string` indicating what the target operating system is.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_OS_STRING: string
|
||||
|
||||
@builtin
|
||||
Odin_Platform_Subtarget_Type :: enum int {
|
||||
Default,
|
||||
iPhone,
|
||||
iPhoneSimulator,
|
||||
Android,
|
||||
}
|
||||
|
||||
/*
|
||||
An `enum` value indicating the platform subtarget, chosen using the `-subtarget` switch.
|
||||
Possible values are: `.Default` `.iPhone`, .iPhoneSimulator, and `.Android`.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_PLATFORM_SUBTARGET: Odin_Platform_Subtarget_Type
|
||||
|
||||
/*
|
||||
A `string` representing the path of the folder containing the Odin compiler,
|
||||
relative to which we expect to find the `base` and `core` package collections.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_ROOT: string
|
||||
|
||||
@builtin
|
||||
Odin_Sanitizer_Flag :: enum u32 {
|
||||
Address = 0,
|
||||
Memory = 1,
|
||||
Thread = 2,
|
||||
}
|
||||
|
||||
@builtin
|
||||
Odin_Sanitizer_Flags :: distinct bit_set[Odin_Sanitizer_Flag; u32]
|
||||
|
||||
/*
|
||||
A `bit_set` indicating the sanitizer flags set using the `-sanitize` command line switch.
|
||||
Supported flags are `.Address`, `.Memory`, and `.Thread`.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_SANITIZER_FLAGS: Odin_Sanitizer_Flags
|
||||
|
||||
/*
|
||||
`true` if the code is being compiled via an invocation of `odin test`.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_TEST: bool
|
||||
|
||||
/*
|
||||
`true` if built using the experimental Tilde backend.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_TILDE: bool
|
||||
|
||||
/*
|
||||
`true` by default, meaning each each package is built into its own object file, and then linked together.
|
||||
`false` if the `-use-single-module` command line switch to force a unity build is provided.
|
||||
|
||||
If `ODIN_OPTIMIZATION_MODE` is anything other than `.None` or `.Minimal`, the compiler will also perform a unity build,
|
||||
and this constant will also be set to `false`.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_USE_SEPARATE_MODULES: bool
|
||||
|
||||
/*
|
||||
`true` if Valgrind integration is supported on the target.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_VALGRIND_SUPPORT: bool
|
||||
|
||||
/*
|
||||
A `string` which identifies the compiler being used. The official compiler sets this to `"odin"`.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_VENDOR: string
|
||||
|
||||
/*
|
||||
A `string` containing the version of the Odin compiler, typically in the format `dev-YYYY-MM`.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_VERSION: string
|
||||
|
||||
/*
|
||||
A `string` containing the Git hash part of the Odin version.
|
||||
Empty if `.git` could not be detected at the time the compiler was built.
|
||||
*/
|
||||
@builtin
|
||||
ODIN_VERSION_HASH: string
|
||||
|
||||
@builtin
|
||||
Odin_Windows_Subsystem_Type :: enum int {
|
||||
Unknown,
|
||||
Console,
|
||||
Windows,
|
||||
}
|
||||
|
||||
/*
|
||||
An `enum` set by the `-subsystem` flag, specifying which Windows subsystem the PE file was created for.
|
||||
Possible values are:
|
||||
`.Unknown` - Default and only value on non-Windows platforms
|
||||
`.Console` - Default on Windows
|
||||
`.Windows` - Can be used by graphical applications so Windows doesn't open an empty console
|
||||
|
||||
There are some other possible values for e.g. EFI applications, but only Console and Windows are supported.
|
||||
|
||||
See also: https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-image_optional_header64
|
||||
*/
|
||||
@builtin
|
||||
ODIN_WINDOWS_SUBSYSTEM: Odin_Windows_Subsystem_Type
|
||||
|
||||
/*
|
||||
An `string` set by the `-subsystem` flag, specifying which Windows subsystem the PE file was created for.
|
||||
Possible values are:
|
||||
"UNKNOWN" - Default and only value on non-Windows platforms
|
||||
"CONSOLE" - Default on Windows
|
||||
"WINDOWS" - Can be used by graphical applications so Windows doesn't open an empty console
|
||||
|
||||
There are some other possible values for e.g. EFI applications, but only Console and Windows are supported.
|
||||
|
||||
See also: https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-image_optional_header64
|
||||
*/
|
||||
@builtin
|
||||
ODIN_WINDOWS_SUBSYSTEM_STRING: string
|
||||
|
||||
/*
|
||||
`true` if LLVM supports the f16 type.
|
||||
*/
|
||||
@builtin
|
||||
__ODIN_LLVM_F16_SUPPORTED: bool
|
||||
459
zsh/.local/share/nvim/mason/packages/ols/builtin/intrinsics.odin
Normal file
459
zsh/.local/share/nvim/mason/packages/ols/builtin/intrinsics.odin
Normal file
@@ -0,0 +1,459 @@
|
||||
package ols_builtin
|
||||
|
||||
// Package-Related
|
||||
is_package_imported :: proc(package_name: string) -> bool ---
|
||||
|
||||
// Matrix Related Procedures
|
||||
transpose :: proc(m: $T/matrix[$R, $C]$E) -> matrix[C, R]E ---
|
||||
outer_product :: proc(a: $A/[$X]$E, b: $B/[$Y]E) -> matrix[X, Y]E ---
|
||||
hadamard_product :: proc(a, b: $T/matrix[$R, $C]$E) -> T ---
|
||||
matrix_flatten :: proc(m: $T/matrix[$R, $C]$E) -> [R*C]E ---
|
||||
|
||||
// Types
|
||||
soa_struct :: proc($N: int, $T: typeid) -> type / #soa[N]T
|
||||
|
||||
// Volatile
|
||||
volatile_load :: proc(dst: ^$T) -> T ---
|
||||
volatile_store :: proc(dst: ^$T, val: T) ---
|
||||
|
||||
non_temporal_load :: proc(dst: ^$T) -> T ---
|
||||
non_temporal_store :: proc(dst: ^$T, val: T) ---
|
||||
|
||||
// Trapping
|
||||
debug_trap :: proc() ---
|
||||
trap :: proc() -> ! ---
|
||||
|
||||
// Instructions
|
||||
|
||||
alloca :: proc(size, align: int) -> [^]u8 ---
|
||||
cpu_relax :: proc() ---
|
||||
read_cycle_counter :: proc() -> i64 ---
|
||||
|
||||
count_ones :: proc(x: $T) -> T ---
|
||||
count_zeros :: proc(x: $T) -> T ---
|
||||
count_trailing_zeros :: proc(x: $T) -> T ---
|
||||
count_leading_zeros :: proc(x: $T) -> T ---
|
||||
reverse_bits :: proc(x: $T) -> T ---
|
||||
byte_swap :: proc(x: $T) -> T ---
|
||||
|
||||
overflow_add :: proc(lhs, rhs: $T) -> (T, bool) #optional_ok ---
|
||||
overflow_sub :: proc(lhs, rhs: $T) -> (T, bool) #optional_ok ---
|
||||
overflow_mul :: proc(lhs, rhs: $T) -> (T, bool) #optional_ok ---
|
||||
|
||||
saturating_add :: proc(lhs, rhs: $T) -> T ---
|
||||
saturating_sub :: proc(lhs, rhs: $T) -> T ---
|
||||
|
||||
sqrt :: proc(x: $T) -> T ---
|
||||
|
||||
fused_mul_add :: proc(a, b, c: $T) -> T ---
|
||||
|
||||
mem_copy :: proc(dst, src: rawptr, len: int) ---
|
||||
mem_copy_non_overlapping :: proc(dst, src: rawptr, len: int) ---
|
||||
mem_zero :: proc(ptr: rawptr, len: int) ---
|
||||
mem_zero_volatile :: proc(ptr: rawptr, len: int) ---
|
||||
|
||||
// prefer [^]T operations if possible
|
||||
ptr_offset :: proc(ptr: ^$T, offset: int) -> ^T ---
|
||||
ptr_sub :: proc(a, b: ^$T) -> int ---
|
||||
|
||||
unaligned_load :: proc(src: ^$T) -> T ---
|
||||
unaligned_store :: proc(dst: ^$T, val: T) -> T ---
|
||||
|
||||
fixed_point_mul :: proc(lhs, rhs: $T, scale: uint) -> T ---
|
||||
fixed_point_div :: proc(lhs, rhs: $T, scale: uint) -> T ---
|
||||
fixed_point_mul_sat :: proc(lhs, rhs: $T, scale: uint) -> T ---
|
||||
fixed_point_div_sat :: proc(lhs, rhs: $T, scale: uint) -> T ---
|
||||
|
||||
prefetch_read_instruction :: proc(
|
||||
address: rawptr,
|
||||
locality: i32,
|
||||
) --- /* 0..=3 */
|
||||
prefetch_read_data :: proc(address: rawptr, locality: i32) --- /* 0..=3 */
|
||||
prefetch_write_instruction :: proc(
|
||||
address: rawptr,
|
||||
locality: i32,
|
||||
) --- /* 0..=3 */
|
||||
prefetch_write_data :: proc(address: rawptr, locality: i32) --- /* 0..=3 */
|
||||
|
||||
// Compiler Hints
|
||||
expect :: proc(val, expected_val: T) -> T ---
|
||||
|
||||
// Linux and Darwin Only
|
||||
syscall :: proc(id: uintptr, args: ..uintptr) -> uintptr ---
|
||||
// FreeBSD, NetBSD, et cetera
|
||||
syscall_bsd :: proc(id: uintptr, args: ..uintptr) -> (uintptr, bool) ---
|
||||
|
||||
// Atomics
|
||||
Atomic_Memory_Order :: enum {
|
||||
Relaxed = 0, // Unordered
|
||||
Consume = 1, // Monotonic
|
||||
Acquire = 2,
|
||||
Release = 3,
|
||||
Acq_Rel = 4,
|
||||
Seq_Cst = 5,
|
||||
}
|
||||
|
||||
atomic_type_is_lock_free :: proc($T: typeid) -> bool ---
|
||||
|
||||
atomic_thread_fence :: proc(order: Atomic_Memory_Order) ---
|
||||
atomic_signal_fence :: proc(order: Atomic_Memory_Order) ---
|
||||
|
||||
atomic_store :: proc(dst: ^$T, val: T) ---
|
||||
atomic_store_explicit :: proc(dst: ^$T, val: T, order: Atomic_Memory_Order) ---
|
||||
|
||||
atomic_load :: proc(dst: ^$T) -> T ---
|
||||
atomic_load_explicit :: proc(dst: ^$T, order: Atomic_Memory_Order) -> T ---
|
||||
|
||||
// fetch then operator
|
||||
atomic_add :: proc(dst: ^$T, val: T) -> T ---
|
||||
atomic_add_explicit :: proc(
|
||||
dst: ^$T,
|
||||
val: T,
|
||||
order: Atomic_Memory_Order,
|
||||
) -> T ---
|
||||
atomic_sub :: proc(dst: ^$T, val: T) -> T ---
|
||||
atomic_sub_explicit :: proc(
|
||||
dst: ^$T,
|
||||
val: T,
|
||||
order: Atomic_Memory_Order,
|
||||
) -> T ---
|
||||
atomic_and :: proc(dst: ^$T, val: T) -> T ---
|
||||
atomic_and_explicit :: proc(
|
||||
dst: ^$T,
|
||||
val: T,
|
||||
order: Atomic_Memory_Order,
|
||||
) -> T ---
|
||||
atomic_nand :: proc(dst: ^$T, val: T) -> T ---
|
||||
atomic_nand_explicit :: proc(
|
||||
dst: ^$T,
|
||||
val: T,
|
||||
order: Atomic_Memory_Order,
|
||||
) -> T ---
|
||||
atomic_or :: proc(dst: ^$T, val: T) -> T ---
|
||||
atomic_or_explicit :: proc(
|
||||
dst: ^$T,
|
||||
val: T,
|
||||
order: Atomic_Memory_Order,
|
||||
) -> T ---
|
||||
atomic_xor :: proc(dst: ^$T, val: T) -> T ---
|
||||
atomic_xor_explicit :: proc(
|
||||
dst: ^$T,
|
||||
val: T,
|
||||
order: Atomic_Memory_Order,
|
||||
) -> T ---
|
||||
atomic_exchange :: proc(dst: ^$T, val: T) -> T ---
|
||||
atomic_exchange_explicit :: proc(
|
||||
dst: ^$T,
|
||||
val: T,
|
||||
order: Atomic_Memory_Order,
|
||||
) -> T ---
|
||||
|
||||
atomic_compare_exchange_strong :: proc(
|
||||
dst: ^$T,
|
||||
old, new: T,
|
||||
) -> (
|
||||
T,
|
||||
bool,
|
||||
) #optional_ok ---
|
||||
atomic_compare_exchange_strong_explicit :: proc(
|
||||
dst: ^$T,
|
||||
old, new: T,
|
||||
success, failure: Atomic_Memory_Order,
|
||||
) -> (
|
||||
T,
|
||||
bool,
|
||||
) #optional_ok ---
|
||||
atomic_compare_exchange_weak :: proc(
|
||||
dst: ^$T,
|
||||
old, new: T,
|
||||
) -> (
|
||||
T,
|
||||
bool,
|
||||
) #optional_ok ---
|
||||
atomic_compare_exchange_weak_explicit :: proc(
|
||||
dst: ^$T,
|
||||
old, new: T,
|
||||
success, failure: Atomic_Memory_Order,
|
||||
) -> (
|
||||
T,
|
||||
bool,
|
||||
) #optional_ok ---
|
||||
|
||||
|
||||
// Constant type tests
|
||||
|
||||
type_base_type :: proc($T: typeid) -> type ---
|
||||
type_core_type :: proc($T: typeid) -> type ---
|
||||
type_elem_type :: proc($T: typeid) -> type ---
|
||||
|
||||
type_is_boolean :: proc($T: typeid) -> bool ---
|
||||
type_is_integer :: proc($T: typeid) -> bool ---
|
||||
type_is_rune :: proc($T: typeid) -> bool ---
|
||||
type_is_float :: proc($T: typeid) -> bool ---
|
||||
type_is_complex :: proc($T: typeid) -> bool ---
|
||||
type_is_quaternion :: proc($T: typeid) -> bool ---
|
||||
type_is_string :: proc($T: typeid) -> bool ---
|
||||
type_is_typeid :: proc($T: typeid) -> bool ---
|
||||
type_is_any :: proc($T: typeid) -> bool ---
|
||||
|
||||
type_is_endian_platform :: proc($T: typeid) -> bool ---
|
||||
type_is_endian_little :: proc($T: typeid) -> bool ---
|
||||
type_is_endian_big :: proc($T: typeid) -> bool ---
|
||||
type_is_unsigned :: proc($T: typeid) -> bool ---
|
||||
type_is_numeric :: proc($T: typeid) -> bool ---
|
||||
type_is_ordered :: proc($T: typeid) -> bool ---
|
||||
type_is_ordered_numeric :: proc($T: typeid) -> bool ---
|
||||
type_is_indexable :: proc($T: typeid) -> bool ---
|
||||
type_is_sliceable :: proc($T: typeid) -> bool ---
|
||||
type_is_comparable :: proc($T: typeid) -> bool ---
|
||||
type_is_simple_compare :: proc($T: typeid) -> bool --- // easily compared using memcmp (== and !=)
|
||||
type_is_dereferenceable :: proc($T: typeid) -> bool ---
|
||||
type_is_valid_map_key :: proc($T: typeid) -> bool ---
|
||||
type_is_valid_matrix_elements :: proc($T: typeid) -> bool ---
|
||||
|
||||
type_is_named :: proc($T: typeid) -> bool ---
|
||||
type_is_pointer :: proc($T: typeid) -> bool ---
|
||||
type_is_multi_pointer :: proc($T: typeid) -> bool ---
|
||||
type_is_array :: proc($T: typeid) -> bool ---
|
||||
type_is_enumerated_array :: proc($T: typeid) -> bool ---
|
||||
type_is_slice :: proc($T: typeid) -> bool ---
|
||||
type_is_dynamic_array :: proc($T: typeid) -> bool ---
|
||||
type_is_map :: proc($T: typeid) -> bool ---
|
||||
type_is_struct :: proc($T: typeid) -> bool ---
|
||||
type_is_union :: proc($T: typeid) -> bool ---
|
||||
type_is_enum :: proc($T: typeid) -> bool ---
|
||||
type_is_proc :: proc($T: typeid) -> bool ---
|
||||
type_is_bit_set :: proc($T: typeid) -> bool ---
|
||||
type_is_simd_vector :: proc($T: typeid) -> bool ---
|
||||
type_is_matrix :: proc($T: typeid) -> bool ---
|
||||
|
||||
type_has_nil :: proc($T: typeid) -> bool ---
|
||||
|
||||
type_is_matrix_row_major :: proc($T: typeid) -> bool ---
|
||||
type_is_matrix_column_major :: proc($T: typeid) -> bool ---
|
||||
|
||||
type_is_specialization_of :: proc($T, $S: typeid) -> bool ---
|
||||
|
||||
type_is_variant_of :: proc($U, $V: typeid) -> bool ---
|
||||
type_union_tag_type :: proc($T: typeid) -> typeid ---
|
||||
type_union_tag_offset :: proc($T: typeid) -> uintptr ---
|
||||
type_union_base_tag_value :: proc($T: typeid) -> int ---
|
||||
type_union_variant_count :: proc($T: typeid) -> int ---
|
||||
type_variant_type_of :: proc($T: typeid, $index: int) -> typeid ---
|
||||
type_variant_index_of :: proc($U, $V: typeid) -> int ---
|
||||
|
||||
type_bit_set_elem_type :: proc($T: typeid) -> typeid ---
|
||||
type_bit_set_underlying_type :: proc($T: typeid) -> typeid ---
|
||||
|
||||
type_has_field :: proc($T: typeid, $name: string) -> bool ---
|
||||
type_field_type :: proc($T: typeid, $name: string) -> typeid ---
|
||||
|
||||
type_proc_parameter_count :: proc($T: typeid) -> int ---
|
||||
type_proc_return_count :: proc($T: typeid) -> int ---
|
||||
|
||||
type_proc_parameter_type :: proc($T: typeid, index: int) -> typeid ---
|
||||
type_proc_return_type :: proc($T: typeid, index: int) -> typeid ---
|
||||
|
||||
type_struct_field_count :: proc($T: typeid) -> int ---
|
||||
type_struct_has_implicit_padding :: proc($T: typeid) -> bool ---
|
||||
|
||||
type_polymorphic_record_parameter_count :: proc($T: typeid) -> typeid ---
|
||||
type_polymorphic_record_parameter_value :: proc(
|
||||
$T: typeid,
|
||||
index: int,
|
||||
) -> $V ---
|
||||
|
||||
type_is_specialized_polymorphic_record :: proc($T: typeid) -> bool ---
|
||||
type_is_unspecialized_polymorphic_record :: proc($T: typeid) -> bool ---
|
||||
|
||||
type_is_subtype_of :: proc($T, $U: typeid) -> bool ---
|
||||
|
||||
type_field_index_of :: proc($T: typeid, $name: string) -> uintptr ---
|
||||
|
||||
// "Contiguous" means that the set of enum constants, when sorted, have a difference of either 0 or 1 between consecutive values.
|
||||
// This is the exact opposite of "sparse".
|
||||
type_enum_is_contiguous :: proc($T: typeid) -> bool ---
|
||||
|
||||
type_equal_proc :: proc(
|
||||
$T: typeid,
|
||||
) -> (
|
||||
equal: proc "contextless" (_: rawptr, _: rawptr) -> bool
|
||||
) ---
|
||||
type_hasher_proc :: proc(
|
||||
$T: typeid,
|
||||
) -> (
|
||||
hasher: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr
|
||||
) ---
|
||||
|
||||
type_map_info :: proc($T: typeid/map[$K]$V) -> ^runtime.Map_Info ---
|
||||
type_map_cell_info :: proc($T: typeid) -> ^runtime.Map_Cell_Info ---
|
||||
|
||||
type_convert_variants_to_pointers :: proc($T: typeid) -> typeid ---
|
||||
type_merge :: proc($U, $V: typeid) -> typeid ---
|
||||
|
||||
type_has_shared_fields :: proc($U, $V: typeid) -> bool ---
|
||||
|
||||
constant_utf16_cstring :: proc($literal: string) -> [^]u16 ---
|
||||
|
||||
constant_log2 :: proc($v: $T) -> T ---
|
||||
|
||||
// SIMD related
|
||||
simd_add :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||
simd_sub :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||
simd_mul :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||
simd_div :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||
|
||||
simd_saturating_add :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||
simd_saturating_sub :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||
|
||||
// Keeps Odin's Behaviour
|
||||
// (x << y) if y <= mask else 0
|
||||
simd_shl :: proc(a: #simd[N]T, b: #simd[N]Unsigned_Integer) -> #simd[N]T ---
|
||||
simd_shr :: proc(a: #simd[N]T, b: #simd[N]Unsigned_Integer) -> #simd[N]T ---
|
||||
|
||||
// Similar to C's Behaviour
|
||||
// x << (y & mask)
|
||||
simd_shl_masked :: proc(
|
||||
a: #simd[N]T,
|
||||
b: #simd[N]Unsigned_Integer,
|
||||
) -> #simd[N]T ---
|
||||
simd_shr_masked :: proc(
|
||||
a: #simd[N]T,
|
||||
b: #simd[N]Unsigned_Integer,
|
||||
) -> #simd[N]T ---
|
||||
|
||||
simd_add_sat :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||
simd_sub_sat :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||
|
||||
simd_bit_and :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||
simd_bit_or :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||
simd_bit_xor :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||
simd_bit_and_not :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||
|
||||
simd_neg :: proc(a: #simd[N]T) -> #simd[N]T ---
|
||||
|
||||
simd_abs :: proc(a: #simd[N]T) -> #simd[N]T ---
|
||||
|
||||
simd_min :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||
simd_max :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||
simd_clamp :: proc(v, min, max: #simd[N]T) -> #simd[N]T ---
|
||||
|
||||
// Return an unsigned integer of the same size as the input type
|
||||
// NOT A BOOLEAN
|
||||
// element-wise:
|
||||
// false => 0x00...00
|
||||
// true => 0xff...ff
|
||||
simd_lanes_eq :: proc(a, b: #simd[N]T) -> #simd[N]Integer ---
|
||||
simd_lanes_ne :: proc(a, b: #simd[N]T) -> #simd[N]Integer ---
|
||||
simd_lanes_lt :: proc(a, b: #simd[N]T) -> #simd[N]Integer ---
|
||||
simd_lanes_le :: proc(a, b: #simd[N]T) -> #simd[N]Integer ---
|
||||
simd_lanes_gt :: proc(a, b: #simd[N]T) -> #simd[N]Integer ---
|
||||
simd_lanes_ge :: proc(a, b: #simd[N]T) -> #simd[N]Integer ---
|
||||
|
||||
simd_extract :: proc(a: #simd[N]T, idx: uint) -> T ---
|
||||
simd_replace :: proc(a: #simd[N]T, idx: uint, elem: T) -> #simd[N]T ---
|
||||
|
||||
simd_reduce_add_ordered :: proc(a: #simd[N]T) -> T ---
|
||||
simd_reduce_mul_ordered :: proc(a: #simd[N]T) -> T ---
|
||||
simd_reduce_min :: proc(a: #simd[N]T) -> T ---
|
||||
simd_reduce_max :: proc(a: #simd[N]T) -> T ---
|
||||
simd_reduce_and :: proc(a: #simd[N]T) -> T ---
|
||||
simd_reduce_or :: proc(a: #simd[N]T) -> T ---
|
||||
simd_reduce_xor :: proc(a: #simd[N]T) -> T ---
|
||||
|
||||
simd_reduce_any :: proc(a: #simd[N]T) -> T ---
|
||||
simd_reduce_all :: proc(a: #simd[N]T) -> T ---
|
||||
|
||||
simd_gather :: proc(ptr: #simd[N]rawptr, val: #simd[N]T, mask: #simd[N]U) -> #simd[N]T ---
|
||||
simd_scatter :: proc(ptr: #simd[N]rawptr, val: #simd[N]T, mask: #simd[N]U) ---
|
||||
|
||||
simd_masked_load :: proc(ptr: rawptr, val: #simd[N]T, mask: #simd[N]U) -> #simd[N]T ---
|
||||
simd_masked_store :: proc(ptr: rawptr, val: #simd[N]T, mask: #simd[N]U) ---
|
||||
|
||||
simd_masked_expand_load :: proc(ptr: rawptr, val: #simd[N]T, mask: #simd[N]U) -> #simd[N]T ---
|
||||
simd_masked_compress_store :: proc(ptr: rawptr, val: #simd[N]T, mask: #simd[N]U) ---
|
||||
|
||||
simd_shuffle :: proc(
|
||||
a, b: #simd[N]T,
|
||||
indices: ..int,
|
||||
) -> #simd[len(indices)]T ---
|
||||
simd_select :: proc(
|
||||
cond: #simd[N]boolean_or_integer,
|
||||
true, false: #simd[N]T,
|
||||
) -> #simd[N]T ---
|
||||
|
||||
// Lane-wise operations
|
||||
simd_ceil :: proc(a: #simd[N]any_float) -> #simd[N]any_float ---
|
||||
simd_floor :: proc(a: #simd[N]any_float) -> #simd[N]any_float ---
|
||||
simd_trunc :: proc(a: #simd[N]any_float) -> #simd[N]any_float ---
|
||||
// rounding to the nearest integral value; if two values are equally near, rounds to the even one
|
||||
simd_nearest :: proc(a: #simd[N]any_float) -> #simd[N]any_float ---
|
||||
|
||||
simd_to_bits :: proc(v: #simd[N]T) -> #simd[N]Integer ---
|
||||
|
||||
// equivalent a swizzle with descending indices, e.g. reserve(a, 3, 2, 1, 0)
|
||||
simd_lanes_reverse :: proc(a: #simd[N]T) -> #simd[N]T ---
|
||||
|
||||
simd_lanes_rotate_left :: proc(a: #simd[N]T, $offset: int) -> #simd[N]T ---
|
||||
simd_lanes_rotate_right :: proc(a: #simd[N]T, $offset: int) -> #simd[N]T ---
|
||||
|
||||
// Checks if the current target supports the given target features.
|
||||
//
|
||||
// Takes a constant comma-seperated string (eg: "sha512,sse4.1"), or a procedure type which has either
|
||||
// `@(require_target_feature)` or `@(enable_target_feature)` as its input and returns a boolean indicating
|
||||
// if all listed features are supported.
|
||||
has_target_feature :: proc($test: $T) -> bool ---
|
||||
|
||||
// Returns the value of the procedure where `x` must be a call expression
|
||||
procedure_of :: proc(x: $T) -> T ---
|
||||
|
||||
// WASM targets only
|
||||
wasm_memory_grow :: proc(index, delta: uintptr) -> int ---
|
||||
wasm_memory_size :: proc(index: uintptr) -> int ---
|
||||
|
||||
// `timeout_ns` is maximum number of nanoseconds the calling thread will be blocked for
|
||||
// A negative value will be blocked forever
|
||||
// Return value:
|
||||
// 0 - indicates that the thread blocked and then was woken up
|
||||
// 1 - the loaded value from `ptr` did not match `expected`, the thread did not block
|
||||
// 2 - the thread blocked, but the timeout
|
||||
wasm_memory_atomic_wait32 :: proc(
|
||||
ptr: ^u32,
|
||||
expected: u32,
|
||||
timeout_ns: i64,
|
||||
) -> u32 ---
|
||||
wasm_memory_atomic_notify32 :: proc(
|
||||
ptr: ^u32,
|
||||
waiters: u32,
|
||||
) -> (
|
||||
waiters_woken_up: u32
|
||||
) ---
|
||||
|
||||
// x86 Targets (i386, amd64)
|
||||
x86_cpuid :: proc(ax, cx: u32) -> (eax, ebc, ecx, edx: u32) ---
|
||||
x86_xgetbv :: proc(cx: u32) -> (eax, edx: u32) ---
|
||||
|
||||
|
||||
// Darwin targets only
|
||||
objc_object :: struct {}
|
||||
objc_selector :: struct {}
|
||||
objc_class :: struct {}
|
||||
objc_id :: ^objc_object
|
||||
objc_SEL :: ^objc_selector
|
||||
objc_Class :: ^objc_class
|
||||
|
||||
objc_find_selector :: proc($name: string) -> objc_SEL ---
|
||||
objc_register_selector :: proc($name: string) -> objc_SEL ---
|
||||
objc_find_class :: proc($name: string) -> objc_Class ---
|
||||
objc_register_class :: proc($name: string) -> objc_Class ---
|
||||
|
||||
|
||||
valgrind_client_request :: proc(
|
||||
default: uintptr,
|
||||
request: uintptr,
|
||||
a0, a1, a2, a3, a4: uintptr,
|
||||
) -> uintptr ---
|
||||
|
||||
// Internal compiler use only
|
||||
|
||||
__entry_point :: proc() ---
|
||||
Reference in New Issue
Block a user