Re: Reference Manual Clarifications
Jon Sargeant <delta17 <at> cox.net>
2008-04-01 00:07:40 GMT
Gordon Henriksen wrote:
> Hi Jon,
>
> Please you'll want to submit patches as unified diffs and as
> attachments.
>
> I notice you're using Thunderbird, so I refer you to this tip:
>
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-January/011992.html
>
> Although this note doesn't apply to how you included your original
> patch (looks like you pasted it in), Thunderbird has default
> attachment handling settings which cause problems for many of our
> reviewers.
>
> Thanks,
> Gordon
Ok, did I get it right this time?
--- langref1.html 2008-03-31 11:44:59.171875000 -0700
+++ langref2.html 2008-03-31 12:15:42.562500000 -0700
<at> <at> -1569,8 +1569,10 <at> <at>
<dd>Floating point constants use standard decimal notation (e.g. 123.421),
exponential notation (e.g. 1.23421e+2), or a more precise hexadecimal
- notation (see below). Floating point constants must have a <a
- href="#t_floating">floating point</a> type. </dd>
+ notation (see below). The assembler requires the exact decimal value of
+ a floating-point constant. For example, the assembler accepts 1.25 but
+ rejects 1.3 because 1.3 is a repeating decimal in binary. Floating point
+ constants must have a <a href="#t_floating">floating point</a> type. </dd>
<dt><b>Null pointer constants</b></dt>
<at> <at> -2175,11 +2177,10 <at> <at>
<div class="doc_subsection"> <a name="binaryops">Binary Operations</a> </div>
<div class="doc_text">
<p>Binary operators are used to do most of the computation in a
-program. They require two operands, execute an operation on them, and
+program. They require two operands of the same type, execute an operation on them, and
produce a single value. The operands might represent
multiple data, as is the case with the <a href="#t_vector">vector</a> data type.
-The result value of a binary operator is not
-necessarily the same type as its operands.</p>
+The result value has the same type as its operands.</p>
<p>There are several different binary operators:</p>
</div>
<!-- _______________________________________________________________________ -->
<at> <at> -2329,7 +2330,7 <at> <at>
of the values in which case the elements must be integers.</p>
<h5>Semantics:</h5>
-<p>The value produced is the signed integer quotient of the two operands.</p>
+<p>The value produced is the signed integer quotient of the two operands rounded towards zero.</p>
<p>Note that signed integer division and unsigned integer division are distinct
operations; for unsigned integer division, use '<tt>udiv</tt>'.</p>
<p>Division by zero leads to undefined behavior. Overflow also leads to
<at> <at> -2383,8 +2384,7 <at> <at>
<h5>Semantics:</h5>
<p>This instruction returns the unsigned integer <i>remainder</i> of a division.
-This instruction always performs an unsigned division to get the remainder,
-regardless of whether the arguments are unsigned or not.</p>
+This instruction always performs an unsigned division to get the remainder.</p>
<p>Note that unsigned integer remainder and signed integer remainder are
distinct operations; for signed integer remainder, use '<tt>srem</tt>'.</p>
<p>Taking the remainder of a division by zero leads to undefined behavior.</p>
<at> <at> -2455,7 +2455,8 <at> <at>
versions of floating point values.</p>
<h5>Semantics:</h5>
-<p>This instruction returns the <i>remainder</i> of a division.</p>
+<p>This instruction returns the <i>remainder</i> of a division.
+The remainder has the same sign as the dividend.</p>
<h5>Example:</h5>
<pre> <result> = frem float 4.0, %var <i>; yields {float}:result = 4.0 % %var</i>
<at> <at> -2469,9 +2470,8 <at> <at>
<p>Bitwise binary operators are used to do various forms of
bit-twiddling in a program. They are generally very efficient
instructions and can commonly be strength reduced from other
-instructions. They require two operands, execute an operation on them,
-and produce a single value. The resulting value of the bitwise binary
-operators is always the same type as its first operand.</p>
+instructions. They require two operands of the same type, execute an operation on them,
+and produce a single value. The resulting value is the same type as its operands.</p>
</div>
<!-- _______________________________________________________________________ -->
<at> <at> -2496,9 +2496,9 <at> <at>
<h5>Semantics:</h5>
-<p>The value produced is <tt>var1</tt> * 2<sup><tt>var2</tt></sup>. If
-<tt>var2</tt> is (statically or dynamically) equal to or larger than the number
-of bits in <tt>var1</tt>, the result is undefined.</p>
+<p>The value produced is <tt>var1</tt> * 2<sup><tt>var2</tt></sup> mod 2<sup>n</sup>,
+where n is the width of the result. If <tt>var2</tt> is (statically or dynamically) negative or
+equal to or larger than the number of bits in <tt>var1</tt>, the result is undefined.</p>
<h5>Example:</h5><pre>
<result> = shl i32 4, %var <i>; yields {i32}: 4 << %var</i>
<at> <at> -2529,7 +2529,7 <at> <at>
<p>This instruction always performs a logical shift right operation. The most
significant bits of the result will be filled with zero bits after the
-shift. If <tt>var2</tt> is (statically or dynamically) equal to or larger than
+shift. If <tt>var2</tt> is (statically or dynamically) negative or equal to or larger than
the number of bits in <tt>var1</tt>, the result is undefined.</p>
<h5>Example:</h5>
<at> <at> -2564,7 +2564,7 <at> <at>
<h5>Semantics:</h5>
<p>This instruction always performs an arithmetic shift right operation,
The most significant bits of the result will be filled with the sign bit
-of <tt>var1</tt>. If <tt>var2</tt> is (statically or dynamically) equal to or
+of <tt>var1</tt>. If <tt>var2</tt> is (statically or dynamically) negative or equal to or
larger than the number of bits in <tt>var1</tt>, the result is undefined.
</p>
_______________________________________________
LLVM Developers mailing list
LLVMdev <at> cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev