diff options
| author | Chris Lattner <sabre@nondot.org> | 2011-02-07 16:40:21 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2011-02-07 16:40:21 +0000 |
| commit | a676c0fc77db9305ba4142e2d410a5bfd899017e (patch) | |
| tree | 5f96a998c61efb7cad83735ee73f3cf37fb86a01 /llvm/docs/LangRef.html | |
| parent | 351762cda239e2bb90fb2084e546878fea90ebf6 (diff) | |
| download | bcm5719-llvm-a676c0fc77db9305ba4142e2d410a5bfd899017e.tar.gz bcm5719-llvm-a676c0fc77db9305ba4142e2d410a5bfd899017e.zip | |
implement .ll and .bc support for nsw/nuw on shl and exact on lshr/ashr.
Factor some code better.
llvm-svn: 125006
Diffstat (limited to 'llvm/docs/LangRef.html')
| -rw-r--r-- | llvm/docs/LangRef.html | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/llvm/docs/LangRef.html b/llvm/docs/LangRef.html index f7997495e04..dbe385387af 100644 --- a/llvm/docs/LangRef.html +++ b/llvm/docs/LangRef.html @@ -3684,7 +3684,10 @@ Instruction</a> </div> <h5>Syntax:</h5> <pre> - <result> = shl <ty> <op1>, <op2> <i>; yields {ty}:result</i> + <result> = shl <ty> <op1>, <op2> <i>; yields {ty}:result</i> + <result> = shl nuw <ty> <op1>, <op2> <i>; yields {ty}:result</i> + <result> = shl nsw <ty> <op1>, <op2> <i>; yields {ty}:result</i> + <result> = shl nuw nsw <ty> <op1>, <op2> <i>; yields {ty}:result</i> </pre> <h5>Overview:</h5> @@ -3704,6 +3707,14 @@ Instruction</a> </div> vectors, each vector element of <tt>op1</tt> is shifted by the corresponding shift amount in <tt>op2</tt>.</p> +<p>If the <tt>nuw</tt> keyword is present, then the shift produces a + <a href="#trapvalues">trap value</a> if it shifts out any non-zero bits. If + the <tt>nsw</tt> keywrod is present, then the shift produces a + <a href="#trapvalues">trap value</a> if it shifts out any bits that disagree + with the resultant sign bit. As such, NUW/NSW have the same semantics as + they would if the shift were expressed as a mul instruction with the same + nsw/nuw bits in (mul %op1, (shl 1, %op2)).</p> + <h5>Example:</h5> <pre> <result> = shl i32 4, %var <i>; yields {i32}: 4 << %var</i> @@ -3723,7 +3734,8 @@ Instruction</a> </div> <h5>Syntax:</h5> <pre> - <result> = lshr <ty> <op1>, <op2> <i>; yields {ty}:result</i> + <result> = lshr <ty> <op1>, <op2> <i>; yields {ty}:result</i> + <result> = lshr exact <ty> <op1>, <op2> <i>; yields {ty}:result</i> </pre> <h5>Overview:</h5> @@ -3743,6 +3755,11 @@ Instruction</a> </div> vectors, each vector element of <tt>op1</tt> is shifted by the corresponding shift amount in <tt>op2</tt>.</p> +<p>If the <tt>exact</tt> keyword is present, the result value of the + <tt>lshr</tt> is a <a href="#trapvalues">trap value</a> if any of the bits + shifted out are non-zero.</p> + + <h5>Example:</h5> <pre> <result> = lshr i32 4, 1 <i>; yields {i32}:result = 2</i> @@ -3762,7 +3779,8 @@ Instruction</a> </div> <h5>Syntax:</h5> <pre> - <result> = ashr <ty> <op1>, <op2> <i>; yields {ty}:result</i> + <result> = ashr <ty> <op1>, <op2> <i>; yields {ty}:result</i> + <result> = ashr exact <ty> <op1>, <op2> <i>; yields {ty}:result</i> </pre> <h5>Overview:</h5> @@ -3783,6 +3801,10 @@ Instruction</a> </div> the arguments are vectors, each vector element of <tt>op1</tt> is shifted by the corresponding shift amount in <tt>op2</tt>.</p> +<p>If the <tt>exact</tt> keyword is present, the result value of the + <tt>ashr</tt> is a <a href="#trapvalues">trap value</a> if any of the bits + shifted out are non-zero.</p> + <h5>Example:</h5> <pre> <result> = ashr i32 4, 1 <i>; yields {i32}:result = 2</i> |

