Skip to content

Commit b87033d

Browse files
giordanoKristofferC
authored andcommitted
[docs] Clarify that Float16 is supported natively when possible (#57725)
Co-authored-by: Jishnu Bhattacharya <[email protected]> (cherry picked from commit 3e57a8a)
1 parent bd9431d commit b87033d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/src/manual/integers-and-floating-point-numbers.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ julia> typeof(x)
335335
Float64
336336
```
337337

338-
Half-precision floating-point numbers are also supported ([`Float16`](@ref)), but they are
339-
implemented in software and use [`Float32`](@ref) for calculations.
338+
Half-precision floating-point numbers are also supported ([`Float16`](@ref)) on all platforms, with native instructions used on hardware which supports this number format. Otherwise, operations are implemented in software, and use [`Float32`](@ref) for intermediate calculations.
339+
As an internal implementation detail, this is achieved under the hood by using LLVM's [`half`](https://llvm.org/docs/LangRef.html#half-precision-floating-point-intrinsics) type, which behaves similarly to what the GCC [`-fexcess-precision=16`](https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fexcess-precision) flag does for C/C++ code.
340340

341341
```jldoctest
342342
julia> sizeof(Float16(4.))

0 commit comments

Comments
 (0)