internal.types.float

Standard library module View source
class float
@extend
class float
Constructors 2
__new__
__new__()
__new__
@overload
__new__(what)
Properties 2
real
@property
real(self)
imag
@property
imag(self)
Methods 2
cdiv
cdiv(self, other: float)
cmod
cmod(self, other: float)
Special methods 32
__repr__
__repr__(self)
__copy__
__copy__(self)
__deepcopy__
__deepcopy__(self)
__int__
@pure @llvm
__int__(self)
%0 = fptosi double %self to i64
ret i64 %0
__float__
__float__(self)
__bool__
@pure @llvm
__bool__(self)
%0 = fcmp une double %self, 0.000000e+00
%1 = zext i1 %0 to i8
ret i8 %1
__pos__
__pos__(self)
__neg__
@pure @llvm
__neg__(self)
%0 = fneg double %self
ret double %0
__add__
@pure @commutative @llvm
__add__(a: float, b: float)
%tmp = fadd double %a, %b
ret double %tmp
__sub__
@pure @llvm
__sub__(a: float, b: float)
%tmp = fsub double %a, %b
ret double %tmp
__mul__
@pure @commutative @llvm
__mul__(a: float, b: float)
%tmp = fmul double %a, %b
ret double %tmp
__floordiv__
__floordiv__(self, other: float)
__truediv__
__truediv__(self, other: float)
__mod__
__mod__(self, other: float)
__divmod__
__divmod__(self, other: float)
__eq__
@pure @llvm
__eq__(a: float, b: float)
%tmp = fcmp oeq double %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__ne__
@pure @llvm
__ne__(a: float, b: float)
%tmp = fcmp une double %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__lt__
@pure @llvm
__lt__(a: float, b: float)
%tmp = fcmp olt double %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__gt__
@pure @llvm
__gt__(a: float, b: float)
%tmp = fcmp ogt double %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__le__
@pure @llvm
__le__(a: float, b: float)
%tmp = fcmp ole double %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__ge__
@pure @llvm
__ge__(a: float, b: float)
%tmp = fcmp oge double %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__abs__
@pure @llvm
__abs__(a: float)
declare double @llvm.fabs.f64(double %a)
%tmp = call double @llvm.fabs.f64(double %a)
ret double %tmp
__floor__
@pure @llvm
__floor__(a: float)
declare double @llvm.floor.f64(double %a)
%tmp = call double @llvm.floor.f64(double %a)
ret double %tmp
__ceil__
@pure @llvm
__ceil__(a: float)
declare double @llvm.ceil.f64(double %a)
%tmp = call double @llvm.ceil.f64(double %a)
ret double %tmp
__trunc__
@pure @llvm
__trunc__(a: float)
declare double @llvm.trunc.f64(double %a)
%tmp = call double @llvm.trunc.f64(double %a)
ret double %tmp
__pow__
@pure @llvm
__pow__(a: float, b: float)
declare double @llvm.pow.f64(double %a, double %b)
%tmp = call double @llvm.pow.f64(double %a, double %b)
ret double %tmp
__round__
__round__(self, ndigits = None)
__atomic_xchg__
@nocapture @llvm
__atomic_xchg__(d: Ptr[float], b: float)
%tmp = atomicrmw xchg ptr %d, double %b seq_cst
ret {} {}
__atomic_add__
@nocapture @llvm
__atomic_add__(d: Ptr[float], b: float)
0:
%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__
@nocapture @llvm
__atomic_sub__(d: Ptr[float], b: float)
0:
%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
__hash__
__hash__(self)
__match__
__match__(self, obj: float)
class float32
@extend
class float32
Constructors 4
__new__
@pure @llvm
__new__(self: float)
%0 = fptrunc double %self to float
ret float %0
__new__
@overload
__new__(what: float32)
__new__
@overload
__new__(what: str)
__new__
@overload
__new__()
Methods 2
cdiv
cdiv(self, other: float32)
cmod
cmod(self, other: float32)
Special methods 32
__repr__
__repr__(self)
__format__
__format__(self, format_spec: str)
__copy__
__copy__(self)
__deepcopy__
__deepcopy__(self)
__int__
@pure @llvm
__int__(self)
%0 = fptosi float %self to i64
ret i64 %0
__float__
@pure @llvm
__float__(self)
%0 = fpext float %self to double
ret double %0
__bool__
@pure @llvm
__bool__(self)
%0 = fcmp une float %self, 0.000000e+00
%1 = zext i1 %0 to i8
ret i8 %1
__pos__
__pos__(self)
__neg__
@pure @llvm
__neg__(self)
%0 = fneg float %self
ret float %0
__add__
@pure @commutative @llvm
__add__(a: float32, b: float32)
%tmp = fadd float %a, %b
ret float %tmp
__sub__
@pure @llvm
__sub__(a: float32, b: float32)
%tmp = fsub float %a, %b
ret float %tmp
__mul__
@pure @commutative @llvm
__mul__(a: float32, b: float32)
%tmp = fmul float %a, %b
ret float %tmp
__floordiv__
__floordiv__(self, other: float32)
__truediv__
__truediv__(self, other: float32)
__mod__
__mod__(self, other: float32)
__divmod__
__divmod__(self, other: float32)
__eq__
@pure @llvm
__eq__(a: float32, b: float32)
%tmp = fcmp oeq float %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__ne__
@pure @llvm
__ne__(a: float32, b: float32)
%tmp = fcmp une float %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__lt__
@pure @llvm
__lt__(a: float32, b: float32)
%tmp = fcmp olt float %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__gt__
@pure @llvm
__gt__(a: float32, b: float32)
%tmp = fcmp ogt float %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__le__
@pure @llvm
__le__(a: float32, b: float32)
%tmp = fcmp ole float %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__ge__
@pure @llvm
__ge__(a: float32, b: float32)
%tmp = fcmp oge float %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__abs__
@pure @llvm
__abs__(a: float32)
declare float @llvm.fabs.f32(float %a)
%tmp = call float @llvm.fabs.f32(float %a)
ret float %tmp
__floor__
@pure @llvm
__floor__(a: float32)
declare float @llvm.floor.f32(float %a)
%tmp = call float @llvm.floor.f32(float %a)
ret float %tmp
__ceil__
@pure @llvm
__ceil__(a: float32)
declare float @llvm.ceil.f32(float %a)
%tmp = call float @llvm.ceil.f32(float %a)
ret float %tmp
__trunc__
@pure @llvm
__trunc__(a: float32)
declare float @llvm.trunc.f32(float %a)
%tmp = call float @llvm.trunc.f32(float %a)
ret float %tmp
__pow__
@pure @llvm
__pow__(a: float32, b: float32)
declare float @llvm.pow.f32(float %a, float %b)
%tmp = call float @llvm.pow.f32(float %a, float %b)
ret float %tmp
__atomic_xchg__
@nocapture @llvm
__atomic_xchg__(d: Ptr[float32], b: float32)
%tmp = atomicrmw xchg ptr %d, float %b seq_cst
ret {} {}
__atomic_add__
@nocapture @llvm
__atomic_add__(d: Ptr[float32], b: float32)
0:
%1 = load atomic i32, ptr %d monotonic, align 4
%2 = bitcast i32 %1 to float
%3 = fadd float %2, %b
%4 = bitcast float %3 to i32
%5 = cmpxchg weak ptr %d, i32 %1, i32 %4 seq_cst monotonic, align 4
%6 = extractvalue { i32, i1 } %5, 1
br i1 %6, label %15, label %7
7:                                                ; preds = %0, %7
%8 = phi { i32, i1 } [ %13, %7 ], [ %5, %0 ]
%9 = extractvalue { i32, i1 } %8, 0
%10 = bitcast i32 %9 to float
%11 = fadd float %10, %b
%12 = bitcast float %11 to i32
%13 = cmpxchg weak ptr %d, i32 %9, i32 %12 seq_cst monotonic, align 4
%14 = extractvalue { i32, i1 } %13, 1
br i1 %14, label %15, label %7
15:                                               ; preds = %7, %0
%16 = phi float [ %2, %0 ], [ %10, %7 ]
ret float %16
__atomic_sub__
@nocapture @llvm
__atomic_sub__(d: Ptr[float32], b: float32)
0:
%1 = load atomic i32, ptr %d monotonic, align 4
%2 = bitcast i32 %1 to float
%3 = fsub float %2, %b
%4 = bitcast float %3 to i32
%5 = cmpxchg weak ptr %d, i32 %1, i32 %4 seq_cst monotonic, align 4
%6 = extractvalue { i32, i1 } %5, 1
br i1 %6, label %15, label %7
7:                                                ; preds = %0, %7
%8 = phi { i32, i1 } [ %13, %7 ], [ %5, %0 ]
%9 = extractvalue { i32, i1 } %8, 0
%10 = bitcast i32 %9 to float
%11 = fsub float %10, %b
%12 = bitcast float %11 to i32
%13 = cmpxchg weak ptr %d, i32 %9, i32 %12 seq_cst monotonic, align 4
%14 = extractvalue { i32, i1 } %13, 1
br i1 %14, label %15, label %7
15:                                               ; preds = %7, %0
%16 = phi float [ %2, %0 ], [ %10, %7 ]
ret float %16
__hash__
__hash__(self)
__match__
__match__(self, obj: float32)
class float16
@extend
class float16
Constructors 4
__new__
@pure @llvm
__new__(self: float)
%0 = fptrunc double %self to half
ret half %0
__new__
@overload
__new__(what: float16)
__new__
@overload
__new__(what: str)
__new__
@overload
__new__()
Methods 2
cdiv
cdiv(self, other: float16)
cmod
cmod(self, other: float16)
Special methods 29
__repr__
__repr__(self)
__format__
__format__(self, format_spec: str)
__copy__
__copy__(self)
__deepcopy__
__deepcopy__(self)
__int__
@pure @llvm
__int__(self)
%0 = fptosi half %self to i64
ret i64 %0
__float__
@pure @llvm
__float__(self)
%0 = fpext half %self to double
ret double %0
__bool__
@pure @llvm
__bool__(self)
%0 = fcmp une half %self, 0.000000e+00
%1 = zext i1 %0 to i8
ret i8 %1
__pos__
__pos__(self)
__neg__
@pure @llvm
__neg__(self)
%0 = fneg half %self
ret half %0
__add__
@pure @commutative @llvm
__add__(a: float16, b: float16)
%tmp = fadd half %a, %b
ret half %tmp
__sub__
@pure @llvm
__sub__(a: float16, b: float16)
%tmp = fsub half %a, %b
ret half %tmp
__mul__
@pure @commutative @llvm
__mul__(a: float16, b: float16)
%tmp = fmul half %a, %b
ret half %tmp
__floordiv__
__floordiv__(self, other: float16)
__truediv__
__truediv__(self, other: float16)
__mod__
__mod__(self, other: float16)
__divmod__
__divmod__(self, other: float16)
__eq__
@pure @llvm
__eq__(a: float16, b: float16)
%tmp = fcmp oeq half %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__ne__
@pure @llvm
__ne__(a: float16, b: float16)
%tmp = fcmp une half %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__lt__
@pure @llvm
__lt__(a: float16, b: float16)
%tmp = fcmp olt half %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__gt__
@pure @llvm
__gt__(a: float16, b: float16)
%tmp = fcmp ogt half %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__le__
@pure @llvm
__le__(a: float16, b: float16)
%tmp = fcmp ole half %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__ge__
@pure @llvm
__ge__(a: float16, b: float16)
%tmp = fcmp oge half %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__abs__
@pure @llvm
__abs__(a: float16)
declare half @llvm.fabs.f16(half %a)
%tmp = call half @llvm.fabs.f16(half %a)
ret half %tmp
__floor__
@pure @llvm
__floor__(a: float16)
declare half @llvm.floor.f16(half %a)
%tmp = call half @llvm.floor.f16(half %a)
ret half %tmp
__ceil__
@pure @llvm
__ceil__(a: float16)
declare half @llvm.ceil.f16(half %a)
%tmp = call half @llvm.ceil.f16(half %a)
ret half %tmp
__trunc__
@pure @llvm
__trunc__(a: float16)
declare half @llvm.trunc.f16(half %a)
%tmp = call half @llvm.trunc.f16(half %a)
ret half %tmp
__pow__
@pure @llvm
__pow__(a: float16, b: float16)
declare half @llvm.pow.f16(half %a, half %b)
%tmp = call half @llvm.pow.f16(half %a, half %b)
ret half %tmp
__hash__
__hash__(self)
__match__
__match__(self, obj: float16)
class bfloat16
@extend
class bfloat16
Constructors 4
__new__
@pure @llvm
__new__(self: float)
%0 = fptrunc double %self to bfloat
ret bfloat %0
__new__
@overload
__new__(what: bfloat16)
__new__
@overload
__new__(what: str)
__new__
@overload
__new__()
Methods 2
cdiv
cdiv(self, other: bfloat16)
cmod
cmod(self, other: bfloat16)
Special methods 29
__repr__
__repr__(self)
__format__
__format__(self, format_spec: str)
__copy__
__copy__(self)
__deepcopy__
__deepcopy__(self)
__int__
@pure @llvm
__int__(self)
%0 = fptosi bfloat %self to i64
ret i64 %0
__float__
@pure @llvm
__float__(self)
%0 = fpext bfloat %self to double
ret double %0
__bool__
@pure @llvm
__bool__(self)
%0 = fcmp une bfloat %self, 0.000000e+00
%1 = zext i1 %0 to i8
ret i8 %1
__pos__
__pos__(self)
__neg__
@pure @llvm
__neg__(self)
%0 = fneg bfloat %self
ret bfloat %0
__add__
@pure @commutative @llvm
__add__(a: bfloat16, b: bfloat16)
%tmp = fadd bfloat %a, %b
ret bfloat %tmp
__sub__
@pure @llvm
__sub__(a: bfloat16, b: bfloat16)
%tmp = fsub bfloat %a, %b
ret bfloat %tmp
__mul__
@pure @commutative @llvm
__mul__(a: bfloat16, b: bfloat16)
%tmp = fmul bfloat %a, %b
ret bfloat %tmp
__floordiv__
__floordiv__(self, other: bfloat16)
__truediv__
__truediv__(self, other: bfloat16)
__mod__
__mod__(self, other: bfloat16)
__divmod__
__divmod__(self, other: bfloat16)
__eq__
@pure @llvm
__eq__(a: bfloat16, b: bfloat16)
%tmp = fcmp oeq bfloat %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__ne__
@pure @llvm
__ne__(a: bfloat16, b: bfloat16)
%tmp = fcmp une bfloat %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__lt__
@pure @llvm
__lt__(a: bfloat16, b: bfloat16)
%tmp = fcmp olt bfloat %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__gt__
@pure @llvm
__gt__(a: bfloat16, b: bfloat16)
%tmp = fcmp ogt bfloat %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__le__
@pure @llvm
__le__(a: bfloat16, b: bfloat16)
%tmp = fcmp ole bfloat %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__ge__
@pure @llvm
__ge__(a: bfloat16, b: bfloat16)
%tmp = fcmp oge bfloat %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__abs__
@pure @llvm
__abs__(a: 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)
declare bfloat @llvm.floor.bf16(bfloat %a)
%tmp = call bfloat @llvm.floor.bf16(bfloat %a)
ret bfloat %tmp
__ceil__
@pure @llvm
__ceil__(a: 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)
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)
declare bfloat @llvm.pow.bf16(bfloat %a, bfloat %b)
%tmp = call bfloat @llvm.pow.bf16(bfloat %a, bfloat %b)
ret bfloat %tmp
__hash__
__hash__(self)
__match__
__match__(self, obj: bfloat16)
class float128
@extend
class float128
Constructors 3
__new__
@pure @llvm
__new__(self: float)
%0 = fpext double %self to fp128
ret fp128 %0
__new__
@overload
__new__(what: float128)
__new__
@overload
__new__()
Methods 2
cdiv
cdiv(self, other: float128)
cmod
cmod(self, other: float128)
Special methods 29
__repr__
__repr__(self)
__format__
__format__(self, format_spec: str)
__copy__
__copy__(self)
__deepcopy__
__deepcopy__(self)
__int__
@pure @llvm
__int__(self)
%0 = fptosi fp128 %self to i64
ret i64 %0
__float__
@pure @llvm
__float__(self)
%0 = fptrunc fp128 %self to double
ret double %0
__bool__
@pure @llvm
__bool__(self)
%0 = fcmp une fp128 %self, 0xL00000000000000000000000000000000
%1 = zext i1 %0 to i8
ret i8 %1
__pos__
__pos__(self)
__neg__
@pure @llvm
__neg__(self)
%0 = fneg fp128 %self
ret fp128 %0
__add__
@pure @commutative @llvm
__add__(a: float128, b: float128)
%tmp = fadd fp128 %a, %b
ret fp128 %tmp
__sub__
@pure @llvm
__sub__(a: float128, b: float128)
%tmp = fsub fp128 %a, %b
ret fp128 %tmp
__mul__
@pure @commutative @llvm
__mul__(a: float128, b: float128)
%tmp = fmul fp128 %a, %b
ret fp128 %tmp
__floordiv__
__floordiv__(self, other: float128)
__truediv__
__truediv__(self, other: float128)
__mod__
__mod__(self, other: float128)
__divmod__
__divmod__(self, other: float128)
__eq__
@pure @llvm
__eq__(a: float128, b: float128)
%tmp = fcmp oeq fp128 %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__ne__
@pure @llvm
__ne__(a: float128, b: float128)
%tmp = fcmp une fp128 %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__lt__
@pure @llvm
__lt__(a: float128, b: float128)
%tmp = fcmp olt fp128 %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__gt__
@pure @llvm
__gt__(a: float128, b: float128)
%tmp = fcmp ogt fp128 %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__le__
@pure @llvm
__le__(a: float128, b: float128)
%tmp = fcmp ole fp128 %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__ge__
@pure @llvm
__ge__(a: float128, b: float128)
%tmp = fcmp oge fp128 %a, %b
%res = zext i1 %tmp to i8
ret i8 %res
__abs__
@pure @llvm
__abs__(a: float128)
declare fp128 @llvm.fabs.f128(fp128 %a)
%tmp = call fp128 @llvm.fabs.f128(fp128 %a)
ret fp128 %tmp
__floor__
@pure @llvm
__floor__(a: float128)
declare fp128 @llvm.floor.f128(fp128 %a)
%tmp = call fp128 @llvm.floor.f128(fp128 %a)
ret fp128 %tmp
__ceil__
@pure @llvm
__ceil__(a: float128)
declare fp128 @llvm.ceil.f128(fp128 %a)
%tmp = call fp128 @llvm.ceil.f128(fp128 %a)
ret fp128 %tmp
__trunc__
@pure @llvm
__trunc__(a: float128)
declare fp128 @llvm.trunc.f128(fp128 %a)
%tmp = call fp128 @llvm.trunc.f128(fp128 %a)
ret fp128 %tmp
__pow__
@pure @llvm
__pow__(a: float128, b: float128)
declare fp128 @llvm.pow.f128(fp128 %a, fp128 %b)
%tmp = call fp128 @llvm.pow.f128(fp128 %a, fp128 %b)
ret fp128 %tmp
__hash__
__hash__(self)
__match__
__match__(self, obj: float128)
class float
@extend
class float
Special methods 4
__suffix_f32__
__suffix_f32__(double)
__suffix_f16__
__suffix_f16__(double)
__suffix_bf16__
__suffix_bf16__(double)
__suffix_f128__
__suffix_f128__(double)