Skip to main content

bfloat16

Standard library class internal.core.bfloat16 View source
class bfloat16
@tuple
class bfloat16
Constructors 11
__new__
@pure @llvm
__new__(self: float) -> bfloat16
%0 = fptrunc double %self to bfloat
ret bfloat %0
__new__
@overload
__new__(what: bfloat16) -> bfloat16
__new__
@overload
__new__(what: str) -> bfloat16
__new__
@overload
__new__() -> bfloat16
__new__
__new__(what) -> bfloat16
Added by internal.ops
__new__
__new__(what: bool) -> bfloat16
Added by internal.ops
__new__
@pure @llvm
__new__[N: Literal[int]](what: Int[N]) -> bfloat16
Added by internal.ops
%0 = sitofp i{=N} %what to bfloat
ret bfloat %0
__new__
@pure @llvm
__new__[N: Literal[int]](what: UInt[N]) -> bfloat16
Added by internal.ops
%0 = uitofp i{=N} %what to bfloat
ret bfloat %0
__new__
@pure @llvm
__new__(what: float128) -> bfloat16
Added by internal.ops
%0 = fptrunc fp128 %what to bfloat
ret bfloat %0
__new__
@pure @llvm
__new__(what: float32) -> bfloat16
Added by internal.ops
%0 = fptrunc float %what to bfloat
ret bfloat %0
__new__
@pure @llvm
__new__(what: float16) -> bfloat16
Added by internal.ops
%0 = fpext float16 %what to float
%1 = fptrunc float %0 to bfloat
ret bfloat %1
Methods 2
cdiv
cdiv(self: Self, other: bfloat16) -> bfloat16
cmod
cmod(self: Self, other: bfloat16) -> bfloat16
Special methods 35
__repr__
__repr__(self: Self) -> str
__format__
__format__(self: Self, format_spec: str) -> str
__copy__
__copy__(self: Self) -> bfloat16
__deepcopy__
__deepcopy__(self: Self) -> bfloat16
__int__
@pure @llvm
__int__(self: Self) -> int
%0 = fptosi bfloat %self to i64
ret i64 %0
__float__
@pure @llvm
__float__(self: Self) -> float
%0 = fpext bfloat %self to double
ret double %0
__bool__
@pure @llvm
__bool__(self: Self) -> bool
%0 = fcmp une bfloat %self, 0.000000e+00
%1 = zext i1 %0 to i8
ret i8 %1
__pos__
__pos__(self: Self) -> bfloat16
__neg__
@pure @llvm
__neg__(self: Self) -> bfloat16
%0 = fneg bfloat %self
ret bfloat %0
__add__
@commutative
@pure @llvm
__add__(a: bfloat16, b: bfloat16) -> bfloat16
%tmp = fadd bfloat %a, %b
ret bfloat %tmp
__add__(self: Self, b: float)
Added by internal.ops
__add__(self: Self, b: float128)
Added by internal.ops
__add__(self: Self, b: float32)
Added by internal.ops
__add__(self: Self, b: float16)
Added by internal.ops
__add__(self: Self, b: Int)
Added by internal.ops
__add__(self: Self, b: UInt)
Added by internal.ops
__add__(self: Self, b: bool)
Added by internal.ops
__sub__
@pure @llvm
__sub__(a: bfloat16, b: bfloat16) -> bfloat16
%tmp = fsub bfloat %a, %b
ret bfloat %tmp
__sub__(self: Self, b: float)
Added by internal.ops
__sub__(self: Self, b: float128)
Added by internal.ops
__sub__(self: Self, b: float32)
Added by internal.ops
__sub__(self: Self, b: float16)
Added by internal.ops
__sub__(self: Self, b: Int)
Added by internal.ops
__sub__(self: Self, b: UInt)
Added by internal.ops
__sub__(self: Self, b: bool)
Added by internal.ops
__mul__
@commutative
@pure @llvm
__mul__(a: bfloat16, b: bfloat16) -> bfloat16
%tmp = fmul bfloat %a, %b
ret bfloat %tmp
__mul__(self: Self, b: float)
Added by internal.ops
__mul__(self: Self, b: float128)
Added by internal.ops
__mul__(self: Self, b: float32)
Added by internal.ops
__mul__(self: Self, b: float16)
Added by internal.ops
__mul__(self: Self, b: Int)
Added by internal.ops
__mul__(self: Self, b: UInt)
Added by internal.ops
__mul__(self: Self, b: bool)
Added by internal.ops
__floordiv__
__floordiv__(self: Self, other: bfloat16) -> bfloat16
__floordiv__(self: Self, b: float)
Added by internal.ops
__floordiv__(self: Self, b: float128)
Added by internal.ops
__floordiv__(self: Self, b: float32)
Added by internal.ops
__floordiv__(self: Self, b: float16)
Added by internal.ops
__floordiv__(self: Self, b: Int)
Added by internal.ops
__floordiv__(self: Self, b: UInt)
Added by internal.ops
__floordiv__(self: Self, b: bool)
Added by internal.ops
__truediv__
__truediv__(self: Self, other: bfloat16) -> bfloat16
__truediv__(self: Self, b: float)
Added by internal.ops
__truediv__(self: Self, b: float128)
Added by internal.ops
__truediv__(self: Self, b: float32)
Added by internal.ops
__truediv__(self: Self, b: float16)
Added by internal.ops
__truediv__(self: Self, b: Int)
Added by internal.ops
__truediv__(self: Self, b: UInt)
Added by internal.ops
__truediv__(self: Self, b: bool)
Added by internal.ops
__mod__
__mod__(self: Self, other: bfloat16) -> bfloat16
__mod__(self: Self, b: float)
Added by internal.ops
__mod__(self: Self, b: float128)
Added by internal.ops
__mod__(self: Self, b: float32)
Added by internal.ops
__mod__(self: Self, b: float16)
Added by internal.ops
__mod__(self: Self, b: Int)
Added by internal.ops
__mod__(self: Self, b: UInt)
Added by internal.ops
__mod__(self: Self, b: bool)
Added by internal.ops
__divmod__
__divmod__(self: Self, other: bfloat16) -> Tuple[(bfloat16, bfloat16)]
__divmod__(self: Self, b: float)
Added by internal.ops
__divmod__(self: Self, b: float128)
Added by internal.ops
__divmod__(self: Self, b: float32)
Added by internal.ops
__divmod__(self: Self, b: float16)
Added by internal.ops
__divmod__(self: Self, b: Int)
Added by internal.ops
__divmod__(self: Self, b: UInt)
Added by internal.ops
__divmod__(self: Self, b: bool)
Added by internal.ops
__eq__
@pure @llvm
__eq__(a: bfloat16, b: bfloat16) -> bool
%tmp = fcmp oeq bfloat %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__eq__(self: Self, b: float)
Added by internal.ops
__eq__(self: Self, b: float128)
Added by internal.ops
__eq__(self: Self, b: float32)
Added by internal.ops
__eq__(self: Self, b: float16)
Added by internal.ops
__eq__(self: Self, b: Int)
Added by internal.ops
__eq__(self: Self, b: UInt)
Added by internal.ops
__eq__(self: Self, b: bool)
Added by internal.ops
__ne__
@pure @llvm
__ne__(a: bfloat16, b: bfloat16) -> bool
%tmp = fcmp une bfloat %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__ne__(self: Self, b: float)
Added by internal.ops
__ne__(self: Self, b: float128)
Added by internal.ops
__ne__(self: Self, b: float32)
Added by internal.ops
__ne__(self: Self, b: float16)
Added by internal.ops
__ne__(self: Self, b: Int)
Added by internal.ops
__ne__(self: Self, b: UInt)
Added by internal.ops
__ne__(self: Self, b: bool)
Added by internal.ops
__lt__
@pure @llvm
__lt__(a: bfloat16, b: bfloat16) -> bool
%tmp = fcmp olt bfloat %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__lt__(self: Self, b: float)
Added by internal.ops
__lt__(self: Self, b: float128)
Added by internal.ops
__lt__(self: Self, b: float32)
Added by internal.ops
__lt__(self: Self, b: float16)
Added by internal.ops
__lt__(self: Self, b: Int)
Added by internal.ops
__lt__(self: Self, b: UInt)
Added by internal.ops
__lt__(self: Self, b: bool)
Added by internal.ops
__gt__
@pure @llvm
__gt__(a: bfloat16, b: bfloat16) -> bool
%tmp = fcmp ogt bfloat %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__gt__(self: Self, b: float)
Added by internal.ops
__gt__(self: Self, b: float128)
Added by internal.ops
__gt__(self: Self, b: float32)
Added by internal.ops
__gt__(self: Self, b: float16)
Added by internal.ops
__gt__(self: Self, b: Int)
Added by internal.ops
__gt__(self: Self, b: UInt)
Added by internal.ops
__gt__(self: Self, b: bool)
Added by internal.ops
__le__
@pure @llvm
__le__(a: bfloat16, b: bfloat16) -> bool
%tmp = fcmp ole bfloat %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__le__(self: Self, b: float)
Added by internal.ops
__le__(self: Self, b: float128)
Added by internal.ops
__le__(self: Self, b: float32)
Added by internal.ops
__le__(self: Self, b: float16)
Added by internal.ops
__le__(self: Self, b: Int)
Added by internal.ops
__le__(self: Self, b: UInt)
Added by internal.ops
__le__(self: Self, b: bool)
Added by internal.ops
__ge__
@pure @llvm
__ge__(a: bfloat16, b: bfloat16) -> bool
%tmp = fcmp oge bfloat %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__ge__(self: Self, b: float)
Added by internal.ops
__ge__(self: Self, b: float128)
Added by internal.ops
__ge__(self: Self, b: float32)
Added by internal.ops
__ge__(self: Self, b: float16)
Added by internal.ops
__ge__(self: Self, b: Int)
Added by internal.ops
__ge__(self: Self, b: UInt)
Added by internal.ops
__ge__(self: Self, b: bool)
Added by internal.ops
__abs__
@pure @llvm
__abs__(a: bfloat16) -> bfloat16
declare bfloat @llvm.fabs.bf16(bfloat %a)
%tmp = call bfloat @llvm.fabs.bf16(bfloat %a)
ret bfloat %tmp
__floor__
@pure @llvm
__floor__(a: bfloat16) -> bfloat16
declare bfloat @llvm.floor.bf16(bfloat %a)
%tmp = call bfloat @llvm.floor.bf16(bfloat %a)
ret bfloat %tmp
__ceil__
@pure @llvm
__ceil__(a: bfloat16) -> bfloat16
declare bfloat @llvm.ceil.bf16(bfloat %a)
%tmp = call bfloat @llvm.ceil.bf16(bfloat %a)
ret bfloat %tmp
__trunc__
@pure @llvm
__trunc__(a: bfloat16) -> bfloat16
declare bfloat @llvm.trunc.bf16(bfloat %a)
%tmp = call bfloat @llvm.trunc.bf16(bfloat %a)
ret bfloat %tmp
__pow__
@pure @llvm
__pow__(a: bfloat16, b: bfloat16) -> bfloat16
declare bfloat @llvm.pow.bf16(bfloat %a, bfloat %b)
%tmp = call bfloat @llvm.pow.bf16(bfloat %a, bfloat %b)
ret bfloat %tmp
__pow__(self: Self, b: float)
Added by internal.ops
__pow__(self: Self, b: float128)
Added by internal.ops
__pow__(self: Self, b: float32)
Added by internal.ops
__pow__(self: Self, b: float16)
Added by internal.ops
__pow__(self: Self, b: Int)
Added by internal.ops
__pow__(self: Self, b: UInt)
Added by internal.ops
__pow__(self: Self, b: bool)
Added by internal.ops
__hash__
__hash__(self: Self) -> int
__match__
__match__(self: Self, obj: bfloat16) -> bool
__complex__
__complex__(self: Self) -> complex
__to_gpu__
__to_gpu__(self: Self, cache: AllocCache)
Added by internal.gpu
__from_gpu__
__from_gpu__(self: Self, other: bfloat16)
Added by internal.gpu
__from_gpu_new__
__from_gpu_new__(other: bfloat16)
Added by internal.gpu
__pickle__
__pickle__(self: Self, jar: Jar)
Added by pickle
__unpickle__
__unpickle__(jar: Jar) -> bfloat16
Added by pickle