float
class float
Constructors
9
__new__[N: Literal[int]](what: Int[N], /) -> float
Added by
internal.ops%0 = sitofp i{=N} %what to double
ret double %0
__new__[N: Literal[int]](what: UInt[N], /) -> float
Added by
internal.ops%0 = uitofp i{=N} %what to double
ret double %0
__new__(what: float32, /) -> float
Added by
internal.ops%0 = fpext float %what to double
ret double %0
__new__(what: float16, /) -> float
Added by
internal.ops%0 = fpext half %what to double
ret double %0
__new__(what: bfloat16, /) -> float
Added by
internal.ops%0 = fpext bfloat %what to double
ret double %0
Properties
2
Methods
2
Special methods
47
__int__(self: Self, /) -> int
Added by
internal.types.float%0 = fptosi double %self to i64
ret i64 %0
__bool__(self: Self, /) -> bool
Added by
internal.types.float%0 = fcmp une double %self, 0.000000e+00
%1 = zext i1 %0 to i8
ret i8 %1
__add__(a: float, b: float, /) -> float
Added by
internal.types.float%tmp = fadd double %a, %b
ret double %tmp
__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: bfloat16, /)
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__(a: float, b: float, /) -> float
Added by
internal.types.float%tmp = fsub double %a, %b
ret double %tmp
__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: bfloat16, /)
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__(a: float, b: float, /) -> float
Added by
internal.types.float%tmp = fmul double %a, %b
ret double %tmp
__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: bfloat16, /)
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__(self: Self, other: float, /) -> float
Added by
internal.types.float__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: bfloat16, /)
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__(self: Self, other: float, /) -> float
Added by
internal.types.float__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: bfloat16, /)
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__(self: Self, other: float, /) -> float
Added by
internal.types.float__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: bfloat16, /)
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__(self: Self, other: float, /) -> Tuple[(float, float)]
Added by
internal.types.float__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: bfloat16, /)
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__(a: float, b: float, /) -> bool
Added by
internal.types.float%tmp = fcmp oeq double %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__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: bfloat16, /)
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__(a: float, b: float, /) -> bool
Added by
internal.types.float%tmp = fcmp une double %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__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: bfloat16, /)
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__(a: float, b: float, /) -> bool
Added by
internal.types.float%tmp = fcmp olt double %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__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: bfloat16, /)
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__(a: float, b: float, /) -> bool
Added by
internal.types.float%tmp = fcmp ogt double %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__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: bfloat16, /)
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__(a: float, b: float, /) -> bool
Added by
internal.types.float%tmp = fcmp ole double %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__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: bfloat16, /)
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__(a: float, b: float, /) -> bool
Added by
internal.types.float%tmp = fcmp oge double %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__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: bfloat16, /)
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__(a: float, /) -> float
Added by
internal.types.floatdeclare double @llvm.fabs.f64(double %a)
%tmp = call double @llvm.fabs.f64(double %a)
ret double %tmp
__floor__(a: float, /) -> float
Added by
internal.types.floatdeclare double @llvm.floor.f64(double %a)
%tmp = call double @llvm.floor.f64(double %a)
ret double %tmp
__ceil__(a: float, /) -> float
Added by
internal.types.floatdeclare double @llvm.ceil.f64(double %a)
%tmp = call double @llvm.ceil.f64(double %a)
ret double %tmp
__trunc__(a: float, /) -> float
Added by
internal.types.floatdeclare double @llvm.trunc.f64(double %a)
%tmp = call double @llvm.trunc.f64(double %a)
ret double %tmp
__pow__(a: float, b: float, /) -> float
Added by
internal.types.floatdeclare double @llvm.pow.f64(double %a, double %b)
%tmp = call double @llvm.pow.f64(double %a, double %b)
ret double %tmp
__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: bfloat16, /)
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__atomic_xchg__(d: Ptr[float], b: float) -> None
Added by
internal.types.float%tmp = atomicrmw xchg ptr %d, double %b seq_cst
ret {} {}
__atomic_add__(d: Ptr[float], b: float) -> float
Added by
internal.types.float0:
%1 = load atomic i64, ptr %d monotonic, align 8
%2 = bitcast i64 %1 to double
%3 = fadd double %2, %b
%4 = bitcast double %3 to i64
%5 = cmpxchg weak ptr %d, i64 %1, i64 %4 seq_cst monotonic, align 8
%6 = extractvalue { i64, i1 } %5, 1
br i1 %6, label %15, label %7
7: ; preds = %0, %7
%8 = phi { i64, i1 } [ %13, %7 ], [ %5, %0 ]
%9 = extractvalue { i64, i1 } %8, 0
%10 = bitcast i64 %9 to double
%11 = fadd double %10, %b
%12 = bitcast double %11 to i64
%13 = cmpxchg weak ptr %d, i64 %9, i64 %12 seq_cst monotonic, align 8
%14 = extractvalue { i64, i1 } %13, 1
br i1 %14, label %15, label %7
15: ; preds = %7, %0
%16 = phi double [ %2, %0 ], [ %10, %7 ]
ret double %16
__atomic_sub__(d: Ptr[float], b: float) -> float
Added by
internal.types.float0:
%1 = load atomic i64, ptr %d monotonic, align 8
%2 = bitcast i64 %1 to double
%3 = fsub double %2, %b
%4 = bitcast double %3 to i64
%5 = cmpxchg weak ptr %d, i64 %1, i64 %4 seq_cst monotonic, align 8
%6 = extractvalue { i64, i1 } %5, 1
br i1 %6, label %15, label %7
7: ; preds = %0, %7
%8 = phi { i64, i1 } [ %13, %7 ], [ %5, %0 ]
%9 = extractvalue { i64, i1 } %8, 0
%10 = bitcast i64 %9 to double
%11 = fsub double %10, %b
%12 = bitcast double %11 to i64
%13 = cmpxchg weak ptr %d, i64 %9, i64 %12 seq_cst monotonic, align 8
%14 = extractvalue { i64, i1 } %13, 1
br i1 %14, label %15, label %7
15: ; preds = %7, %0
%16 = phi double [ %2, %0 ], [ %10, %7 ]
ret double %16