package core:math/bits

⌘K
Ctrl+K
or
/

    Index

    Types (0)

    This section is empty.

    Variables (0)

    This section is empty.

    Procedures (88)

    Types

    This section is empty.

    Constants

    I16_MAX ¶

    I16_MAX :: 1 << 15 - 1

    I16_MIN ¶

    I16_MIN :: -1 << 15

    I32_MAX ¶

    I32_MAX :: 1 << 31 - 1

    I32_MIN ¶

    I32_MIN :: -1 << 31

    I64_MAX ¶

    I64_MAX :: 1 << 63 - 1

    I64_MIN ¶

    I64_MIN :: -1 << 63

    I8_MAX ¶

    I8_MAX :: 1 << 7 - 1

    I8_MIN ¶

    I8_MIN :: -1 << 7

    U16_MAX ¶

    U16_MAX :: 1 << 16 - 1

    U16_MIN ¶

    U16_MIN :: 0

    U32_MAX ¶

    U32_MAX :: 1 << 32 - 1

    U32_MIN ¶

    U32_MIN :: 0

    U64_MAX ¶

    U64_MAX :: 1 << 64 - 1

    U64_MIN ¶

    U64_MIN :: 0

    U8_MAX ¶

    U8_MAX :: 1 << 8 - 1

    U8_MIN ¶

    U8_MIN :: 0

    Variables

    This section is empty.

    Procedures

    add_u32 ¶

    add_u32 :: proc "contextless" (x, y, carry: u32) -> (sum, carry_out: u32) {…}

    add_u64 ¶

    add_u64 :: proc "contextless" (x, y, carry: u64) -> (sum, carry_out: u64) {…}

    add_uint ¶

    add_uint :: proc "contextless" (x, y, carry: uint) -> (sum, carry_out: uint) {…}

    bitfield_extract_i128 ¶

    bitfield_extract_i128 :: proc "contextless" (value: i128, offset, bits: uint) -> i128 {…}

    bitfield_extract_i16 ¶

    bitfield_extract_i16 :: proc "contextless" (value: i16, offset, bits: uint) -> i16 {…}

    bitfield_extract_i32 ¶

    bitfield_extract_i32 :: proc "contextless" (value: i32, offset, bits: uint) -> i32 {…}

    bitfield_extract_i64 ¶

    bitfield_extract_i64 :: proc "contextless" (value: i64, offset, bits: uint) -> i64 {…}

    bitfield_extract_i8 ¶

    bitfield_extract_i8 :: proc "contextless" (value: i8, offset, bits: uint) -> i8 {…}

    bitfield_extract_int ¶

    bitfield_extract_int :: proc "contextless" (value: int, offset, bits: uint) -> int {…}

    bitfield_extract_u128 ¶

    bitfield_extract_u128 :: proc "contextless" (value: u128, offset, bits: uint) -> u128 {…}

    bitfield_extract_u16 ¶

    bitfield_extract_u16 :: proc "contextless" (value: u16, offset, bits: uint) -> u16 {…}

    bitfield_extract_u32 ¶

    bitfield_extract_u32 :: proc "contextless" (value: u32, offset, bits: uint) -> u32 {…}

    bitfield_extract_u64 ¶

    bitfield_extract_u64 :: proc "contextless" (value: u64, offset, bits: uint) -> u64 {…}

    bitfield_extract_u8 ¶

    bitfield_extract_u8 :: proc "contextless" (value: u8, offset, bits: uint) -> u8 {…}

    bitfield_extract_uint ¶

    bitfield_extract_uint :: proc "contextless" (value: uint, offset, bits: uint) -> uint {…}

    bitfield_insert_i128 ¶

    bitfield_insert_i128 :: proc "contextless" (base, insert: i128, offset, bits: uint) -> i128 {…}

    bitfield_insert_i16 ¶

    bitfield_insert_i16 :: proc "contextless" (base, insert: i16, offset, bits: uint) -> i16 {…}

    bitfield_insert_i32 ¶

    bitfield_insert_i32 :: proc "contextless" (base, insert: i32, offset, bits: uint) -> i32 {…}

    bitfield_insert_i64 ¶

    bitfield_insert_i64 :: proc "contextless" (base, insert: i64, offset, bits: uint) -> i64 {…}

    bitfield_insert_i8 ¶

    bitfield_insert_i8 :: proc "contextless" (base, insert: i8, offset, bits: uint) -> i8 {…}

    bitfield_insert_int ¶

    bitfield_insert_int :: proc "contextless" (base, insert: int, offset, bits: uint) -> int {…}

    bitfield_insert_u128 ¶

    bitfield_insert_u128 :: proc "contextless" (base, insert: u128, offset, bits: uint) -> u128 {…}

    bitfield_insert_u16 ¶

    bitfield_insert_u16 :: proc "contextless" (base, insert: u16, offset, bits: uint) -> u16 {…}

    bitfield_insert_u32 ¶

    bitfield_insert_u32 :: proc "contextless" (base, insert: u32, offset, bits: uint) -> u32 {…}

    bitfield_insert_u64 ¶

    bitfield_insert_u64 :: proc "contextless" (base, insert: u64, offset, bits: uint) -> u64 {…}

    bitfield_insert_u8 ¶

    bitfield_insert_u8 :: proc "contextless" (base, insert: u8, offset, bits: uint) -> u8 {…}

    bitfield_insert_uint ¶

    bitfield_insert_uint :: proc "contextless" (base, insert: uint, offset, bits: uint) -> uint {…}

    byte_swap ¶

    byte_swap :: intrinsics.byte_swap

    count_leading_zeros ¶

    count_leading_zeros :: intrinsics.count_leading_zeros

    count_ones ¶

    count_ones :: intrinsics.count_ones

    count_trailing_zeros ¶

    count_trailing_zeros :: intrinsics.count_trailing_zeros

    count_zeros ¶

    count_zeros :: intrinsics.count_zeros

    div_u32 ¶

    div_u32 :: proc(hi, lo, y: u32) -> (quo, rem: u32) {…}

    div_u64 ¶

    div_u64 :: proc(hi, lo, y: u64) -> (quo, rem: u64) {…}

    div_uint ¶

    div_uint :: proc(hi, lo, y: uint) -> (quo, rem: uint) {…}

    from_be_u16 ¶

    from_be_u16 :: proc "contextless" (i: u16) -> u16 {…}

    from_be_u32 ¶

    from_be_u32 :: proc "contextless" (i: u32) -> u32 {…}

    from_be_u64 ¶

    from_be_u64 :: proc "contextless" (i: u64) -> u64 {…}

    from_be_u8 ¶

    from_be_u8 :: proc "contextless" (i: u8) -> u8 {…}

    from_be_uint ¶

    from_be_uint :: proc "contextless" (i: uint) -> uint {…}

    from_le_u16 ¶

    from_le_u16 :: proc "contextless" (i: u16) -> u16 {…}

    from_le_u32 ¶

    from_le_u32 :: proc "contextless" (i: u32) -> u32 {…}

    from_le_u64 ¶

    from_le_u64 :: proc "contextless" (i: u64) -> u64 {…}

    from_le_u8 ¶

    from_le_u8 :: proc "contextless" (i: u8) -> u8 {…}

    from_le_uint ¶

    from_le_uint :: proc "contextless" (i: uint) -> uint {…}

    is_power_of_two_i16 ¶

    is_power_of_two_i16 :: proc "contextless" (i: i16) -> bool {…}

    is_power_of_two_i32 ¶

    is_power_of_two_i32 :: proc "contextless" (i: i32) -> bool {…}

    is_power_of_two_i64 ¶

    is_power_of_two_i64 :: proc "contextless" (i: i64) -> bool {…}

    is_power_of_two_i8 ¶

    is_power_of_two_i8 :: proc "contextless" (i: i8) -> bool {…}

    is_power_of_two_int ¶

    is_power_of_two_int :: proc "contextless" (i: int) -> bool {…}

    is_power_of_two_u16 ¶

    is_power_of_two_u16 :: proc "contextless" (i: u16) -> bool {…}

    is_power_of_two_u32 ¶

    is_power_of_two_u32 :: proc "contextless" (i: u32) -> bool {…}

    is_power_of_two_u64 ¶

    is_power_of_two_u64 :: proc "contextless" (i: u64) -> bool {…}

    is_power_of_two_u8 ¶

    is_power_of_two_u8 :: proc "contextless" (i: u8) -> bool {…}

    is_power_of_two_uint ¶

    is_power_of_two_uint :: proc "contextless" (i: uint) -> bool {…}

    leading_zeros ¶

    leading_zeros :: intrinsics.count_leading_zeros

    len_u16 ¶

    len_u16 :: proc "contextless" (x: u16) -> (n: int) {…}

    len_u32 ¶

    len_u32 :: proc "contextless" (x: u32) -> (n: int) {…}

    len_u64 ¶

    len_u64 :: proc "contextless" (x: u64) -> (n: int) {…}

    len_u8 ¶

    len_u8 :: proc "contextless" (x: u8) -> int {…}

    len_uint ¶

    len_uint :: proc "contextless" (x: uint) -> (n: int) {…}

    log2 ¶

    log2 :: proc "contextless" (x: $T) -> $T {…}

    mul_u32 ¶

    mul_u32 :: proc "contextless" (x, y: u32) -> (hi, lo: u32) {…}

    mul_u64 ¶

    mul_u64 :: proc "contextless" (x, y: u64) -> (hi, lo: u64) {…}

    mul_uint ¶

    mul_uint :: proc "contextless" (x, y: uint) -> (hi, lo: uint) {…}

    overflowing_add ¶

    overflowing_add :: intrinsics.overflow_add

    overflowing_mul ¶

    overflowing_mul :: intrinsics.overflow_mul

    overflowing_sub ¶

    overflowing_sub :: intrinsics.overflow_sub

    reverse_bits ¶

    reverse_bits :: intrinsics.reverse_bits

    rotate_left ¶

    rotate_left :: proc "contextless" (x: uint, k: int) -> uint {…}

    rotate_left16 ¶

    rotate_left16 :: proc "contextless" (x: u16, k: int) -> u16 {…}

    rotate_left32 ¶

    rotate_left32 :: proc "contextless" (x: u32, k: int) -> u32 {…}

    rotate_left64 ¶

    rotate_left64 :: proc "contextless" (x: u64, k: int) -> u64 {…}

    rotate_left8 ¶

    rotate_left8 :: proc "contextless" (x: u8, k: int) -> u8 {…}

    sub_u32 ¶

    sub_u32 :: proc "contextless" (x, y, borrow: u32) -> (diff, borrow_out: u32) {…}

    sub_u64 ¶

    sub_u64 :: proc "contextless" (x, y, borrow: u64) -> (diff, borrow_out: u64) {…}

    sub_uint ¶

    sub_uint :: proc "contextless" (x, y, borrow: uint) -> (diff, borrow_out: uint) {…}

    to_be_u16 ¶

    to_be_u16 :: proc "contextless" (i: u16) -> u16 {…}

    to_be_u32 ¶

    to_be_u32 :: proc "contextless" (i: u32) -> u32 {…}

    to_be_u64 ¶

    to_be_u64 :: proc "contextless" (i: u64) -> u64 {…}

    to_be_u8 ¶

    to_be_u8 :: proc "contextless" (i: u8) -> u8 {…}

    to_be_uint ¶

    to_be_uint :: proc "contextless" (i: uint) -> uint {…}

    to_le_u16 ¶

    to_le_u16 :: proc "contextless" (i: u16) -> u16 {…}

    to_le_u32 ¶

    to_le_u32 :: proc "contextless" (i: u32) -> u32 {…}

    to_le_u64 ¶

    to_le_u64 :: proc "contextless" (i: u64) -> u64 {…}

    to_le_u8 ¶

    to_le_u8 :: proc "contextless" (i: u8) -> u8 {…}

    to_le_uint ¶

    to_le_uint :: proc "contextless" (i: uint) -> uint {…}

    trailing_zeros ¶

    trailing_zeros :: intrinsics.count_trailing_zeros

    Procedure Groups

    len ¶

    len :: proc{
    	len_u8,
    	len_u16,
    	len_u32,
    	len_u64,
    	len_uint,
    }
    
     

    returns the minimum number of bits required to represent x

    Source Files

    Generation Information

    Generated with odin version dev-2024-12 (vendor "odin") Windows_amd64 @ 2024-12-17 21:11:01.035075000 +0000 UTC