diff --git a/docs/LangRef.html b/docs/LangRef.html index 308dd207e5d..10fb2e6a6c7 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -2168,18 +2168,28 @@ Instruction
<result> = shl <ty> <var1>, <var2> ; yields {ty}:result+
The 'shl' instruction returns the first operand shifted to the left a specified number of bits.
+Both arguments to the 'shl' instruction must be the same integer type.
+The value produced is var1 * 2var2.
+ +The value produced is var1 * 2var2. If +var2 is (statically or dynamically) equal to or larger than the number +of bits in var1, the result is undefined.
+<result> = shl i32 4, %var ; yields {i32}: 4 << %var <result> = shl i32 4, 2 ; yields {i32}: 16 <result> = shl i32 1, 10 ; yields {i32}: 1024 + <result> = shl i32 1, 32 ; undefined@@ -2199,9 +2209,11 @@ operand shifted to the right a specified number of bits with zero fill. integer type.
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.
+shift. If var2 is (statically or dynamically) equal to or larger than +the number of bits in var1, the result is undefined.@@ -2209,6 +2221,7 @@ shift. <result> = lshr i32 4, 2 ; yields {i32}:result = 1 <result> = lshr i8 4, 3 ; yields {i8}:result = 0 <result> = lshr i8 -2, 1 ; yields {i8}:result = 0x7FFFFFFF + <result> = lshr i32 1, 32 ; undefined@@ -2232,7 +2245,9 @@ operand shifted to the right a specified number of bits with sign extension.
This instruction always performs an arithmetic shift right operation, The most significant bits of the result will be filled with the sign bit -of var1.
+of var1. If var2 is (statically or dynamically) equal to or +larger than the number of bits in var1, the result is undefined. +@@ -2240,6 +2255,7 @@ of var1. <result> = ashr i32 4, 2 ; yields {i32}:result = 1 <result> = ashr i8 4, 3 ; yields {i8}:result = 0 <result> = ashr i8 -2, 1 ; yields {i8}:result = -1 + <result> = ashr i32 1, 32 ; undefined