選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

471 行
21KB

  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>Arithmetic (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="Arithmetic (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="Arithmetic (GNU Compiler Collection (GCC) Internals)">
  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="RTL.html#RTL" rel="up" title="RTL">
  30. <link href="Comparisons.html#Comparisons" rel="next" title="Comparisons">
  31. <link href="Regs-and-Memory.html#Regs-and-Memory" rel="prev" title="Regs and Memory">
  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="Arithmetic"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Comparisons.html#Comparisons" accesskey="n" rel="next">Comparisons</a>, Previous: <a href="Regs-and-Memory.html#Regs-and-Memory" accesskey="p" rel="prev">Regs and Memory</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>
  65. </div>
  66. <hr>
  67. <a name="RTL-Expressions-for-Arithmetic"></a>
  68. <h3 class="section">14.9 RTL Expressions for Arithmetic</h3>
  69. <a name="index-arithmetic_002c-in-RTL"></a>
  70. <a name="index-math_002c-in-RTL"></a>
  71. <a name="index-RTL-expressions-for-arithmetic"></a>
  72. <p>Unless otherwise specified, all the operands of arithmetic expressions
  73. must be valid for mode <var>m</var>. An operand is valid for mode <var>m</var>
  74. if it has mode <var>m</var>, or if it is a <code>const_int</code> or
  75. <code>const_double</code> and <var>m</var> is a mode of class <code>MODE_INT</code>.
  76. </p>
  77. <p>For commutative binary operations, constants should be placed in the
  78. second operand.
  79. </p>
  80. <dl compact="compact">
  81. <dd><a name="index-plus"></a>
  82. <a name="index-ss_005fplus"></a>
  83. <a name="index-us_005fplus"></a>
  84. <a name="index-RTL-sum"></a>
  85. <a name="index-RTL-addition"></a>
  86. <a name="index-RTL-addition-with-signed-saturation"></a>
  87. <a name="index-RTL-addition-with-unsigned-saturation"></a>
  88. </dd>
  89. <dt><code>(plus:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  90. <dt><code>(ss_plus:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  91. <dt><code>(us_plus:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  92. <dd>
  93. <p>These three expressions all represent the sum of the values
  94. represented by <var>x</var> and <var>y</var> carried out in machine mode
  95. <var>m</var>. They differ in their behavior on overflow of integer modes.
  96. <code>plus</code> wraps round modulo the width of <var>m</var>; <code>ss_plus</code>
  97. saturates at the maximum signed value representable in <var>m</var>;
  98. <code>us_plus</code> saturates at the maximum unsigned value.
  99. </p>
  100. <a name="index-lo_005fsum"></a>
  101. </dd>
  102. <dt><code>(lo_sum:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  103. <dd>
  104. <p>This expression represents the sum of <var>x</var> and the low-order bits
  105. of <var>y</var>. It is used with <code>high</code> (see <a href="Constants.html#Constants">Constants</a>) to
  106. represent the typical two-instruction sequence used in RISC machines to
  107. reference large immediate values and/or link-time constants such
  108. as global memory addresses. In the latter case, <var>m</var> is <code>Pmode</code>
  109. and <var>y</var> is usually a constant expression involving <code>symbol_ref</code>.
  110. </p>
  111. <p>The number of low order bits is machine-dependent but is
  112. normally the number of bits in mode <var>m</var> minus the number of
  113. bits set by <code>high</code>.
  114. </p>
  115. <a name="index-minus"></a>
  116. <a name="index-ss_005fminus"></a>
  117. <a name="index-us_005fminus"></a>
  118. <a name="index-RTL-difference"></a>
  119. <a name="index-RTL-subtraction"></a>
  120. <a name="index-RTL-subtraction-with-signed-saturation"></a>
  121. <a name="index-RTL-subtraction-with-unsigned-saturation"></a>
  122. </dd>
  123. <dt><code>(minus:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  124. <dt><code>(ss_minus:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  125. <dt><code>(us_minus:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  126. <dd>
  127. <p>These three expressions represent the result of subtracting <var>y</var>
  128. from <var>x</var>, carried out in mode <var>M</var>. Behavior on overflow is
  129. the same as for the three variants of <code>plus</code> (see above).
  130. </p>
  131. <a name="index-compare"></a>
  132. <a name="index-RTL-comparison"></a>
  133. </dd>
  134. <dt><code>(compare:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  135. <dd><p>Represents the result of subtracting <var>y</var> from <var>x</var> for purposes
  136. of comparison. The result is computed without overflow, as if with
  137. infinite precision.
  138. </p>
  139. <p>Of course, machines cannot really subtract with infinite precision.
  140. However, they can pretend to do so when only the sign of the result will
  141. be used, which is the case when the result is stored in the condition
  142. code. And that is the <em>only</em> way this kind of expression may
  143. validly be used: as a value to be stored in the condition codes, either
  144. <code>(cc0)</code> or a register. See <a href="Comparisons.html#Comparisons">Comparisons</a>.
  145. </p>
  146. <p>The mode <var>m</var> is not related to the modes of <var>x</var> and <var>y</var>, but
  147. instead is the mode of the condition code value. If <code>(cc0)</code> is
  148. used, it is <code>VOIDmode</code>. Otherwise it is some mode in class
  149. <code>MODE_CC</code>, often <code>CCmode</code>. See <a href="Condition-Code.html#Condition-Code">Condition Code</a>. If <var>m</var>
  150. is <code>VOIDmode</code> or <code>CCmode</code>, the operation returns sufficient
  151. information (in an unspecified format) so that any comparison operator
  152. can be applied to the result of the <code>COMPARE</code> operation. For other
  153. modes in class <code>MODE_CC</code>, the operation only returns a subset of
  154. this information.
  155. </p>
  156. <p>Normally, <var>x</var> and <var>y</var> must have the same mode. Otherwise,
  157. <code>compare</code> is valid only if the mode of <var>x</var> is in class
  158. <code>MODE_INT</code> and <var>y</var> is a <code>const_int</code> or
  159. <code>const_double</code> with mode <code>VOIDmode</code>. The mode of <var>x</var>
  160. determines what mode the comparison is to be done in; thus it must not
  161. be <code>VOIDmode</code>.
  162. </p>
  163. <p>If one of the operands is a constant, it should be placed in the
  164. second operand and the comparison code adjusted as appropriate.
  165. </p>
  166. <p>A <code>compare</code> specifying two <code>VOIDmode</code> constants is not valid
  167. since there is no way to know in what mode the comparison is to be
  168. performed; the comparison must either be folded during the compilation
  169. or the first operand must be loaded into a register while its mode is
  170. still known.
  171. </p>
  172. <a name="index-neg"></a>
  173. <a name="index-ss_005fneg"></a>
  174. <a name="index-us_005fneg"></a>
  175. <a name="index-negation"></a>
  176. <a name="index-negation-with-signed-saturation"></a>
  177. <a name="index-negation-with-unsigned-saturation"></a>
  178. </dd>
  179. <dt><code>(neg:<var>m</var> <var>x</var>)</code></dt>
  180. <dt><code>(ss_neg:<var>m</var> <var>x</var>)</code></dt>
  181. <dt><code>(us_neg:<var>m</var> <var>x</var>)</code></dt>
  182. <dd><p>These two expressions represent the negation (subtraction from zero) of
  183. the value represented by <var>x</var>, carried out in mode <var>m</var>. They
  184. differ in the behavior on overflow of integer modes. In the case of
  185. <code>neg</code>, the negation of the operand may be a number not representable
  186. in mode <var>m</var>, in which case it is truncated to <var>m</var>. <code>ss_neg</code>
  187. and <code>us_neg</code> ensure that an out-of-bounds result saturates to the
  188. maximum or minimum signed or unsigned value.
  189. </p>
  190. <a name="index-mult"></a>
  191. <a name="index-ss_005fmult"></a>
  192. <a name="index-us_005fmult"></a>
  193. <a name="index-multiplication"></a>
  194. <a name="index-product"></a>
  195. <a name="index-multiplication-with-signed-saturation"></a>
  196. <a name="index-multiplication-with-unsigned-saturation"></a>
  197. </dd>
  198. <dt><code>(mult:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  199. <dt><code>(ss_mult:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  200. <dt><code>(us_mult:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  201. <dd><p>Represents the signed product of the values represented by <var>x</var> and
  202. <var>y</var> carried out in machine mode <var>m</var>.
  203. <code>ss_mult</code> and <code>us_mult</code> ensure that an out-of-bounds result
  204. saturates to the maximum or minimum signed or unsigned value.
  205. </p>
  206. <p>Some machines support a multiplication that generates a product wider
  207. than the operands. Write the pattern for this as
  208. </p>
  209. <div class="smallexample">
  210. <pre class="smallexample">(mult:<var>m</var> (sign_extend:<var>m</var> <var>x</var>) (sign_extend:<var>m</var> <var>y</var>))
  211. </pre></div>
  212. <p>where <var>m</var> is wider than the modes of <var>x</var> and <var>y</var>, which need
  213. not be the same.
  214. </p>
  215. <p>For unsigned widening multiplication, use the same idiom, but with
  216. <code>zero_extend</code> instead of <code>sign_extend</code>.
  217. </p>
  218. <a name="index-fma"></a>
  219. </dd>
  220. <dt><code>(fma:<var>m</var> <var>x</var> <var>y</var> <var>z</var>)</code></dt>
  221. <dd><p>Represents the <code>fma</code>, <code>fmaf</code>, and <code>fmal</code> builtin
  222. functions, which compute &lsquo;<samp><var>x</var> * <var>y</var> + <var>z</var></samp>&rsquo;
  223. without doing an intermediate rounding step.
  224. </p>
  225. <a name="index-div"></a>
  226. <a name="index-ss_005fdiv"></a>
  227. <a name="index-division"></a>
  228. <a name="index-signed-division"></a>
  229. <a name="index-signed-division-with-signed-saturation"></a>
  230. <a name="index-quotient"></a>
  231. </dd>
  232. <dt><code>(div:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  233. <dt><code>(ss_div:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  234. <dd><p>Represents the quotient in signed division of <var>x</var> by <var>y</var>,
  235. carried out in machine mode <var>m</var>. If <var>m</var> is a floating point
  236. mode, it represents the exact quotient; otherwise, the integerized
  237. quotient.
  238. <code>ss_div</code> ensures that an out-of-bounds result saturates to the maximum
  239. or minimum signed value.
  240. </p>
  241. <p>Some machines have division instructions in which the operands and
  242. quotient widths are not all the same; you should represent
  243. such instructions using <code>truncate</code> and <code>sign_extend</code> as in,
  244. </p>
  245. <div class="smallexample">
  246. <pre class="smallexample">(truncate:<var>m1</var> (div:<var>m2</var> <var>x</var> (sign_extend:<var>m2</var> <var>y</var>)))
  247. </pre></div>
  248. <a name="index-udiv"></a>
  249. <a name="index-unsigned-division"></a>
  250. <a name="index-unsigned-division-with-unsigned-saturation"></a>
  251. <a name="index-division-1"></a>
  252. </dd>
  253. <dt><code>(udiv:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  254. <dt><code>(us_div:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  255. <dd><p>Like <code>div</code> but represents unsigned division.
  256. <code>us_div</code> ensures that an out-of-bounds result saturates to the maximum
  257. or minimum unsigned value.
  258. </p>
  259. <a name="index-mod"></a>
  260. <a name="index-umod"></a>
  261. <a name="index-remainder"></a>
  262. <a name="index-division-2"></a>
  263. </dd>
  264. <dt><code>(mod:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  265. <dt><code>(umod:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  266. <dd><p>Like <code>div</code> and <code>udiv</code> but represent the remainder instead of
  267. the quotient.
  268. </p>
  269. <a name="index-smin"></a>
  270. <a name="index-smax"></a>
  271. <a name="index-signed-minimum"></a>
  272. <a name="index-signed-maximum"></a>
  273. </dd>
  274. <dt><code>(smin:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  275. <dt><code>(smax:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  276. <dd><p>Represents the smaller (for <code>smin</code>) or larger (for <code>smax</code>) of
  277. <var>x</var> and <var>y</var>, interpreted as signed values in mode <var>m</var>.
  278. When used with floating point, if both operands are zeros, or if either
  279. operand is <code>NaN</code>, then it is unspecified which of the two operands
  280. is returned as the result.
  281. </p>
  282. <a name="index-umin"></a>
  283. <a name="index-umax"></a>
  284. <a name="index-unsigned-minimum-and-maximum"></a>
  285. </dd>
  286. <dt><code>(umin:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  287. <dt><code>(umax:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  288. <dd><p>Like <code>smin</code> and <code>smax</code>, but the values are interpreted as unsigned
  289. integers.
  290. </p>
  291. <a name="index-not"></a>
  292. <a name="index-complement_002c-bitwise"></a>
  293. <a name="index-bitwise-complement"></a>
  294. </dd>
  295. <dt><code>(not:<var>m</var> <var>x</var>)</code></dt>
  296. <dd><p>Represents the bitwise complement of the value represented by <var>x</var>,
  297. carried out in mode <var>m</var>, which must be a fixed-point machine mode.
  298. </p>
  299. <a name="index-and"></a>
  300. <a name="index-logical_002dand_002c-bitwise"></a>
  301. <a name="index-bitwise-logical_002dand"></a>
  302. </dd>
  303. <dt><code>(and:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  304. <dd><p>Represents the bitwise logical-and of the values represented by
  305. <var>x</var> and <var>y</var>, carried out in machine mode <var>m</var>, which must be
  306. a fixed-point machine mode.
  307. </p>
  308. <a name="index-ior"></a>
  309. <a name="index-inclusive_002dor_002c-bitwise"></a>
  310. <a name="index-bitwise-inclusive_002dor"></a>
  311. </dd>
  312. <dt><code>(ior:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  313. <dd><p>Represents the bitwise inclusive-or of the values represented by <var>x</var>
  314. and <var>y</var>, carried out in machine mode <var>m</var>, which must be a
  315. fixed-point mode.
  316. </p>
  317. <a name="index-xor"></a>
  318. <a name="index-exclusive_002dor_002c-bitwise"></a>
  319. <a name="index-bitwise-exclusive_002dor"></a>
  320. </dd>
  321. <dt><code>(xor:<var>m</var> <var>x</var> <var>y</var>)</code></dt>
  322. <dd><p>Represents the bitwise exclusive-or of the values represented by <var>x</var>
  323. and <var>y</var>, carried out in machine mode <var>m</var>, which must be a
  324. fixed-point mode.
  325. </p>
  326. <a name="index-ashift"></a>
  327. <a name="index-ss_005fashift"></a>
  328. <a name="index-us_005fashift"></a>
  329. <a name="index-left-shift"></a>
  330. <a name="index-shift"></a>
  331. <a name="index-arithmetic-shift"></a>
  332. <a name="index-arithmetic-shift-with-signed-saturation"></a>
  333. <a name="index-arithmetic-shift-with-unsigned-saturation"></a>
  334. </dd>
  335. <dt><code>(ashift:<var>m</var> <var>x</var> <var>c</var>)</code></dt>
  336. <dt><code>(ss_ashift:<var>m</var> <var>x</var> <var>c</var>)</code></dt>
  337. <dt><code>(us_ashift:<var>m</var> <var>x</var> <var>c</var>)</code></dt>
  338. <dd><p>These three expressions represent the result of arithmetically shifting <var>x</var>
  339. left by <var>c</var> places. They differ in their behavior on overflow of integer
  340. modes. An <code>ashift</code> operation is a plain shift with no special behavior
  341. in case of a change in the sign bit; <code>ss_ashift</code> and <code>us_ashift</code>
  342. saturates to the minimum or maximum representable value if any of the bits
  343. shifted out differs from the final sign bit.
  344. </p>
  345. <p><var>x</var> have mode <var>m</var>, a fixed-point machine mode. <var>c</var>
  346. be a fixed-point mode or be a constant with mode <code>VOIDmode</code>; which
  347. mode is determined by the mode called for in the machine description
  348. entry for the left-shift instruction. For example, on the VAX, the mode
  349. of <var>c</var> is <code>QImode</code> regardless of <var>m</var>.
  350. </p>
  351. <a name="index-lshiftrt"></a>
  352. <a name="index-right-shift"></a>
  353. <a name="index-ashiftrt"></a>
  354. </dd>
  355. <dt><code>(lshiftrt:<var>m</var> <var>x</var> <var>c</var>)</code></dt>
  356. <dt><code>(ashiftrt:<var>m</var> <var>x</var> <var>c</var>)</code></dt>
  357. <dd><p>Like <code>ashift</code> but for right shift. Unlike the case for left shift,
  358. these two operations are distinct.
  359. </p>
  360. <a name="index-rotate-1"></a>
  361. <a name="index-rotate"></a>
  362. <a name="index-left-rotate"></a>
  363. <a name="index-rotatert"></a>
  364. <a name="index-right-rotate"></a>
  365. </dd>
  366. <dt><code>(rotate:<var>m</var> <var>x</var> <var>c</var>)</code></dt>
  367. <dt><code>(rotatert:<var>m</var> <var>x</var> <var>c</var>)</code></dt>
  368. <dd><p>Similar but represent left and right rotate. If <var>c</var> is a constant,
  369. use <code>rotate</code>.
  370. </p>
  371. <a name="index-abs"></a>
  372. <a name="index-ss_005fabs"></a>
  373. <a name="index-absolute-value"></a>
  374. </dd>
  375. <dt><code>(abs:<var>m</var> <var>x</var>)</code></dt>
  376. <dt><code>(ss_abs:<var>m</var> <var>x</var>)</code></dt>
  377. <dd><p>Represents the absolute value of <var>x</var>, computed in mode <var>m</var>.
  378. <code>ss_abs</code> ensures that an out-of-bounds result saturates to the
  379. maximum signed value.
  380. </p>
  381. <a name="index-sqrt"></a>
  382. <a name="index-square-root"></a>
  383. </dd>
  384. <dt><code>(sqrt:<var>m</var> <var>x</var>)</code></dt>
  385. <dd><p>Represents the square root of <var>x</var>, computed in mode <var>m</var>.
  386. Most often <var>m</var> will be a floating point mode.
  387. </p>
  388. <a name="index-ffs"></a>
  389. </dd>
  390. <dt><code>(ffs:<var>m</var> <var>x</var>)</code></dt>
  391. <dd><p>Represents one plus the index of the least significant 1-bit in
  392. <var>x</var>, represented as an integer of mode <var>m</var>. (The value is
  393. zero if <var>x</var> is zero.) The mode of <var>x</var> must be <var>m</var>
  394. or <code>VOIDmode</code>.
  395. </p>
  396. <a name="index-clrsb"></a>
  397. </dd>
  398. <dt><code>(clrsb:<var>m</var> <var>x</var>)</code></dt>
  399. <dd><p>Represents the number of redundant leading sign bits in <var>x</var>,
  400. represented as an integer of mode <var>m</var>, starting at the most
  401. significant bit position. This is one less than the number of leading
  402. sign bits (either 0 or 1), with no special cases. The mode of <var>x</var>
  403. must be <var>m</var> or <code>VOIDmode</code>.
  404. </p>
  405. <a name="index-clz"></a>
  406. </dd>
  407. <dt><code>(clz:<var>m</var> <var>x</var>)</code></dt>
  408. <dd><p>Represents the number of leading 0-bits in <var>x</var>, represented as an
  409. integer of mode <var>m</var>, starting at the most significant bit position.
  410. If <var>x</var> is zero, the value is determined by
  411. <code>CLZ_DEFINED_VALUE_AT_ZERO</code> (see <a href="Misc.html#Misc">Misc</a>). Note that this is one of
  412. the few expressions that is not invariant under widening. The mode of
  413. <var>x</var> must be <var>m</var> or <code>VOIDmode</code>.
  414. </p>
  415. <a name="index-ctz"></a>
  416. </dd>
  417. <dt><code>(ctz:<var>m</var> <var>x</var>)</code></dt>
  418. <dd><p>Represents the number of trailing 0-bits in <var>x</var>, represented as an
  419. integer of mode <var>m</var>, starting at the least significant bit position.
  420. If <var>x</var> is zero, the value is determined by
  421. <code>CTZ_DEFINED_VALUE_AT_ZERO</code> (see <a href="Misc.html#Misc">Misc</a>). Except for this case,
  422. <code>ctz(x)</code> is equivalent to <code>ffs(<var>x</var>) - 1</code>. The mode of
  423. <var>x</var> must be <var>m</var> or <code>VOIDmode</code>.
  424. </p>
  425. <a name="index-popcount"></a>
  426. </dd>
  427. <dt><code>(popcount:<var>m</var> <var>x</var>)</code></dt>
  428. <dd><p>Represents the number of 1-bits in <var>x</var>, represented as an integer of
  429. mode <var>m</var>. The mode of <var>x</var> must be <var>m</var> or <code>VOIDmode</code>.
  430. </p>
  431. <a name="index-parity"></a>
  432. </dd>
  433. <dt><code>(parity:<var>m</var> <var>x</var>)</code></dt>
  434. <dd><p>Represents the number of 1-bits modulo 2 in <var>x</var>, represented as an
  435. integer of mode <var>m</var>. The mode of <var>x</var> must be <var>m</var> or
  436. <code>VOIDmode</code>.
  437. </p>
  438. <a name="index-bswap"></a>
  439. </dd>
  440. <dt><code>(bswap:<var>m</var> <var>x</var>)</code></dt>
  441. <dd><p>Represents the value <var>x</var> with the order of bytes reversed, carried out
  442. in mode <var>m</var>, which must be a fixed-point machine mode.
  443. The mode of <var>x</var> must be <var>m</var> or <code>VOIDmode</code>.
  444. </p></dd>
  445. </dl>
  446. <hr>
  447. <div class="header">
  448. <p>
  449. Next: <a href="Comparisons.html#Comparisons" accesskey="n" rel="next">Comparisons</a>, Previous: <a href="Regs-and-Memory.html#Regs-and-Memory" accesskey="p" rel="prev">Regs and Memory</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>
  450. </div>
  451. </body>
  452. </html>