package core:math/bits
This section is empty.
This section is empty.
add_u32 :: proc "contextless" (x, y, carry: u32) -> (sum, carry_out: u32) {…}
add_u64 :: proc "contextless" (x, y, carry: u64) -> (sum, carry_out: u64) {…}
add_uint :: proc "contextless" (x, y, carry: uint) -> (sum, carry_out: uint) {…}
bitfield_extract_i128 :: proc "contextless" (value: i128, offset, bits: uint) -> i128 {…}
bitfield_extract_i16 :: proc "contextless" (value: i16, offset, bits: uint) -> i16 {…}
bitfield_extract_i32 :: proc "contextless" (value: i32, offset, bits: uint) -> i32 {…}
bitfield_extract_i64 :: proc "contextless" (value: i64, offset, bits: uint) -> i64 {…}
bitfield_extract_i8 :: proc "contextless" (value: i8, offset, bits: uint) -> i8 {…}
bitfield_extract_int :: proc "contextless" (value: int, offset, bits: uint) -> int {…}
bitfield_extract_u128 :: proc "contextless" (value: u128, offset, bits: uint) -> u128 {…}
bitfield_extract_u16 :: proc "contextless" (value: u16, offset, bits: uint) -> u16 {…}
bitfield_extract_u32 :: proc "contextless" (value: u32, offset, bits: uint) -> u32 {…}
bitfield_extract_u64 :: proc "contextless" (value: u64, offset, bits: uint) -> u64 {…}
bitfield_extract_u8 :: proc "contextless" (value: u8, offset, bits: uint) -> u8 {…}
bitfield_extract_uint :: proc "contextless" (value: uint, offset, bits: uint) -> uint {…}
bitfield_insert_i128 :: proc "contextless" (base, insert: i128, offset, bits: uint) -> i128 {…}
bitfield_insert_i16 :: proc "contextless" (base, insert: i16, offset, bits: uint) -> i16 {…}
bitfield_insert_i32 :: proc "contextless" (base, insert: i32, offset, bits: uint) -> i32 {…}
bitfield_insert_i64 :: proc "contextless" (base, insert: i64, offset, bits: uint) -> i64 {…}
bitfield_insert_i8 :: proc "contextless" (base, insert: i8, offset, bits: uint) -> i8 {…}
bitfield_insert_int :: proc "contextless" (base, insert: int, offset, bits: uint) -> int {…}
bitfield_insert_u128 :: proc "contextless" (base, insert: u128, offset, bits: uint) -> u128 {…}
bitfield_insert_u16 :: proc "contextless" (base, insert: u16, offset, bits: uint) -> u16 {…}
bitfield_insert_u32 :: proc "contextless" (base, insert: u32, offset, bits: uint) -> u32 {…}
bitfield_insert_u64 :: proc "contextless" (base, insert: u64, offset, bits: uint) -> u64 {…}
bitfield_insert_u8 :: proc "contextless" (base, insert: u8, offset, bits: uint) -> u8 {…}
bitfield_insert_uint :: proc "contextless" (base, insert: uint, offset, bits: uint) -> uint {…}
count_leading_zeros :: intrinsics.count_leading_zeros
count_trailing_zeros :: intrinsics.count_trailing_zeros
div_u32 :: proc(hi, lo, y: u32) -> (quo, rem: u32) {…}
div_u64 :: proc(hi, lo, y: u64) -> (quo, rem: u64) {…}
div_uint :: proc(hi, lo, y: uint) -> (quo, rem: uint) {…}
from_be_u16 :: proc "contextless" (i: u16) -> u16 {…}
from_be_u32 :: proc "contextless" (i: u32) -> u32 {…}
from_be_u64 :: proc "contextless" (i: u64) -> u64 {…}
from_be_u8 :: proc "contextless" (i: u8) -> u8 {…}
from_be_uint :: proc "contextless" (i: uint) -> uint {…}
from_le_u16 :: proc "contextless" (i: u16) -> u16 {…}
from_le_u32 :: proc "contextless" (i: u32) -> u32 {…}
from_le_u64 :: proc "contextless" (i: u64) -> u64 {…}
from_le_u8 :: proc "contextless" (i: u8) -> u8 {…}
from_le_uint :: proc "contextless" (i: uint) -> uint {…}
is_power_of_two_i16 :: proc "contextless" (i: i16) -> bool {…}
is_power_of_two_i32 :: proc "contextless" (i: i32) -> bool {…}
is_power_of_two_i64 :: proc "contextless" (i: i64) -> bool {…}
is_power_of_two_i8 :: proc "contextless" (i: i8) -> bool {…}
is_power_of_two_int :: proc "contextless" (i: int) -> bool {…}
is_power_of_two_u16 :: proc "contextless" (i: u16) -> bool {…}
is_power_of_two_u32 :: proc "contextless" (i: u32) -> bool {…}
is_power_of_two_u64 :: proc "contextless" (i: u64) -> bool {…}
is_power_of_two_u8 :: proc "contextless" (i: u8) -> bool {…}
is_power_of_two_uint :: proc "contextless" (i: uint) -> bool {…}
len_u16 :: proc "contextless" (x: u16) -> (n: int) {…}
len_u32 :: proc "contextless" (x: u32) -> (n: int) {…}
len_u64 :: proc "contextless" (x: u64) -> (n: int) {…}
len_u8 :: proc "contextless" (x: u8) -> int {…}
len_uint :: proc "contextless" (x: uint) -> (n: int) {…}
log2 :: proc "contextless" (x: $T) -> $T {…}
mul_u32 :: proc "contextless" (x, y: u32) -> (hi, lo: u32) {…}
mul_u64 :: proc "contextless" (x, y: u64) -> (hi, lo: u64) {…}
mul_uint :: proc "contextless" (x, y: uint) -> (hi, lo: uint) {…}
rotate_left :: proc "contextless" (x: uint, k: int) -> uint {…}
rotate_left16 :: proc "contextless" (x: u16, k: int) -> u16 {…}
rotate_left32 :: proc "contextless" (x: u32, k: int) -> u32 {…}
rotate_left64 :: proc "contextless" (x: u64, k: int) -> u64 {…}
rotate_left8 :: proc "contextless" (x: u8, k: int) -> u8 {…}
sub_u32 :: proc "contextless" (x, y, borrow: u32) -> (diff, borrow_out: u32) {…}
sub_u64 :: proc "contextless" (x, y, borrow: u64) -> (diff, borrow_out: u64) {…}
sub_uint :: proc "contextless" (x, y, borrow: uint) -> (diff, borrow_out: uint) {…}
to_be_u16 :: proc "contextless" (i: u16) -> u16 {…}
to_be_u32 :: proc "contextless" (i: u32) -> u32 {…}
to_be_u64 :: proc "contextless" (i: u64) -> u64 {…}
to_be_u8 :: proc "contextless" (i: u8) -> u8 {…}
to_be_uint :: proc "contextless" (i: uint) -> uint {…}
to_le_u16 :: proc "contextless" (i: u16) -> u16 {…}
to_le_u32 :: proc "contextless" (i: u32) -> u32 {…}
to_le_u64 :: proc "contextless" (i: u64) -> u64 {…}
to_le_u8 :: proc "contextless" (i: u8) -> u8 {…}
to_le_uint :: proc "contextless" (i: uint) -> uint {…}
bitfield_extract :: proc{
bitfield_extract_u8,
bitfield_extract_u16,
bitfield_extract_u32,
bitfield_extract_u64,
bitfield_extract_u128,
bitfield_extract_uint,
bitfield_extract_i8,
bitfield_extract_i16,
bitfield_extract_i32,
bitfield_extract_i64,
bitfield_extract_i128,
bitfield_extract_int,
}
bitfield_insert :: proc{
bitfield_insert_u8,
bitfield_insert_u16,
bitfield_insert_u32,
bitfield_insert_u64,
bitfield_insert_u128,
bitfield_insert_uint,
bitfield_insert_i8,
bitfield_insert_i16,
bitfield_insert_i32,
bitfield_insert_i64,
bitfield_insert_i128,
bitfield_insert_int,
}
is_power_of_two :: proc{
is_power_of_two_u8,
is_power_of_two_i8,
is_power_of_two_u16,
is_power_of_two_i16,
is_power_of_two_u32,
is_power_of_two_i32,
is_power_of_two_u64,
is_power_of_two_i64,
is_power_of_two_uint,
is_power_of_two_int,
}
returns the minimum number of bits required to represent x
Source Files
Generated with odin version dev-2024-12 (vendor "odin") Windows_amd64 @ 2024-12-17 21:11:01.035075000 +0000 UTC