From f067d584a81ae771d301304ea885e55e2de8ee9a Mon Sep 17 00:00:00 2001
From: Chris Lattner Syntax:
- <result> = shl <ty> <op1>, <op2> ; yields {ty}:result
+ <result> = shl <ty> <op1>, <op2> ; yields {ty}:result
+ <result> = shl nuw <ty> <op1>, <op2> ; yields {ty}:result
+ <result> = shl nsw <ty> <op1>, <op2> ; yields {ty}:result
+ <result> = shl nuw nsw <ty> <op1>, <op2> ; yields {ty}:result
Overview:
@@ -3704,6 +3707,14 @@ Instruction
vectors, each vector element of op1 is shifted by the corresponding
shift amount in op2.
If the nuw keyword is present, then the shift produces a + trap value if it shifts out any non-zero bits. If + the nsw keywrod is present, then the shift produces a + trap value 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)).
+<result> = shl i32 4, %var ; yields {i32}: 4 << %var @@ -3723,7 +3734,8 @@ InstructionSyntax:
- <result> = lshr <ty> <op1>, <op2> ; yields {ty}:result + <result> = lshr <ty> <op1>, <op2> ; yields {ty}:result + <result> = lshr exact <ty> <op1>, <op2> ; yields {ty}:resultOverview:
@@ -3743,6 +3755,11 @@ Instruction vectors, each vector element of op1 is shifted by the corresponding shift amount in op2. +If the exact keyword is present, the result value of the + lshr is a trap value if any of the bits + shifted out are non-zero.
+ +Example:
<result> = lshr i32 4, 1 ; yields {i32}:result = 2 @@ -3762,7 +3779,8 @@ InstructionSyntax:
- <result> = ashr <ty> <op1>, <op2> ; yields {ty}:result + <result> = ashr <ty> <op1>, <op2> ; yields {ty}:result + <result> = ashr exact <ty> <op1>, <op2> ; yields {ty}:resultOverview:
@@ -3783,6 +3801,10 @@ Instruction the arguments are vectors, each vector element of op1 is shifted by the corresponding shift amount in op2. +If the exact keyword is present, the result value of the + ashr is a trap value if any of the bits + shifted out are non-zero.
+Example:
<result> = ashr i32 4, 1 ; yields {i32}:result = 2 -- cgit v1.2.3