diff options
author | Dan Gohman <gohman@apple.com> | 2009-06-04 22:49:04 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-06-04 22:49:04 +0000 |
commit | ae3a0be92e33bc716722aa600983fc1535acb122 (patch) | |
tree | 768333097a76cc105813c7c636daf6259e6a0fc7 /docs/LangRef.html | |
parent | d18e31ae17390d9c6f6cf93d18badf962452031d (diff) | |
download | external_llvm-ae3a0be92e33bc716722aa600983fc1535acb122.zip external_llvm-ae3a0be92e33bc716722aa600983fc1535acb122.tar.gz external_llvm-ae3a0be92e33bc716722aa600983fc1535acb122.tar.bz2 |
Split the Add, Sub, and Mul instruction opcodes into separate
integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.
For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.
This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72897 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/LangRef.html')
-rw-r--r-- | docs/LangRef.html | 135 |
1 files changed, 117 insertions, 18 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html index 5f23674..60217ec 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -89,8 +89,11 @@ <li><a href="#binaryops">Binary Operations</a> <ol> <li><a href="#i_add">'<tt>add</tt>' Instruction</a></li> + <li><a href="#i_fadd">'<tt>fadd</tt>' Instruction</a></li> <li><a href="#i_sub">'<tt>sub</tt>' Instruction</a></li> + <li><a href="#i_fsub">'<tt>fsub</tt>' Instruction</a></li> <li><a href="#i_mul">'<tt>mul</tt>' Instruction</a></li> + <li><a href="#i_fmul">'<tt>fmul</tt>' Instruction</a></li> <li><a href="#i_udiv">'<tt>udiv</tt>' Instruction</a></li> <li><a href="#i_sdiv">'<tt>sdiv</tt>' Instruction</a></li> <li><a href="#i_fdiv">'<tt>fdiv</tt>' Instruction</a></li> @@ -2503,16 +2506,15 @@ The result value has the same type as its operands.</p> <h5>Arguments:</h5> <p>The two arguments to the '<tt>add</tt>' instruction must be <a - href="#t_integer">integer</a>, <a href="#t_floating">floating point</a>, or - <a href="#t_vector">vector</a> values. Both arguments must have identical - types.</p> + href="#t_integer">integer</a> or + <a href="#t_vector">vector</a> of integer values. Both arguments must + have identical types.</p> <h5>Semantics:</h5> -<p>The value produced is the integer or floating point sum of the two -operands.</p> +<p>The value produced is the integer sum of the two operands.</p> -<p>If an integer sum has unsigned overflow, the result returned is the +<p>If the sum has unsigned overflow, the result returned is the mathematical result modulo 2<sup>n</sup>, where n is the bit width of the result.</p> @@ -2527,6 +2529,39 @@ instruction is appropriate for both signed and unsigned integers.</p> </div> <!-- _______________________________________________________________________ --> <div class="doc_subsubsection"> + <a name="i_fadd">'<tt>fadd</tt>' Instruction</a> +</div> + +<div class="doc_text"> + +<h5>Syntax:</h5> + +<pre> + <result> = fadd <ty> <op1>, <op2> <i>; yields {ty}:result</i> +</pre> + +<h5>Overview:</h5> + +<p>The '<tt>fadd</tt>' instruction returns the sum of its two operands.</p> + +<h5>Arguments:</h5> + +<p>The two arguments to the '<tt>fadd</tt>' instruction must be +<a href="#t_floating">floating point</a> or <a href="#t_vector">vector</a> of +floating point values. Both arguments must have identical types.</p> + +<h5>Semantics:</h5> + +<p>The value produced is the floating point sum of the two operands.</p> + +<h5>Example:</h5> + +<pre> + <result> = fadd float 4.0, %var <i>; yields {float}:result = 4.0 + %var</i> +</pre> +</div> +<!-- _______________________________________________________________________ --> +<div class="doc_subsubsection"> <a name="i_sub">'<tt>sub</tt>' Instruction</a> </div> @@ -2550,16 +2585,14 @@ representations.</p> <h5>Arguments:</h5> <p>The two arguments to the '<tt>sub</tt>' instruction must be <a - href="#t_integer">integer</a>, <a href="#t_floating">floating point</a>, - or <a href="#t_vector">vector</a> values. Both arguments must have identical - types.</p> + href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of + integer values. Both arguments must have identical types.</p> <h5>Semantics:</h5> -<p>The value produced is the integer or floating point difference of -the two operands.</p> +<p>The value produced is the integer difference of the two operands.</p> -<p>If an integer difference has unsigned overflow, the result returned is the +<p>If the difference has unsigned overflow, the result returned is the mathematical result modulo 2<sup>n</sup>, where n is the bit width of the result.</p> @@ -2575,6 +2608,45 @@ instruction is appropriate for both signed and unsigned integers.</p> <!-- _______________________________________________________________________ --> <div class="doc_subsubsection"> + <a name="i_fsub">'<tt>fsub</tt>' Instruction</a> +</div> + +<div class="doc_text"> + +<h5>Syntax:</h5> + +<pre> + <result> = fsub <ty> <op1>, <op2> <i>; yields {ty}:result</i> +</pre> + +<h5>Overview:</h5> + +<p>The '<tt>fsub</tt>' instruction returns the difference of its two +operands.</p> + +<p>Note that the '<tt>fsub</tt>' instruction is used to represent the +'<tt>fneg</tt>' instruction present in most other intermediate +representations.</p> + +<h5>Arguments:</h5> + +<p>The two arguments to the '<tt>fsub</tt>' instruction must be <a + <a href="#t_floating">floating point</a> or <a href="#t_vector">vector</a> + of floating point values. Both arguments must have identical types.</p> + +<h5>Semantics:</h5> + +<p>The value produced is the floating point difference of the two operands.</p> + +<h5>Example:</h5> +<pre> + <result> = fsub float 4.0, %var <i>; yields {float}:result = 4.0 - %var</i> + <result> = fsub float -0.0, %val <i>; yields {float}:result = -%var</i> +</pre> +</div> + +<!-- _______________________________________________________________________ --> +<div class="doc_subsubsection"> <a name="i_mul">'<tt>mul</tt>' Instruction</a> </div> @@ -2590,16 +2662,14 @@ operands.</p> <h5>Arguments:</h5> <p>The two arguments to the '<tt>mul</tt>' instruction must be <a -href="#t_integer">integer</a>, <a href="#t_floating">floating point</a>, -or <a href="#t_vector">vector</a> values. Both arguments must have identical -types.</p> +href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer +values. Both arguments must have identical types.</p> <h5>Semantics:</h5> -<p>The value produced is the integer or floating point product of the -two operands.</p> +<p>The value produced is the integer product of the two operands.</p> -<p>If the result of an integer multiplication has unsigned overflow, +<p>If the result of the multiplication has unsigned overflow, the result returned is the mathematical result modulo 2<sup>n</sup>, where n is the bit width of the result.</p> <p>Because LLVM integers use a two's complement representation, and the @@ -2614,6 +2684,35 @@ width of the full product.</p> </div> <!-- _______________________________________________________________________ --> +<div class="doc_subsubsection"> + <a name="i_fmul">'<tt>fmul</tt>' Instruction</a> +</div> + +<div class="doc_text"> + +<h5>Syntax:</h5> +<pre> <result> = fmul <ty> <op1>, <op2> <i>; yields {ty}:result</i> +</pre> +<h5>Overview:</h5> +<p>The '<tt>fmul</tt>' instruction returns the product of its two +operands.</p> + +<h5>Arguments:</h5> + +<p>The two arguments to the '<tt>fmul</tt>' instruction must be +<a href="#t_floating">floating point</a> or <a href="#t_vector">vector</a> +of floating point values. Both arguments must have identical types.</p> + +<h5>Semantics:</h5> + +<p>The value produced is the floating point product of the two operands.</p> + +<h5>Example:</h5> +<pre> <result> = fmul float 4.0, %var <i>; yields {float}:result = 4.0 * %var</i> +</pre> +</div> + +<!-- _______________________________________________________________________ --> <div class="doc_subsubsection"> <a name="i_udiv">'<tt>udiv</tt>' Instruction </a></div> <div class="doc_text"> |