This patch documents the -mfloat16 switch.

2025-11-05  Michael Meissner  <[email protected]>

gcc/

        * doc/invoke.texi (RS/6000 and PowerPC Options): Document -mfloat16.
---
 gcc/doc/invoke.texi | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 189b2662012..f7952f4ee8b 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -1367,7 +1367,7 @@ See RS/6000 and PowerPC Options.
 -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg}
 -mstack-protector-guard-offset=@var{offset} -mprefixed -mno-prefixed
 -mpcrel -mno-pcrel -mmma -mno-mmma -mrop-protect -mno-rop-protect
--mprivileged -mno-privileged}
+-mprivileged -mno-privileged -mfloat16 -mno-float16}
 
 @emph{RX Options} (@ref{RX Options})
 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu
@@ -33064,6 +33064,40 @@ Generate (do not generate) code that will run in 
privileged state.
 Generate (do not generate) unaligned vsx loads and stores for
 inline expansion of @code{memcpy} and @code{memmove}.
 
+@opindex mfloat16
+@opindex mno-float16
+@item -mfloat16
+@itemx -mno-float16
+Enable (do not enable) the 16-bit floating point types,
+@code{_Float16} and @code{__bfloat16}.  If you use the
+@option{-mfloat16} option, you must use at least the
+@option{-mcpu=power8} option or later.
+
+The @code{_Float16} type uses the IEEE 754 half precision format (1
+sign bit, 5 exponent bits, and 10 explcit mantissa bits, plus an
+implicit mantissa bi).  If you use the @option{-mcpu=power9} option or
+later, the PowerPC GCC compiler will generate inline instructions for
+@code{_Float16} conversions.  If you use the @option{-Ofast
+-mcpu=power9} options, the GCC compiler will automatically vectorize
+some loops using @code{_Float16} arrays.
+
+The @code{__bfloat16} type uses the Google brain 16-bit format (1 sign
+bit, 8 exponent bits, 7 explicit mantissa bits, plus an implicit
+mantissa bit).  If you use the @option{-mcpu=power10} option or later,
+the PowerPC GCC compiler will generate inline instructions for
+@code{__bfloat16} conversions.  If you use the @option{-Ofast
+-mcpu=power10} options, the GCC compiler will automatically vectorize
+some loops using @code{__bfloat16} arrays.
+
+At the current time the @option{-mfloat16} option is experimental, and
+it is not enabled by default.
+
+If you pass a 16-bit floating point value to a function or have a
+function returning a 16-bit floating point value, the PowerPC GCC
+compiler will issue a warning that the calling sequence may change in
+the future.  The @option{-Wno-psabi} option will turn off this
+warning.
+
 @item --param rs6000-vect-unroll-limit=
 The vectorizer will check with target information to determine whether it
 would be beneficial to unroll the main vectorized loop and by how much.  This
-- 
2.51.1


-- 
Michael Meissner, IBM
PO Box 98, Ayer, Massachusetts, USA, 01432
email: [email protected]

Reply via email to