mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
More updates to objectsize intrinsic docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90644 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -7262,24 +7262,44 @@ LLVM</a>.</p>
|
||||
</pre>
|
||||
|
||||
<h5>Overview:</h5>
|
||||
<p>The <tt>llvm.objectsize</tt> intrinsic returns the constant number of bytes
|
||||
from <tt>ptr</tt> to the end of the object <tt>ptr</tt> points to, if it
|
||||
can deduce this at compile time. If there are any side-effects in evaluating
|
||||
the argument or it cannot deduce which objects <tt>ptr</tt> points to at compile
|
||||
time, the intrinsic returns <tt>i32/i64 -1</tt> for <tt>type</tt> 0
|
||||
or 1 and <tt>i32/i64 0</tt> for <tt>type</tt> 2 or 3.</p>
|
||||
<p>The <tt>llvm.objectsize</tt> intrinsic is designed to provide information
|
||||
to the optimizers to either discover at compile time either a) when an
|
||||
operation like memcpy will either overflow a buffer that corresponds to
|
||||
an object, or b) to determine that a runtime check for overflow isn't
|
||||
necessary. An object in this context means an allocation of a
|
||||
specific <a href="#typesystem">type</a>.</p>
|
||||
|
||||
<h5>Arguments:</h5>
|
||||
<p>The <tt>llvm.objectsize</tt> intrinsic takes two arguments. The first
|
||||
argument is a pointer to the object <tt>ptr</tt>. The second argument
|
||||
is an integer <tt>type</tt> which ranges from 0 to 3. The first bit
|
||||
corresponds to a return value based on whole objects, and the second bit
|
||||
whether or not we return the maximum or minimum remaining bytes computed.</p>
|
||||
is an integer <tt>type</tt> which ranges from 0 to 3. The first bit in
|
||||
the type corresponds to a return value based on whole objects,
|
||||
and the second bit whether or not we return the maximum or minimum
|
||||
remaining bytes computed.</p>
|
||||
<table class="layout">
|
||||
<tr class="layout">
|
||||
<td class="left"><tt>00</tt></td>
|
||||
<td class="left">whole object, maximum number of bytes</td>
|
||||
</tr>
|
||||
<tr class="layout">
|
||||
<td class="left"><tt>01</tt></td>
|
||||
<td class="left">partial object, maximum number of bytes</td>
|
||||
</tr>
|
||||
<tr class="layout">
|
||||
<td class="left"><tt>10</tt></td>
|
||||
<td class="left">whole object, minimum number of bytes</td>
|
||||
</tr>
|
||||
<tr class="layout">
|
||||
<td class="left"><tt>11</tt></td>
|
||||
<td class="left">partial object, minimum number of bytes</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h5>Semantics:</h5>
|
||||
<p>The <tt>llvm.objectsize</tt> intrinsic is lowered to either a constant
|
||||
representing the size of the object concerned or <tt>i32/i64 -1</tt> if
|
||||
it cannot be determined at compile time.</p>
|
||||
representing the size of the object concerned or <tt>i32/i64 -1 or 0</tt>
|
||||
(depending on the <tt>type</tt> argument if the size cannot be determined
|
||||
at compile time.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user