xiongji90 updated this revision to Diff 506460. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146188/new/
https://reviews.llvm.org/D146188 Files: clang/docs/LanguageExtensions.rst Index: clang/docs/LanguageExtensions.rst =================================================================== --- clang/docs/LanguageExtensions.rst +++ clang/docs/LanguageExtensions.rst @@ -3246,7 +3246,7 @@ double __builtin_canonicalize(double); float __builtin_canonicalizef(float); - long double__builtin_canonicalizel(long double); + long double __builtin_canonicalizel(long double); Returns the platform specific canonical encoding of a floating point number. This canonicalization is useful for implementing certain @@ -3254,6 +3254,39 @@ <https://llvm.org/docs/LangRef.html#llvm-canonicalize-intrinsic>`_ for more information on the semantics. +``__builtin_flt_rounds`` +-------------------------- + +.. code-block:: c + + int __builtin_flt_rounds(); + +Returns the current rounding mode. Encoding of the returned values is +same as the result of FLT_ROUNDS, specified by C standard: +0 - toward zero +1 - to nearest, ties to even +2 - toward positive infinity +3 - toward negative infinity +4 - to nearest, ties away from zero +The effect of passing some other value to this builtin is implementation-defined. + +``__builtin_set_flt_rounds`` +-------------------------- + +.. code-block:: c + + void __builtin_set_flt_rounds(int); + +Sets the current rounding mode. Encoding of the returned values is +same as the result of FLT_ROUNDS, specified by C standard: +0 - toward zero +1 - to nearest, ties to even +2 - toward positive infinity +3 - toward negative infinity +4 - to nearest, ties away from zero +This builtin is restrcted to work on x86 and arm targets currently. When support +for the builtin is added for new targets, the manual should be updated accordingly. + String builtins ---------------
Index: clang/docs/LanguageExtensions.rst =================================================================== --- clang/docs/LanguageExtensions.rst +++ clang/docs/LanguageExtensions.rst @@ -3246,7 +3246,7 @@ double __builtin_canonicalize(double); float __builtin_canonicalizef(float); - long double__builtin_canonicalizel(long double); + long double __builtin_canonicalizel(long double); Returns the platform specific canonical encoding of a floating point number. This canonicalization is useful for implementing certain @@ -3254,6 +3254,39 @@ <https://llvm.org/docs/LangRef.html#llvm-canonicalize-intrinsic>`_ for more information on the semantics. +``__builtin_flt_rounds`` +-------------------------- + +.. code-block:: c + + int __builtin_flt_rounds(); + +Returns the current rounding mode. Encoding of the returned values is +same as the result of FLT_ROUNDS, specified by C standard: +0 - toward zero +1 - to nearest, ties to even +2 - toward positive infinity +3 - toward negative infinity +4 - to nearest, ties away from zero +The effect of passing some other value to this builtin is implementation-defined. + +``__builtin_set_flt_rounds`` +-------------------------- + +.. code-block:: c + + void __builtin_set_flt_rounds(int); + +Sets the current rounding mode. Encoding of the returned values is +same as the result of FLT_ROUNDS, specified by C standard: +0 - toward zero +1 - to nearest, ties to even +2 - toward positive infinity +3 - toward negative infinity +4 - to nearest, ties away from zero +This builtin is restrcted to work on x86 and arm targets currently. When support +for the builtin is added for new targets, the manual should be updated accordingly. + String builtins ---------------
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits