📄 libgcc.texi
字号:
@deftypefn {Runtime Function} int32_t __bswapsi2 (int32_t @var{a})@deftypefnx {Runtime Function} int64_t __bswapdi2 (int64_t @var{a})These functions return the @var{a} byteswapped.@end deftypefn@node Soft float library routines@section Routines for floating point emulation@cindex soft float library@cindex arithmetic library@cindex math library@opindex msoft-floatThe software floating point library is used on machines which do nothave hardware support for floating point. It is also used whenever@option{-msoft-float} is used to disable generation of floating pointinstructions. (Not all targets support this switch.)For compatibility with other compilers, the floating point emulationroutines can be renamed with the @code{DECLARE_LIBRARY_RENAMES} macro(@pxref{Library Calls}). In this section, the default names are used.Presently the library does not support @code{XFmode}, which is usedfor @code{long double} on some architectures.@subsection Arithmetic functions@deftypefn {Runtime Function} float __addsf3 (float @var{a}, float @var{b})@deftypefnx {Runtime Function} double __adddf3 (double @var{a}, double @var{b})@deftypefnx {Runtime Function} {long double} __addtf3 (long double @var{a}, long double @var{b})@deftypefnx {Runtime Function} {long double} __addxf3 (long double @var{a}, long double @var{b})These functions return the sum of @var{a} and @var{b}.@end deftypefn@deftypefn {Runtime Function} float __subsf3 (float @var{a}, float @var{b})@deftypefnx {Runtime Function} double __subdf3 (double @var{a}, double @var{b})@deftypefnx {Runtime Function} {long double} __subtf3 (long double @var{a}, long double @var{b})@deftypefnx {Runtime Function} {long double} __subxf3 (long double @var{a}, long double @var{b})These functions return the difference between @var{b} and @var{a};that is, @w{@math{@var{a} - @var{b}}}.@end deftypefn@deftypefn {Runtime Function} float __mulsf3 (float @var{a}, float @var{b})@deftypefnx {Runtime Function} double __muldf3 (double @var{a}, double @var{b})@deftypefnx {Runtime Function} {long double} __multf3 (long double @var{a}, long double @var{b})@deftypefnx {Runtime Function} {long double} __mulxf3 (long double @var{a}, long double @var{b})These functions return the product of @var{a} and @var{b}.@end deftypefn@deftypefn {Runtime Function} float __divsf3 (float @var{a}, float @var{b})@deftypefnx {Runtime Function} double __divdf3 (double @var{a}, double @var{b})@deftypefnx {Runtime Function} {long double} __divtf3 (long double @var{a}, long double @var{b})@deftypefnx {Runtime Function} {long double} __divxf3 (long double @var{a}, long double @var{b})These functions return the quotient of @var{a} and @var{b}; that is,@w{@math{@var{a} / @var{b}}}.@end deftypefn@deftypefn {Runtime Function} float __negsf2 (float @var{a})@deftypefnx {Runtime Function} double __negdf2 (double @var{a})@deftypefnx {Runtime Function} {long double} __negtf2 (long double @var{a})@deftypefnx {Runtime Function} {long double} __negxf2 (long double @var{a})These functions return the negation of @var{a}. They simply flip thesign bit, so they can produce negative zero and negative NaN@.@end deftypefn@subsection Conversion functions@deftypefn {Runtime Function} double __extendsfdf2 (float @var{a})@deftypefnx {Runtime Function} {long double} __extendsftf2 (float @var{a})@deftypefnx {Runtime Function} {long double} __extendsfxf2 (float @var{a})@deftypefnx {Runtime Function} {long double} __extenddftf2 (double @var{a})@deftypefnx {Runtime Function} {long double} __extenddfxf2 (double @var{a})These functions extend @var{a} to the wider mode of their returntype.@end deftypefn@deftypefn {Runtime Function} double __truncxfdf2 (long double @var{a})@deftypefnx {Runtime Function} double __trunctfdf2 (long double @var{a})@deftypefnx {Runtime Function} float __truncxfsf2 (long double @var{a})@deftypefnx {Runtime Function} float __trunctfsf2 (long double @var{a})@deftypefnx {Runtime Function} float __truncdfsf2 (double @var{a})These functions truncate @var{a} to the narrower mode of their returntype, rounding toward zero.@end deftypefn@deftypefn {Runtime Function} int __fixsfsi (float @var{a})@deftypefnx {Runtime Function} int __fixdfsi (double @var{a})@deftypefnx {Runtime Function} int __fixtfsi (long double @var{a})@deftypefnx {Runtime Function} int __fixxfsi (long double @var{a})These functions convert @var{a} to a signed integer, rounding toward zero.@end deftypefn@deftypefn {Runtime Function} long __fixsfdi (float @var{a})@deftypefnx {Runtime Function} long __fixdfdi (double @var{a})@deftypefnx {Runtime Function} long __fixtfdi (long double @var{a})@deftypefnx {Runtime Function} long __fixxfdi (long double @var{a})These functions convert @var{a} to a signed long, rounding toward zero.@end deftypefn@deftypefn {Runtime Function} {long long} __fixsfti (float @var{a})@deftypefnx {Runtime Function} {long long} __fixdfti (double @var{a})@deftypefnx {Runtime Function} {long long} __fixtfti (long double @var{a})@deftypefnx {Runtime Function} {long long} __fixxfti (long double @var{a})These functions convert @var{a} to a signed long long, rounding toward zero.@end deftypefn@deftypefn {Runtime Function} {unsigned int} __fixunssfsi (float @var{a})@deftypefnx {Runtime Function} {unsigned int} __fixunsdfsi (double @var{a})@deftypefnx {Runtime Function} {unsigned int} __fixunstfsi (long double @var{a})@deftypefnx {Runtime Function} {unsigned int} __fixunsxfsi (long double @var{a})These functions convert @var{a} to an unsigned integer, roundingtoward zero. Negative values all become zero.@end deftypefn@deftypefn {Runtime Function} {unsigned long} __fixunssfdi (float @var{a})@deftypefnx {Runtime Function} {unsigned long} __fixunsdfdi (double @var{a})@deftypefnx {Runtime Function} {unsigned long} __fixunstfdi (long double @var{a})@deftypefnx {Runtime Function} {unsigned long} __fixunsxfdi (long double @var{a})These functions convert @var{a} to an unsigned long, roundingtoward zero. Negative values all become zero.@end deftypefn@deftypefn {Runtime Function} {unsigned long long} __fixunssfti (float @var{a})@deftypefnx {Runtime Function} {unsigned long long} __fixunsdfti (double @var{a})@deftypefnx {Runtime Function} {unsigned long long} __fixunstfti (long double @var{a})@deftypefnx {Runtime Function} {unsigned long long} __fixunsxfti (long double @var{a})These functions convert @var{a} to an unsigned long long, roundingtoward zero. Negative values all become zero.@end deftypefn@deftypefn {Runtime Function} float __floatsisf (int @var{i})@deftypefnx {Runtime Function} double __floatsidf (int @var{i})@deftypefnx {Runtime Function} {long double} __floatsitf (int @var{i})@deftypefnx {Runtime Function} {long double} __floatsixf (int @var{i})These functions convert @var{i}, a signed integer, to floating point.@end deftypefn@deftypefn {Runtime Function} float __floatdisf (long @var{i})@deftypefnx {Runtime Function} double __floatdidf (long @var{i})@deftypefnx {Runtime Function} {long double} __floatditf (long @var{i})@deftypefnx {Runtime Function} {long double} __floatdixf (long @var{i})These functions convert @var{i}, a signed long, to floating point.@end deftypefn@deftypefn {Runtime Function} float __floattisf (long long @var{i})@deftypefnx {Runtime Function} double __floattidf (long long @var{i})@deftypefnx {Runtime Function} {long double} __floattitf (long long @var{i})@deftypefnx {Runtime Function} {long double} __floattixf (long long @var{i})These functions convert @var{i}, a signed long long, to floating point.@end deftypefn@deftypefn {Runtime Function} float __floatunsisf (unsigned int @var{i})@deftypefnx {Runtime Function} double __floatunsidf (unsigned int @var{i})@deftypefnx {Runtime Function} {long double} __floatunsitf (unsigned int @var{i})@deftypefnx {Runtime Function} {long double} __floatunsixf (unsigned int @var{i})These functions convert @var{i}, an unsigned integer, to floating point.@end deftypefn@deftypefn {Runtime Function} float __floatundisf (unsigned long @var{i})@deftypefnx {Runtime Function} double __floatundidf (unsigned long @var{i})@deftypefnx {Runtime Function} {long double} __floatunditf (unsigned long @var{i})@deftypefnx {Runtime Function} {long double} __floatundixf (unsigned long @var{i})These functions convert @var{i}, an unsigned long, to floating point.@end deftypefn@deftypefn {Runtime Function} float __floatuntisf (unsigned long long @var{i})@deftypefnx {Runtime Function} double __floatuntidf (unsigned long long @var{i})@deftypefnx {Runtime Function} {long double} __floatuntitf (unsigned long long @var{i})@deftypefnx {Runtime Function} {long double} __floatuntixf (unsigned long long @var{i})These functions convert @var{i}, an unsigned long long, to floating point.@end deftypefn@subsection Comparison functionsThere are two sets of basic comparison functions.@deftypefn {Runtime Function} int __cmpsf2 (float @var{a}, float @var{b})@deftypefnx {Runtime Function} int __cmpdf2 (double @var{a}, double @var{b})@deftypefnx {Runtime Function} int __cmptf2 (long double @var{a}, long double @var{b})These functions calculate @math{a <=> b}. That is, if @var{a} is lessthan @var{b}, they return @minus{}1; if @var{a} is greater than @var{b}, theyreturn 1; and if @var{a} and @var{b} are equal they return 0. Ifeither argument is NaN they return 1, but you should not rely on this;if NaN is a possibility, use one of the higher-level comparisonfunctions.@end deftypefn@deftypefn {Runtime Function} int __unordsf2 (float @var{a}, float @var{b})@deftypefnx {Runtime Function} int __unorddf2 (double @var{a}, double @var{b})@deftypefnx {Runtime Function} int __unordtf2 (long double @var{a}, long double @var{b})These functions return a nonzero value if either argument is NaN, otherwise 0.@end deftypefnThere is also a complete group of higher level functions whichcorrespond directly to comparison operators. They implement the ISO Csemantics for floating-point comparisons, taking NaN into account.Pay careful attention to the return values defined for each set.Under the hood, all of these routines are implemented as@smallexample if (__unord@var{X}f2 (a, b)) return @var{E}; return __cmp@var{X}f2 (a, b);@end smallexample@noindentwhere @var{E} is a constant chosen to give the proper behavior forNaN@. Thus, the meaning of the return value is different for each set.Do not rely on this implementation; only the semantics documentedbelow are guaranteed.@deftypefn {Runtime Function} int __eqsf2 (float @var{a}, float @var{b})@deftypefnx {Runtime Function} int __eqdf2 (double @var{a}, double @var{b})@deftypefnx {Runtime Function} int __eqtf2 (long double @var{a}, long double @var{b})These functions return zero if neither argument is NaN, and @var{a} and@var{b} are equal.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -