Skip to content

Commit 31d998e

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 c4b667d commit 31d998e

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
@@ -334,8 +334,8 @@ julia> typeof(x)
334334
Float64
335335
```
336336

337-
Half-precision floating-point numbers are also supported ([`Float16`](@ref)), but they are
338-
implemented in software and use [`Float32`](@ref) for calculations.
337+
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.
338+
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.
339339

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

0 commit comments

Comments
 (0)