Other-Builtins.html 66 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2017 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <title>Using the GNU Compiler Collection (GCC): Other Builtins</title>
  20. <meta name="description" content="Using the GNU Compiler Collection (GCC): Other Builtins">
  21. <meta name="keywords" content="Using the GNU Compiler Collection (GCC): Other Builtins">
  22. <meta name="resource-type" content="document">
  23. <meta name="distribution" content="global">
  24. <meta name="Generator" content="makeinfo">
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="C-Extensions.html#C-Extensions" rel="up" title="C Extensions">
  30. <link href="Target-Builtins.html#Target-Builtins" rel="next" title="Target Builtins">
  31. <link href="Cilk-Plus-Builtins.html#Cilk-Plus-Builtins" rel="prev" title="Cilk Plus Builtins">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.smallquotation {font-size: smaller}
  36. div.display {margin-left: 3.2em}
  37. div.example {margin-left: 3.2em}
  38. div.indentedblock {margin-left: 3.2em}
  39. div.lisp {margin-left: 3.2em}
  40. div.smalldisplay {margin-left: 3.2em}
  41. div.smallexample {margin-left: 3.2em}
  42. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style:oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nocodebreak {white-space:nowrap}
  54. span.nolinebreak {white-space:nowrap}
  55. span.roman {font-family:serif; font-weight:normal}
  56. span.sansserif {font-family:sans-serif; font-weight:normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  62. <a name="Other-Builtins"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="Target-Builtins.html#Target-Builtins" accesskey="n" rel="next">Target Builtins</a>, Previous: <a href="Cilk-Plus-Builtins.html#Cilk-Plus-Builtins" accesskey="p" rel="prev">Cilk Plus Builtins</a>, Up: <a href="C-Extensions.html#C-Extensions" accesskey="u" rel="up">C Extensions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  66. </div>
  67. <hr>
  68. <a name="Other-Built_002din-Functions-Provided-by-GCC"></a>
  69. <h3 class="section">6.59 Other Built-in Functions Provided by GCC</h3>
  70. <a name="index-built_002din-functions-1"></a>
  71. <a name="index-_005f_005fbuiltin_005falloca"></a>
  72. <a name="index-_005f_005fbuiltin_005falloca_005fwith_005falign"></a>
  73. <a name="index-_005f_005fbuiltin_005fcall_005fwith_005fstatic_005fchain"></a>
  74. <a name="index-_005f_005fbuiltin_005ffpclassify"></a>
  75. <a name="index-_005f_005fbuiltin_005fisfinite"></a>
  76. <a name="index-_005f_005fbuiltin_005fisnormal"></a>
  77. <a name="index-_005f_005fbuiltin_005fisgreater"></a>
  78. <a name="index-_005f_005fbuiltin_005fisgreaterequal"></a>
  79. <a name="index-_005f_005fbuiltin_005fisinf_005fsign"></a>
  80. <a name="index-_005f_005fbuiltin_005fisless"></a>
  81. <a name="index-_005f_005fbuiltin_005fislessequal"></a>
  82. <a name="index-_005f_005fbuiltin_005fislessgreater"></a>
  83. <a name="index-_005f_005fbuiltin_005fisunordered"></a>
  84. <a name="index-_005f_005fbuiltin_005fpowi"></a>
  85. <a name="index-_005f_005fbuiltin_005fpowif"></a>
  86. <a name="index-_005f_005fbuiltin_005fpowil"></a>
  87. <a name="index-_005fExit"></a>
  88. <a name="index-_005fexit"></a>
  89. <a name="index-abort"></a>
  90. <a name="index-abs"></a>
  91. <a name="index-acos"></a>
  92. <a name="index-acosf"></a>
  93. <a name="index-acosh"></a>
  94. <a name="index-acoshf"></a>
  95. <a name="index-acoshl"></a>
  96. <a name="index-acosl"></a>
  97. <a name="index-alloca"></a>
  98. <a name="index-asin"></a>
  99. <a name="index-asinf"></a>
  100. <a name="index-asinh"></a>
  101. <a name="index-asinhf"></a>
  102. <a name="index-asinhl"></a>
  103. <a name="index-asinl"></a>
  104. <a name="index-atan"></a>
  105. <a name="index-atan2"></a>
  106. <a name="index-atan2f"></a>
  107. <a name="index-atan2l"></a>
  108. <a name="index-atanf"></a>
  109. <a name="index-atanh"></a>
  110. <a name="index-atanhf"></a>
  111. <a name="index-atanhl"></a>
  112. <a name="index-atanl"></a>
  113. <a name="index-bcmp"></a>
  114. <a name="index-bzero"></a>
  115. <a name="index-cabs"></a>
  116. <a name="index-cabsf"></a>
  117. <a name="index-cabsl"></a>
  118. <a name="index-cacos"></a>
  119. <a name="index-cacosf"></a>
  120. <a name="index-cacosh"></a>
  121. <a name="index-cacoshf"></a>
  122. <a name="index-cacoshl"></a>
  123. <a name="index-cacosl"></a>
  124. <a name="index-calloc"></a>
  125. <a name="index-carg"></a>
  126. <a name="index-cargf"></a>
  127. <a name="index-cargl"></a>
  128. <a name="index-casin"></a>
  129. <a name="index-casinf"></a>
  130. <a name="index-casinh"></a>
  131. <a name="index-casinhf"></a>
  132. <a name="index-casinhl"></a>
  133. <a name="index-casinl"></a>
  134. <a name="index-catan"></a>
  135. <a name="index-catanf"></a>
  136. <a name="index-catanh"></a>
  137. <a name="index-catanhf"></a>
  138. <a name="index-catanhl"></a>
  139. <a name="index-catanl"></a>
  140. <a name="index-cbrt"></a>
  141. <a name="index-cbrtf"></a>
  142. <a name="index-cbrtl"></a>
  143. <a name="index-ccos"></a>
  144. <a name="index-ccosf"></a>
  145. <a name="index-ccosh"></a>
  146. <a name="index-ccoshf"></a>
  147. <a name="index-ccoshl"></a>
  148. <a name="index-ccosl"></a>
  149. <a name="index-ceil"></a>
  150. <a name="index-ceilf"></a>
  151. <a name="index-ceill"></a>
  152. <a name="index-cexp"></a>
  153. <a name="index-cexpf"></a>
  154. <a name="index-cexpl"></a>
  155. <a name="index-cimag"></a>
  156. <a name="index-cimagf"></a>
  157. <a name="index-cimagl"></a>
  158. <a name="index-clog"></a>
  159. <a name="index-clogf"></a>
  160. <a name="index-clogl"></a>
  161. <a name="index-clog10"></a>
  162. <a name="index-clog10f"></a>
  163. <a name="index-clog10l"></a>
  164. <a name="index-conj"></a>
  165. <a name="index-conjf"></a>
  166. <a name="index-conjl"></a>
  167. <a name="index-copysign"></a>
  168. <a name="index-copysignf"></a>
  169. <a name="index-copysignl"></a>
  170. <a name="index-cos"></a>
  171. <a name="index-cosf"></a>
  172. <a name="index-cosh"></a>
  173. <a name="index-coshf"></a>
  174. <a name="index-coshl"></a>
  175. <a name="index-cosl"></a>
  176. <a name="index-cpow"></a>
  177. <a name="index-cpowf"></a>
  178. <a name="index-cpowl"></a>
  179. <a name="index-cproj"></a>
  180. <a name="index-cprojf"></a>
  181. <a name="index-cprojl"></a>
  182. <a name="index-creal"></a>
  183. <a name="index-crealf"></a>
  184. <a name="index-creall"></a>
  185. <a name="index-csin"></a>
  186. <a name="index-csinf"></a>
  187. <a name="index-csinh"></a>
  188. <a name="index-csinhf"></a>
  189. <a name="index-csinhl"></a>
  190. <a name="index-csinl"></a>
  191. <a name="index-csqrt"></a>
  192. <a name="index-csqrtf"></a>
  193. <a name="index-csqrtl"></a>
  194. <a name="index-ctan"></a>
  195. <a name="index-ctanf"></a>
  196. <a name="index-ctanh"></a>
  197. <a name="index-ctanhf"></a>
  198. <a name="index-ctanhl"></a>
  199. <a name="index-ctanl"></a>
  200. <a name="index-dcgettext"></a>
  201. <a name="index-dgettext"></a>
  202. <a name="index-drem"></a>
  203. <a name="index-dremf"></a>
  204. <a name="index-dreml"></a>
  205. <a name="index-erf"></a>
  206. <a name="index-erfc"></a>
  207. <a name="index-erfcf"></a>
  208. <a name="index-erfcl"></a>
  209. <a name="index-erff"></a>
  210. <a name="index-erfl"></a>
  211. <a name="index-exit"></a>
  212. <a name="index-exp"></a>
  213. <a name="index-exp10"></a>
  214. <a name="index-exp10f"></a>
  215. <a name="index-exp10l"></a>
  216. <a name="index-exp2"></a>
  217. <a name="index-exp2f"></a>
  218. <a name="index-exp2l"></a>
  219. <a name="index-expf"></a>
  220. <a name="index-expl"></a>
  221. <a name="index-expm1"></a>
  222. <a name="index-expm1f"></a>
  223. <a name="index-expm1l"></a>
  224. <a name="index-fabs"></a>
  225. <a name="index-fabsf"></a>
  226. <a name="index-fabsl"></a>
  227. <a name="index-fdim"></a>
  228. <a name="index-fdimf"></a>
  229. <a name="index-fdiml"></a>
  230. <a name="index-ffs"></a>
  231. <a name="index-floor"></a>
  232. <a name="index-floorf"></a>
  233. <a name="index-floorl"></a>
  234. <a name="index-fma"></a>
  235. <a name="index-fmaf"></a>
  236. <a name="index-fmal"></a>
  237. <a name="index-fmax"></a>
  238. <a name="index-fmaxf"></a>
  239. <a name="index-fmaxl"></a>
  240. <a name="index-fmin"></a>
  241. <a name="index-fminf"></a>
  242. <a name="index-fminl"></a>
  243. <a name="index-fmod"></a>
  244. <a name="index-fmodf"></a>
  245. <a name="index-fmodl"></a>
  246. <a name="index-fprintf"></a>
  247. <a name="index-fprintf_005funlocked"></a>
  248. <a name="index-fputs"></a>
  249. <a name="index-fputs_005funlocked"></a>
  250. <a name="index-frexp"></a>
  251. <a name="index-frexpf"></a>
  252. <a name="index-frexpl"></a>
  253. <a name="index-fscanf"></a>
  254. <a name="index-gamma"></a>
  255. <a name="index-gammaf"></a>
  256. <a name="index-gammal"></a>
  257. <a name="index-gamma_005fr"></a>
  258. <a name="index-gammaf_005fr"></a>
  259. <a name="index-gammal_005fr"></a>
  260. <a name="index-gettext"></a>
  261. <a name="index-hypot"></a>
  262. <a name="index-hypotf"></a>
  263. <a name="index-hypotl"></a>
  264. <a name="index-ilogb"></a>
  265. <a name="index-ilogbf"></a>
  266. <a name="index-ilogbl"></a>
  267. <a name="index-imaxabs"></a>
  268. <a name="index-index"></a>
  269. <a name="index-isalnum"></a>
  270. <a name="index-isalpha"></a>
  271. <a name="index-isascii"></a>
  272. <a name="index-isblank"></a>
  273. <a name="index-iscntrl"></a>
  274. <a name="index-isdigit"></a>
  275. <a name="index-isgraph"></a>
  276. <a name="index-islower"></a>
  277. <a name="index-isprint"></a>
  278. <a name="index-ispunct"></a>
  279. <a name="index-isspace"></a>
  280. <a name="index-isupper"></a>
  281. <a name="index-iswalnum"></a>
  282. <a name="index-iswalpha"></a>
  283. <a name="index-iswblank"></a>
  284. <a name="index-iswcntrl"></a>
  285. <a name="index-iswdigit"></a>
  286. <a name="index-iswgraph"></a>
  287. <a name="index-iswlower"></a>
  288. <a name="index-iswprint"></a>
  289. <a name="index-iswpunct"></a>
  290. <a name="index-iswspace"></a>
  291. <a name="index-iswupper"></a>
  292. <a name="index-iswxdigit"></a>
  293. <a name="index-isxdigit"></a>
  294. <a name="index-j0"></a>
  295. <a name="index-j0f"></a>
  296. <a name="index-j0l"></a>
  297. <a name="index-j1"></a>
  298. <a name="index-j1f"></a>
  299. <a name="index-j1l"></a>
  300. <a name="index-jn"></a>
  301. <a name="index-jnf"></a>
  302. <a name="index-jnl"></a>
  303. <a name="index-labs"></a>
  304. <a name="index-ldexp"></a>
  305. <a name="index-ldexpf"></a>
  306. <a name="index-ldexpl"></a>
  307. <a name="index-lgamma"></a>
  308. <a name="index-lgammaf"></a>
  309. <a name="index-lgammal"></a>
  310. <a name="index-lgamma_005fr"></a>
  311. <a name="index-lgammaf_005fr"></a>
  312. <a name="index-lgammal_005fr"></a>
  313. <a name="index-llabs"></a>
  314. <a name="index-llrint"></a>
  315. <a name="index-llrintf"></a>
  316. <a name="index-llrintl"></a>
  317. <a name="index-llround"></a>
  318. <a name="index-llroundf"></a>
  319. <a name="index-llroundl"></a>
  320. <a name="index-log"></a>
  321. <a name="index-log10"></a>
  322. <a name="index-log10f"></a>
  323. <a name="index-log10l"></a>
  324. <a name="index-log1p"></a>
  325. <a name="index-log1pf"></a>
  326. <a name="index-log1pl"></a>
  327. <a name="index-log2"></a>
  328. <a name="index-log2f"></a>
  329. <a name="index-log2l"></a>
  330. <a name="index-logb"></a>
  331. <a name="index-logbf"></a>
  332. <a name="index-logbl"></a>
  333. <a name="index-logf"></a>
  334. <a name="index-logl"></a>
  335. <a name="index-lrint"></a>
  336. <a name="index-lrintf"></a>
  337. <a name="index-lrintl"></a>
  338. <a name="index-lround"></a>
  339. <a name="index-lroundf"></a>
  340. <a name="index-lroundl"></a>
  341. <a name="index-malloc"></a>
  342. <a name="index-memchr"></a>
  343. <a name="index-memcmp"></a>
  344. <a name="index-memcpy"></a>
  345. <a name="index-mempcpy"></a>
  346. <a name="index-memset"></a>
  347. <a name="index-modf"></a>
  348. <a name="index-modff"></a>
  349. <a name="index-modfl"></a>
  350. <a name="index-nearbyint"></a>
  351. <a name="index-nearbyintf"></a>
  352. <a name="index-nearbyintl"></a>
  353. <a name="index-nextafter"></a>
  354. <a name="index-nextafterf"></a>
  355. <a name="index-nextafterl"></a>
  356. <a name="index-nexttoward"></a>
  357. <a name="index-nexttowardf"></a>
  358. <a name="index-nexttowardl"></a>
  359. <a name="index-pow"></a>
  360. <a name="index-pow10"></a>
  361. <a name="index-pow10f"></a>
  362. <a name="index-pow10l"></a>
  363. <a name="index-powf"></a>
  364. <a name="index-powl"></a>
  365. <a name="index-printf"></a>
  366. <a name="index-printf_005funlocked"></a>
  367. <a name="index-putchar"></a>
  368. <a name="index-puts"></a>
  369. <a name="index-remainder"></a>
  370. <a name="index-remainderf"></a>
  371. <a name="index-remainderl"></a>
  372. <a name="index-remquo"></a>
  373. <a name="index-remquof"></a>
  374. <a name="index-remquol"></a>
  375. <a name="index-rindex"></a>
  376. <a name="index-rint"></a>
  377. <a name="index-rintf"></a>
  378. <a name="index-rintl"></a>
  379. <a name="index-round"></a>
  380. <a name="index-roundf"></a>
  381. <a name="index-roundl"></a>
  382. <a name="index-scalb"></a>
  383. <a name="index-scalbf"></a>
  384. <a name="index-scalbl"></a>
  385. <a name="index-scalbln"></a>
  386. <a name="index-scalblnf"></a>
  387. <a name="index-scalblnf-1"></a>
  388. <a name="index-scalbn"></a>
  389. <a name="index-scalbnf"></a>
  390. <a name="index-scanfnl"></a>
  391. <a name="index-signbit"></a>
  392. <a name="index-signbitf"></a>
  393. <a name="index-signbitl"></a>
  394. <a name="index-signbitd32"></a>
  395. <a name="index-signbitd64"></a>
  396. <a name="index-signbitd128"></a>
  397. <a name="index-significand"></a>
  398. <a name="index-significandf"></a>
  399. <a name="index-significandl"></a>
  400. <a name="index-sin"></a>
  401. <a name="index-sincos"></a>
  402. <a name="index-sincosf"></a>
  403. <a name="index-sincosl"></a>
  404. <a name="index-sinf"></a>
  405. <a name="index-sinh"></a>
  406. <a name="index-sinhf"></a>
  407. <a name="index-sinhl"></a>
  408. <a name="index-sinl"></a>
  409. <a name="index-snprintf"></a>
  410. <a name="index-sprintf"></a>
  411. <a name="index-sqrt"></a>
  412. <a name="index-sqrtf"></a>
  413. <a name="index-sqrtl"></a>
  414. <a name="index-sscanf"></a>
  415. <a name="index-stpcpy"></a>
  416. <a name="index-stpncpy"></a>
  417. <a name="index-strcasecmp"></a>
  418. <a name="index-strcat"></a>
  419. <a name="index-strchr"></a>
  420. <a name="index-strcmp"></a>
  421. <a name="index-strcpy"></a>
  422. <a name="index-strcspn"></a>
  423. <a name="index-strdup"></a>
  424. <a name="index-strfmon"></a>
  425. <a name="index-strftime"></a>
  426. <a name="index-strlen"></a>
  427. <a name="index-strncasecmp"></a>
  428. <a name="index-strncat"></a>
  429. <a name="index-strncmp"></a>
  430. <a name="index-strncpy"></a>
  431. <a name="index-strndup"></a>
  432. <a name="index-strpbrk"></a>
  433. <a name="index-strrchr"></a>
  434. <a name="index-strspn"></a>
  435. <a name="index-strstr"></a>
  436. <a name="index-tan"></a>
  437. <a name="index-tanf"></a>
  438. <a name="index-tanh"></a>
  439. <a name="index-tanhf"></a>
  440. <a name="index-tanhl"></a>
  441. <a name="index-tanl"></a>
  442. <a name="index-tgamma"></a>
  443. <a name="index-tgammaf"></a>
  444. <a name="index-tgammal"></a>
  445. <a name="index-toascii"></a>
  446. <a name="index-tolower"></a>
  447. <a name="index-toupper"></a>
  448. <a name="index-towlower"></a>
  449. <a name="index-towupper"></a>
  450. <a name="index-trunc"></a>
  451. <a name="index-truncf"></a>
  452. <a name="index-truncl"></a>
  453. <a name="index-vfprintf"></a>
  454. <a name="index-vfscanf"></a>
  455. <a name="index-vprintf"></a>
  456. <a name="index-vscanf"></a>
  457. <a name="index-vsnprintf"></a>
  458. <a name="index-vsprintf"></a>
  459. <a name="index-vsscanf"></a>
  460. <a name="index-y0"></a>
  461. <a name="index-y0f"></a>
  462. <a name="index-y0l"></a>
  463. <a name="index-y1"></a>
  464. <a name="index-y1f"></a>
  465. <a name="index-y1l"></a>
  466. <a name="index-yn"></a>
  467. <a name="index-ynf"></a>
  468. <a name="index-ynl"></a>
  469. <p>GCC provides a large number of built-in functions other than the ones
  470. mentioned above. Some of these are for internal use in the processing
  471. of exceptions or variable-length argument lists and are not
  472. documented here because they may change from time to time; we do not
  473. recommend general use of these functions.
  474. </p>
  475. <p>The remaining functions are provided for optimization purposes.
  476. </p>
  477. <p>With the exception of built-ins that have library equivalents such as
  478. the standard C library functions discussed below, or that expand to
  479. library calls, GCC built-in functions are always expanded inline and
  480. thus do not have corresponding entry points and their address cannot
  481. be obtained. Attempting to use them in an expression other than
  482. a function call results in a compile-time error.
  483. </p>
  484. <a name="index-fno_002dbuiltin-3"></a>
  485. <p>GCC includes built-in versions of many of the functions in the standard
  486. C library. These functions come in two forms: one whose names start with
  487. the <code>__builtin_</code> prefix, and the other without. Both forms have the
  488. same type (including prototype), the same address (when their address is
  489. taken), and the same meaning as the C library functions even if you specify
  490. the <samp>-fno-builtin</samp> option see <a href="C-Dialect-Options.html#C-Dialect-Options">C Dialect Options</a>). Many of these
  491. functions are only optimized in certain cases; if they are not optimized in
  492. a particular case, a call to the library function is emitted.
  493. </p>
  494. <a name="index-ansi-2"></a>
  495. <a name="index-std-2"></a>
  496. <p>Outside strict ISO C mode (<samp>-ansi</samp>, <samp>-std=c90</samp>,
  497. <samp>-std=c99</samp> or <samp>-std=c11</samp>), the functions
  498. <code>_exit</code>, <code>alloca</code>, <code>bcmp</code>, <code>bzero</code>,
  499. <code>dcgettext</code>, <code>dgettext</code>, <code>dremf</code>, <code>dreml</code>,
  500. <code>drem</code>, <code>exp10f</code>, <code>exp10l</code>, <code>exp10</code>, <code>ffsll</code>,
  501. <code>ffsl</code>, <code>ffs</code>, <code>fprintf_unlocked</code>,
  502. <code>fputs_unlocked</code>, <code>gammaf</code>, <code>gammal</code>, <code>gamma</code>,
  503. <code>gammaf_r</code>, <code>gammal_r</code>, <code>gamma_r</code>, <code>gettext</code>,
  504. <code>index</code>, <code>isascii</code>, <code>j0f</code>, <code>j0l</code>, <code>j0</code>,
  505. <code>j1f</code>, <code>j1l</code>, <code>j1</code>, <code>jnf</code>, <code>jnl</code>, <code>jn</code>,
  506. <code>lgammaf_r</code>, <code>lgammal_r</code>, <code>lgamma_r</code>, <code>mempcpy</code>,
  507. <code>pow10f</code>, <code>pow10l</code>, <code>pow10</code>, <code>printf_unlocked</code>,
  508. <code>rindex</code>, <code>scalbf</code>, <code>scalbl</code>, <code>scalb</code>,
  509. <code>signbit</code>, <code>signbitf</code>, <code>signbitl</code>, <code>signbitd32</code>,
  510. <code>signbitd64</code>, <code>signbitd128</code>, <code>significandf</code>,
  511. <code>significandl</code>, <code>significand</code>, <code>sincosf</code>,
  512. <code>sincosl</code>, <code>sincos</code>, <code>stpcpy</code>, <code>stpncpy</code>,
  513. <code>strcasecmp</code>, <code>strdup</code>, <code>strfmon</code>, <code>strncasecmp</code>,
  514. <code>strndup</code>, <code>toascii</code>, <code>y0f</code>, <code>y0l</code>, <code>y0</code>,
  515. <code>y1f</code>, <code>y1l</code>, <code>y1</code>, <code>ynf</code>, <code>ynl</code> and
  516. <code>yn</code>
  517. may be handled as built-in functions.
  518. All these functions have corresponding versions
  519. prefixed with <code>__builtin_</code>, which may be used even in strict C90
  520. mode.
  521. </p>
  522. <p>The ISO C99 functions
  523. <code>_Exit</code>, <code>acoshf</code>, <code>acoshl</code>, <code>acosh</code>, <code>asinhf</code>,
  524. <code>asinhl</code>, <code>asinh</code>, <code>atanhf</code>, <code>atanhl</code>, <code>atanh</code>,
  525. <code>cabsf</code>, <code>cabsl</code>, <code>cabs</code>, <code>cacosf</code>, <code>cacoshf</code>,
  526. <code>cacoshl</code>, <code>cacosh</code>, <code>cacosl</code>, <code>cacos</code>,
  527. <code>cargf</code>, <code>cargl</code>, <code>carg</code>, <code>casinf</code>, <code>casinhf</code>,
  528. <code>casinhl</code>, <code>casinh</code>, <code>casinl</code>, <code>casin</code>,
  529. <code>catanf</code>, <code>catanhf</code>, <code>catanhl</code>, <code>catanh</code>,
  530. <code>catanl</code>, <code>catan</code>, <code>cbrtf</code>, <code>cbrtl</code>, <code>cbrt</code>,
  531. <code>ccosf</code>, <code>ccoshf</code>, <code>ccoshl</code>, <code>ccosh</code>, <code>ccosl</code>,
  532. <code>ccos</code>, <code>cexpf</code>, <code>cexpl</code>, <code>cexp</code>, <code>cimagf</code>,
  533. <code>cimagl</code>, <code>cimag</code>, <code>clogf</code>, <code>clogl</code>, <code>clog</code>,
  534. <code>conjf</code>, <code>conjl</code>, <code>conj</code>, <code>copysignf</code>, <code>copysignl</code>,
  535. <code>copysign</code>, <code>cpowf</code>, <code>cpowl</code>, <code>cpow</code>, <code>cprojf</code>,
  536. <code>cprojl</code>, <code>cproj</code>, <code>crealf</code>, <code>creall</code>, <code>creal</code>,
  537. <code>csinf</code>, <code>csinhf</code>, <code>csinhl</code>, <code>csinh</code>, <code>csinl</code>,
  538. <code>csin</code>, <code>csqrtf</code>, <code>csqrtl</code>, <code>csqrt</code>, <code>ctanf</code>,
  539. <code>ctanhf</code>, <code>ctanhl</code>, <code>ctanh</code>, <code>ctanl</code>, <code>ctan</code>,
  540. <code>erfcf</code>, <code>erfcl</code>, <code>erfc</code>, <code>erff</code>, <code>erfl</code>,
  541. <code>erf</code>, <code>exp2f</code>, <code>exp2l</code>, <code>exp2</code>, <code>expm1f</code>,
  542. <code>expm1l</code>, <code>expm1</code>, <code>fdimf</code>, <code>fdiml</code>, <code>fdim</code>,
  543. <code>fmaf</code>, <code>fmal</code>, <code>fmaxf</code>, <code>fmaxl</code>, <code>fmax</code>,
  544. <code>fma</code>, <code>fminf</code>, <code>fminl</code>, <code>fmin</code>, <code>hypotf</code>,
  545. <code>hypotl</code>, <code>hypot</code>, <code>ilogbf</code>, <code>ilogbl</code>, <code>ilogb</code>,
  546. <code>imaxabs</code>, <code>isblank</code>, <code>iswblank</code>, <code>lgammaf</code>,
  547. <code>lgammal</code>, <code>lgamma</code>, <code>llabs</code>, <code>llrintf</code>, <code>llrintl</code>,
  548. <code>llrint</code>, <code>llroundf</code>, <code>llroundl</code>, <code>llround</code>,
  549. <code>log1pf</code>, <code>log1pl</code>, <code>log1p</code>, <code>log2f</code>, <code>log2l</code>,
  550. <code>log2</code>, <code>logbf</code>, <code>logbl</code>, <code>logb</code>, <code>lrintf</code>,
  551. <code>lrintl</code>, <code>lrint</code>, <code>lroundf</code>, <code>lroundl</code>,
  552. <code>lround</code>, <code>nearbyintf</code>, <code>nearbyintl</code>, <code>nearbyint</code>,
  553. <code>nextafterf</code>, <code>nextafterl</code>, <code>nextafter</code>,
  554. <code>nexttowardf</code>, <code>nexttowardl</code>, <code>nexttoward</code>,
  555. <code>remainderf</code>, <code>remainderl</code>, <code>remainder</code>, <code>remquof</code>,
  556. <code>remquol</code>, <code>remquo</code>, <code>rintf</code>, <code>rintl</code>, <code>rint</code>,
  557. <code>roundf</code>, <code>roundl</code>, <code>round</code>, <code>scalblnf</code>,
  558. <code>scalblnl</code>, <code>scalbln</code>, <code>scalbnf</code>, <code>scalbnl</code>,
  559. <code>scalbn</code>, <code>snprintf</code>, <code>tgammaf</code>, <code>tgammal</code>,
  560. <code>tgamma</code>, <code>truncf</code>, <code>truncl</code>, <code>trunc</code>,
  561. <code>vfscanf</code>, <code>vscanf</code>, <code>vsnprintf</code> and <code>vsscanf</code>
  562. are handled as built-in functions
  563. except in strict ISO C90 mode (<samp>-ansi</samp> or <samp>-std=c90</samp>).
  564. </p>
  565. <p>There are also built-in versions of the ISO C99 functions
  566. <code>acosf</code>, <code>acosl</code>, <code>asinf</code>, <code>asinl</code>, <code>atan2f</code>,
  567. <code>atan2l</code>, <code>atanf</code>, <code>atanl</code>, <code>ceilf</code>, <code>ceill</code>,
  568. <code>cosf</code>, <code>coshf</code>, <code>coshl</code>, <code>cosl</code>, <code>expf</code>,
  569. <code>expl</code>, <code>fabsf</code>, <code>fabsl</code>, <code>floorf</code>, <code>floorl</code>,
  570. <code>fmodf</code>, <code>fmodl</code>, <code>frexpf</code>, <code>frexpl</code>, <code>ldexpf</code>,
  571. <code>ldexpl</code>, <code>log10f</code>, <code>log10l</code>, <code>logf</code>, <code>logl</code>,
  572. <code>modfl</code>, <code>modf</code>, <code>powf</code>, <code>powl</code>, <code>sinf</code>,
  573. <code>sinhf</code>, <code>sinhl</code>, <code>sinl</code>, <code>sqrtf</code>, <code>sqrtl</code>,
  574. <code>tanf</code>, <code>tanhf</code>, <code>tanhl</code> and <code>tanl</code>
  575. that are recognized in any mode since ISO C90 reserves these names for
  576. the purpose to which ISO C99 puts them. All these functions have
  577. corresponding versions prefixed with <code>__builtin_</code>.
  578. </p>
  579. <p>There are also built-in functions <code>__builtin_fabsf<var>n</var></code>,
  580. <code>__builtin_fabsf<var>n</var>x</code>, <code>__builtin_copysignf<var>n</var></code> and
  581. <code>__builtin_copysignf<var>n</var>x</code>, corresponding to the TS 18661-3
  582. functions <code>fabsf<var>n</var></code>, <code>fabsf<var>n</var>x</code>,
  583. <code>copysignf<var>n</var></code> and <code>copysignf<var>n</var>x</code>, for supported
  584. types <code>_Float<var>n</var></code> and <code>_Float<var>n</var>x</code>.
  585. </p>
  586. <p>There are also GNU extension functions <code>clog10</code>, <code>clog10f</code> and
  587. <code>clog10l</code> which names are reserved by ISO C99 for future use.
  588. All these functions have versions prefixed with <code>__builtin_</code>.
  589. </p>
  590. <p>The ISO C94 functions
  591. <code>iswalnum</code>, <code>iswalpha</code>, <code>iswcntrl</code>, <code>iswdigit</code>,
  592. <code>iswgraph</code>, <code>iswlower</code>, <code>iswprint</code>, <code>iswpunct</code>,
  593. <code>iswspace</code>, <code>iswupper</code>, <code>iswxdigit</code>, <code>towlower</code> and
  594. <code>towupper</code>
  595. are handled as built-in functions
  596. except in strict ISO C90 mode (<samp>-ansi</samp> or <samp>-std=c90</samp>).
  597. </p>
  598. <p>The ISO C90 functions
  599. <code>abort</code>, <code>abs</code>, <code>acos</code>, <code>asin</code>, <code>atan2</code>,
  600. <code>atan</code>, <code>calloc</code>, <code>ceil</code>, <code>cosh</code>, <code>cos</code>,
  601. <code>exit</code>, <code>exp</code>, <code>fabs</code>, <code>floor</code>, <code>fmod</code>,
  602. <code>fprintf</code>, <code>fputs</code>, <code>frexp</code>, <code>fscanf</code>,
  603. <code>isalnum</code>, <code>isalpha</code>, <code>iscntrl</code>, <code>isdigit</code>,
  604. <code>isgraph</code>, <code>islower</code>, <code>isprint</code>, <code>ispunct</code>,
  605. <code>isspace</code>, <code>isupper</code>, <code>isxdigit</code>, <code>tolower</code>,
  606. <code>toupper</code>, <code>labs</code>, <code>ldexp</code>, <code>log10</code>, <code>log</code>,
  607. <code>malloc</code>, <code>memchr</code>, <code>memcmp</code>, <code>memcpy</code>,
  608. <code>memset</code>, <code>modf</code>, <code>pow</code>, <code>printf</code>, <code>putchar</code>,
  609. <code>puts</code>, <code>scanf</code>, <code>sinh</code>, <code>sin</code>, <code>snprintf</code>,
  610. <code>sprintf</code>, <code>sqrt</code>, <code>sscanf</code>, <code>strcat</code>,
  611. <code>strchr</code>, <code>strcmp</code>, <code>strcpy</code>, <code>strcspn</code>,
  612. <code>strlen</code>, <code>strncat</code>, <code>strncmp</code>, <code>strncpy</code>,
  613. <code>strpbrk</code>, <code>strrchr</code>, <code>strspn</code>, <code>strstr</code>,
  614. <code>tanh</code>, <code>tan</code>, <code>vfprintf</code>, <code>vprintf</code> and <code>vsprintf</code>
  615. are all recognized as built-in functions unless
  616. <samp>-fno-builtin</samp> is specified (or <samp>-fno-builtin-<var>function</var></samp>
  617. is specified for an individual function). All of these functions have
  618. corresponding versions prefixed with <code>__builtin_</code>.
  619. </p>
  620. <p>GCC provides built-in versions of the ISO C99 floating-point comparison
  621. macros that avoid raising exceptions for unordered operands. They have
  622. the same names as the standard macros ( <code>isgreater</code>,
  623. <code>isgreaterequal</code>, <code>isless</code>, <code>islessequal</code>,
  624. <code>islessgreater</code>, and <code>isunordered</code>) , with <code>__builtin_</code>
  625. prefixed. We intend for a library implementor to be able to simply
  626. <code>#define</code> each standard macro to its built-in equivalent.
  627. In the same fashion, GCC provides <code>fpclassify</code>, <code>isfinite</code>,
  628. <code>isinf_sign</code>, <code>isnormal</code> and <code>signbit</code> built-ins used with
  629. <code>__builtin_</code> prefixed. The <code>isinf</code> and <code>isnan</code>
  630. built-in functions appear both with and without the <code>__builtin_</code> prefix.
  631. </p>
  632. <dl>
  633. <dt><a name="index-_002a_005f_005fbuiltin_005falloca"></a>Built-in Function: <em>void</em> <strong>*__builtin_alloca</strong> <em>(size_t size)</em></dt>
  634. <dd><p>The <code>__builtin_alloca</code> function must be called at block scope.
  635. The function allocates an object <var>size</var> bytes large on the stack
  636. of the calling function. The object is aligned on the default stack
  637. alignment boundary for the target determined by the
  638. <code>__BIGGEST_ALIGNMENT__</code> macro. The <code>__builtin_alloca</code>
  639. function returns a pointer to the first byte of the allocated object.
  640. The lifetime of the allocated object ends just before the calling
  641. function returns to its caller. This is so even when
  642. <code>__builtin_alloca</code> is called within a nested block.
  643. </p>
  644. <p>For example, the following function allocates eight objects of <code>n</code>
  645. bytes each on the stack, storing a pointer to each in consecutive elements
  646. of the array <code>a</code>. It then passes the array to function <code>g</code>
  647. which can safely use the storage pointed to by each of the array elements.
  648. </p>
  649. <div class="smallexample">
  650. <pre class="smallexample">void f (unsigned n)
  651. {
  652. void *a [8];
  653. for (int i = 0; i != 8; ++i)
  654. a [i] = __builtin_alloca (n);
  655. g (a, n); // <span class="roman">safe</span>
  656. }
  657. </pre></div>
  658. <p>Since the <code>__builtin_alloca</code> function doesn&rsquo;t validate its argument
  659. it is the responsibility of its caller to make sure the argument doesn&rsquo;t
  660. cause it to exceed the stack size limit.
  661. The <code>__builtin_alloca</code> function is provided to make it possible to
  662. allocate on the stack arrays of bytes with an upper bound that may be
  663. computed at run time. Since C99 Variable Length Arrays offer
  664. similar functionality under a portable, more convenient, and safer
  665. interface they are recommended instead, in both C99 and C++ programs
  666. where GCC provides them as an extension.
  667. See <a href="Variable-Length.html#Variable-Length">Variable Length</a>, for details.
  668. </p>
  669. </dd></dl>
  670. <dl>
  671. <dt><a name="index-_002a_005f_005fbuiltin_005falloca_005fwith_005falign"></a>Built-in Function: <em>void</em> <strong>*__builtin_alloca_with_align</strong> <em>(size_t size, size_t alignment)</em></dt>
  672. <dd><p>The <code>__builtin_alloca_with_align</code> function must be called at block
  673. scope. The function allocates an object <var>size</var> bytes large on
  674. the stack of the calling function. The allocated object is aligned on
  675. the boundary specified by the argument <var>alignment</var> whose unit is given
  676. in bits (not bytes). The <var>size</var> argument must be positive and not
  677. exceed the stack size limit. The <var>alignment</var> argument must be a constant
  678. integer expression that evaluates to a power of 2 greater than or equal to
  679. <code>CHAR_BIT</code> and less than some unspecified maximum. Invocations
  680. with other values are rejected with an error indicating the valid bounds.
  681. The function returns a pointer to the first byte of the allocated object.
  682. The lifetime of the allocated object ends at the end of the block in which
  683. the function was called. The allocated storage is released no later than
  684. just before the calling function returns to its caller, but may be released
  685. at the end of the block in which the function was called.
  686. </p>
  687. <p>For example, in the following function the call to <code>g</code> is unsafe
  688. because when <code>overalign</code> is non-zero, the space allocated by
  689. <code>__builtin_alloca_with_align</code> may have been released at the end
  690. of the <code>if</code> statement in which it was called.
  691. </p>
  692. <div class="smallexample">
  693. <pre class="smallexample">void f (unsigned n, bool overalign)
  694. {
  695. void *p;
  696. if (overalign)
  697. p = __builtin_alloca_with_align (n, 64 /* bits */);
  698. else
  699. p = __builtin_alloc (n);
  700. g (p, n); // <span class="roman">unsafe</span>
  701. }
  702. </pre></div>
  703. <p>Since the <code>__builtin_alloca_with_align</code> function doesn&rsquo;t validate its
  704. <var>size</var> argument it is the responsibility of its caller to make sure
  705. the argument doesn&rsquo;t cause it to exceed the stack size limit.
  706. The <code>__builtin_alloca_with_align</code> function is provided to make
  707. it possible to allocate on the stack overaligned arrays of bytes with
  708. an upper bound that may be computed at run time. Since C99
  709. Variable Length Arrays offer the same functionality under
  710. a portable, more convenient, and safer interface they are recommended
  711. instead, in both C99 and C++ programs where GCC provides them as
  712. an extension. See <a href="Variable-Length.html#Variable-Length">Variable Length</a>, for details.
  713. </p>
  714. </dd></dl>
  715. <dl>
  716. <dt><a name="index-_005f_005fbuiltin_005ftypes_005fcompatible_005fp"></a>Built-in Function: <em>int</em> <strong>__builtin_types_compatible_p</strong> <em>(<var>type1</var>, <var>type2</var>)</em></dt>
  717. <dd>
  718. <p>You can use the built-in function <code>__builtin_types_compatible_p</code> to
  719. determine whether two types are the same.
  720. </p>
  721. <p>This built-in function returns 1 if the unqualified versions of the
  722. types <var>type1</var> and <var>type2</var> (which are types, not expressions) are
  723. compatible, 0 otherwise. The result of this built-in function can be
  724. used in integer constant expressions.
  725. </p>
  726. <p>This built-in function ignores top level qualifiers (e.g., <code>const</code>,
  727. <code>volatile</code>). For example, <code>int</code> is equivalent to <code>const
  728. int</code>.
  729. </p>
  730. <p>The type <code>int[]</code> and <code>int[5]</code> are compatible. On the other
  731. hand, <code>int</code> and <code>char *</code> are not compatible, even if the size
  732. of their types, on the particular architecture are the same. Also, the
  733. amount of pointer indirection is taken into account when determining
  734. similarity. Consequently, <code>short *</code> is not similar to
  735. <code>short **</code>. Furthermore, two types that are typedefed are
  736. considered compatible if their underlying types are compatible.
  737. </p>
  738. <p>An <code>enum</code> type is not considered to be compatible with another
  739. <code>enum</code> type even if both are compatible with the same integer
  740. type; this is what the C standard specifies.
  741. For example, <code>enum {foo, bar}</code> is not similar to
  742. <code>enum {hot, dog}</code>.
  743. </p>
  744. <p>You typically use this function in code whose execution varies
  745. depending on the arguments&rsquo; types. For example:
  746. </p>
  747. <div class="smallexample">
  748. <pre class="smallexample">#define foo(x) \
  749. ({ \
  750. typeof (x) tmp = (x); \
  751. if (__builtin_types_compatible_p (typeof (x), long double)) \
  752. tmp = foo_long_double (tmp); \
  753. else if (__builtin_types_compatible_p (typeof (x), double)) \
  754. tmp = foo_double (tmp); \
  755. else if (__builtin_types_compatible_p (typeof (x), float)) \
  756. tmp = foo_float (tmp); \
  757. else \
  758. abort (); \
  759. tmp; \
  760. })
  761. </pre></div>
  762. <p><em>Note:</em> This construct is only available for C.
  763. </p>
  764. </dd></dl>
  765. <dl>
  766. <dt><a name="index-_005f_005fbuiltin_005fcall_005fwith_005fstatic_005fchain-1"></a>Built-in Function: <em><var>type</var></em> <strong>__builtin_call_with_static_chain</strong> <em>(<var>call_exp</var>, <var>pointer_exp</var>)</em></dt>
  767. <dd>
  768. <p>The <var>call_exp</var> expression must be a function call, and the
  769. <var>pointer_exp</var> expression must be a pointer. The <var>pointer_exp</var>
  770. is passed to the function call in the target&rsquo;s static chain location.
  771. The result of builtin is the result of the function call.
  772. </p>
  773. <p><em>Note:</em> This builtin is only available for C.
  774. This builtin can be used to call Go closures from C.
  775. </p>
  776. </dd></dl>
  777. <dl>
  778. <dt><a name="index-_005f_005fbuiltin_005fchoose_005fexpr"></a>Built-in Function: <em><var>type</var></em> <strong>__builtin_choose_expr</strong> <em>(<var>const_exp</var>, <var>exp1</var>, <var>exp2</var>)</em></dt>
  779. <dd>
  780. <p>You can use the built-in function <code>__builtin_choose_expr</code> to
  781. evaluate code depending on the value of a constant expression. This
  782. built-in function returns <var>exp1</var> if <var>const_exp</var>, which is an
  783. integer constant expression, is nonzero. Otherwise it returns <var>exp2</var>.
  784. </p>
  785. <p>This built-in function is analogous to the &lsquo;<samp>? :</samp>&rsquo; operator in C,
  786. except that the expression returned has its type unaltered by promotion
  787. rules. Also, the built-in function does not evaluate the expression
  788. that is not chosen. For example, if <var>const_exp</var> evaluates to true,
  789. <var>exp2</var> is not evaluated even if it has side-effects.
  790. </p>
  791. <p>This built-in function can return an lvalue if the chosen argument is an
  792. lvalue.
  793. </p>
  794. <p>If <var>exp1</var> is returned, the return type is the same as <var>exp1</var>&rsquo;s
  795. type. Similarly, if <var>exp2</var> is returned, its return type is the same
  796. as <var>exp2</var>.
  797. </p>
  798. <p>Example:
  799. </p>
  800. <div class="smallexample">
  801. <pre class="smallexample">#define foo(x) \
  802. __builtin_choose_expr ( \
  803. __builtin_types_compatible_p (typeof (x), double), \
  804. foo_double (x), \
  805. __builtin_choose_expr ( \
  806. __builtin_types_compatible_p (typeof (x), float), \
  807. foo_float (x), \
  808. /* <span class="roman">The void expression results in a compile-time error</span> \
  809. <span class="roman">when assigning the result to something.</span> */ \
  810. (void)0))
  811. </pre></div>
  812. <p><em>Note:</em> This construct is only available for C. Furthermore, the
  813. unused expression (<var>exp1</var> or <var>exp2</var> depending on the value of
  814. <var>const_exp</var>) may still generate syntax errors. This may change in
  815. future revisions.
  816. </p>
  817. </dd></dl>
  818. <dl>
  819. <dt><a name="index-_005f_005fbuiltin_005fcomplex"></a>Built-in Function: <em><var>type</var></em> <strong>__builtin_complex</strong> <em>(<var>real</var>, <var>imag</var>)</em></dt>
  820. <dd>
  821. <p>The built-in function <code>__builtin_complex</code> is provided for use in
  822. implementing the ISO C11 macros <code>CMPLXF</code>, <code>CMPLX</code> and
  823. <code>CMPLXL</code>. <var>real</var> and <var>imag</var> must have the same type, a
  824. real binary floating-point type, and the result has the corresponding
  825. complex type with real and imaginary parts <var>real</var> and <var>imag</var>.
  826. Unlike &lsquo;<samp><var>real</var> + I * <var>imag</var></samp>&rsquo;, this works even when
  827. infinities, NaNs and negative zeros are involved.
  828. </p>
  829. </dd></dl>
  830. <dl>
  831. <dt><a name="index-_005f_005fbuiltin_005fconstant_005fp"></a>Built-in Function: <em>int</em> <strong>__builtin_constant_p</strong> <em>(<var>exp</var>)</em></dt>
  832. <dd><p>You can use the built-in function <code>__builtin_constant_p</code> to
  833. determine if a value is known to be constant at compile time and hence
  834. that GCC can perform constant-folding on expressions involving that
  835. value. The argument of the function is the value to test. The function
  836. returns the integer 1 if the argument is known to be a compile-time
  837. constant and 0 if it is not known to be a compile-time constant. A
  838. return of 0 does not indicate that the value is <em>not</em> a constant,
  839. but merely that GCC cannot prove it is a constant with the specified
  840. value of the <samp>-O</samp> option.
  841. </p>
  842. <p>You typically use this function in an embedded application where
  843. memory is a critical resource. If you have some complex calculation,
  844. you may want it to be folded if it involves constants, but need to call
  845. a function if it does not. For example:
  846. </p>
  847. <div class="smallexample">
  848. <pre class="smallexample">#define Scale_Value(X) \
  849. (__builtin_constant_p (X) \
  850. ? ((X) * SCALE + OFFSET) : Scale (X))
  851. </pre></div>
  852. <p>You may use this built-in function in either a macro or an inline
  853. function. However, if you use it in an inlined function and pass an
  854. argument of the function as the argument to the built-in, GCC
  855. never returns 1 when you call the inline function with a string constant
  856. or compound literal (see <a href="Compound-Literals.html#Compound-Literals">Compound Literals</a>) and does not return 1
  857. when you pass a constant numeric value to the inline function unless you
  858. specify the <samp>-O</samp> option.
  859. </p>
  860. <p>You may also use <code>__builtin_constant_p</code> in initializers for static
  861. data. For instance, you can write
  862. </p>
  863. <div class="smallexample">
  864. <pre class="smallexample">static const int table[] = {
  865. __builtin_constant_p (EXPRESSION) ? (EXPRESSION) : -1,
  866. /* <span class="roman">&hellip;</span> */
  867. };
  868. </pre></div>
  869. <p>This is an acceptable initializer even if <var>EXPRESSION</var> is not a
  870. constant expression, including the case where
  871. <code>__builtin_constant_p</code> returns 1 because <var>EXPRESSION</var> can be
  872. folded to a constant but <var>EXPRESSION</var> contains operands that are
  873. not otherwise permitted in a static initializer (for example,
  874. <code>0 &amp;&amp; foo ()</code>). GCC must be more conservative about evaluating the
  875. built-in in this case, because it has no opportunity to perform
  876. optimization.
  877. </p></dd></dl>
  878. <dl>
  879. <dt><a name="index-_005f_005fbuiltin_005fexpect"></a>Built-in Function: <em>long</em> <strong>__builtin_expect</strong> <em>(long <var>exp</var>, long <var>c</var>)</em></dt>
  880. <dd><a name="index-fprofile_002darcs-1"></a>
  881. <p>You may use <code>__builtin_expect</code> to provide the compiler with
  882. branch prediction information. In general, you should prefer to
  883. use actual profile feedback for this (<samp>-fprofile-arcs</samp>), as
  884. programmers are notoriously bad at predicting how their programs
  885. actually perform. However, there are applications in which this
  886. data is hard to collect.
  887. </p>
  888. <p>The return value is the value of <var>exp</var>, which should be an integral
  889. expression. The semantics of the built-in are that it is expected that
  890. <var>exp</var> == <var>c</var>. For example:
  891. </p>
  892. <div class="smallexample">
  893. <pre class="smallexample">if (__builtin_expect (x, 0))
  894. foo ();
  895. </pre></div>
  896. <p>indicates that we do not expect to call <code>foo</code>, since
  897. we expect <code>x</code> to be zero. Since you are limited to integral
  898. expressions for <var>exp</var>, you should use constructions such as
  899. </p>
  900. <div class="smallexample">
  901. <pre class="smallexample">if (__builtin_expect (ptr != NULL, 1))
  902. foo (*ptr);
  903. </pre></div>
  904. <p>when testing pointer or floating-point values.
  905. </p></dd></dl>
  906. <dl>
  907. <dt><a name="index-_005f_005fbuiltin_005ftrap"></a>Built-in Function: <em>void</em> <strong>__builtin_trap</strong> <em>(void)</em></dt>
  908. <dd><p>This function causes the program to exit abnormally. GCC implements
  909. this function by using a target-dependent mechanism (such as
  910. intentionally executing an illegal instruction) or by calling
  911. <code>abort</code>. The mechanism used may vary from release to release so
  912. you should not rely on any particular implementation.
  913. </p></dd></dl>
  914. <dl>
  915. <dt><a name="index-_005f_005fbuiltin_005funreachable"></a>Built-in Function: <em>void</em> <strong>__builtin_unreachable</strong> <em>(void)</em></dt>
  916. <dd><p>If control flow reaches the point of the <code>__builtin_unreachable</code>,
  917. the program is undefined. It is useful in situations where the
  918. compiler cannot deduce the unreachability of the code.
  919. </p>
  920. <p>One such case is immediately following an <code>asm</code> statement that
  921. either never terminates, or one that transfers control elsewhere
  922. and never returns. In this example, without the
  923. <code>__builtin_unreachable</code>, GCC issues a warning that control
  924. reaches the end of a non-void function. It also generates code
  925. to return after the <code>asm</code>.
  926. </p>
  927. <div class="smallexample">
  928. <pre class="smallexample">int f (int c, int v)
  929. {
  930. if (c)
  931. {
  932. return v;
  933. }
  934. else
  935. {
  936. asm(&quot;jmp error_handler&quot;);
  937. __builtin_unreachable ();
  938. }
  939. }
  940. </pre></div>
  941. <p>Because the <code>asm</code> statement unconditionally transfers control out
  942. of the function, control never reaches the end of the function
  943. body. The <code>__builtin_unreachable</code> is in fact unreachable and
  944. communicates this fact to the compiler.
  945. </p>
  946. <p>Another use for <code>__builtin_unreachable</code> is following a call a
  947. function that never returns but that is not declared
  948. <code>__attribute__((noreturn))</code>, as in this example:
  949. </p>
  950. <div class="smallexample">
  951. <pre class="smallexample">void function_that_never_returns (void);
  952. int g (int c)
  953. {
  954. if (c)
  955. {
  956. return 1;
  957. }
  958. else
  959. {
  960. function_that_never_returns ();
  961. __builtin_unreachable ();
  962. }
  963. }
  964. </pre></div>
  965. </dd></dl>
  966. <dl>
  967. <dt><a name="index-_005f_005fbuiltin_005fassume_005faligned"></a>Built-in Function: <em>void *</em> <strong>__builtin_assume_aligned</strong> <em>(const void *<var>exp</var>, size_t <var>align</var>, ...)</em></dt>
  968. <dd><p>This function returns its first argument, and allows the compiler
  969. to assume that the returned pointer is at least <var>align</var> bytes
  970. aligned. This built-in can have either two or three arguments,
  971. if it has three, the third argument should have integer type, and
  972. if it is nonzero means misalignment offset. For example:
  973. </p>
  974. <div class="smallexample">
  975. <pre class="smallexample">void *x = __builtin_assume_aligned (arg, 16);
  976. </pre></div>
  977. <p>means that the compiler can assume <code>x</code>, set to <code>arg</code>, is at least
  978. 16-byte aligned, while:
  979. </p>
  980. <div class="smallexample">
  981. <pre class="smallexample">void *x = __builtin_assume_aligned (arg, 32, 8);
  982. </pre></div>
  983. <p>means that the compiler can assume for <code>x</code>, set to <code>arg</code>, that
  984. <code>(char *) x - 8</code> is 32-byte aligned.
  985. </p></dd></dl>
  986. <dl>
  987. <dt><a name="index-_005f_005fbuiltin_005fLINE"></a>Built-in Function: <em>int</em> <strong>__builtin_LINE</strong> <em>()</em></dt>
  988. <dd><p>This function is the equivalent of the preprocessor <code>__LINE__</code>
  989. macro and returns a constant integer expression that evaluates to
  990. the line number of the invocation of the built-in. When used as a C++
  991. default argument for a function <var>F</var>, it returns the line number
  992. of the call to <var>F</var>.
  993. </p></dd></dl>
  994. <dl>
  995. <dt><a name="index-_005f_005fbuiltin_005fFUNCTION"></a>Built-in Function: <em>const char *</em> <strong>__builtin_FUNCTION</strong> <em>()</em></dt>
  996. <dd><p>This function is the equivalent of the <code>__FUNCTION__</code> symbol
  997. and returns an address constant pointing to the name of the function
  998. from which the built-in was invoked, or the empty string if
  999. the invocation is not at function scope. When used as a C++ default
  1000. argument for a function <var>F</var>, it returns the name of <var>F</var>&rsquo;s
  1001. caller or the empty string if the call was not made at function
  1002. scope.
  1003. </p></dd></dl>
  1004. <dl>
  1005. <dt><a name="index-_005f_005fbuiltin_005fFILE"></a>Built-in Function: <em>const char *</em> <strong>__builtin_FILE</strong> <em>()</em></dt>
  1006. <dd><p>This function is the equivalent of the preprocessor <code>__FILE__</code>
  1007. macro and returns an address constant pointing to the file name
  1008. containing the invocation of the built-in, or the empty string if
  1009. the invocation is not at function scope. When used as a C++ default
  1010. argument for a function <var>F</var>, it returns the file name of the call
  1011. to <var>F</var> or the empty string if the call was not made at function
  1012. scope.
  1013. </p>
  1014. <p>For example, in the following, each call to function <code>foo</code> will
  1015. print a line similar to <code>&quot;file.c:123: foo: message&quot;</code> with the name
  1016. of the file and the line number of the <code>printf</code> call, the name of
  1017. the function <code>foo</code>, followed by the word <code>message</code>.
  1018. </p>
  1019. <div class="smallexample">
  1020. <pre class="smallexample">const char*
  1021. function (const char *func = __builtin_FUNCTION ())
  1022. {
  1023. return func;
  1024. }
  1025. void foo (void)
  1026. {
  1027. printf (&quot;%s:%i: %s: message\n&quot;, file (), line (), function ());
  1028. }
  1029. </pre></div>
  1030. </dd></dl>
  1031. <dl>
  1032. <dt><a name="index-_005f_005fbuiltin_005f_005f_005fclear_005fcache"></a>Built-in Function: <em>void</em> <strong>__builtin___clear_cache</strong> <em>(char *<var>begin</var>, char *<var>end</var>)</em></dt>
  1033. <dd><p>This function is used to flush the processor&rsquo;s instruction cache for
  1034. the region of memory between <var>begin</var> inclusive and <var>end</var>
  1035. exclusive. Some targets require that the instruction cache be
  1036. flushed, after modifying memory containing code, in order to obtain
  1037. deterministic behavior.
  1038. </p>
  1039. <p>If the target does not require instruction cache flushes,
  1040. <code>__builtin___clear_cache</code> has no effect. Otherwise either
  1041. instructions are emitted in-line to clear the instruction cache or a
  1042. call to the <code>__clear_cache</code> function in libgcc is made.
  1043. </p></dd></dl>
  1044. <dl>
  1045. <dt><a name="index-_005f_005fbuiltin_005fprefetch"></a>Built-in Function: <em>void</em> <strong>__builtin_prefetch</strong> <em>(const void *<var>addr</var>, ...)</em></dt>
  1046. <dd><p>This function is used to minimize cache-miss latency by moving data into
  1047. a cache before it is accessed.
  1048. You can insert calls to <code>__builtin_prefetch</code> into code for which
  1049. you know addresses of data in memory that is likely to be accessed soon.
  1050. If the target supports them, data prefetch instructions are generated.
  1051. If the prefetch is done early enough before the access then the data will
  1052. be in the cache by the time it is accessed.
  1053. </p>
  1054. <p>The value of <var>addr</var> is the address of the memory to prefetch.
  1055. There are two optional arguments, <var>rw</var> and <var>locality</var>.
  1056. The value of <var>rw</var> is a compile-time constant one or zero; one
  1057. means that the prefetch is preparing for a write to the memory address
  1058. and zero, the default, means that the prefetch is preparing for a read.
  1059. The value <var>locality</var> must be a compile-time constant integer between
  1060. zero and three. A value of zero means that the data has no temporal
  1061. locality, so it need not be left in the cache after the access. A value
  1062. of three means that the data has a high degree of temporal locality and
  1063. should be left in all levels of cache possible. Values of one and two
  1064. mean, respectively, a low or moderate degree of temporal locality. The
  1065. default is three.
  1066. </p>
  1067. <div class="smallexample">
  1068. <pre class="smallexample">for (i = 0; i &lt; n; i++)
  1069. {
  1070. a[i] = a[i] + b[i];
  1071. __builtin_prefetch (&amp;a[i+j], 1, 1);
  1072. __builtin_prefetch (&amp;b[i+j], 0, 1);
  1073. /* <span class="roman">&hellip;</span> */
  1074. }
  1075. </pre></div>
  1076. <p>Data prefetch does not generate faults if <var>addr</var> is invalid, but
  1077. the address expression itself must be valid. For example, a prefetch
  1078. of <code>p-&gt;next</code> does not fault if <code>p-&gt;next</code> is not a valid
  1079. address, but evaluation faults if <code>p</code> is not a valid address.
  1080. </p>
  1081. <p>If the target does not support data prefetch, the address expression
  1082. is evaluated if it includes side effects but no other code is generated
  1083. and GCC does not issue a warning.
  1084. </p></dd></dl>
  1085. <dl>
  1086. <dt><a name="index-_005f_005fbuiltin_005fhuge_005fval"></a>Built-in Function: <em>double</em> <strong>__builtin_huge_val</strong> <em>(void)</em></dt>
  1087. <dd><p>Returns a positive infinity, if supported by the floating-point format,
  1088. else <code>DBL_MAX</code>. This function is suitable for implementing the
  1089. ISO C macro <code>HUGE_VAL</code>.
  1090. </p></dd></dl>
  1091. <dl>
  1092. <dt><a name="index-_005f_005fbuiltin_005fhuge_005fvalf"></a>Built-in Function: <em>float</em> <strong>__builtin_huge_valf</strong> <em>(void)</em></dt>
  1093. <dd><p>Similar to <code>__builtin_huge_val</code>, except the return type is <code>float</code>.
  1094. </p></dd></dl>
  1095. <dl>
  1096. <dt><a name="index-_005f_005fbuiltin_005fhuge_005fvall"></a>Built-in Function: <em>long double</em> <strong>__builtin_huge_vall</strong> <em>(void)</em></dt>
  1097. <dd><p>Similar to <code>__builtin_huge_val</code>, except the return
  1098. type is <code>long double</code>.
  1099. </p></dd></dl>
  1100. <dl>
  1101. <dt><a name="index-n"></a>Built-in Function: <em>_Float</em> <strong><var>n</var></strong> <em>__builtin_huge_valf<var>n</var> (void)</em></dt>
  1102. <dd><p>Similar to <code>__builtin_huge_val</code>, except the return type is
  1103. <code>_Float<var>n</var></code>.
  1104. </p></dd></dl>
  1105. <dl>
  1106. <dt><a name="index-n-1"></a>Built-in Function: <em>_Float</em> <strong><var>n</var></strong> <em>x __builtin_huge_valf<var>n</var>x (void)</em></dt>
  1107. <dd><p>Similar to <code>__builtin_huge_val</code>, except the return type is
  1108. <code>_Float<var>n</var>x</code>.
  1109. </p></dd></dl>
  1110. <dl>
  1111. <dt><a name="index-_005f_005fbuiltin_005ffpclassify-1"></a>Built-in Function: <em>int</em> <strong>__builtin_fpclassify</strong> <em>(int, int, int, int, int, ...)</em></dt>
  1112. <dd><p>This built-in implements the C99 fpclassify functionality. The first
  1113. five int arguments should be the target library&rsquo;s notion of the
  1114. possible FP classes and are used for return values. They must be
  1115. constant values and they must appear in this order: <code>FP_NAN</code>,
  1116. <code>FP_INFINITE</code>, <code>FP_NORMAL</code>, <code>FP_SUBNORMAL</code> and
  1117. <code>FP_ZERO</code>. The ellipsis is for exactly one floating-point value
  1118. to classify. GCC treats the last argument as type-generic, which
  1119. means it does not do default promotion from float to double.
  1120. </p></dd></dl>
  1121. <dl>
  1122. <dt><a name="index-_005f_005fbuiltin_005finf"></a>Built-in Function: <em>double</em> <strong>__builtin_inf</strong> <em>(void)</em></dt>
  1123. <dd><p>Similar to <code>__builtin_huge_val</code>, except a warning is generated
  1124. if the target floating-point format does not support infinities.
  1125. </p></dd></dl>
  1126. <dl>
  1127. <dt><a name="index-_005f_005fbuiltin_005finfd32"></a>Built-in Function: <em>_Decimal32</em> <strong>__builtin_infd32</strong> <em>(void)</em></dt>
  1128. <dd><p>Similar to <code>__builtin_inf</code>, except the return type is <code>_Decimal32</code>.
  1129. </p></dd></dl>
  1130. <dl>
  1131. <dt><a name="index-_005f_005fbuiltin_005finfd64"></a>Built-in Function: <em>_Decimal64</em> <strong>__builtin_infd64</strong> <em>(void)</em></dt>
  1132. <dd><p>Similar to <code>__builtin_inf</code>, except the return type is <code>_Decimal64</code>.
  1133. </p></dd></dl>
  1134. <dl>
  1135. <dt><a name="index-_005f_005fbuiltin_005finfd128"></a>Built-in Function: <em>_Decimal128</em> <strong>__builtin_infd128</strong> <em>(void)</em></dt>
  1136. <dd><p>Similar to <code>__builtin_inf</code>, except the return type is <code>_Decimal128</code>.
  1137. </p></dd></dl>
  1138. <dl>
  1139. <dt><a name="index-_005f_005fbuiltin_005finff"></a>Built-in Function: <em>float</em> <strong>__builtin_inff</strong> <em>(void)</em></dt>
  1140. <dd><p>Similar to <code>__builtin_inf</code>, except the return type is <code>float</code>.
  1141. This function is suitable for implementing the ISO C99 macro <code>INFINITY</code>.
  1142. </p></dd></dl>
  1143. <dl>
  1144. <dt><a name="index-_005f_005fbuiltin_005finfl"></a>Built-in Function: <em>long double</em> <strong>__builtin_infl</strong> <em>(void)</em></dt>
  1145. <dd><p>Similar to <code>__builtin_inf</code>, except the return
  1146. type is <code>long double</code>.
  1147. </p></dd></dl>
  1148. <dl>
  1149. <dt><a name="index-n-2"></a>Built-in Function: <em>_Float</em> <strong><var>n</var></strong> <em>__builtin_inff<var>n</var> (void)</em></dt>
  1150. <dd><p>Similar to <code>__builtin_inf</code>, except the return
  1151. type is <code>_Float<var>n</var></code>.
  1152. </p></dd></dl>
  1153. <dl>
  1154. <dt><a name="index-n-3"></a>Built-in Function: <em>_Float</em> <strong><var>n</var></strong> <em>__builtin_inff<var>n</var>x (void)</em></dt>
  1155. <dd><p>Similar to <code>__builtin_inf</code>, except the return
  1156. type is <code>_Float<var>n</var>x</code>.
  1157. </p></dd></dl>
  1158. <dl>
  1159. <dt><a name="index-_005f_005fbuiltin_005fisinf_005fsign-1"></a>Built-in Function: <em>int</em> <strong>__builtin_isinf_sign</strong> <em>(...)</em></dt>
  1160. <dd><p>Similar to <code>isinf</code>, except the return value is -1 for
  1161. an argument of <code>-Inf</code> and 1 for an argument of <code>+Inf</code>.
  1162. Note while the parameter list is an
  1163. ellipsis, this function only accepts exactly one floating-point
  1164. argument. GCC treats this parameter as type-generic, which means it
  1165. does not do default promotion from float to double.
  1166. </p></dd></dl>
  1167. <dl>
  1168. <dt><a name="index-_005f_005fbuiltin_005fnan"></a>Built-in Function: <em>double</em> <strong>__builtin_nan</strong> <em>(const char *str)</em></dt>
  1169. <dd><p>This is an implementation of the ISO C99 function <code>nan</code>.
  1170. </p>
  1171. <p>Since ISO C99 defines this function in terms of <code>strtod</code>, which we
  1172. do not implement, a description of the parsing is in order. The string
  1173. is parsed as by <code>strtol</code>; that is, the base is recognized by
  1174. leading &lsquo;<samp>0</samp>&rsquo; or &lsquo;<samp>0x</samp>&rsquo; prefixes. The number parsed is placed
  1175. in the significand such that the least significant bit of the number
  1176. is at the least significant bit of the significand. The number is
  1177. truncated to fit the significand field provided. The significand is
  1178. forced to be a quiet NaN.
  1179. </p>
  1180. <p>This function, if given a string literal all of which would have been
  1181. consumed by <code>strtol</code>, is evaluated early enough that it is considered a
  1182. compile-time constant.
  1183. </p></dd></dl>
  1184. <dl>
  1185. <dt><a name="index-_005f_005fbuiltin_005fnand32"></a>Built-in Function: <em>_Decimal32</em> <strong>__builtin_nand32</strong> <em>(const char *str)</em></dt>
  1186. <dd><p>Similar to <code>__builtin_nan</code>, except the return type is <code>_Decimal32</code>.
  1187. </p></dd></dl>
  1188. <dl>
  1189. <dt><a name="index-_005f_005fbuiltin_005fnand64"></a>Built-in Function: <em>_Decimal64</em> <strong>__builtin_nand64</strong> <em>(const char *str)</em></dt>
  1190. <dd><p>Similar to <code>__builtin_nan</code>, except the return type is <code>_Decimal64</code>.
  1191. </p></dd></dl>
  1192. <dl>
  1193. <dt><a name="index-_005f_005fbuiltin_005fnand128"></a>Built-in Function: <em>_Decimal128</em> <strong>__builtin_nand128</strong> <em>(const char *str)</em></dt>
  1194. <dd><p>Similar to <code>__builtin_nan</code>, except the return type is <code>_Decimal128</code>.
  1195. </p></dd></dl>
  1196. <dl>
  1197. <dt><a name="index-_005f_005fbuiltin_005fnanf"></a>Built-in Function: <em>float</em> <strong>__builtin_nanf</strong> <em>(const char *str)</em></dt>
  1198. <dd><p>Similar to <code>__builtin_nan</code>, except the return type is <code>float</code>.
  1199. </p></dd></dl>
  1200. <dl>
  1201. <dt><a name="index-_005f_005fbuiltin_005fnanl"></a>Built-in Function: <em>long double</em> <strong>__builtin_nanl</strong> <em>(const char *str)</em></dt>
  1202. <dd><p>Similar to <code>__builtin_nan</code>, except the return type is <code>long double</code>.
  1203. </p></dd></dl>
  1204. <dl>
  1205. <dt><a name="index-n-4"></a>Built-in Function: <em>_Float</em> <strong><var>n</var></strong> <em>__builtin_nanf<var>n</var> (const char *str)</em></dt>
  1206. <dd><p>Similar to <code>__builtin_nan</code>, except the return type is
  1207. <code>_Float<var>n</var></code>.
  1208. </p></dd></dl>
  1209. <dl>
  1210. <dt><a name="index-n-5"></a>Built-in Function: <em>_Float</em> <strong><var>n</var></strong> <em>x __builtin_nanf<var>n</var>x (const char *str)</em></dt>
  1211. <dd><p>Similar to <code>__builtin_nan</code>, except the return type is
  1212. <code>_Float<var>n</var>x</code>.
  1213. </p></dd></dl>
  1214. <dl>
  1215. <dt><a name="index-_005f_005fbuiltin_005fnans"></a>Built-in Function: <em>double</em> <strong>__builtin_nans</strong> <em>(const char *str)</em></dt>
  1216. <dd><p>Similar to <code>__builtin_nan</code>, except the significand is forced
  1217. to be a signaling NaN. The <code>nans</code> function is proposed by
  1218. <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n965.htm">WG14 N965</a>.
  1219. </p></dd></dl>
  1220. <dl>
  1221. <dt><a name="index-_005f_005fbuiltin_005fnansf"></a>Built-in Function: <em>float</em> <strong>__builtin_nansf</strong> <em>(const char *str)</em></dt>
  1222. <dd><p>Similar to <code>__builtin_nans</code>, except the return type is <code>float</code>.
  1223. </p></dd></dl>
  1224. <dl>
  1225. <dt><a name="index-_005f_005fbuiltin_005fnansl"></a>Built-in Function: <em>long double</em> <strong>__builtin_nansl</strong> <em>(const char *str)</em></dt>
  1226. <dd><p>Similar to <code>__builtin_nans</code>, except the return type is <code>long double</code>.
  1227. </p></dd></dl>
  1228. <dl>
  1229. <dt><a name="index-n-6"></a>Built-in Function: <em>_Float</em> <strong><var>n</var></strong> <em>__builtin_nansf<var>n</var> (const char *str)</em></dt>
  1230. <dd><p>Similar to <code>__builtin_nans</code>, except the return type is
  1231. <code>_Float<var>n</var></code>.
  1232. </p></dd></dl>
  1233. <dl>
  1234. <dt><a name="index-n-7"></a>Built-in Function: <em>_Float</em> <strong><var>n</var></strong> <em>x __builtin_nansf<var>n</var>x (const char *str)</em></dt>
  1235. <dd><p>Similar to <code>__builtin_nans</code>, except the return type is
  1236. <code>_Float<var>n</var>x</code>.
  1237. </p></dd></dl>
  1238. <dl>
  1239. <dt><a name="index-_005f_005fbuiltin_005fffs"></a>Built-in Function: <em>int</em> <strong>__builtin_ffs</strong> <em>(int x)</em></dt>
  1240. <dd><p>Returns one plus the index of the least significant 1-bit of <var>x</var>, or
  1241. if <var>x</var> is zero, returns zero.
  1242. </p></dd></dl>
  1243. <dl>
  1244. <dt><a name="index-_005f_005fbuiltin_005fclz"></a>Built-in Function: <em>int</em> <strong>__builtin_clz</strong> <em>(unsigned int x)</em></dt>
  1245. <dd><p>Returns the number of leading 0-bits in <var>x</var>, starting at the most
  1246. significant bit position. If <var>x</var> is 0, the result is undefined.
  1247. </p></dd></dl>
  1248. <dl>
  1249. <dt><a name="index-_005f_005fbuiltin_005fctz"></a>Built-in Function: <em>int</em> <strong>__builtin_ctz</strong> <em>(unsigned int x)</em></dt>
  1250. <dd><p>Returns the number of trailing 0-bits in <var>x</var>, starting at the least
  1251. significant bit position. If <var>x</var> is 0, the result is undefined.
  1252. </p></dd></dl>
  1253. <dl>
  1254. <dt><a name="index-_005f_005fbuiltin_005fclrsb"></a>Built-in Function: <em>int</em> <strong>__builtin_clrsb</strong> <em>(int x)</em></dt>
  1255. <dd><p>Returns the number of leading redundant sign bits in <var>x</var>, i.e. the
  1256. number of bits following the most significant bit that are identical
  1257. to it. There are no special cases for 0 or other values.
  1258. </p></dd></dl>
  1259. <dl>
  1260. <dt><a name="index-_005f_005fbuiltin_005fpopcount"></a>Built-in Function: <em>int</em> <strong>__builtin_popcount</strong> <em>(unsigned int x)</em></dt>
  1261. <dd><p>Returns the number of 1-bits in <var>x</var>.
  1262. </p></dd></dl>
  1263. <dl>
  1264. <dt><a name="index-_005f_005fbuiltin_005fparity"></a>Built-in Function: <em>int</em> <strong>__builtin_parity</strong> <em>(unsigned int x)</em></dt>
  1265. <dd><p>Returns the parity of <var>x</var>, i.e. the number of 1-bits in <var>x</var>
  1266. modulo 2.
  1267. </p></dd></dl>
  1268. <dl>
  1269. <dt><a name="index-_005f_005fbuiltin_005fffsl"></a>Built-in Function: <em>int</em> <strong>__builtin_ffsl</strong> <em>(long)</em></dt>
  1270. <dd><p>Similar to <code>__builtin_ffs</code>, except the argument type is
  1271. <code>long</code>.
  1272. </p></dd></dl>
  1273. <dl>
  1274. <dt><a name="index-_005f_005fbuiltin_005fclzl"></a>Built-in Function: <em>int</em> <strong>__builtin_clzl</strong> <em>(unsigned long)</em></dt>
  1275. <dd><p>Similar to <code>__builtin_clz</code>, except the argument type is
  1276. <code>unsigned long</code>.
  1277. </p></dd></dl>
  1278. <dl>
  1279. <dt><a name="index-_005f_005fbuiltin_005fctzl"></a>Built-in Function: <em>int</em> <strong>__builtin_ctzl</strong> <em>(unsigned long)</em></dt>
  1280. <dd><p>Similar to <code>__builtin_ctz</code>, except the argument type is
  1281. <code>unsigned long</code>.
  1282. </p></dd></dl>
  1283. <dl>
  1284. <dt><a name="index-_005f_005fbuiltin_005fclrsbl"></a>Built-in Function: <em>int</em> <strong>__builtin_clrsbl</strong> <em>(long)</em></dt>
  1285. <dd><p>Similar to <code>__builtin_clrsb</code>, except the argument type is
  1286. <code>long</code>.
  1287. </p></dd></dl>
  1288. <dl>
  1289. <dt><a name="index-_005f_005fbuiltin_005fpopcountl"></a>Built-in Function: <em>int</em> <strong>__builtin_popcountl</strong> <em>(unsigned long)</em></dt>
  1290. <dd><p>Similar to <code>__builtin_popcount</code>, except the argument type is
  1291. <code>unsigned long</code>.
  1292. </p></dd></dl>
  1293. <dl>
  1294. <dt><a name="index-_005f_005fbuiltin_005fparityl"></a>Built-in Function: <em>int</em> <strong>__builtin_parityl</strong> <em>(unsigned long)</em></dt>
  1295. <dd><p>Similar to <code>__builtin_parity</code>, except the argument type is
  1296. <code>unsigned long</code>.
  1297. </p></dd></dl>
  1298. <dl>
  1299. <dt><a name="index-_005f_005fbuiltin_005fffsll"></a>Built-in Function: <em>int</em> <strong>__builtin_ffsll</strong> <em>(long long)</em></dt>
  1300. <dd><p>Similar to <code>__builtin_ffs</code>, except the argument type is
  1301. <code>long long</code>.
  1302. </p></dd></dl>
  1303. <dl>
  1304. <dt><a name="index-_005f_005fbuiltin_005fclzll"></a>Built-in Function: <em>int</em> <strong>__builtin_clzll</strong> <em>(unsigned long long)</em></dt>
  1305. <dd><p>Similar to <code>__builtin_clz</code>, except the argument type is
  1306. <code>unsigned long long</code>.
  1307. </p></dd></dl>
  1308. <dl>
  1309. <dt><a name="index-_005f_005fbuiltin_005fctzll"></a>Built-in Function: <em>int</em> <strong>__builtin_ctzll</strong> <em>(unsigned long long)</em></dt>
  1310. <dd><p>Similar to <code>__builtin_ctz</code>, except the argument type is
  1311. <code>unsigned long long</code>.
  1312. </p></dd></dl>
  1313. <dl>
  1314. <dt><a name="index-_005f_005fbuiltin_005fclrsbll"></a>Built-in Function: <em>int</em> <strong>__builtin_clrsbll</strong> <em>(long long)</em></dt>
  1315. <dd><p>Similar to <code>__builtin_clrsb</code>, except the argument type is
  1316. <code>long long</code>.
  1317. </p></dd></dl>
  1318. <dl>
  1319. <dt><a name="index-_005f_005fbuiltin_005fpopcountll"></a>Built-in Function: <em>int</em> <strong>__builtin_popcountll</strong> <em>(unsigned long long)</em></dt>
  1320. <dd><p>Similar to <code>__builtin_popcount</code>, except the argument type is
  1321. <code>unsigned long long</code>.
  1322. </p></dd></dl>
  1323. <dl>
  1324. <dt><a name="index-_005f_005fbuiltin_005fparityll"></a>Built-in Function: <em>int</em> <strong>__builtin_parityll</strong> <em>(unsigned long long)</em></dt>
  1325. <dd><p>Similar to <code>__builtin_parity</code>, except the argument type is
  1326. <code>unsigned long long</code>.
  1327. </p></dd></dl>
  1328. <dl>
  1329. <dt><a name="index-_005f_005fbuiltin_005fpowi-1"></a>Built-in Function: <em>double</em> <strong>__builtin_powi</strong> <em>(double, int)</em></dt>
  1330. <dd><p>Returns the first argument raised to the power of the second. Unlike the
  1331. <code>pow</code> function no guarantees about precision and rounding are made.
  1332. </p></dd></dl>
  1333. <dl>
  1334. <dt><a name="index-_005f_005fbuiltin_005fpowif-1"></a>Built-in Function: <em>float</em> <strong>__builtin_powif</strong> <em>(float, int)</em></dt>
  1335. <dd><p>Similar to <code>__builtin_powi</code>, except the argument and return types
  1336. are <code>float</code>.
  1337. </p></dd></dl>
  1338. <dl>
  1339. <dt><a name="index-_005f_005fbuiltin_005fpowil-1"></a>Built-in Function: <em>long double</em> <strong>__builtin_powil</strong> <em>(long double, int)</em></dt>
  1340. <dd><p>Similar to <code>__builtin_powi</code>, except the argument and return types
  1341. are <code>long double</code>.
  1342. </p></dd></dl>
  1343. <dl>
  1344. <dt><a name="index-_005f_005fbuiltin_005fbswap16"></a>Built-in Function: <em>uint16_t</em> <strong>__builtin_bswap16</strong> <em>(uint16_t x)</em></dt>
  1345. <dd><p>Returns <var>x</var> with the order of the bytes reversed; for example,
  1346. <code>0xaabb</code> becomes <code>0xbbaa</code>. Byte here always means
  1347. exactly 8 bits.
  1348. </p></dd></dl>
  1349. <dl>
  1350. <dt><a name="index-_005f_005fbuiltin_005fbswap32"></a>Built-in Function: <em>uint32_t</em> <strong>__builtin_bswap32</strong> <em>(uint32_t x)</em></dt>
  1351. <dd><p>Similar to <code>__builtin_bswap16</code>, except the argument and return types
  1352. are 32 bit.
  1353. </p></dd></dl>
  1354. <dl>
  1355. <dt><a name="index-_005f_005fbuiltin_005fbswap64"></a>Built-in Function: <em>uint64_t</em> <strong>__builtin_bswap64</strong> <em>(uint64_t x)</em></dt>
  1356. <dd><p>Similar to <code>__builtin_bswap32</code>, except the argument and return types
  1357. are 64 bit.
  1358. </p></dd></dl>
  1359. <hr>
  1360. <div class="header">
  1361. <p>
  1362. Next: <a href="Target-Builtins.html#Target-Builtins" accesskey="n" rel="next">Target Builtins</a>, Previous: <a href="Cilk-Plus-Builtins.html#Cilk-Plus-Builtins" accesskey="p" rel="prev">Cilk Plus Builtins</a>, Up: <a href="C-Extensions.html#C-Extensions" accesskey="u" rel="up">C Extensions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  1363. </div>
  1364. </body>
  1365. </html>