aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorliuhongt <hongtao.liu@intel.com>2021-08-02 10:56:45 +0800
committerliuhongt <hongtao.liu@intel.com>2021-09-08 12:44:49 +0800
commitf19a327077ecc34a51487761378b9edb43c82997 (patch)
treefd3b704957ec91abaa1ce10931e9afb969fe18c7 /gcc/doc
parenta549a9a39a9bd92107667b99a67acbd7ef551323 (diff)
downloadgcc-f19a327077ecc34a51487761378b9edb43c82997.zip
gcc-f19a327077ecc34a51487761378b9edb43c82997.tar.gz
gcc-f19a327077ecc34a51487761378b9edb43c82997.tar.bz2
Support -fexcess-precision=16 which will enable FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16 when backend supports _Float16.
gcc/ada/ChangeLog: * gcc-interface/misc.c (gnat_post_options): Issue an error for -fexcess-precision=16. gcc/c-family/ChangeLog: * c-common.c (excess_precision_mode_join): Update below comments. (c_ts18661_flt_eval_method): Set excess_precision_type to EXCESS_PRECISION_TYPE_FLOAT16 when -fexcess-precision=16. * c-cppbuiltin.c (cpp_atomic_builtins): Update below comments. (c_cpp_flt_eval_method_iec_559): Set excess_precision_type to EXCESS_PRECISION_TYPE_FLOAT16 when -fexcess-precision=16. gcc/ChangeLog: * common.opt: Support -fexcess-precision=16. * config/aarch64/aarch64.c (aarch64_excess_precision): Return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16 when EXCESS_PRECISION_TYPE_FLOAT16. * config/arm/arm.c (arm_excess_precision): Ditto. * config/i386/i386.c (ix86_get_excess_precision): Ditto. * config/m68k/m68k.c (m68k_excess_precision): Issue an error when EXCESS_PRECISION_TYPE_FLOAT16. * config/s390/s390.c (s390_excess_precision): Ditto. * coretypes.h (enum excess_precision_type): Add EXCESS_PRECISION_TYPE_FLOAT16. * doc/tm.texi (TARGET_C_EXCESS_PRECISION): Update documents. * doc/tm.texi.in (TARGET_C_EXCESS_PRECISION): Ditto. * doc/extend.texi (Half-Precision): Document -fexcess-precision=16. * flag-types.h (enum excess_precision): Add EXCESS_PRECISION_FLOAT16. * target.def (excess_precision): Update document. * tree.c (excess_precision_type): Set excess_precision_type to EXCESS_PRECISION_FLOAT16 when -fexcess-precision=16. gcc/fortran/ChangeLog: * options.c (gfc_post_options): Issue an error for -fexcess-precision=16. gcc/testsuite/ChangeLog: * gcc.target/i386/float16-6.c: New test. * gcc.target/i386/float16-7.c: New test.
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi3
-rw-r--r--gcc/doc/tm.texi14
-rw-r--r--gcc/doc/tm.texi.in3
3 files changed, 15 insertions, 5 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 777dc0f..f08238b 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -1160,7 +1160,8 @@ On x86 targets with SSE2 enabled, without @option{-mavx512fp16},
software emulation and the @code{float} instructions. The default behavior
for @code{FLT_EVAL_METHOD} is to keep the intermediate result of the operation
as 32-bit precision. This may lead to inconsistent behavior between software
-emulation and AVX512-FP16 instructions.
+emulation and AVX512-FP16 instructions. Using @option{-fexcess-precision=16}
+will force round back after each operation.
@node Decimal Float
@section Decimal Floating Types
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index f68f426..be81485 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -982,20 +982,26 @@ Do not define this macro if it would never modify @var{m}.
Return a value, with the same meaning as the C99 macro
@code{FLT_EVAL_METHOD} that describes which excess precision should be
applied. @var{type} is either @code{EXCESS_PRECISION_TYPE_IMPLICIT},
-@code{EXCESS_PRECISION_TYPE_FAST}, or
-@code{EXCESS_PRECISION_TYPE_STANDARD}. For
+@code{EXCESS_PRECISION_TYPE_FAST},
+@code{EXCESS_PRECISION_TYPE_STANDARD}, or
+@code{EXCESS_PRECISION_TYPE_FLOAT16}. For
@code{EXCESS_PRECISION_TYPE_IMPLICIT}, the target should return which
precision and range operations will be implictly evaluated in regardless
of the excess precision explicitly added. For
-@code{EXCESS_PRECISION_TYPE_STANDARD} and
+@code{EXCESS_PRECISION_TYPE_STANDARD},
+@code{EXCESS_PRECISION_TYPE_FLOAT16}, and
@code{EXCESS_PRECISION_TYPE_FAST}, the target should return the
explicit excess precision that should be added depending on the
value set for @option{-fexcess-precision=@r{[}standard@r{|}fast@r{]}}.
Note that unpredictable explicit excess precision does not make sense,
so a target should never return @code{FLT_EVAL_METHOD_UNPREDICTABLE}
-when @var{type} is @code{EXCESS_PRECISION_TYPE_STANDARD} or
+when @var{type} is @code{EXCESS_PRECISION_TYPE_STANDARD},
+@code{EXCESS_PRECISION_TYPE_FLOAT16} or
@code{EXCESS_PRECISION_TYPE_FAST}.
@end deftypefn
+Return a value, with the same meaning as the C99 macro
+@code{FLT_EVAL_METHOD} that describes which excess precision should be
+applied.
@deftypefn {Target Hook} machine_mode TARGET_PROMOTE_FUNCTION_MODE (const_tree @var{type}, machine_mode @var{mode}, int *@var{punsignedp}, const_tree @var{funtype}, int @var{for_return})
Like @code{PROMOTE_MODE}, but it is applied to outgoing function arguments or
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index fdf16b9..d088eee 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -929,6 +929,9 @@ Do not define this macro if it would never modify @var{m}.
@end defmac
@hook TARGET_C_EXCESS_PRECISION
+Return a value, with the same meaning as the C99 macro
+@code{FLT_EVAL_METHOD} that describes which excess precision should be
+applied.
@hook TARGET_PROMOTE_FUNCTION_MODE