Machine-Modes.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2017 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <title>GNU Compiler Collection (GCC) Internals: Machine Modes</title>
  20. <meta name="description" content="GNU Compiler Collection (GCC) Internals: Machine Modes">
  21. <meta name="keywords" content="GNU Compiler Collection (GCC) Internals: Machine Modes">
  22. <meta name="resource-type" content="document">
  23. <meta name="distribution" content="global">
  24. <meta name="Generator" content="makeinfo">
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="RTL.html#RTL" rel="up" title="RTL">
  30. <link href="Constants.html#Constants" rel="next" title="Constants">
  31. <link href="Flags.html#Flags" rel="prev" title="Flags">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.smallquotation {font-size: smaller}
  36. div.display {margin-left: 3.2em}
  37. div.example {margin-left: 3.2em}
  38. div.indentedblock {margin-left: 3.2em}
  39. div.lisp {margin-left: 3.2em}
  40. div.smalldisplay {margin-left: 3.2em}
  41. div.smallexample {margin-left: 3.2em}
  42. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style:oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nocodebreak {white-space:nowrap}
  54. span.nolinebreak {white-space:nowrap}
  55. span.roman {font-family:serif; font-weight:normal}
  56. span.sansserif {font-family:sans-serif; font-weight:normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  62. <a name="Machine-Modes"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="Constants.html#Constants" accesskey="n" rel="next">Constants</a>, Previous: <a href="Flags.html#Flags" accesskey="p" rel="prev">Flags</a>, Up: <a href="RTL.html#RTL" accesskey="u" rel="up">RTL</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  66. </div>
  67. <hr>
  68. <a name="Machine-Modes-1"></a>
  69. <h3 class="section">13.6 Machine Modes</h3>
  70. <a name="index-machine-modes"></a>
  71. <a name="index-machine_005fmode"></a>
  72. <p>A machine mode describes a size of data object and the representation used
  73. for it. In the C code, machine modes are represented by an enumeration
  74. type, <code>machine_mode</code>, defined in <samp>machmode.def</samp>. Each RTL
  75. expression has room for a machine mode and so do certain kinds of tree
  76. expressions (declarations and types, to be precise).
  77. </p>
  78. <p>In debugging dumps and machine descriptions, the machine mode of an RTL
  79. expression is written after the expression code with a colon to separate
  80. them. The letters &lsquo;<samp>mode</samp>&rsquo; which appear at the end of each machine mode
  81. name are omitted. For example, <code>(reg:SI 38)</code> is a <code>reg</code>
  82. expression with machine mode <code>SImode</code>. If the mode is
  83. <code>VOIDmode</code>, it is not written at all.
  84. </p>
  85. <p>Here is a table of machine modes. The term &ldquo;byte&rdquo; below refers to an
  86. object of <code>BITS_PER_UNIT</code> bits (see <a href="Storage-Layout.html#Storage-Layout">Storage Layout</a>).
  87. </p>
  88. <dl compact="compact">
  89. <dd><a name="index-BImode"></a>
  90. </dd>
  91. <dt><code>BImode</code></dt>
  92. <dd><p>&ldquo;Bit&rdquo; mode represents a single bit, for predicate registers.
  93. </p>
  94. <a name="index-QImode"></a>
  95. </dd>
  96. <dt><code>QImode</code></dt>
  97. <dd><p>&ldquo;Quarter-Integer&rdquo; mode represents a single byte treated as an integer.
  98. </p>
  99. <a name="index-HImode"></a>
  100. </dd>
  101. <dt><code>HImode</code></dt>
  102. <dd><p>&ldquo;Half-Integer&rdquo; mode represents a two-byte integer.
  103. </p>
  104. <a name="index-PSImode"></a>
  105. </dd>
  106. <dt><code>PSImode</code></dt>
  107. <dd><p>&ldquo;Partial Single Integer&rdquo; mode represents an integer which occupies
  108. four bytes but which doesn&rsquo;t really use all four. On some machines,
  109. this is the right mode to use for pointers.
  110. </p>
  111. <a name="index-SImode"></a>
  112. </dd>
  113. <dt><code>SImode</code></dt>
  114. <dd><p>&ldquo;Single Integer&rdquo; mode represents a four-byte integer.
  115. </p>
  116. <a name="index-PDImode"></a>
  117. </dd>
  118. <dt><code>PDImode</code></dt>
  119. <dd><p>&ldquo;Partial Double Integer&rdquo; mode represents an integer which occupies
  120. eight bytes but which doesn&rsquo;t really use all eight. On some machines,
  121. this is the right mode to use for certain pointers.
  122. </p>
  123. <a name="index-DImode"></a>
  124. </dd>
  125. <dt><code>DImode</code></dt>
  126. <dd><p>&ldquo;Double Integer&rdquo; mode represents an eight-byte integer.
  127. </p>
  128. <a name="index-TImode"></a>
  129. </dd>
  130. <dt><code>TImode</code></dt>
  131. <dd><p>&ldquo;Tetra Integer&rdquo; (?) mode represents a sixteen-byte integer.
  132. </p>
  133. <a name="index-OImode"></a>
  134. </dd>
  135. <dt><code>OImode</code></dt>
  136. <dd><p>&ldquo;Octa Integer&rdquo; (?) mode represents a thirty-two-byte integer.
  137. </p>
  138. <a name="index-XImode"></a>
  139. </dd>
  140. <dt><code>XImode</code></dt>
  141. <dd><p>&ldquo;Hexadeca Integer&rdquo; (?) mode represents a sixty-four-byte integer.
  142. </p>
  143. <a name="index-QFmode"></a>
  144. </dd>
  145. <dt><code>QFmode</code></dt>
  146. <dd><p>&ldquo;Quarter-Floating&rdquo; mode represents a quarter-precision (single byte)
  147. floating point number.
  148. </p>
  149. <a name="index-HFmode"></a>
  150. </dd>
  151. <dt><code>HFmode</code></dt>
  152. <dd><p>&ldquo;Half-Floating&rdquo; mode represents a half-precision (two byte) floating
  153. point number.
  154. </p>
  155. <a name="index-TQFmode"></a>
  156. </dd>
  157. <dt><code>TQFmode</code></dt>
  158. <dd><p>&ldquo;Three-Quarter-Floating&rdquo; (?) mode represents a three-quarter-precision
  159. (three byte) floating point number.
  160. </p>
  161. <a name="index-SFmode"></a>
  162. </dd>
  163. <dt><code>SFmode</code></dt>
  164. <dd><p>&ldquo;Single Floating&rdquo; mode represents a four byte floating point number.
  165. In the common case, of a processor with IEEE arithmetic and 8-bit bytes,
  166. this is a single-precision IEEE floating point number; it can also be
  167. used for double-precision (on processors with 16-bit bytes) and
  168. single-precision VAX and IBM types.
  169. </p>
  170. <a name="index-DFmode"></a>
  171. </dd>
  172. <dt><code>DFmode</code></dt>
  173. <dd><p>&ldquo;Double Floating&rdquo; mode represents an eight byte floating point number.
  174. In the common case, of a processor with IEEE arithmetic and 8-bit bytes,
  175. this is a double-precision IEEE floating point number.
  176. </p>
  177. <a name="index-XFmode"></a>
  178. </dd>
  179. <dt><code>XFmode</code></dt>
  180. <dd><p>&ldquo;Extended Floating&rdquo; mode represents an IEEE extended floating point
  181. number. This mode only has 80 meaningful bits (ten bytes). Some
  182. processors require such numbers to be padded to twelve bytes, others
  183. to sixteen; this mode is used for either.
  184. </p>
  185. <a name="index-SDmode"></a>
  186. </dd>
  187. <dt><code>SDmode</code></dt>
  188. <dd><p>&ldquo;Single Decimal Floating&rdquo; mode represents a four byte decimal
  189. floating point number (as distinct from conventional binary floating
  190. point).
  191. </p>
  192. <a name="index-DDmode"></a>
  193. </dd>
  194. <dt><code>DDmode</code></dt>
  195. <dd><p>&ldquo;Double Decimal Floating&rdquo; mode represents an eight byte decimal
  196. floating point number.
  197. </p>
  198. <a name="index-TDmode"></a>
  199. </dd>
  200. <dt><code>TDmode</code></dt>
  201. <dd><p>&ldquo;Tetra Decimal Floating&rdquo; mode represents a sixteen byte decimal
  202. floating point number all 128 of whose bits are meaningful.
  203. </p>
  204. <a name="index-TFmode"></a>
  205. </dd>
  206. <dt><code>TFmode</code></dt>
  207. <dd><p>&ldquo;Tetra Floating&rdquo; mode represents a sixteen byte floating point number
  208. all 128 of whose bits are meaningful. One common use is the
  209. IEEE quad-precision format.
  210. </p>
  211. <a name="index-QQmode"></a>
  212. </dd>
  213. <dt><code>QQmode</code></dt>
  214. <dd><p>&ldquo;Quarter-Fractional&rdquo; mode represents a single byte treated as a signed
  215. fractional number. The default format is &ldquo;s.7&rdquo;.
  216. </p>
  217. <a name="index-HQmode"></a>
  218. </dd>
  219. <dt><code>HQmode</code></dt>
  220. <dd><p>&ldquo;Half-Fractional&rdquo; mode represents a two-byte signed fractional number.
  221. The default format is &ldquo;s.15&rdquo;.
  222. </p>
  223. <a name="index-SQmode"></a>
  224. </dd>
  225. <dt><code>SQmode</code></dt>
  226. <dd><p>&ldquo;Single Fractional&rdquo; mode represents a four-byte signed fractional number.
  227. The default format is &ldquo;s.31&rdquo;.
  228. </p>
  229. <a name="index-DQmode"></a>
  230. </dd>
  231. <dt><code>DQmode</code></dt>
  232. <dd><p>&ldquo;Double Fractional&rdquo; mode represents an eight-byte signed fractional number.
  233. The default format is &ldquo;s.63&rdquo;.
  234. </p>
  235. <a name="index-TQmode"></a>
  236. </dd>
  237. <dt><code>TQmode</code></dt>
  238. <dd><p>&ldquo;Tetra Fractional&rdquo; mode represents a sixteen-byte signed fractional number.
  239. The default format is &ldquo;s.127&rdquo;.
  240. </p>
  241. <a name="index-UQQmode"></a>
  242. </dd>
  243. <dt><code>UQQmode</code></dt>
  244. <dd><p>&ldquo;Unsigned Quarter-Fractional&rdquo; mode represents a single byte treated as an
  245. unsigned fractional number. The default format is &ldquo;.8&rdquo;.
  246. </p>
  247. <a name="index-UHQmode"></a>
  248. </dd>
  249. <dt><code>UHQmode</code></dt>
  250. <dd><p>&ldquo;Unsigned Half-Fractional&rdquo; mode represents a two-byte unsigned fractional
  251. number. The default format is &ldquo;.16&rdquo;.
  252. </p>
  253. <a name="index-USQmode"></a>
  254. </dd>
  255. <dt><code>USQmode</code></dt>
  256. <dd><p>&ldquo;Unsigned Single Fractional&rdquo; mode represents a four-byte unsigned fractional
  257. number. The default format is &ldquo;.32&rdquo;.
  258. </p>
  259. <a name="index-UDQmode"></a>
  260. </dd>
  261. <dt><code>UDQmode</code></dt>
  262. <dd><p>&ldquo;Unsigned Double Fractional&rdquo; mode represents an eight-byte unsigned
  263. fractional number. The default format is &ldquo;.64&rdquo;.
  264. </p>
  265. <a name="index-UTQmode"></a>
  266. </dd>
  267. <dt><code>UTQmode</code></dt>
  268. <dd><p>&ldquo;Unsigned Tetra Fractional&rdquo; mode represents a sixteen-byte unsigned
  269. fractional number. The default format is &ldquo;.128&rdquo;.
  270. </p>
  271. <a name="index-HAmode"></a>
  272. </dd>
  273. <dt><code>HAmode</code></dt>
  274. <dd><p>&ldquo;Half-Accumulator&rdquo; mode represents a two-byte signed accumulator.
  275. The default format is &ldquo;s8.7&rdquo;.
  276. </p>
  277. <a name="index-SAmode"></a>
  278. </dd>
  279. <dt><code>SAmode</code></dt>
  280. <dd><p>&ldquo;Single Accumulator&rdquo; mode represents a four-byte signed accumulator.
  281. The default format is &ldquo;s16.15&rdquo;.
  282. </p>
  283. <a name="index-DAmode"></a>
  284. </dd>
  285. <dt><code>DAmode</code></dt>
  286. <dd><p>&ldquo;Double Accumulator&rdquo; mode represents an eight-byte signed accumulator.
  287. The default format is &ldquo;s32.31&rdquo;.
  288. </p>
  289. <a name="index-TAmode"></a>
  290. </dd>
  291. <dt><code>TAmode</code></dt>
  292. <dd><p>&ldquo;Tetra Accumulator&rdquo; mode represents a sixteen-byte signed accumulator.
  293. The default format is &ldquo;s64.63&rdquo;.
  294. </p>
  295. <a name="index-UHAmode"></a>
  296. </dd>
  297. <dt><code>UHAmode</code></dt>
  298. <dd><p>&ldquo;Unsigned Half-Accumulator&rdquo; mode represents a two-byte unsigned accumulator.
  299. The default format is &ldquo;8.8&rdquo;.
  300. </p>
  301. <a name="index-USAmode"></a>
  302. </dd>
  303. <dt><code>USAmode</code></dt>
  304. <dd><p>&ldquo;Unsigned Single Accumulator&rdquo; mode represents a four-byte unsigned
  305. accumulator. The default format is &ldquo;16.16&rdquo;.
  306. </p>
  307. <a name="index-UDAmode"></a>
  308. </dd>
  309. <dt><code>UDAmode</code></dt>
  310. <dd><p>&ldquo;Unsigned Double Accumulator&rdquo; mode represents an eight-byte unsigned
  311. accumulator. The default format is &ldquo;32.32&rdquo;.
  312. </p>
  313. <a name="index-UTAmode"></a>
  314. </dd>
  315. <dt><code>UTAmode</code></dt>
  316. <dd><p>&ldquo;Unsigned Tetra Accumulator&rdquo; mode represents a sixteen-byte unsigned
  317. accumulator. The default format is &ldquo;64.64&rdquo;.
  318. </p>
  319. <a name="index-CCmode"></a>
  320. </dd>
  321. <dt><code>CCmode</code></dt>
  322. <dd><p>&ldquo;Condition Code&rdquo; mode represents the value of a condition code, which
  323. is a machine-specific set of bits used to represent the result of a
  324. comparison operation. Other machine-specific modes may also be used for
  325. the condition code. These modes are not used on machines that use
  326. <code>cc0</code> (see <a href="Condition-Code.html#Condition-Code">Condition Code</a>).
  327. </p>
  328. <a name="index-BLKmode"></a>
  329. </dd>
  330. <dt><code>BLKmode</code></dt>
  331. <dd><p>&ldquo;Block&rdquo; mode represents values that are aggregates to which none of
  332. the other modes apply. In RTL, only memory references can have this mode,
  333. and only if they appear in string-move or vector instructions. On machines
  334. which have no such instructions, <code>BLKmode</code> will not appear in RTL.
  335. </p>
  336. <a name="index-VOIDmode"></a>
  337. </dd>
  338. <dt><code>VOIDmode</code></dt>
  339. <dd><p>Void mode means the absence of a mode or an unspecified mode.
  340. For example, RTL expressions of code <code>const_int</code> have mode
  341. <code>VOIDmode</code> because they can be taken to have whatever mode the context
  342. requires. In debugging dumps of RTL, <code>VOIDmode</code> is expressed by
  343. the absence of any mode.
  344. </p>
  345. <a name="index-QCmode"></a>
  346. <a name="index-HCmode"></a>
  347. <a name="index-SCmode"></a>
  348. <a name="index-DCmode"></a>
  349. <a name="index-XCmode"></a>
  350. <a name="index-TCmode"></a>
  351. </dd>
  352. <dt><code>QCmode, HCmode, SCmode, DCmode, XCmode, TCmode</code></dt>
  353. <dd><p>These modes stand for a complex number represented as a pair of floating
  354. point values. The floating point values are in <code>QFmode</code>,
  355. <code>HFmode</code>, <code>SFmode</code>, <code>DFmode</code>, <code>XFmode</code>, and
  356. <code>TFmode</code>, respectively.
  357. </p>
  358. <a name="index-CQImode"></a>
  359. <a name="index-CHImode"></a>
  360. <a name="index-CSImode"></a>
  361. <a name="index-CDImode"></a>
  362. <a name="index-CTImode"></a>
  363. <a name="index-COImode"></a>
  364. <a name="index-CPSImode"></a>
  365. </dd>
  366. <dt><code>CQImode, CHImode, CSImode, CDImode, CTImode, COImode, CPSImode</code></dt>
  367. <dd><p>These modes stand for a complex number represented as a pair of integer
  368. values. The integer values are in <code>QImode</code>, <code>HImode</code>,
  369. <code>SImode</code>, <code>DImode</code>, <code>TImode</code>, <code>OImode</code>, and <code>PSImode</code>,
  370. respectively.
  371. </p>
  372. <a name="index-BND32mode"></a>
  373. <a name="index-BND64mode"></a>
  374. </dd>
  375. <dt><code>BND32mode BND64mode</code></dt>
  376. <dd><p>These modes stand for bounds for pointer of 32 and 64 bit size respectively.
  377. Mode size is double pointer mode size.
  378. </p></dd>
  379. </dl>
  380. <p>The machine description defines <code>Pmode</code> as a C macro which expands
  381. into the machine mode used for addresses. Normally this is the mode
  382. whose size is <code>BITS_PER_WORD</code>, <code>SImode</code> on 32-bit machines.
  383. </p>
  384. <p>The only modes which a machine description <i>must</i> support are
  385. <code>QImode</code>, and the modes corresponding to <code>BITS_PER_WORD</code>,
  386. <code>FLOAT_TYPE_SIZE</code> and <code>DOUBLE_TYPE_SIZE</code>.
  387. The compiler will attempt to use <code>DImode</code> for 8-byte structures and
  388. unions, but this can be prevented by overriding the definition of
  389. <code>MAX_FIXED_MODE_SIZE</code>. Alternatively, you can have the compiler
  390. use <code>TImode</code> for 16-byte structures and unions. Likewise, you can
  391. arrange for the C type <code>short int</code> to avoid using <code>HImode</code>.
  392. </p>
  393. <a name="index-mode-classes"></a>
  394. <p>Very few explicit references to machine modes remain in the compiler and
  395. these few references will soon be removed. Instead, the machine modes
  396. are divided into mode classes. These are represented by the enumeration
  397. type <code>enum mode_class</code> defined in <samp>machmode.h</samp>. The possible
  398. mode classes are:
  399. </p>
  400. <dl compact="compact">
  401. <dd><a name="index-MODE_005fINT"></a>
  402. </dd>
  403. <dt><code>MODE_INT</code></dt>
  404. <dd><p>Integer modes. By default these are <code>BImode</code>, <code>QImode</code>,
  405. <code>HImode</code>, <code>SImode</code>, <code>DImode</code>, <code>TImode</code>, and
  406. <code>OImode</code>.
  407. </p>
  408. <a name="index-MODE_005fPARTIAL_005fINT"></a>
  409. </dd>
  410. <dt><code>MODE_PARTIAL_INT</code></dt>
  411. <dd><p>The &ldquo;partial integer&rdquo; modes, <code>PQImode</code>, <code>PHImode</code>,
  412. <code>PSImode</code> and <code>PDImode</code>.
  413. </p>
  414. <a name="index-MODE_005fFLOAT"></a>
  415. </dd>
  416. <dt><code>MODE_FLOAT</code></dt>
  417. <dd><p>Floating point modes. By default these are <code>QFmode</code>,
  418. <code>HFmode</code>, <code>TQFmode</code>, <code>SFmode</code>, <code>DFmode</code>,
  419. <code>XFmode</code> and <code>TFmode</code>.
  420. </p>
  421. <a name="index-MODE_005fDECIMAL_005fFLOAT"></a>
  422. </dd>
  423. <dt><code>MODE_DECIMAL_FLOAT</code></dt>
  424. <dd><p>Decimal floating point modes. By default these are <code>SDmode</code>,
  425. <code>DDmode</code> and <code>TDmode</code>.
  426. </p>
  427. <a name="index-MODE_005fFRACT"></a>
  428. </dd>
  429. <dt><code>MODE_FRACT</code></dt>
  430. <dd><p>Signed fractional modes. By default these are <code>QQmode</code>, <code>HQmode</code>,
  431. <code>SQmode</code>, <code>DQmode</code> and <code>TQmode</code>.
  432. </p>
  433. <a name="index-MODE_005fUFRACT"></a>
  434. </dd>
  435. <dt><code>MODE_UFRACT</code></dt>
  436. <dd><p>Unsigned fractional modes. By default these are <code>UQQmode</code>, <code>UHQmode</code>,
  437. <code>USQmode</code>, <code>UDQmode</code> and <code>UTQmode</code>.
  438. </p>
  439. <a name="index-MODE_005fACCUM"></a>
  440. </dd>
  441. <dt><code>MODE_ACCUM</code></dt>
  442. <dd><p>Signed accumulator modes. By default these are <code>HAmode</code>,
  443. <code>SAmode</code>, <code>DAmode</code> and <code>TAmode</code>.
  444. </p>
  445. <a name="index-MODE_005fUACCUM"></a>
  446. </dd>
  447. <dt><code>MODE_UACCUM</code></dt>
  448. <dd><p>Unsigned accumulator modes. By default these are <code>UHAmode</code>,
  449. <code>USAmode</code>, <code>UDAmode</code> and <code>UTAmode</code>.
  450. </p>
  451. <a name="index-MODE_005fCOMPLEX_005fINT"></a>
  452. </dd>
  453. <dt><code>MODE_COMPLEX_INT</code></dt>
  454. <dd><p>Complex integer modes. (These are not currently implemented).
  455. </p>
  456. <a name="index-MODE_005fCOMPLEX_005fFLOAT"></a>
  457. </dd>
  458. <dt><code>MODE_COMPLEX_FLOAT</code></dt>
  459. <dd><p>Complex floating point modes. By default these are <code>QCmode</code>,
  460. <code>HCmode</code>, <code>SCmode</code>, <code>DCmode</code>, <code>XCmode</code>, and
  461. <code>TCmode</code>.
  462. </p>
  463. <a name="index-MODE_005fFUNCTION"></a>
  464. </dd>
  465. <dt><code>MODE_FUNCTION</code></dt>
  466. <dd><p>Algol or Pascal function variables including a static chain.
  467. (These are not currently implemented).
  468. </p>
  469. <a name="index-MODE_005fCC"></a>
  470. </dd>
  471. <dt><code>MODE_CC</code></dt>
  472. <dd><p>Modes representing condition code values. These are <code>CCmode</code> plus
  473. any <code>CC_MODE</code> modes listed in the <samp><var>machine</var>-modes.def</samp>.
  474. See <a href="Jump-Patterns.html#Jump-Patterns">Jump Patterns</a>,
  475. also see <a href="Condition-Code.html#Condition-Code">Condition Code</a>.
  476. </p>
  477. <a name="index-MODE_005fPOINTER_005fBOUNDS"></a>
  478. </dd>
  479. <dt><code>MODE_POINTER_BOUNDS</code></dt>
  480. <dd><p>Pointer bounds modes. Used to represent values of pointer bounds type.
  481. Operations in these modes may be executed as NOPs depending on hardware
  482. features and environment setup.
  483. </p>
  484. <a name="index-MODE_005fRANDOM"></a>
  485. </dd>
  486. <dt><code>MODE_RANDOM</code></dt>
  487. <dd><p>This is a catchall mode class for modes which don&rsquo;t fit into the above
  488. classes. Currently <code>VOIDmode</code> and <code>BLKmode</code> are in
  489. <code>MODE_RANDOM</code>.
  490. </p></dd>
  491. </dl>
  492. <p>Here are some C macros that relate to machine modes:
  493. </p>
  494. <dl compact="compact">
  495. <dd><a name="index-GET_005fMODE"></a>
  496. </dd>
  497. <dt><code>GET_MODE (<var>x</var>)</code></dt>
  498. <dd><p>Returns the machine mode of the RTX <var>x</var>.
  499. </p>
  500. <a name="index-PUT_005fMODE"></a>
  501. </dd>
  502. <dt><code>PUT_MODE (<var>x</var>, <var>newmode</var>)</code></dt>
  503. <dd><p>Alters the machine mode of the RTX <var>x</var> to be <var>newmode</var>.
  504. </p>
  505. <a name="index-NUM_005fMACHINE_005fMODES"></a>
  506. </dd>
  507. <dt><code>NUM_MACHINE_MODES</code></dt>
  508. <dd><p>Stands for the number of machine modes available on the target
  509. machine. This is one greater than the largest numeric value of any
  510. machine mode.
  511. </p>
  512. <a name="index-GET_005fMODE_005fNAME"></a>
  513. </dd>
  514. <dt><code>GET_MODE_NAME (<var>m</var>)</code></dt>
  515. <dd><p>Returns the name of mode <var>m</var> as a string.
  516. </p>
  517. <a name="index-GET_005fMODE_005fCLASS"></a>
  518. </dd>
  519. <dt><code>GET_MODE_CLASS (<var>m</var>)</code></dt>
  520. <dd><p>Returns the mode class of mode <var>m</var>.
  521. </p>
  522. <a name="index-GET_005fMODE_005fWIDER_005fMODE"></a>
  523. </dd>
  524. <dt><code>GET_MODE_WIDER_MODE (<var>m</var>)</code></dt>
  525. <dd><p>Returns the next wider natural mode. For example, the expression
  526. <code>GET_MODE_WIDER_MODE (QImode)</code> returns <code>HImode</code>.
  527. </p>
  528. <a name="index-GET_005fMODE_005fSIZE"></a>
  529. </dd>
  530. <dt><code>GET_MODE_SIZE (<var>m</var>)</code></dt>
  531. <dd><p>Returns the size in bytes of a datum of mode <var>m</var>.
  532. </p>
  533. <a name="index-GET_005fMODE_005fBITSIZE"></a>
  534. </dd>
  535. <dt><code>GET_MODE_BITSIZE (<var>m</var>)</code></dt>
  536. <dd><p>Returns the size in bits of a datum of mode <var>m</var>.
  537. </p>
  538. <a name="index-GET_005fMODE_005fIBIT"></a>
  539. </dd>
  540. <dt><code>GET_MODE_IBIT (<var>m</var>)</code></dt>
  541. <dd><p>Returns the number of integral bits of a datum of fixed-point mode <var>m</var>.
  542. </p>
  543. <a name="index-GET_005fMODE_005fFBIT"></a>
  544. </dd>
  545. <dt><code>GET_MODE_FBIT (<var>m</var>)</code></dt>
  546. <dd><p>Returns the number of fractional bits of a datum of fixed-point mode <var>m</var>.
  547. </p>
  548. <a name="index-GET_005fMODE_005fMASK"></a>
  549. </dd>
  550. <dt><code>GET_MODE_MASK (<var>m</var>)</code></dt>
  551. <dd><p>Returns a bitmask containing 1 for all bits in a word that fit within
  552. mode <var>m</var>. This macro can only be used for modes whose bitsize is
  553. less than or equal to <code>HOST_BITS_PER_INT</code>.
  554. </p>
  555. <a name="index-GET_005fMODE_005fALIGNMENT"></a>
  556. </dd>
  557. <dt><code>GET_MODE_ALIGNMENT (<var>m</var>)</code></dt>
  558. <dd><p>Return the required alignment, in bits, for an object of mode <var>m</var>.
  559. </p>
  560. <a name="index-GET_005fMODE_005fUNIT_005fSIZE"></a>
  561. </dd>
  562. <dt><code>GET_MODE_UNIT_SIZE (<var>m</var>)</code></dt>
  563. <dd><p>Returns the size in bytes of the subunits of a datum of mode <var>m</var>.
  564. This is the same as <code>GET_MODE_SIZE</code> except in the case of complex
  565. modes. For them, the unit size is the size of the real or imaginary
  566. part.
  567. </p>
  568. <a name="index-GET_005fMODE_005fNUNITS"></a>
  569. </dd>
  570. <dt><code>GET_MODE_NUNITS (<var>m</var>)</code></dt>
  571. <dd><p>Returns the number of units contained in a mode, i.e.,
  572. <code>GET_MODE_SIZE</code> divided by <code>GET_MODE_UNIT_SIZE</code>.
  573. </p>
  574. <a name="index-GET_005fCLASS_005fNARROWEST_005fMODE"></a>
  575. </dd>
  576. <dt><code>GET_CLASS_NARROWEST_MODE (<var>c</var>)</code></dt>
  577. <dd><p>Returns the narrowest mode in mode class <var>c</var>.
  578. </p></dd>
  579. </dl>
  580. <p>The following 3 variables are defined on every target. They can be
  581. used to allocate buffers that are guaranteed to be large enough to
  582. hold any value that can be represented on the target. The first two
  583. can be overridden by defining them in the target&rsquo;s mode.def file,
  584. however, the value must be a constant that can determined very early
  585. in the compilation process. The third symbol cannot be overridden.
  586. </p>
  587. <dl compact="compact">
  588. <dd><a name="index-BITS_005fPER_005fUNIT"></a>
  589. </dd>
  590. <dt><code>BITS_PER_UNIT</code></dt>
  591. <dd><p>The number of bits in an addressable storage unit (byte). If you do
  592. not define this, the default is 8.
  593. </p>
  594. <a name="index-MAX_005fBITSIZE_005fMODE_005fANY_005fINT"></a>
  595. </dd>
  596. <dt><code>MAX_BITSIZE_MODE_ANY_INT</code></dt>
  597. <dd><p>The maximum bitsize of any mode that is used in integer math. This
  598. should be overridden by the target if it uses large integers as
  599. containers for larger vectors but otherwise never uses the contents to
  600. compute integer values.
  601. </p>
  602. <a name="index-MAX_005fBITSIZE_005fMODE_005fANY_005fMODE"></a>
  603. </dd>
  604. <dt><code>MAX_BITSIZE_MODE_ANY_MODE</code></dt>
  605. <dd><p>The bitsize of the largest mode on the target.
  606. </p></dd>
  607. </dl>
  608. <a name="index-byte_005fmode"></a>
  609. <a name="index-word_005fmode"></a>
  610. <p>The global variables <code>byte_mode</code> and <code>word_mode</code> contain modes
  611. whose classes are <code>MODE_INT</code> and whose bitsizes are either
  612. <code>BITS_PER_UNIT</code> or <code>BITS_PER_WORD</code>, respectively. On 32-bit
  613. machines, these are <code>QImode</code> and <code>SImode</code>, respectively.
  614. </p>
  615. <hr>
  616. <div class="header">
  617. <p>
  618. Next: <a href="Constants.html#Constants" accesskey="n" rel="next">Constants</a>, Previous: <a href="Flags.html#Flags" accesskey="p" rel="prev">Flags</a>, Up: <a href="RTL.html#RTL" accesskey="u" rel="up">RTL</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>
  619. </div>
  620. </body>
  621. </html>