| <html lang="en"> |
| <head> |
| <title>Other Builtins - Using the GNU Compiler Collection (GCC)</title> |
| <meta http-equiv="Content-Type" content="text/html"> |
| <meta name="description" content="Using the GNU Compiler Collection (GCC)"> |
| <meta name="generator" content="makeinfo 4.13"> |
| <link title="Top" rel="start" href="index.html#Top"> |
| <link rel="up" href="C-Extensions.html#C-Extensions" title="C Extensions"> |
| <link rel="prev" href="Object-Size-Checking.html#Object-Size-Checking" title="Object Size Checking"> |
| <link rel="next" href="Target-Builtins.html#Target-Builtins" title="Target Builtins"> |
| <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> |
| <!-- |
| Copyright (C) 1988-2013 Free Software Foundation, Inc. |
| |
| Permission is granted to copy, distribute and/or modify this document |
| under the terms of the GNU Free Documentation License, Version 1.3 or |
| any later version published by the Free Software Foundation; with the |
| Invariant Sections being ``Funding Free Software'', the Front-Cover |
| Texts being (a) (see below), and with the Back-Cover Texts being (b) |
| (see below). A copy of the license is included in the section entitled |
| ``GNU Free Documentation License''. |
| |
| (a) The FSF's Front-Cover Text is: |
| |
| A GNU Manual |
| |
| (b) The FSF's Back-Cover Text is: |
| |
| You have freedom to copy and modify this GNU Manual, like GNU |
| software. Copies published by the Free Software Foundation raise |
| funds for GNU development.--> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| <style type="text/css"><!-- |
| pre.display { font-family:inherit } |
| pre.format { font-family:inherit } |
| pre.smalldisplay { font-family:inherit; font-size:smaller } |
| pre.smallformat { font-family:inherit; font-size:smaller } |
| pre.smallexample { font-size:smaller } |
| pre.smalllisp { font-size:smaller } |
| span.sc { font-variant:small-caps } |
| span.roman { font-family:serif; font-weight:normal; } |
| span.sansserif { font-family:sans-serif; font-weight:normal; } |
| --></style> |
| </head> |
| <body> |
| <div class="node"> |
| <a name="Other-Builtins"></a> |
| <p> |
| Next: <a rel="next" accesskey="n" href="Target-Builtins.html#Target-Builtins">Target Builtins</a>, |
| Previous: <a rel="previous" accesskey="p" href="Object-Size-Checking.html#Object-Size-Checking">Object Size Checking</a>, |
| Up: <a rel="up" accesskey="u" href="C-Extensions.html#C-Extensions">C Extensions</a> |
| <hr> |
| </div> |
| |
| <h3 class="section">6.55 Other Built-in Functions Provided by GCC</h3> |
| |
| <p><a name="index-built_002din-functions-2953"></a><a name="index-g_t_005f_005fbuiltin_005ffpclassify-2954"></a><a name="index-g_t_005f_005fbuiltin_005fisfinite-2955"></a><a name="index-g_t_005f_005fbuiltin_005fisnormal-2956"></a><a name="index-g_t_005f_005fbuiltin_005fisgreater-2957"></a><a name="index-g_t_005f_005fbuiltin_005fisgreaterequal-2958"></a><a name="index-g_t_005f_005fbuiltin_005fisinf_005fsign-2959"></a><a name="index-g_t_005f_005fbuiltin_005fisless-2960"></a><a name="index-g_t_005f_005fbuiltin_005fislessequal-2961"></a><a name="index-g_t_005f_005fbuiltin_005fislessgreater-2962"></a><a name="index-g_t_005f_005fbuiltin_005fisunordered-2963"></a><a name="index-g_t_005f_005fbuiltin_005fpowi-2964"></a><a name="index-g_t_005f_005fbuiltin_005fpowif-2965"></a><a name="index-g_t_005f_005fbuiltin_005fpowil-2966"></a><a name="index-g_t_005fExit-2967"></a><a name="index-g_t_005fexit-2968"></a><a name="index-abort-2969"></a><a name="index-abs-2970"></a><a name="index-acos-2971"></a><a name="index-acosf-2972"></a><a name="index-acosh-2973"></a><a name="index-acoshf-2974"></a><a name="index-acoshl-2975"></a><a name="index-acosl-2976"></a><a name="index-alloca-2977"></a><a name="index-asin-2978"></a><a name="index-asinf-2979"></a><a name="index-asinh-2980"></a><a name="index-asinhf-2981"></a><a name="index-asinhl-2982"></a><a name="index-asinl-2983"></a><a name="index-atan-2984"></a><a name="index-atan2-2985"></a><a name="index-atan2f-2986"></a><a name="index-atan2l-2987"></a><a name="index-atanf-2988"></a><a name="index-atanh-2989"></a><a name="index-atanhf-2990"></a><a name="index-atanhl-2991"></a><a name="index-atanl-2992"></a><a name="index-bcmp-2993"></a><a name="index-bzero-2994"></a><a name="index-cabs-2995"></a><a name="index-cabsf-2996"></a><a name="index-cabsl-2997"></a><a name="index-cacos-2998"></a><a name="index-cacosf-2999"></a><a name="index-cacosh-3000"></a><a name="index-cacoshf-3001"></a><a name="index-cacoshl-3002"></a><a name="index-cacosl-3003"></a><a name="index-calloc-3004"></a><a name="index-carg-3005"></a><a name="index-cargf-3006"></a><a name="index-cargl-3007"></a><a name="index-casin-3008"></a><a name="index-casinf-3009"></a><a name="index-casinh-3010"></a><a name="index-casinhf-3011"></a><a name="index-casinhl-3012"></a><a name="index-casinl-3013"></a><a name="index-catan-3014"></a><a name="index-catanf-3015"></a><a name="index-catanh-3016"></a><a name="index-catanhf-3017"></a><a name="index-catanhl-3018"></a><a name="index-catanl-3019"></a><a name="index-cbrt-3020"></a><a name="index-cbrtf-3021"></a><a name="index-cbrtl-3022"></a><a name="index-ccos-3023"></a><a name="index-ccosf-3024"></a><a name="index-ccosh-3025"></a><a name="index-ccoshf-3026"></a><a name="index-ccoshl-3027"></a><a name="index-ccosl-3028"></a><a name="index-ceil-3029"></a><a name="index-ceilf-3030"></a><a name="index-ceill-3031"></a><a name="index-cexp-3032"></a><a name="index-cexpf-3033"></a><a name="index-cexpl-3034"></a><a name="index-cimag-3035"></a><a name="index-cimagf-3036"></a><a name="index-cimagl-3037"></a><a name="index-clog-3038"></a><a name="index-clogf-3039"></a><a name="index-clogl-3040"></a><a name="index-conj-3041"></a><a name="index-conjf-3042"></a><a name="index-conjl-3043"></a><a name="index-copysign-3044"></a><a name="index-copysignf-3045"></a><a name="index-copysignl-3046"></a><a name="index-cos-3047"></a><a name="index-cosf-3048"></a><a name="index-cosh-3049"></a><a name="index-coshf-3050"></a><a name="index-coshl-3051"></a><a name="index-cosl-3052"></a><a name="index-cpow-3053"></a><a name="index-cpowf-3054"></a><a name="index-cpowl-3055"></a><a name="index-cproj-3056"></a><a name="index-cprojf-3057"></a><a name="index-cprojl-3058"></a><a name="index-creal-3059"></a><a name="index-crealf-3060"></a><a name="index-creall-3061"></a><a name="index-csin-3062"></a><a name="index-csinf-3063"></a><a name="index-csinh-3064"></a><a name="index-csinhf-3065"></a><a name="index-csinhl-3066"></a><a name="index-csinl-3067"></a><a name="index-csqrt-3068"></a><a name="index-csqrtf-3069"></a><a name="index-csqrtl-3070"></a><a name="index-ctan-3071"></a><a name="index-ctanf-3072"></a><a name="index-ctanh-3073"></a><a name="index-ctanhf-3074"></a><a name="index-ctanhl-3075"></a><a name="index-ctanl-3076"></a><a name="index-dcgettext-3077"></a><a name="index-dgettext-3078"></a><a name="index-drem-3079"></a><a name="index-dremf-3080"></a><a name="index-dreml-3081"></a><a name="index-erf-3082"></a><a name="index-erfc-3083"></a><a name="index-erfcf-3084"></a><a name="index-erfcl-3085"></a><a name="index-erff-3086"></a><a name="index-erfl-3087"></a><a name="index-exit-3088"></a><a name="index-exp-3089"></a><a name="index-exp10-3090"></a><a name="index-exp10f-3091"></a><a name="index-exp10l-3092"></a><a name="index-exp2-3093"></a><a name="index-exp2f-3094"></a><a name="index-exp2l-3095"></a><a name="index-expf-3096"></a><a name="index-expl-3097"></a><a name="index-expm1-3098"></a><a name="index-expm1f-3099"></a><a name="index-expm1l-3100"></a><a name="index-fabs-3101"></a><a name="index-fabsf-3102"></a><a name="index-fabsl-3103"></a><a name="index-fdim-3104"></a><a name="index-fdimf-3105"></a><a name="index-fdiml-3106"></a><a name="index-ffs-3107"></a><a name="index-floor-3108"></a><a name="index-floorf-3109"></a><a name="index-floorl-3110"></a><a name="index-fma-3111"></a><a name="index-fmaf-3112"></a><a name="index-fmal-3113"></a><a name="index-fmax-3114"></a><a name="index-fmaxf-3115"></a><a name="index-fmaxl-3116"></a><a name="index-fmin-3117"></a><a name="index-fminf-3118"></a><a name="index-fminl-3119"></a><a name="index-fmod-3120"></a><a name="index-fmodf-3121"></a><a name="index-fmodl-3122"></a><a name="index-fprintf-3123"></a><a name="index-fprintf_005funlocked-3124"></a><a name="index-fputs-3125"></a><a name="index-fputs_005funlocked-3126"></a><a name="index-frexp-3127"></a><a name="index-frexpf-3128"></a><a name="index-frexpl-3129"></a><a name="index-fscanf-3130"></a><a name="index-gamma-3131"></a><a name="index-gammaf-3132"></a><a name="index-gammal-3133"></a><a name="index-gamma_005fr-3134"></a><a name="index-gammaf_005fr-3135"></a><a name="index-gammal_005fr-3136"></a><a name="index-gettext-3137"></a><a name="index-hypot-3138"></a><a name="index-hypotf-3139"></a><a name="index-hypotl-3140"></a><a name="index-ilogb-3141"></a><a name="index-ilogbf-3142"></a><a name="index-ilogbl-3143"></a><a name="index-imaxabs-3144"></a><a name="index-index-3145"></a><a name="index-isalnum-3146"></a><a name="index-isalpha-3147"></a><a name="index-isascii-3148"></a><a name="index-isblank-3149"></a><a name="index-iscntrl-3150"></a><a name="index-isdigit-3151"></a><a name="index-isgraph-3152"></a><a name="index-islower-3153"></a><a name="index-isprint-3154"></a><a name="index-ispunct-3155"></a><a name="index-isspace-3156"></a><a name="index-isupper-3157"></a><a name="index-iswalnum-3158"></a><a name="index-iswalpha-3159"></a><a name="index-iswblank-3160"></a><a name="index-iswcntrl-3161"></a><a name="index-iswdigit-3162"></a><a name="index-iswgraph-3163"></a><a name="index-iswlower-3164"></a><a name="index-iswprint-3165"></a><a name="index-iswpunct-3166"></a><a name="index-iswspace-3167"></a><a name="index-iswupper-3168"></a><a name="index-iswxdigit-3169"></a><a name="index-isxdigit-3170"></a><a name="index-j0-3171"></a><a name="index-j0f-3172"></a><a name="index-j0l-3173"></a><a name="index-j1-3174"></a><a name="index-j1f-3175"></a><a name="index-j1l-3176"></a><a name="index-jn-3177"></a><a name="index-jnf-3178"></a><a name="index-jnl-3179"></a><a name="index-labs-3180"></a><a name="index-ldexp-3181"></a><a name="index-ldexpf-3182"></a><a name="index-ldexpl-3183"></a><a name="index-lgamma-3184"></a><a name="index-lgammaf-3185"></a><a name="index-lgammal-3186"></a><a name="index-lgamma_005fr-3187"></a><a name="index-lgammaf_005fr-3188"></a><a name="index-lgammal_005fr-3189"></a><a name="index-llabs-3190"></a><a name="index-llrint-3191"></a><a name="index-llrintf-3192"></a><a name="index-llrintl-3193"></a><a name="index-llround-3194"></a><a name="index-llroundf-3195"></a><a name="index-llroundl-3196"></a><a name="index-log-3197"></a><a name="index-log10-3198"></a><a name="index-log10f-3199"></a><a name="index-log10l-3200"></a><a name="index-log1p-3201"></a><a name="index-log1pf-3202"></a><a name="index-log1pl-3203"></a><a name="index-log2-3204"></a><a name="index-log2f-3205"></a><a name="index-log2l-3206"></a><a name="index-logb-3207"></a><a name="index-logbf-3208"></a><a name="index-logbl-3209"></a><a name="index-logf-3210"></a><a name="index-logl-3211"></a><a name="index-lrint-3212"></a><a name="index-lrintf-3213"></a><a name="index-lrintl-3214"></a><a name="index-lround-3215"></a><a name="index-lroundf-3216"></a><a name="index-lroundl-3217"></a><a name="index-malloc-3218"></a><a name="index-memchr-3219"></a><a name="index-memcmp-3220"></a><a name="index-memcpy-3221"></a><a name="index-mempcpy-3222"></a><a name="index-memset-3223"></a><a name="index-modf-3224"></a><a name="index-modff-3225"></a><a name="index-modfl-3226"></a><a name="index-nearbyint-3227"></a><a name="index-nearbyintf-3228"></a><a name="index-nearbyintl-3229"></a><a name="index-nextafter-3230"></a><a name="index-nextafterf-3231"></a><a name="index-nextafterl-3232"></a><a name="index-nexttoward-3233"></a><a name="index-nexttowardf-3234"></a><a name="index-nexttowardl-3235"></a><a name="index-pow-3236"></a><a name="index-pow10-3237"></a><a name="index-pow10f-3238"></a><a name="index-pow10l-3239"></a><a name="index-powf-3240"></a><a name="index-powl-3241"></a><a name="index-printf-3242"></a><a name="index-printf_005funlocked-3243"></a><a name="index-putchar-3244"></a><a name="index-puts-3245"></a><a name="index-remainder-3246"></a><a name="index-remainderf-3247"></a><a name="index-remainderl-3248"></a><a name="index-remquo-3249"></a><a name="index-remquof-3250"></a><a name="index-remquol-3251"></a><a name="index-rindex-3252"></a><a name="index-rint-3253"></a><a name="index-rintf-3254"></a><a name="index-rintl-3255"></a><a name="index-round-3256"></a><a name="index-roundf-3257"></a><a name="index-roundl-3258"></a><a name="index-scalb-3259"></a><a name="index-scalbf-3260"></a><a name="index-scalbl-3261"></a><a name="index-scalbln-3262"></a><a name="index-scalblnf-3263"></a><a name="index-scalblnf-3264"></a><a name="index-scalbn-3265"></a><a name="index-scalbnf-3266"></a><a name="index-scanfnl-3267"></a><a name="index-signbit-3268"></a><a name="index-signbitf-3269"></a><a name="index-signbitl-3270"></a><a name="index-signbitd32-3271"></a><a name="index-signbitd64-3272"></a><a name="index-signbitd128-3273"></a><a name="index-significand-3274"></a><a name="index-significandf-3275"></a><a name="index-significandl-3276"></a><a name="index-sin-3277"></a><a name="index-sincos-3278"></a><a name="index-sincosf-3279"></a><a name="index-sincosl-3280"></a><a name="index-sinf-3281"></a><a name="index-sinh-3282"></a><a name="index-sinhf-3283"></a><a name="index-sinhl-3284"></a><a name="index-sinl-3285"></a><a name="index-snprintf-3286"></a><a name="index-sprintf-3287"></a><a name="index-sqrt-3288"></a><a name="index-sqrtf-3289"></a><a name="index-sqrtl-3290"></a><a name="index-sscanf-3291"></a><a name="index-stpcpy-3292"></a><a name="index-stpncpy-3293"></a><a name="index-strcasecmp-3294"></a><a name="index-strcat-3295"></a><a name="index-strchr-3296"></a><a name="index-strcmp-3297"></a><a name="index-strcpy-3298"></a><a name="index-strcspn-3299"></a><a name="index-strdup-3300"></a><a name="index-strfmon-3301"></a><a name="index-strftime-3302"></a><a name="index-strlen-3303"></a><a name="index-strncasecmp-3304"></a><a name="index-strncat-3305"></a><a name="index-strncmp-3306"></a><a name="index-strncpy-3307"></a><a name="index-strndup-3308"></a><a name="index-strpbrk-3309"></a><a name="index-strrchr-3310"></a><a name="index-strspn-3311"></a><a name="index-strstr-3312"></a><a name="index-tan-3313"></a><a name="index-tanf-3314"></a><a name="index-tanh-3315"></a><a name="index-tanhf-3316"></a><a name="index-tanhl-3317"></a><a name="index-tanl-3318"></a><a name="index-tgamma-3319"></a><a name="index-tgammaf-3320"></a><a name="index-tgammal-3321"></a><a name="index-toascii-3322"></a><a name="index-tolower-3323"></a><a name="index-toupper-3324"></a><a name="index-towlower-3325"></a><a name="index-towupper-3326"></a><a name="index-trunc-3327"></a><a name="index-truncf-3328"></a><a name="index-truncl-3329"></a><a name="index-vfprintf-3330"></a><a name="index-vfscanf-3331"></a><a name="index-vprintf-3332"></a><a name="index-vscanf-3333"></a><a name="index-vsnprintf-3334"></a><a name="index-vsprintf-3335"></a><a name="index-vsscanf-3336"></a><a name="index-y0-3337"></a><a name="index-y0f-3338"></a><a name="index-y0l-3339"></a><a name="index-y1-3340"></a><a name="index-y1f-3341"></a><a name="index-y1l-3342"></a><a name="index-yn-3343"></a><a name="index-ynf-3344"></a><a name="index-ynl-3345"></a> |
| GCC provides a large number of built-in functions other than the ones |
| mentioned above. Some of these are for internal use in the processing |
| of exceptions or variable-length argument lists and are not |
| documented here because they may change from time to time; we do not |
| recommend general use of these functions. |
| |
| <p>The remaining functions are provided for optimization purposes. |
| |
| <p><a name="index-fno_002dbuiltin-3346"></a>GCC includes built-in versions of many of the functions in the standard |
| C library. The versions prefixed with <code>__builtin_</code> are always |
| treated as having the same meaning as the C library function even if you |
| specify the <samp><span class="option">-fno-builtin</span></samp> option. (see <a href="C-Dialect-Options.html#C-Dialect-Options">C Dialect Options</a>) |
| Many of these functions are only optimized in certain cases; if they are |
| not optimized in a particular case, a call to the library function is |
| emitted. |
| |
| <p><a name="index-ansi-3347"></a><a name="index-std-3348"></a>Outside strict ISO C mode (<samp><span class="option">-ansi</span></samp>, <samp><span class="option">-std=c90</span></samp>, |
| <samp><span class="option">-std=c99</span></samp> or <samp><span class="option">-std=c11</span></samp>), the functions |
| <code>_exit</code>, <code>alloca</code>, <code>bcmp</code>, <code>bzero</code>, |
| <code>dcgettext</code>, <code>dgettext</code>, <code>dremf</code>, <code>dreml</code>, |
| <code>drem</code>, <code>exp10f</code>, <code>exp10l</code>, <code>exp10</code>, <code>ffsll</code>, |
| <code>ffsl</code>, <code>ffs</code>, <code>fprintf_unlocked</code>, |
| <code>fputs_unlocked</code>, <code>gammaf</code>, <code>gammal</code>, <code>gamma</code>, |
| <code>gammaf_r</code>, <code>gammal_r</code>, <code>gamma_r</code>, <code>gettext</code>, |
| <code>index</code>, <code>isascii</code>, <code>j0f</code>, <code>j0l</code>, <code>j0</code>, |
| <code>j1f</code>, <code>j1l</code>, <code>j1</code>, <code>jnf</code>, <code>jnl</code>, <code>jn</code>, |
| <code>lgammaf_r</code>, <code>lgammal_r</code>, <code>lgamma_r</code>, <code>mempcpy</code>, |
| <code>pow10f</code>, <code>pow10l</code>, <code>pow10</code>, <code>printf_unlocked</code>, |
| <code>rindex</code>, <code>scalbf</code>, <code>scalbl</code>, <code>scalb</code>, |
| <code>signbit</code>, <code>signbitf</code>, <code>signbitl</code>, <code>signbitd32</code>, |
| <code>signbitd64</code>, <code>signbitd128</code>, <code>significandf</code>, |
| <code>significandl</code>, <code>significand</code>, <code>sincosf</code>, |
| <code>sincosl</code>, <code>sincos</code>, <code>stpcpy</code>, <code>stpncpy</code>, |
| <code>strcasecmp</code>, <code>strdup</code>, <code>strfmon</code>, <code>strncasecmp</code>, |
| <code>strndup</code>, <code>toascii</code>, <code>y0f</code>, <code>y0l</code>, <code>y0</code>, |
| <code>y1f</code>, <code>y1l</code>, <code>y1</code>, <code>ynf</code>, <code>ynl</code> and |
| <code>yn</code> |
| may be handled as built-in functions. |
| All these functions have corresponding versions |
| prefixed with <code>__builtin_</code>, which may be used even in strict C90 |
| mode. |
| |
| <p>The ISO C99 functions |
| <code>_Exit</code>, <code>acoshf</code>, <code>acoshl</code>, <code>acosh</code>, <code>asinhf</code>, |
| <code>asinhl</code>, <code>asinh</code>, <code>atanhf</code>, <code>atanhl</code>, <code>atanh</code>, |
| <code>cabsf</code>, <code>cabsl</code>, <code>cabs</code>, <code>cacosf</code>, <code>cacoshf</code>, |
| <code>cacoshl</code>, <code>cacosh</code>, <code>cacosl</code>, <code>cacos</code>, |
| <code>cargf</code>, <code>cargl</code>, <code>carg</code>, <code>casinf</code>, <code>casinhf</code>, |
| <code>casinhl</code>, <code>casinh</code>, <code>casinl</code>, <code>casin</code>, |
| <code>catanf</code>, <code>catanhf</code>, <code>catanhl</code>, <code>catanh</code>, |
| <code>catanl</code>, <code>catan</code>, <code>cbrtf</code>, <code>cbrtl</code>, <code>cbrt</code>, |
| <code>ccosf</code>, <code>ccoshf</code>, <code>ccoshl</code>, <code>ccosh</code>, <code>ccosl</code>, |
| <code>ccos</code>, <code>cexpf</code>, <code>cexpl</code>, <code>cexp</code>, <code>cimagf</code>, |
| <code>cimagl</code>, <code>cimag</code>, <code>clogf</code>, <code>clogl</code>, <code>clog</code>, |
| <code>conjf</code>, <code>conjl</code>, <code>conj</code>, <code>copysignf</code>, <code>copysignl</code>, |
| <code>copysign</code>, <code>cpowf</code>, <code>cpowl</code>, <code>cpow</code>, <code>cprojf</code>, |
| <code>cprojl</code>, <code>cproj</code>, <code>crealf</code>, <code>creall</code>, <code>creal</code>, |
| <code>csinf</code>, <code>csinhf</code>, <code>csinhl</code>, <code>csinh</code>, <code>csinl</code>, |
| <code>csin</code>, <code>csqrtf</code>, <code>csqrtl</code>, <code>csqrt</code>, <code>ctanf</code>, |
| <code>ctanhf</code>, <code>ctanhl</code>, <code>ctanh</code>, <code>ctanl</code>, <code>ctan</code>, |
| <code>erfcf</code>, <code>erfcl</code>, <code>erfc</code>, <code>erff</code>, <code>erfl</code>, |
| <code>erf</code>, <code>exp2f</code>, <code>exp2l</code>, <code>exp2</code>, <code>expm1f</code>, |
| <code>expm1l</code>, <code>expm1</code>, <code>fdimf</code>, <code>fdiml</code>, <code>fdim</code>, |
| <code>fmaf</code>, <code>fmal</code>, <code>fmaxf</code>, <code>fmaxl</code>, <code>fmax</code>, |
| <code>fma</code>, <code>fminf</code>, <code>fminl</code>, <code>fmin</code>, <code>hypotf</code>, |
| <code>hypotl</code>, <code>hypot</code>, <code>ilogbf</code>, <code>ilogbl</code>, <code>ilogb</code>, |
| <code>imaxabs</code>, <code>isblank</code>, <code>iswblank</code>, <code>lgammaf</code>, |
| <code>lgammal</code>, <code>lgamma</code>, <code>llabs</code>, <code>llrintf</code>, <code>llrintl</code>, |
| <code>llrint</code>, <code>llroundf</code>, <code>llroundl</code>, <code>llround</code>, |
| <code>log1pf</code>, <code>log1pl</code>, <code>log1p</code>, <code>log2f</code>, <code>log2l</code>, |
| <code>log2</code>, <code>logbf</code>, <code>logbl</code>, <code>logb</code>, <code>lrintf</code>, |
| <code>lrintl</code>, <code>lrint</code>, <code>lroundf</code>, <code>lroundl</code>, |
| <code>lround</code>, <code>nearbyintf</code>, <code>nearbyintl</code>, <code>nearbyint</code>, |
| <code>nextafterf</code>, <code>nextafterl</code>, <code>nextafter</code>, |
| <code>nexttowardf</code>, <code>nexttowardl</code>, <code>nexttoward</code>, |
| <code>remainderf</code>, <code>remainderl</code>, <code>remainder</code>, <code>remquof</code>, |
| <code>remquol</code>, <code>remquo</code>, <code>rintf</code>, <code>rintl</code>, <code>rint</code>, |
| <code>roundf</code>, <code>roundl</code>, <code>round</code>, <code>scalblnf</code>, |
| <code>scalblnl</code>, <code>scalbln</code>, <code>scalbnf</code>, <code>scalbnl</code>, |
| <code>scalbn</code>, <code>snprintf</code>, <code>tgammaf</code>, <code>tgammal</code>, |
| <code>tgamma</code>, <code>truncf</code>, <code>truncl</code>, <code>trunc</code>, |
| <code>vfscanf</code>, <code>vscanf</code>, <code>vsnprintf</code> and <code>vsscanf</code> |
| are handled as built-in functions |
| except in strict ISO C90 mode (<samp><span class="option">-ansi</span></samp> or <samp><span class="option">-std=c90</span></samp>). |
| |
| <p>There are also built-in versions of the ISO C99 functions |
| <code>acosf</code>, <code>acosl</code>, <code>asinf</code>, <code>asinl</code>, <code>atan2f</code>, |
| <code>atan2l</code>, <code>atanf</code>, <code>atanl</code>, <code>ceilf</code>, <code>ceill</code>, |
| <code>cosf</code>, <code>coshf</code>, <code>coshl</code>, <code>cosl</code>, <code>expf</code>, |
| <code>expl</code>, <code>fabsf</code>, <code>fabsl</code>, <code>floorf</code>, <code>floorl</code>, |
| <code>fmodf</code>, <code>fmodl</code>, <code>frexpf</code>, <code>frexpl</code>, <code>ldexpf</code>, |
| <code>ldexpl</code>, <code>log10f</code>, <code>log10l</code>, <code>logf</code>, <code>logl</code>, |
| <code>modfl</code>, <code>modf</code>, <code>powf</code>, <code>powl</code>, <code>sinf</code>, |
| <code>sinhf</code>, <code>sinhl</code>, <code>sinl</code>, <code>sqrtf</code>, <code>sqrtl</code>, |
| <code>tanf</code>, <code>tanhf</code>, <code>tanhl</code> and <code>tanl</code> |
| that are recognized in any mode since ISO C90 reserves these names for |
| the purpose to which ISO C99 puts them. All these functions have |
| corresponding versions prefixed with <code>__builtin_</code>. |
| |
| <p>The ISO C94 functions |
| <code>iswalnum</code>, <code>iswalpha</code>, <code>iswcntrl</code>, <code>iswdigit</code>, |
| <code>iswgraph</code>, <code>iswlower</code>, <code>iswprint</code>, <code>iswpunct</code>, |
| <code>iswspace</code>, <code>iswupper</code>, <code>iswxdigit</code>, <code>towlower</code> and |
| <code>towupper</code> |
| are handled as built-in functions |
| except in strict ISO C90 mode (<samp><span class="option">-ansi</span></samp> or <samp><span class="option">-std=c90</span></samp>). |
| |
| <p>The ISO C90 functions |
| <code>abort</code>, <code>abs</code>, <code>acos</code>, <code>asin</code>, <code>atan2</code>, |
| <code>atan</code>, <code>calloc</code>, <code>ceil</code>, <code>cosh</code>, <code>cos</code>, |
| <code>exit</code>, <code>exp</code>, <code>fabs</code>, <code>floor</code>, <code>fmod</code>, |
| <code>fprintf</code>, <code>fputs</code>, <code>frexp</code>, <code>fscanf</code>, |
| <code>isalnum</code>, <code>isalpha</code>, <code>iscntrl</code>, <code>isdigit</code>, |
| <code>isgraph</code>, <code>islower</code>, <code>isprint</code>, <code>ispunct</code>, |
| <code>isspace</code>, <code>isupper</code>, <code>isxdigit</code>, <code>tolower</code>, |
| <code>toupper</code>, <code>labs</code>, <code>ldexp</code>, <code>log10</code>, <code>log</code>, |
| <code>malloc</code>, <code>memchr</code>, <code>memcmp</code>, <code>memcpy</code>, |
| <code>memset</code>, <code>modf</code>, <code>pow</code>, <code>printf</code>, <code>putchar</code>, |
| <code>puts</code>, <code>scanf</code>, <code>sinh</code>, <code>sin</code>, <code>snprintf</code>, |
| <code>sprintf</code>, <code>sqrt</code>, <code>sscanf</code>, <code>strcat</code>, |
| <code>strchr</code>, <code>strcmp</code>, <code>strcpy</code>, <code>strcspn</code>, |
| <code>strlen</code>, <code>strncat</code>, <code>strncmp</code>, <code>strncpy</code>, |
| <code>strpbrk</code>, <code>strrchr</code>, <code>strspn</code>, <code>strstr</code>, |
| <code>tanh</code>, <code>tan</code>, <code>vfprintf</code>, <code>vprintf</code> and <code>vsprintf</code> |
| are all recognized as built-in functions unless |
| <samp><span class="option">-fno-builtin</span></samp> is specified (or <samp><span class="option">-fno-builtin-</span><var>function</var></samp> |
| is specified for an individual function). All of these functions have |
| corresponding versions prefixed with <code>__builtin_</code>. |
| |
| <p>GCC provides built-in versions of the ISO C99 floating-point comparison |
| macros that avoid raising exceptions for unordered operands. They have |
| the same names as the standard macros ( <code>isgreater</code>, |
| <code>isgreaterequal</code>, <code>isless</code>, <code>islessequal</code>, |
| <code>islessgreater</code>, and <code>isunordered</code>) , with <code>__builtin_</code> |
| prefixed. We intend for a library implementor to be able to simply |
| <code>#define</code> each standard macro to its built-in equivalent. |
| In the same fashion, GCC provides <code>fpclassify</code>, <code>isfinite</code>, |
| <code>isinf_sign</code> and <code>isnormal</code> built-ins used with |
| <code>__builtin_</code> prefixed. The <code>isinf</code> and <code>isnan</code> |
| built-in functions appear both with and without the <code>__builtin_</code> prefix. |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_types_compatible_p</b> (<var>type1, type2</var>)<var><a name="index-g_t_005f_005fbuiltin_005ftypes_005fcompatible_005fp-3349"></a></var><br> |
| <blockquote> |
| <p>You can use the built-in function <code>__builtin_types_compatible_p</code> to |
| determine whether two types are the same. |
| |
| <p>This built-in function returns 1 if the unqualified versions of the |
| types <var>type1</var> and <var>type2</var> (which are types, not expressions) are |
| compatible, 0 otherwise. The result of this built-in function can be |
| used in integer constant expressions. |
| |
| <p>This built-in function ignores top level qualifiers (e.g., <code>const</code>, |
| <code>volatile</code>). For example, <code>int</code> is equivalent to <code>const |
| int</code>. |
| |
| <p>The type <code>int[]</code> and <code>int[5]</code> are compatible. On the other |
| hand, <code>int</code> and <code>char *</code> are not compatible, even if the size |
| of their types, on the particular architecture are the same. Also, the |
| amount of pointer indirection is taken into account when determining |
| similarity. Consequently, <code>short *</code> is not similar to |
| <code>short **</code>. Furthermore, two types that are typedefed are |
| considered compatible if their underlying types are compatible. |
| |
| <p>An <code>enum</code> type is not considered to be compatible with another |
| <code>enum</code> type even if both are compatible with the same integer |
| type; this is what the C standard specifies. |
| For example, <code>enum {foo, bar}</code> is not similar to |
| <code>enum {hot, dog}</code>. |
| |
| <p>You typically use this function in code whose execution varies |
| depending on the arguments' types. For example: |
| |
| <pre class="smallexample"> #define foo(x) \ |
| ({ \ |
| typeof (x) tmp = (x); \ |
| if (__builtin_types_compatible_p (typeof (x), long double)) \ |
| tmp = foo_long_double (tmp); \ |
| else if (__builtin_types_compatible_p (typeof (x), double)) \ |
| tmp = foo_double (tmp); \ |
| else if (__builtin_types_compatible_p (typeof (x), float)) \ |
| tmp = foo_float (tmp); \ |
| else \ |
| abort (); \ |
| tmp; \ |
| }) |
| </pre> |
| <p><em>Note:</em> This construct is only available for C. |
| |
| </blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: <var>type</var> <b>__builtin_choose_expr</b> (<var>const_exp, exp1, exp2</var>)<var><a name="index-g_t_005f_005fbuiltin_005fchoose_005fexpr-3350"></a></var><br> |
| <blockquote> |
| <p>You can use the built-in function <code>__builtin_choose_expr</code> to |
| evaluate code depending on the value of a constant expression. This |
| built-in function returns <var>exp1</var> if <var>const_exp</var>, which is an |
| integer constant expression, is nonzero. Otherwise it returns <var>exp2</var>. |
| |
| <p>This built-in function is analogous to the ‘<samp><span class="samp">? :</span></samp>’ operator in C, |
| except that the expression returned has its type unaltered by promotion |
| rules. Also, the built-in function does not evaluate the expression |
| that is not chosen. For example, if <var>const_exp</var> evaluates to true, |
| <var>exp2</var> is not evaluated even if it has side-effects. |
| |
| <p>This built-in function can return an lvalue if the chosen argument is an |
| lvalue. |
| |
| <p>If <var>exp1</var> is returned, the return type is the same as <var>exp1</var>'s |
| type. Similarly, if <var>exp2</var> is returned, its return type is the same |
| as <var>exp2</var>. |
| |
| <p>Example: |
| |
| <pre class="smallexample"> #define foo(x) \ |
| __builtin_choose_expr ( \ |
| __builtin_types_compatible_p (typeof (x), double), \ |
| foo_double (x), \ |
| __builtin_choose_expr ( \ |
| __builtin_types_compatible_p (typeof (x), float), \ |
| foo_float (x), \ |
| /* <span class="roman">The void expression results in a compile-time error</span> \ |
| <span class="roman">when assigning the result to something.</span> */ \ |
| (void)0)) |
| </pre> |
| <p><em>Note:</em> This construct is only available for C. Furthermore, the |
| unused expression (<var>exp1</var> or <var>exp2</var> depending on the value of |
| <var>const_exp</var>) may still generate syntax errors. This may change in |
| future revisions. |
| |
| </blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: <var>type</var> <b>__builtin_complex</b> (<var>real, imag</var>)<var><a name="index-g_t_005f_005fbuiltin_005fcomplex-3351"></a></var><br> |
| <blockquote> |
| <p>The built-in function <code>__builtin_complex</code> is provided for use in |
| implementing the ISO C11 macros <code>CMPLXF</code>, <code>CMPLX</code> and |
| <code>CMPLXL</code>. <var>real</var> and <var>imag</var> must have the same type, a |
| real binary floating-point type, and the result has the corresponding |
| complex type with real and imaginary parts <var>real</var> and <var>imag</var>. |
| Unlike ‘<samp><var>real</var><span class="samp"> + I * </span><var>imag</var></samp>’, this works even when |
| infinities, NaNs and negative zeros are involved. |
| |
| </blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_constant_p</b> (<var>exp</var>)<var><a name="index-g_t_005f_005fbuiltin_005fconstant_005fp-3352"></a></var><br> |
| <blockquote><p>You can use the built-in function <code>__builtin_constant_p</code> to |
| determine if a value is known to be constant at compile time and hence |
| that GCC can perform constant-folding on expressions involving that |
| value. The argument of the function is the value to test. The function |
| returns the integer 1 if the argument is known to be a compile-time |
| constant and 0 if it is not known to be a compile-time constant. A |
| return of 0 does not indicate that the value is <em>not</em> a constant, |
| but merely that GCC cannot prove it is a constant with the specified |
| value of the <samp><span class="option">-O</span></samp> option. |
| |
| <p>You typically use this function in an embedded application where |
| memory is a critical resource. If you have some complex calculation, |
| you may want it to be folded if it involves constants, but need to call |
| a function if it does not. For example: |
| |
| <pre class="smallexample"> #define Scale_Value(X) \ |
| (__builtin_constant_p (X) \ |
| ? ((X) * SCALE + OFFSET) : Scale (X)) |
| </pre> |
| <p>You may use this built-in function in either a macro or an inline |
| function. However, if you use it in an inlined function and pass an |
| argument of the function as the argument to the built-in, GCC |
| never returns 1 when you call the inline function with a string constant |
| or compound literal (see <a href="Compound-Literals.html#Compound-Literals">Compound Literals</a>) and does not return 1 |
| when you pass a constant numeric value to the inline function unless you |
| specify the <samp><span class="option">-O</span></samp> option. |
| |
| <p>You may also use <code>__builtin_constant_p</code> in initializers for static |
| data. For instance, you can write |
| |
| <pre class="smallexample"> static const int table[] = { |
| __builtin_constant_p (EXPRESSION) ? (EXPRESSION) : -1, |
| /* <span class="roman">...</span> */ |
| }; |
| </pre> |
| <p class="noindent">This is an acceptable initializer even if <var>EXPRESSION</var> is not a |
| constant expression, including the case where |
| <code>__builtin_constant_p</code> returns 1 because <var>EXPRESSION</var> can be |
| folded to a constant but <var>EXPRESSION</var> contains operands that are |
| not otherwise permitted in a static initializer (for example, |
| <code>0 && foo ()</code>). GCC must be more conservative about evaluating the |
| built-in in this case, because it has no opportunity to perform |
| optimization. |
| |
| <p>Previous versions of GCC did not accept this built-in in data |
| initializers. The earliest version where it is completely safe is |
| 3.0.1. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: long <b>__builtin_expect</b> (<var>long exp, long c</var>)<var><a name="index-g_t_005f_005fbuiltin_005fexpect-3353"></a></var><br> |
| <blockquote><p><a name="index-fprofile_002darcs-3354"></a>You may use <code>__builtin_expect</code> to provide the compiler with |
| branch prediction information. In general, you should prefer to |
| use actual profile feedback for this (<samp><span class="option">-fprofile-arcs</span></samp>), as |
| programmers are notoriously bad at predicting how their programs |
| actually perform. However, there are applications in which this |
| data is hard to collect. |
| |
| <p>The return value is the value of <var>exp</var>, which should be an integral |
| expression. The semantics of the built-in are that it is expected that |
| <var>exp</var> == <var>c</var>. For example: |
| |
| <pre class="smallexample"> if (__builtin_expect (x, 0)) |
| foo (); |
| </pre> |
| <p class="noindent">indicates that we do not expect to call <code>foo</code>, since |
| we expect <code>x</code> to be zero. Since you are limited to integral |
| expressions for <var>exp</var>, you should use constructions such as |
| |
| <pre class="smallexample"> if (__builtin_expect (ptr != NULL, 1)) |
| foo (*ptr); |
| </pre> |
| <p class="noindent">when testing pointer or floating-point values. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: void <b>__builtin_trap</b> (<var>void</var>)<var><a name="index-g_t_005f_005fbuiltin_005ftrap-3355"></a></var><br> |
| <blockquote><p>This function causes the program to exit abnormally. GCC implements |
| this function by using a target-dependent mechanism (such as |
| intentionally executing an illegal instruction) or by calling |
| <code>abort</code>. The mechanism used may vary from release to release so |
| you should not rely on any particular implementation. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: void <b>__builtin_unreachable</b> (<var>void</var>)<var><a name="index-g_t_005f_005fbuiltin_005funreachable-3356"></a></var><br> |
| <blockquote><p>If control flow reaches the point of the <code>__builtin_unreachable</code>, |
| the program is undefined. It is useful in situations where the |
| compiler cannot deduce the unreachability of the code. |
| |
| <p>One such case is immediately following an <code>asm</code> statement that |
| either never terminates, or one that transfers control elsewhere |
| and never returns. In this example, without the |
| <code>__builtin_unreachable</code>, GCC issues a warning that control |
| reaches the end of a non-void function. It also generates code |
| to return after the <code>asm</code>. |
| |
| <pre class="smallexample"> int f (int c, int v) |
| { |
| if (c) |
| { |
| return v; |
| } |
| else |
| { |
| asm("jmp error_handler"); |
| __builtin_unreachable (); |
| } |
| } |
| </pre> |
| <p class="noindent">Because the <code>asm</code> statement unconditionally transfers control out |
| of the function, control never reaches the end of the function |
| body. The <code>__builtin_unreachable</code> is in fact unreachable and |
| communicates this fact to the compiler. |
| |
| <p>Another use for <code>__builtin_unreachable</code> is following a call a |
| function that never returns but that is not declared |
| <code>__attribute__((noreturn))</code>, as in this example: |
| |
| <pre class="smallexample"> void function_that_never_returns (void); |
| |
| int g (int c) |
| { |
| if (c) |
| { |
| return 1; |
| } |
| else |
| { |
| function_that_never_returns (); |
| __builtin_unreachable (); |
| } |
| } |
| </pre> |
| </blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: void <b>*__builtin_assume_aligned</b> (<var>const void *exp, size_t align, ...</var>)<var><a name="index-g_t_002a_005f_005fbuiltin_005fassume_005faligned-3357"></a></var><br> |
| <blockquote><p>This function returns its first argument, and allows the compiler |
| to assume that the returned pointer is at least <var>align</var> bytes |
| aligned. This built-in can have either two or three arguments, |
| if it has three, the third argument should have integer type, and |
| if it is nonzero means misalignment offset. For example: |
| |
| <pre class="smallexample"> void *x = __builtin_assume_aligned (arg, 16); |
| </pre> |
| <p class="noindent">means that the compiler can assume <code>x</code>, set to <code>arg</code>, is at least |
| 16-byte aligned, while: |
| |
| <pre class="smallexample"> void *x = __builtin_assume_aligned (arg, 32, 8); |
| </pre> |
| <p class="noindent">means that the compiler can assume for <code>x</code>, set to <code>arg</code>, that |
| <code>(char *) x - 8</code> is 32-byte aligned. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_LINE</b> ()<var><a name="index-g_t_005f_005fbuiltin_005fLINE-3358"></a></var><br> |
| <blockquote><p>This function is the equivalent to the preprocessor <code>__LINE__</code> |
| macro and returns the line number of the invocation of the built-in. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_FUNCTION</b> ()<var><a name="index-g_t_005f_005fbuiltin_005fFUNCTION-3359"></a></var><br> |
| <blockquote><p>This function is the equivalent to the preprocessor <code>__FUNCTION__</code> |
| macro and returns the function name the invocation of the built-in is in. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_FILE</b> ()<var><a name="index-g_t_005f_005fbuiltin_005fFILE-3360"></a></var><br> |
| <blockquote><p>This function is the equivalent to the preprocessor <code>__FILE__</code> |
| macro and returns the file name the invocation of the built-in is in. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: void <b>__builtin___clear_cache</b> (<var>char *begin, char *end</var>)<var><a name="index-g_t_005f_005fbuiltin_005f_005f_005fclear_005fcache-3361"></a></var><br> |
| <blockquote><p>This function is used to flush the processor's instruction cache for |
| the region of memory between <var>begin</var> inclusive and <var>end</var> |
| exclusive. Some targets require that the instruction cache be |
| flushed, after modifying memory containing code, in order to obtain |
| deterministic behavior. |
| |
| <p>If the target does not require instruction cache flushes, |
| <code>__builtin___clear_cache</code> has no effect. Otherwise either |
| instructions are emitted in-line to clear the instruction cache or a |
| call to the <code>__clear_cache</code> function in libgcc is made. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: void <b>__builtin_prefetch</b> (<var>const void *addr, ...</var>)<var><a name="index-g_t_005f_005fbuiltin_005fprefetch-3362"></a></var><br> |
| <blockquote><p>This function is used to minimize cache-miss latency by moving data into |
| a cache before it is accessed. |
| You can insert calls to <code>__builtin_prefetch</code> into code for which |
| you know addresses of data in memory that is likely to be accessed soon. |
| If the target supports them, data prefetch instructions are generated. |
| If the prefetch is done early enough before the access then the data will |
| be in the cache by the time it is accessed. |
| |
| <p>The value of <var>addr</var> is the address of the memory to prefetch. |
| There are two optional arguments, <var>rw</var> and <var>locality</var>. |
| The value of <var>rw</var> is a compile-time constant one or zero; one |
| means that the prefetch is preparing for a write to the memory address |
| and zero, the default, means that the prefetch is preparing for a read. |
| The value <var>locality</var> must be a compile-time constant integer between |
| zero and three. A value of zero means that the data has no temporal |
| locality, so it need not be left in the cache after the access. A value |
| of three means that the data has a high degree of temporal locality and |
| should be left in all levels of cache possible. Values of one and two |
| mean, respectively, a low or moderate degree of temporal locality. The |
| default is three. |
| |
| <pre class="smallexample"> for (i = 0; i < n; i++) |
| { |
| a[i] = a[i] + b[i]; |
| __builtin_prefetch (&a[i+j], 1, 1); |
| __builtin_prefetch (&b[i+j], 0, 1); |
| /* <span class="roman">...</span> */ |
| } |
| </pre> |
| <p>Data prefetch does not generate faults if <var>addr</var> is invalid, but |
| the address expression itself must be valid. For example, a prefetch |
| of <code>p->next</code> does not fault if <code>p->next</code> is not a valid |
| address, but evaluation faults if <code>p</code> is not a valid address. |
| |
| <p>If the target does not support data prefetch, the address expression |
| is evaluated if it includes side effects but no other code is generated |
| and GCC does not issue a warning. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: double <b>__builtin_huge_val</b> (<var>void</var>)<var><a name="index-g_t_005f_005fbuiltin_005fhuge_005fval-3363"></a></var><br> |
| <blockquote><p>Returns a positive infinity, if supported by the floating-point format, |
| else <code>DBL_MAX</code>. This function is suitable for implementing the |
| ISO C macro <code>HUGE_VAL</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: float <b>__builtin_huge_valf</b> (<var>void</var>)<var><a name="index-g_t_005f_005fbuiltin_005fhuge_005fvalf-3364"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_huge_val</code>, except the return type is <code>float</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: long double <b>__builtin_huge_vall</b> (<var>void</var>)<var><a name="index-g_t_005f_005fbuiltin_005fhuge_005fvall-3365"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_huge_val</code>, except the return |
| type is <code>long double</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_fpclassify</b> (<var>int, int, int, int, int, ...</var>)<var><a name="index-g_t_005f_005fbuiltin_005ffpclassify-3366"></a></var><br> |
| <blockquote><p>This built-in implements the C99 fpclassify functionality. The first |
| five int arguments should be the target library's notion of the |
| possible FP classes and are used for return values. They must be |
| constant values and they must appear in this order: <code>FP_NAN</code>, |
| <code>FP_INFINITE</code>, <code>FP_NORMAL</code>, <code>FP_SUBNORMAL</code> and |
| <code>FP_ZERO</code>. The ellipsis is for exactly one floating-point value |
| to classify. GCC treats the last argument as type-generic, which |
| means it does not do default promotion from float to double. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: double <b>__builtin_inf</b> (<var>void</var>)<var><a name="index-g_t_005f_005fbuiltin_005finf-3367"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_huge_val</code>, except a warning is generated |
| if the target floating-point format does not support infinities. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: _Decimal32 <b>__builtin_infd32</b> (<var>void</var>)<var><a name="index-g_t_005f_005fbuiltin_005finfd32-3368"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_inf</code>, except the return type is <code>_Decimal32</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: _Decimal64 <b>__builtin_infd64</b> (<var>void</var>)<var><a name="index-g_t_005f_005fbuiltin_005finfd64-3369"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_inf</code>, except the return type is <code>_Decimal64</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: _Decimal128 <b>__builtin_infd128</b> (<var>void</var>)<var><a name="index-g_t_005f_005fbuiltin_005finfd128-3370"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_inf</code>, except the return type is <code>_Decimal128</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: float <b>__builtin_inff</b> (<var>void</var>)<var><a name="index-g_t_005f_005fbuiltin_005finff-3371"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_inf</code>, except the return type is <code>float</code>. |
| This function is suitable for implementing the ISO C99 macro <code>INFINITY</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: long double <b>__builtin_infl</b> (<var>void</var>)<var><a name="index-g_t_005f_005fbuiltin_005finfl-3372"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_inf</code>, except the return |
| type is <code>long double</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_isinf_sign</b> (<var>...</var>)<var><a name="index-g_t_005f_005fbuiltin_005fisinf_005fsign-3373"></a></var><br> |
| <blockquote><p>Similar to <code>isinf</code>, except the return value is negative for |
| an argument of <code>-Inf</code>. Note while the parameter list is an |
| ellipsis, this function only accepts exactly one floating-point |
| argument. GCC treats this parameter as type-generic, which means it |
| does not do default promotion from float to double. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: double <b>__builtin_nan</b> (<var>const char *str</var>)<var><a name="index-g_t_005f_005fbuiltin_005fnan-3374"></a></var><br> |
| <blockquote><p>This is an implementation of the ISO C99 function <code>nan</code>. |
| |
| <p>Since ISO C99 defines this function in terms of <code>strtod</code>, which we |
| do not implement, a description of the parsing is in order. The string |
| is parsed as by <code>strtol</code>; that is, the base is recognized by |
| leading ‘<samp><span class="samp">0</span></samp>’ or ‘<samp><span class="samp">0x</span></samp>’ prefixes. The number parsed is placed |
| in the significand such that the least significant bit of the number |
| is at the least significant bit of the significand. The number is |
| truncated to fit the significand field provided. The significand is |
| forced to be a quiet NaN. |
| |
| <p>This function, if given a string literal all of which would have been |
| consumed by <code>strtol</code>, is evaluated early enough that it is considered a |
| compile-time constant. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: _Decimal32 <b>__builtin_nand32</b> (<var>const char *str</var>)<var><a name="index-g_t_005f_005fbuiltin_005fnand32-3375"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_nan</code>, except the return type is <code>_Decimal32</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: _Decimal64 <b>__builtin_nand64</b> (<var>const char *str</var>)<var><a name="index-g_t_005f_005fbuiltin_005fnand64-3376"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_nan</code>, except the return type is <code>_Decimal64</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: _Decimal128 <b>__builtin_nand128</b> (<var>const char *str</var>)<var><a name="index-g_t_005f_005fbuiltin_005fnand128-3377"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_nan</code>, except the return type is <code>_Decimal128</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: float <b>__builtin_nanf</b> (<var>const char *str</var>)<var><a name="index-g_t_005f_005fbuiltin_005fnanf-3378"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_nan</code>, except the return type is <code>float</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: long double <b>__builtin_nanl</b> (<var>const char *str</var>)<var><a name="index-g_t_005f_005fbuiltin_005fnanl-3379"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_nan</code>, except the return type is <code>long double</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: double <b>__builtin_nans</b> (<var>const char *str</var>)<var><a name="index-g_t_005f_005fbuiltin_005fnans-3380"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_nan</code>, except the significand is forced |
| to be a signaling NaN. The <code>nans</code> function is proposed by |
| <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n965.htm">WG14 N965</a>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: float <b>__builtin_nansf</b> (<var>const char *str</var>)<var><a name="index-g_t_005f_005fbuiltin_005fnansf-3381"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_nans</code>, except the return type is <code>float</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: long double <b>__builtin_nansl</b> (<var>const char *str</var>)<var><a name="index-g_t_005f_005fbuiltin_005fnansl-3382"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_nans</code>, except the return type is <code>long double</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_ffs</b> (<var>unsigned int x</var>)<var><a name="index-g_t_005f_005fbuiltin_005fffs-3383"></a></var><br> |
| <blockquote><p>Returns one plus the index of the least significant 1-bit of <var>x</var>, or |
| if <var>x</var> is zero, returns zero. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_clz</b> (<var>unsigned int x</var>)<var><a name="index-g_t_005f_005fbuiltin_005fclz-3384"></a></var><br> |
| <blockquote><p>Returns the number of leading 0-bits in <var>x</var>, starting at the most |
| significant bit position. If <var>x</var> is 0, the result is undefined. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_ctz</b> (<var>unsigned int x</var>)<var><a name="index-g_t_005f_005fbuiltin_005fctz-3385"></a></var><br> |
| <blockquote><p>Returns the number of trailing 0-bits in <var>x</var>, starting at the least |
| significant bit position. If <var>x</var> is 0, the result is undefined. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_clrsb</b> (<var>int x</var>)<var><a name="index-g_t_005f_005fbuiltin_005fclrsb-3386"></a></var><br> |
| <blockquote><p>Returns the number of leading redundant sign bits in <var>x</var>, i.e. the |
| number of bits following the most significant bit that are identical |
| to it. There are no special cases for 0 or other values. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_popcount</b> (<var>unsigned int x</var>)<var><a name="index-g_t_005f_005fbuiltin_005fpopcount-3387"></a></var><br> |
| <blockquote><p>Returns the number of 1-bits in <var>x</var>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_parity</b> (<var>unsigned int x</var>)<var><a name="index-g_t_005f_005fbuiltin_005fparity-3388"></a></var><br> |
| <blockquote><p>Returns the parity of <var>x</var>, i.e. the number of 1-bits in <var>x</var> |
| modulo 2. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_ffsl</b> (<var>unsigned long</var>)<var><a name="index-g_t_005f_005fbuiltin_005fffsl-3389"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_ffs</code>, except the argument type is |
| <code>unsigned long</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_clzl</b> (<var>unsigned long</var>)<var><a name="index-g_t_005f_005fbuiltin_005fclzl-3390"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_clz</code>, except the argument type is |
| <code>unsigned long</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_ctzl</b> (<var>unsigned long</var>)<var><a name="index-g_t_005f_005fbuiltin_005fctzl-3391"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_ctz</code>, except the argument type is |
| <code>unsigned long</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_clrsbl</b> (<var>long</var>)<var><a name="index-g_t_005f_005fbuiltin_005fclrsbl-3392"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_clrsb</code>, except the argument type is |
| <code>long</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_popcountl</b> (<var>unsigned long</var>)<var><a name="index-g_t_005f_005fbuiltin_005fpopcountl-3393"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_popcount</code>, except the argument type is |
| <code>unsigned long</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_parityl</b> (<var>unsigned long</var>)<var><a name="index-g_t_005f_005fbuiltin_005fparityl-3394"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_parity</code>, except the argument type is |
| <code>unsigned long</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_ffsll</b> (<var>unsigned long long</var>)<var><a name="index-g_t_005f_005fbuiltin_005fffsll-3395"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_ffs</code>, except the argument type is |
| <code>unsigned long long</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_clzll</b> (<var>unsigned long long</var>)<var><a name="index-g_t_005f_005fbuiltin_005fclzll-3396"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_clz</code>, except the argument type is |
| <code>unsigned long long</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_ctzll</b> (<var>unsigned long long</var>)<var><a name="index-g_t_005f_005fbuiltin_005fctzll-3397"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_ctz</code>, except the argument type is |
| <code>unsigned long long</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_clrsbll</b> (<var>long long</var>)<var><a name="index-g_t_005f_005fbuiltin_005fclrsbll-3398"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_clrsb</code>, except the argument type is |
| <code>long long</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_popcountll</b> (<var>unsigned long long</var>)<var><a name="index-g_t_005f_005fbuiltin_005fpopcountll-3399"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_popcount</code>, except the argument type is |
| <code>unsigned long long</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: int <b>__builtin_parityll</b> (<var>unsigned long long</var>)<var><a name="index-g_t_005f_005fbuiltin_005fparityll-3400"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_parity</code>, except the argument type is |
| <code>unsigned long long</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: double <b>__builtin_powi</b> (<var>double, int</var>)<var><a name="index-g_t_005f_005fbuiltin_005fpowi-3401"></a></var><br> |
| <blockquote><p>Returns the first argument raised to the power of the second. Unlike the |
| <code>pow</code> function no guarantees about precision and rounding are made. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: float <b>__builtin_powif</b> (<var>float, int</var>)<var><a name="index-g_t_005f_005fbuiltin_005fpowif-3402"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_powi</code>, except the argument and return types |
| are <code>float</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: long double <b>__builtin_powil</b> (<var>long double, int</var>)<var><a name="index-g_t_005f_005fbuiltin_005fpowil-3403"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_powi</code>, except the argument and return types |
| are <code>long double</code>. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: uint16_t <b>__builtin_bswap16</b> (<var>uint16_t x</var>)<var><a name="index-g_t_005f_005fbuiltin_005fbswap16-3404"></a></var><br> |
| <blockquote><p>Returns <var>x</var> with the order of the bytes reversed; for example, |
| <code>0xaabb</code> becomes <code>0xbbaa</code>. Byte here always means |
| exactly 8 bits. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: uint32_t <b>__builtin_bswap32</b> (<var>uint32_t x</var>)<var><a name="index-g_t_005f_005fbuiltin_005fbswap32-3405"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_bswap16</code>, except the argument and return types |
| are 32 bit. |
| </p></blockquote></div> |
| |
| <div class="defun"> |
| — Built-in Function: uint64_t <b>__builtin_bswap64</b> (<var>uint64_t x</var>)<var><a name="index-g_t_005f_005fbuiltin_005fbswap64-3406"></a></var><br> |
| <blockquote><p>Similar to <code>__builtin_bswap32</code>, except the argument and return types |
| are 64 bit. |
| </p></blockquote></div> |
| |
| </body></html> |
| |