abla/int128

Generated from source.

Import with import "abla/int128".

Source: abla/int128/entry.ab

ablaI128NativeMul (extern)

noescape extern:"intrinsic" fun ablaI128NativeMul(): bool

Returns whether the target supports the wide multiply without a runtime helper.

ablaI128_fromU64 (extern)

noescape extern:"intrinsic" fun ablaI128_fromU64(value: u64): int128

Zero-extends an unsigned 64-bit integer to 128 bits.

ablaI128_fromI64 (extern)

noescape extern:"intrinsic" fun ablaI128_fromI64(value: i64): int128

Sign-extends a signed 64-bit integer to 128 bits.

ablaI128_toU64 (extern)

noescape extern:"intrinsic" fun ablaI128_toU64(value: int128): u64

Returns the low 64 bits of the input.

ablaI128_not (extern)

noescape extern:"intrinsic" fun ablaI128_not(value: int128): int128

Returns the input with every bit flipped.

ablaI128_add (extern)

noescape extern:"intrinsic" fun ablaI128_add(a: int128, b: int128): int128

Returns the sum modulo 2^128.

ablaI128_sub (extern)

noescape extern:"intrinsic" fun ablaI128_sub(a: int128, b: int128): int128

Returns the difference modulo 2^128.

ablaI128_mul (extern)

noescape extern:"intrinsic" fun ablaI128_mul(a: int128, b: int128): int128

Returns the product modulo 2^128.

ablaI128_udiv (extern)

noescape extern:"intrinsic" fun ablaI128_udiv(a: int128, b: int128): int128

Returns the unsigned quotient for a nonzero divisor.

ablaI128_urem (extern)

noescape extern:"intrinsic" fun ablaI128_urem(a: int128, b: int128): int128

Returns the unsigned remainder for a nonzero divisor.

ablaI128_sdiv (extern)

noescape extern:"intrinsic" fun ablaI128_sdiv(a: int128, b: int128): int128

Returns the signed quotient truncated toward zero when the divisor is nonzero and the quotient is representable.

ablaI128_srem (extern)

noescape extern:"intrinsic" fun ablaI128_srem(a: int128, b: int128): int128

Returns the signed remainder for a nonzero divisor when the signed division quotient is representable.

ablaI128_and (extern)

noescape extern:"intrinsic" fun ablaI128_and(a: int128, b: int128): int128

Returns the bitwise AND of the operands.

ablaI128_or (extern)

noescape extern:"intrinsic" fun ablaI128_or(a: int128, b: int128): int128

Returns the bitwise OR of the operands.

ablaI128_xor (extern)

noescape extern:"intrinsic" fun ablaI128_xor(a: int128, b: int128): int128

Returns the bitwise XOR of the operands.

ablaI128_shl (extern)

noescape extern:"intrinsic" fun ablaI128_shl(a: int128, count: u32): int128

Returns the bit pattern shifted left by a count below 128.

ablaI128_lshr (extern)

noescape extern:"intrinsic" fun ablaI128_lshr(a: int128, count: u32): int128

Returns the bit pattern shifted right with zero fill by a count below 128.

ablaI128_ashr (extern)

noescape extern:"intrinsic" fun ablaI128_ashr(a: int128, count: u32): int128

Returns the bit pattern shifted right with sign extension by a count below 128.

ablaI128_eq (extern)

noescape extern:"intrinsic" fun ablaI128_eq(a: int128, b: int128): bool

Returns whether the two bit patterns are equal.

ablaI128_lt (extern)

noescape extern:"intrinsic" fun ablaI128_lt(a: int128, b: int128): bool

Returns whether the first bit pattern is smaller when both are interpreted as unsigned.

ablaI128_slt (extern)

noescape extern:"intrinsic" fun ablaI128_slt(a: int128, b: int128): bool

Returns whether the first value is smaller when both are interpreted as signed.

ablaI128NarrowTarget (extern)

noescape extern:"intrinsic" fun ablaI128NarrowTarget(): bool

Returns whether the target uses 32-bit pointers outside WebAssembly.

int128 (fun)

@inline fun int128(value: int): int128

As every widening: a signed source extends its sign, an unsigned one its zeros.

int128 (fun)

@inline fun int128(value: i32): int128

As every widening: a signed source extends its sign, an unsigned one its zeros.

int128 (fun)

@inline fun int128(value: i16): int128

As every widening: a signed source extends its sign, an unsigned one its zeros.

int128 (fun)

@inline fun int128(value: i8): int128

As every widening: a signed source extends its sign, an unsigned one its zeros.

int128 (fun)

@inline fun int128(value: u64): int128

As every widening: a signed source extends its sign, an unsigned one its zeros.

int128 (fun)

@inline fun int128(value: u32): int128

As every widening: a signed source extends its sign, an unsigned one its zeros.

int128 (fun)

@inline fun int128(value: u16): int128

As every widening: a signed source extends its sign, an unsigned one its zeros.

int128 (fun)

@inline fun int128(value: u8): int128

As every widening: a signed source extends its sign, an unsigned one its zeros.

int128Words (fun)

fun int128Words(w3: u32, w2: u32, w1: u32, w0: u32): int128

Four words of its two's complement, most significant first: how to write a constant that doesn't fit an int.

int128Max (fun)

fun int128Max(): int128

2^127 - 1.

int128Min (fun)

fun int128Min(): int128

-2^127.

int128Equal (fun)

@inline fun int128Equal(a: int128, b: int128): bool

What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".

int128NotEqual (fun)

@inline fun int128NotEqual(a: int128, b: int128): bool

What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".

int128Less (fun)

@inline fun int128Less(a: int128, b: int128): bool

What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".

int128LessEqual (fun)

@inline fun int128LessEqual(a: int128, b: int128): bool

What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".

int128Greater (fun)

@inline fun int128Greater(a: int128, b: int128): bool

What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".

int128GreaterEqual (fun)

@inline fun int128GreaterEqual(a: int128, b: int128): bool

What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".

int128Text (fun)

fun int128Text(value: int128): string

What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".

int128.plus (extension fun)

@inline operator fun int128.plus(other: int128): int128

Returns the sum modulo 2^128.

int128.minus (extension fun)

@inline operator fun int128.minus(other: int128): int128

Returns the difference modulo 2^128.

int128.unaryMinus (extension fun)

@inline operator fun int128.unaryMinus(): int128

Returns the additive inverse modulo 2^128.

int128.and (extension fun)

@inline operator fun int128.and(other: int128): int128

Returns the bitwise AND of the operands.

int128.or (extension fun)

@inline operator fun int128.or(other: int128): int128

Returns the bitwise OR of the operands.

int128.xor (extension fun)

@inline operator fun int128.xor(other: int128): int128

Returns the bitwise XOR of the operands.

int128.inv (extension fun)

@inline operator fun int128.inv(): int128

Returns the input with every bit flipped.

int128.times (extension fun)

@inline operator fun int128.times(other: int128): int128

Returns the product modulo 2^128.

int128.div (extension fun)

@inline operator fun int128.div(other: int128): int128

Returns the signed quotient truncated toward zero, wrapping the minimum value divided by -1 and panicking for zero.

int128.rem (extension fun)

@inline operator fun int128.rem(other: int128): int128

Returns the remainder with the dividend's sign when nonzero and panics for a zero divisor.

int128ShiftLeft (fun)

fun int128ShiftLeft(value: int128, count: int): int128

As every width's: a count that's negative or at least the width gives zero.

int128ShiftRight (fun)

fun int128ShiftRight(value: int128, count: int): int128

Returns the value shifted right with sign extension, or zero for a count outside 0 through 127.

int128UnsignedShiftRight (fun)

fun int128UnsignedShiftRight(value: int128, count: int): int128

Returns the value shifted right with zero fill, or zero for a count outside 0 through 127.

int128.shl (extension fun)

@inline operator fun int128.shl(count: int): int128

Returns the value shifted left, or zero for a count outside 0 through 127.

int128.shr (extension fun)

@inline operator fun int128.shr(count: int): int128

Returns the value shifted right with sign extension, or zero for a count outside 0 through 127.

int128.shl (extension fun)

@inline operator fun int128.shl(count: i32): int128

Returns the value shifted left, or zero for a count outside 0 through 127.

int128.shr (extension fun)

@inline operator fun int128.shr(count: i32): int128

Returns the value shifted right with sign extension, or zero for a count outside 0 through 127.

int128.shl (extension fun)

@inline operator fun int128.shl(count: i16): int128

Returns the value shifted left, or zero for a count outside 0 through 127.

int128.shr (extension fun)

@inline operator fun int128.shr(count: i16): int128

Returns the value shifted right with sign extension, or zero for a count outside 0 through 127.

int128.shl (extension fun)

@inline operator fun int128.shl(count: i8): int128

Returns the value shifted left, or zero for a count outside 0 through 127.

int128.shr (extension fun)

@inline operator fun int128.shr(count: i8): int128

Returns the value shifted right with sign extension, or zero for a count outside 0 through 127.

int128.shl (extension fun)

@inline operator fun int128.shl(count: u64): int128

Returns the value shifted left, or zero for a count outside 0 through 127.

int128.shr (extension fun)

@inline operator fun int128.shr(count: u64): int128

Returns the value shifted right with sign extension, or zero for a count outside 0 through 127.

int128.shl (extension fun)

@inline operator fun int128.shl(count: u32): int128

Returns the value shifted left, or zero for a count outside 0 through 127.

int128.shr (extension fun)

@inline operator fun int128.shr(count: u32): int128

Returns the value shifted right with sign extension, or zero for a count outside 0 through 127.

int128.shl (extension fun)

@inline operator fun int128.shl(count: u16): int128

Returns the value shifted left, or zero for a count outside 0 through 127.

int128.shr (extension fun)

@inline operator fun int128.shr(count: u16): int128

Returns the value shifted right with sign extension, or zero for a count outside 0 through 127.

int128.shl (extension fun)

@inline operator fun int128.shl(count: u8): int128

Returns the value shifted left, or zero for a count outside 0 through 127.

int128.shr (extension fun)

@inline operator fun int128.shr(count: u8): int128

Returns the value shifted right with sign extension, or zero for a count outside 0 through 127.

int128.ushr (extension fun)

@inline fun int128.ushr(count: int): int128

>>>: logical, zeros shifted in whatever the sign.

int128.isZero (extension fun)

@inline fun int128.isZero(): bool

Returns whether the value equals zero.

int128.isNegative (extension fun)

@inline fun int128.isNegative(): bool

Returns whether the value is below zero.

int128.signum (extension fun)

fun int128.signum(): int

-1, 0 or 1.

int128.abs (extension fun)

fun int128.abs(): int128

The magnitude; the smallest value has none that fits, and stays itself.

int128.bit (extension fun)

fun int128.bit(index: int): bool

Bit index of its two's complement, the least significant being 0; beyond the width, the sign.

int128.addChecked (extension fun)

fun int128.addChecked(other: int128): int128?

The sum, or null if it doesn't fit.

int128.subChecked (extension fun)

fun int128.subChecked(other: int128): int128?

The difference, or null if it doesn't fit.

int128.mulChecked (extension fun)

fun int128.mulChecked(other: int128): int128?

The product, or null if it doesn't fit.

int128.toU64 (extension fun)

@inline fun int128.toU64(): u64

Narrowing as every width's does: keeps the low bits.

int128.toInt (extension fun)

@inline fun int128.toInt(): int

Narrowing as every width's does: keeps the low bits.

int128.toI32 (extension fun)

@inline fun int128.toI32(): i32

Narrowing as every width's does: keeps the low bits.

int128.toU32 (extension fun)

@inline fun int128.toU32(): u32

Narrowing as every width's does: keeps the low bits.

int128.toU16 (extension fun)

@inline fun int128.toU16(): u16

Narrowing as every width's does: keeps the low bits.

int128.toU8 (extension fun)

@inline fun int128.toU8(): u8

Narrowing as every width's does: keeps the low bits.

int128.toIntOrNull (extension fun)

fun int128.toIntOrNull(): int?

Or null if it doesn't fit.

int128.toI32OrNull (extension fun)

fun int128.toI32OrNull(): i32?

Returns the value as i32, or null if it cannot be represented.

int128.toU64OrNull (extension fun)

fun int128.toU64OrNull(): u64?

Returns the value as u64, or null if it cannot be represented.

int128.toU32OrNull (extension fun)

fun int128.toU32OrNull(): u32?

Returns the value as u32, or null if it cannot be represented.

int128.toU16OrNull (extension fun)

fun int128.toU16OrNull(): u16?

Returns the value as u16, or null if it cannot be represented.

int128.toU8OrNull (extension fun)

fun int128.toU8OrNull(): u8?

Returns the value as u8, or null if it cannot be represented.

int128.toDecimal (extension fun)

fun int128.toDecimal(): string

In decimal, as "$x" writes it: a minus for a negative one.

int128.toHex (extension fun)

fun int128.toHex(): string

In hex with 0x, in lower case, no leading zeros, a minus before the 0x for a negative one.

int128FromDecimal (fun)

fun int128FromDecimal(text: string): int128?

Digits with an optional leading minus (no plus, space or point); leading zeros are allowed. Null if it isn't that, or doesn't fit.

int128FromHex (fun)

fun int128FromHex(text: string): int128?

With or without 0x, in either case, after an optional minus. Null with no digits, on anything else, or if it doesn't fit.

int128.toBytes (extension fun)

fun int128.toBytes(): string

16 bytes, big-endian, in two's complement.

int128.toBytesLittleEndian (extension fun)

fun int128.toBytesLittleEndian(): string

16 bytes, little-endian: the least significant byte first.

int128FromBytes (fun)

fun int128FromBytes(bytes: string): int128?

Big-endian bytes, fewer than 16 extending the sign of the first. Null above 16.

int128FromBytesLittleEndian (fun)

fun int128FromBytesLittleEndian(bytes: string): int128?

Little-endian bytes, fewer than 16 extending the sign of the last. Null above 16.

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.