simd

Standard library module View source
class Vec
@tuple
class Vec[T, N]
Fields 2
T type
N Literal[int]
Constructors 4
__new__
__new__(x, check: Literal[bool] = True)
__new__
__new__(x: str, offset: int = 0, check: Literal[bool] = True)
__new__
__new__(x: bytes, offset: int = 0, check: Literal[bool] = True)
__new__
__new__(x: List[T], offset: int = 0, check: Literal[bool] = True)
Methods 46
load
load(data: Ptr[T], offset: int = 0, alignment: Literal[int] = 1, mask = NoneType(), passthrough = NoneType())
store
store(self, data: Ptr[T], offset: int = 0, alignment: Literal[int] = 1, mask = NoneType())
gather
gather(data: Ptr[T], indices: Vec[int, N], alignment: Literal[int] = 1, mask = NoneType(), passthrough = NoneType())
scatter
scatter(self, data: Ptr[T], indices: Vec[int, N], alignment: Literal[int] = 1, mask = NoneType())
scatter(self: Vec[T, N])
cast
cast(self, T2: type)
cast_ptr
@pure @llvm
cast_ptr(ptr: Ptr[T], T: type, T2: type)
ret ptr %ptr
extract
extract(self, index: int, check: Literal[bool] = True)
insert
insert(self, index: int, value: T, check: Literal[bool] = True)
shuffle
shuffle(self, indices, other = NoneType(), check: Literal[bool] = True)
interleave
interleave(self, other: Vec[T, N])
lshift
lshift(self, other: Vec[T, N], check: Literal[bool] = True)
lshift(self, other: T, check: Literal[bool] = True)
lshift(self, other: int, check: Literal[bool] = True)
lsh
lsh(self, other: Literal[int])
rshift
rshift(self, other: Vec[T, N], check: Literal[bool] = True)
rshift(self, other: T, check: Literal[bool] = True)
rshift(self, other: int, check: Literal[bool] = True)
rsh
rsh(self, other: Literal[int])
any
any(self)
all
all(self)
count
count(self)
to_bits
to_bits(self)
from_bits
from_bits(bits: UInt[N])
floordiv
floordiv(self, other: Vec[T, N], check: Literal[bool] = True)
floordiv(self, other: T, check: Literal[bool] = True)
mod
mod(self, other: Vec[T, N], check: Literal[bool] = True)
mod(self, other: T, check: Literal[bool] = True)
sqrt
sqrt(self)
log
log(self)
sin
sin(self)
cos
cos(self)
min
min(self, other: Vec[T, N])
min(self, other: T)
min(self)
max
max(self, other: Vec[T, N])
max(self, other: T)
max(self)
mask
mask(self, other: Vec[T, N], mask)
add
add(self, other: Vec[T, N], overflow: Literal[bool] = False)
sub
sub(self, other: Vec[T, N], overflow: Literal[bool] = False)
sum
sum(self)
prod
prod(self)
fma
fma(self, other, addend)
exp
exp(self)
exp2
exp2(self)
log2
log2(self)
log10
log10(self)
floor
floor(self)
ceil
ceil(self)
trunc
trunc(self)
round
round(self)
isnan
isnan(self)
isinf
isinf(self)
isfinite
isfinite(self)
signbit
signbit(self)
bitflip
bitflip(self)
Special methods 35
__copy__
__copy__(self)
__len__
__len__(self)
__neg__
__neg__(self)
__getitem__
__getitem__(self, index: int)
__getitem__(self, n: Literal[int])
__repr__
__repr__(self)
__eq__
__eq__(self, other: Vec[T, N])
__eq__(self, other: T)
__ne__
__ne__(self: Vec[T, N], other: Vec[T, N])
__ne__(self, other: T)
__and__
__and__(self, other: Vec[T, N])
__and__(self, other: T)
__or__
__or__(self, other: Vec[T, N])
__or__(self, other: T)
__xor__
__xor__(self, other: Vec[T, N])
__xor__(self, other: T)
__rand__
__rand__(self, other: T)
__ror__
__ror__(self, other: T)
__rxor__
__rxor__(self, other: T)
__invert__
__invert__(self)
__lshift__
__lshift__(self, other: Vec[T, N])
__lshift__(self, other: T)
__lshift__(self, other: int)
__rlshift__
__rlshift__(self, other: T)
__rshift__
__rshift__(self, other: Vec[T, N])
__rshift__(self, other: T)
__rshift__(self, other: int)
__rrshift__
__rrshift__(self, other: T)
__add__
__add__(self, other: Vec[T, N])
__add__(self, other: T)
__radd__
__radd__(self, other: T)
__sub__
__sub__(self, other: Vec[T, N])
__sub__(self, other: T)
__rsub__
__rsub__(self, other: T)
__mul__
__mul__(self, other: Vec[T, N])
__mul__(self, other: T)
__rmul__
__rmul__(self, other: T)
__truediv__
__truediv__(self, other: Vec[T, N])
__truediv__(self, other: T)
__rtruediv__
__rtruediv__(self, other: T)
__floordiv__
__floordiv__(self, other: Vec[T, N])
__floordiv__(self, other: T)
__rfloordiv__
__rfloordiv__(self, other: T)
__mod__
__mod__(self, other: Vec[T, N])
__mod__(self, other: T)
__rmod__
__rmod__(self, other: T)
__lt__
__lt__(self, other: Vec[T, N])
__lt__(self, other: T)
__le__
__le__(self, other: Vec[T, N])
__le__(self, other: T)
__gt__
__gt__(self, other: Vec[T, N])
__gt__(self, other: T)
__ge__
__ge__(self, other: Vec[T, N])
__ge__(self, other: T)
__abs__
__abs__(self)
class Ptr
@extend
class Ptr[T]
Special methods 2
__getitem__
@pure @derives @llvm
__getitem__(self: Ptr[Vec[S, M]], index: int, S: type, M: Literal[int])
%address = getelementptr <{=M} x {=S}>, ptr %self, i64 %index
%result = load <{=M} x {=S}>, ptr %address, align 1
ret <{=M} x {=S}> %result
__setitem__
@self_captures @llvm
__setitem__(self: Ptr[Vec[S, M]], index: int, what: Vec[S, M], S: type, M: Literal[int])
%address = getelementptr <{=M} x {=S}>, ptr %self, i64 %index
store <{=M} x {=S}> %what, ptr %address, align 1
ret {} zeroinitializer