Skip to content

Commit efa20fa

Browse files
committed
ctlz = most signficant bits, cttz = least sig
llvm-svn: 22061
1 parent 04d6ed5 commit efa20fa

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

llvm/docs/LangRef.html

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@
149149
<li><a href="#int_count">Bit counting Intrinsics</a>
150150
<ol>
151151
<li><a href="#int_ctpop">'<tt>llvm.ctpop</tt>' Intrinsic </a></li>
152-
<li><a href="#int_cttz">'<tt>llvm.cttz</tt>' Intrinsic </a></li>
153152
<li><a href="#int_ctlz">'<tt>llvm.ctlz</tt>' Intrinsic </a></li>
153+
<li><a href="#int_cttz">'<tt>llvm.cttz</tt>' Intrinsic </a></li>
154154
</ol>
155155
</li>
156156
<li><a href="#int_debugger">Debugger intrinsics</a></li>
@@ -3205,74 +3205,77 @@ <h5>Semantics:</h5>
32053205

32063206
<!-- _______________________________________________________________________ -->
32073207
<div class="doc_subsubsection">
3208-
<a name="int_cttz">'<tt>llvm.cttz</tt>' Intrinsic</a>
3208+
<a name="int_ctlz">'<tt>llvm.ctlz</tt>' Intrinsic</a>
32093209
</div>
32103210

32113211
<div class="doc_text">
32123212

32133213
<h5>Syntax:</h5>
32143214
<pre>
3215-
declare int %llvm.cttz(int &lt;src&gt;)
3215+
declare int %llvm.ctlz(int &lt;src&gt;)
32163216

32173217
</pre>
32183218

32193219
<h5>Overview:</h5>
32203220

32213221
<p>
3222-
The '<tt>llvm.cttz</tt>' intrinsic counts the number of trailing zeros.
3222+
The '<tt>llvm.ctlz</tt>' intrinsic counts the number of leading zeros in a
3223+
variable.
32233224
</p>
32243225

32253226
<h5>Arguments:</h5>
32263227

32273228
<p>
32283229
The only argument is the value to be counted. The argument may be of any
3229-
integer type. The return type must match the argument type.
3230+
integer type. The return type must match the argument type.
32303231
</p>
32313232

32323233
<h5>Semantics:</h5>
32333234

32343235
<p>
3235-
The '<tt>llvm.cttz</tt>' intrinsic counts the trailing zeros in a variable. If
3236-
the src == 0 then the result is the size in bits of the type of src.
3236+
The '<tt>llvm.ctlz</tt>' intrinsic counts the leading (most significant) zeros
3237+
in a variable. If the src == 0 then the result is the size in bits of the type
3238+
of src. For example, <tt>llvm.cttz(int 2) = 30</tt>.
32373239
</p>
32383240
</div>
32393241

3242+
3243+
32403244
<!-- _______________________________________________________________________ -->
32413245
<div class="doc_subsubsection">
3242-
<a name="int_ctlz">'<tt>llvm.ctlz</tt>' Intrinsic</a>
3246+
<a name="int_cttz">'<tt>llvm.cttz</tt>' Intrinsic</a>
32433247
</div>
32443248

32453249
<div class="doc_text">
32463250

32473251
<h5>Syntax:</h5>
32483252
<pre>
3249-
declare int %llvm.ctlz(int &lt;src&gt;)
3253+
declare int %llvm.cttz(int &lt;src&gt;)
32503254

32513255
</pre>
32523256

32533257
<h5>Overview:</h5>
32543258

32553259
<p>
3256-
The '<tt>llvm.ctlz</tt>' intrinsic counts the number of leading zeros in a
3257-
variable.
3260+
The '<tt>llvm.cttz</tt>' intrinsic counts the number of trailing zeros.
32583261
</p>
32593262

32603263
<h5>Arguments:</h5>
32613264

32623265
<p>
32633266
The only argument is the value to be counted. The argument may be of any
3264-
integer type. The return type must match the argument type.
3267+
integer type. The return type must match the argument type.
32653268
</p>
32663269

32673270
<h5>Semantics:</h5>
32683271

32693272
<p>
3270-
The '<tt>llvm.ctlz</tt>' intrinsic counts the leading zeros in a variable. If
3271-
the src == 0 then the result is the size in bits of the type of src.
3273+
The '<tt>llvm.cttz</tt>' intrinsic counts the trailing (least significant) zeros
3274+
in a variable. If the src == 0 then the result is the size in bits of the type
3275+
of src. For example, <tt>llvm.cttz(2) = 1</tt>.
32723276
</p>
32733277
</div>
32743278

3275-
32763279
<!-- ======================================================================= -->
32773280
<div class="doc_subsection">
32783281
<a name="int_debugger">Debugger Intrinsics</a>

0 commit comments

Comments
 (0)