From 6ccc2d579e7e9f2bce353391aa487f218b3dc5c1 Mon Sep 17 00:00:00 2001
From: Chris Lattner 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.Syntax:
<result> = shl <ty> <var1>, <var2> ; yields {ty}:result
+
Overview:
+
Arguments:
+
Semantics:
-Example:
<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.
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