Skip to main content

internal.types.int

Standard library Module View source
class Int
@extend
class Int[N]
Constructors 5
__new__
__new__() -> Int[N]
__new__
@overload
__new__[M: Literal[int]](what: Int[M], /) -> Int[N]
__new__
@overload
__new__[M: Literal[int]](what: UInt[M], /) -> Int[N]
__new__
@overload
__new__(what: str, /, base: int) -> Int[N]
__new__
@overload
__new__(what, /) -> Int[N]
Properties 2
real
@property
real(self: Self) -> Int[N]
imag
@property
imag(self: Self) -> Int[N]
Methods 4
cdiv
cdiv(self: Self, other: Int[N]) -> Int[N]
cmod
cmod(self: Self, other: Int[N]) -> Int[N]
popcnt
popcnt(self: Self) -> int
bit_length
bit_length(self: Self, /) -> int
Special methods 42
__int__
__int__(self: Self, /) -> int
__index__
__index__(self: Self, /) -> int
__copy__
__copy__(self: Self) -> Int[N]
__deepcopy__
__deepcopy__(self: Self) -> Int[N]
__hash__
__hash__(self: Self, /) -> int
__float__
@pure @llvm
__float__(self: Self, /) -> float
%0 = sitofp i{=N} %self to double
ret double %0
__bool__
@pure @llvm
__bool__(self: Self, /) -> bool
%0 = icmp ne i{=N} %self, 0
%1 = zext i1 %0 to i8
ret i8 %1
__pos__
__pos__(self: Self, /) -> Int[N]
__neg__
@pure @llvm
__neg__(self: Self, /) -> Int[N]
%0 = sub i{=N} 0, %self
ret i{=N} %0
__invert__
@pure @llvm
__invert__(self: Self, /) -> Int[N]
%0 = xor i{=N} %self, -1
ret i{=N} %0
__abs__
@pure @llvm
__abs__(self: Self, /) -> Int[N]
declare i{=N} @llvm.abs.i{=N}(i{=N}, i1)
%0 = call i{=N} @llvm.abs.i{=N}(i{=N} %self, i1 false)
ret i{=N} %0
__add__
@pure @commutative @associative @llvm
__add__(self: Self, other: Int[N], /) -> Int[N]
%0 = add i{=N} %self, %other
ret i{=N} %0
__sub__
@pure @llvm
__sub__(self: Self, other: Int[N], /) -> Int[N]
%0 = sub i{=N} %self, %other
ret i{=N} %0
__mul__
@pure @commutative @associative @distributive @llvm
__mul__(self: Self, other: Int[N], /) -> Int[N]
%0 = mul i{=N} %self, %other
ret i{=N} %0
__floordiv__
__floordiv__(self: Self, other: Int[N], /) -> Int[N]
__truediv__
__truediv__(self: Self, other: Int[N], /) -> float
__mod__
__mod__(self: Self, other: Int[N], /) -> Int[N]
__divmod__
__divmod__(self: Self, other: Int[N], /) -> Tuple[(Int[N], Int[N])]
__lshift__
__lshift__(self: Self, other: Int[N], /) -> Int[N]
__lshift__(self: Self, other: int, /) -> Int[N]
__rshift__
__rshift__(self: Self, other: Int[N], /) -> Int[N]
__rshift__(self: Self, other: int, /) -> Int[N]
__eq__
@pure @llvm
__eq__(self: Self, other: Int[N], /) -> bool
%0 = icmp eq i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__ne__
@pure @llvm
__ne__(self: Self, other: Int[N], /) -> bool
%0 = icmp ne i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__lt__
@pure @llvm
__lt__(self: Self, other: Int[N], /) -> bool
%0 = icmp slt i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__gt__
@pure @llvm
__gt__(self: Self, other: Int[N], /) -> bool
%0 = icmp sgt i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__le__
@pure @llvm
__le__(self: Self, other: Int[N], /) -> bool
%0 = icmp sle i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__ge__
@pure @llvm
__ge__(self: Self, other: Int[N], /) -> bool
%0 = icmp sge i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__and__
@pure @commutative @associative @llvm
__and__(self: Self, other: Int[N], /) -> Int[N]
%0 = and i{=N} %self, %other
ret i{=N} %0
__or__
@pure @commutative @associative @llvm
__or__(self: Self, other: Int[N], /) -> Int[N]
%0 = or i{=N} %self, %other
ret i{=N} %0
__xor__
@pure @commutative @associative @llvm
__xor__(self: Self, other: Int[N], /) -> Int[N]
%0 = xor i{=N} %self, %other
ret i{=N} %0
__pow__
__pow__(self: Self, exp: Int[N], /) -> Int[N]
__pow__[exp: Literal[int]](self: Self, /)
__repr__
__repr__(self: Self, /) -> str
__match__
__match__(self: Self, obj: Int[N]) -> bool
__round__
__round__(self: Self, ndigits = None, /) -> Int[N]
__atomic_xchg__
@nocapture @llvm
__atomic_xchg__(d: Ptr[Int[N]], b: Int[N]) -> Int[N]
%tmp = atomicrmw xchg ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_add__
@nocapture @llvm
__atomic_add__(d: Ptr[Int[N]], b: Int[N]) -> Int[N]
%tmp = atomicrmw add ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_sub__
@nocapture @llvm
__atomic_sub__(d: Ptr[Int[N]], b: Int[N]) -> Int[N]
%tmp = atomicrmw sub ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_and__
@nocapture @llvm
__atomic_and__(d: Ptr[Int[N]], b: Int[N]) -> Int[N]
%tmp = atomicrmw and ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_nand__
@nocapture @llvm
__atomic_nand__(d: Ptr[Int[N]], b: Int[N]) -> Int[N]
%tmp = atomicrmw nand ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_or__
@nocapture @llvm
__atomic_or__(d: Ptr[Int[N]], b: Int[N]) -> Int[N]
%tmp = atomicrmw or ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_xor__
@nocapture @llvm
__atomic_xor__(d: Ptr[Int[N]], b: Int[N]) -> Int[N]
%tmp = atomicrmw xor ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_min__
@nocapture @llvm
__atomic_min__(d: Ptr[Int[N]], b: Int[N]) -> Int[N]
%tmp = atomicrmw min ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_max__
@nocapture @llvm
__atomic_max__(d: Ptr[Int[N]], b: Int[N]) -> Int[N]
%tmp = atomicrmw max ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
class UInt
@extend
class UInt[N]
Constructors 4
__new__
__new__() -> UInt[N]
__new__
@overload
__new__[M: Literal[int]](what: UInt[M]) -> UInt[N]
__new__
@overload
__new__[M: Literal[int]](what: Int[M]) -> UInt[N]
__new__
__new__(what: str, base: int = 10) -> UInt[N]
Properties 2
real
@property
real(self: Self) -> UInt[N]
imag
@property
imag(self: Self) -> UInt[N]
Methods 4
cdiv
cdiv(self: Self, other: UInt[N]) -> UInt[N]
cmod
cmod(self: Self, other: UInt[N]) -> UInt[N]
popcnt
popcnt(self: Self) -> int
bit_length
bit_length(self: Self) -> int
Special methods 42
__int__
__int__(self: Self) -> int
__index__
__index__(self: Self) -> int
__copy__
__copy__(self: Self) -> UInt[N]
__deepcopy__
__deepcopy__(self: Self) -> UInt[N]
__hash__
__hash__(self: Self) -> int
__float__
@pure @llvm
__float__(self: Self) -> float
%0 = uitofp i{=N} %self to double
ret double %0
__bool__
@pure @llvm
__bool__(self: Self) -> bool
%0 = icmp ne i{=N} %self, 0
%1 = zext i1 %0 to i8
ret i8 %1
__pos__
__pos__(self: Self) -> UInt[N]
__neg__
@pure @llvm
__neg__(self: Self) -> UInt[N]
%0 = sub i{=N} 0, %self
ret i{=N} %0
__invert__
@pure @llvm
__invert__(self: Self) -> UInt[N]
%0 = xor i{=N} %self, -1
ret i{=N} %0
__abs__
__abs__(self: Self) -> UInt[N]
__add__
@pure @commutative @associative @llvm
__add__(self: Self, other: UInt[N]) -> UInt[N]
%0 = add i{=N} %self, %other
ret i{=N} %0
__sub__
@pure @llvm
__sub__(self: Self, other: UInt[N]) -> UInt[N]
%0 = sub i{=N} %self, %other
ret i{=N} %0
__mul__
@pure @commutative @associative @distributive @llvm
__mul__(self: Self, other: UInt[N]) -> UInt[N]
%0 = mul i{=N} %self, %other
ret i{=N} %0
__floordiv__
__floordiv__(self: Self, other: UInt[N]) -> UInt[N]
__truediv__
__truediv__(self: Self, other: UInt[N]) -> float
__mod__
__mod__(self: Self, other: UInt[N]) -> UInt[N]
__divmod__
__divmod__(self: Self, other: UInt[N]) -> Tuple[(UInt[N], UInt[N])]
__lshift__
__lshift__(self: Self, other: UInt[N]) -> UInt[N]
__lshift__(self: Self, other: int) -> UInt[N]
__rshift__
__rshift__(self: Self, other: UInt[N]) -> UInt[N]
__rshift__(self: Self, other: int) -> UInt[N]
__eq__
@pure @llvm
__eq__(self: Self, other: UInt[N]) -> bool
%0 = icmp eq i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__ne__
@pure @llvm
__ne__(self: Self, other: UInt[N]) -> bool
%0 = icmp ne i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__lt__
@pure @llvm
__lt__(self: Self, other: UInt[N]) -> bool
%0 = icmp ult i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__gt__
@pure @llvm
__gt__(self: Self, other: UInt[N]) -> bool
%0 = icmp ugt i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__le__
@pure @llvm
__le__(self: Self, other: UInt[N]) -> bool
%0 = icmp ule i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__ge__
@pure @llvm
__ge__(self: Self, other: UInt[N]) -> bool
%0 = icmp uge i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__and__
@pure @commutative @associative @llvm
__and__(self: Self, other: UInt[N]) -> UInt[N]
%0 = and i{=N} %self, %other
ret i{=N} %0
__or__
@pure @commutative @associative @llvm
__or__(self: Self, other: UInt[N]) -> UInt[N]
%0 = or i{=N} %self, %other
ret i{=N} %0
__xor__
@pure @commutative @associative @llvm
__xor__(self: Self, other: UInt[N]) -> UInt[N]
%0 = xor i{=N} %self, %other
ret i{=N} %0
__pow__
__pow__(self: Self, exp: UInt[N]) -> UInt[N]
__pow__[exp: Literal[int]](self: Self)
__repr__
__repr__(self: Self) -> str
__match__
__match__(self: Self, obj: UInt[N]) -> bool
__round__
__round__(self: Self, ndigits = None) -> UInt[N]
__atomic_xchg__
@nocapture @llvm
__atomic_xchg__(d: Ptr[UInt[N]], b: UInt[N]) -> UInt[N]
%tmp = atomicrmw xchg ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_add__
@nocapture @llvm
__atomic_add__(d: Ptr[UInt[N]], b: UInt[N]) -> UInt[N]
%tmp = atomicrmw add ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_sub__
@nocapture @llvm
__atomic_sub__(d: Ptr[UInt[N]], b: UInt[N]) -> UInt[N]
%tmp = atomicrmw sub ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_and__
@nocapture @llvm
__atomic_and__(d: Ptr[UInt[N]], b: UInt[N]) -> UInt[N]
%tmp = atomicrmw and ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_nand__
@nocapture @llvm
__atomic_nand__(d: Ptr[UInt[N]], b: UInt[N]) -> UInt[N]
%tmp = atomicrmw nand ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_or__
@nocapture @llvm
__atomic_or__(d: Ptr[UInt[N]], b: UInt[N]) -> UInt[N]
%tmp = atomicrmw or ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_xor__
@nocapture @llvm
__atomic_xor__(d: Ptr[UInt[N]], b: UInt[N]) -> UInt[N]
%tmp = atomicrmw xor ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_min__
@nocapture @llvm
__atomic_min__(d: Ptr[UInt[N]], b: UInt[N]) -> UInt[N]
%tmp = atomicrmw umin ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp
__atomic_max__
@nocapture @llvm
__atomic_max__(d: Ptr[UInt[N]], b: UInt[N]) -> UInt[N]
%tmp = atomicrmw umax ptr %d, i{=N} %b seq_cst
ret i{=N} %tmp