Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

1739 linhas
81KB

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