From 569f2fa7f131be0a1c1f12a59e621506ce7744c1 Mon Sep 17 00:00:00 2001
From: Reid Spencer
<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.
++ <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> = lshr <ty> <var1>, <var2> ; yields {ty}:result ++ +
The 'lshr' instruction (logical shift right) returns the first +operand shifted to the right a specified number of bits.
+ +Both arguments to the 'lshr' instruction must be the same +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.
+ ++ <result> = lshr i32 4, 1 ; yields {i32}:result = 2 + <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> = ashr <ty> <var1>, <var2> ; yields {ty}:result ++ +
The 'ashr' instruction (arithmetic shift right) returns the first +operand shifted to the right a specified number of bits.
+ +Both arguments to the 'ashr' instruction must be the same +integer type.
+ +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.
+ ++ <result> = ashr i32 4, 1 ; yields {i32}:result = 2 + <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> = shl <ty> <var1>, i8 <var2> ; yields {ty}:result --
The 'shl' instruction returns the first operand shifted to -the left a specified number of bits.
-The first argument to the 'shl' instruction must be an integer type. The second argument must be an 'i8' -type.
-The value produced is var1 * 2var2.
-<result> = shl i32 4, i8 %var ; yields {i32}:result = 4 << %var - <result> = shl i32 4, i8 2 ; yields {i32}:result = 16 - <result> = shl i32 1, i8 10 ; yields {i32}:result = 1024 --
<result> = lshr <ty> <var1>, i8 <var2> ; yields {ty}:result -- -
The 'lshr' instruction (logical shift right) returns the first -operand shifted to the right a specified number of bits.
- -The first argument to the 'lshr' instruction must be an integer type. The second argument must be an 'i8' type.
- -This instruction always performs a logical shift right operation. The -var2 most significant bits will be filled with zero bits after the -shift.
- -- <result> = lshr i32 4, i8 1 ; yields {i32}:result = 2 - <result> = lshr i32 4, i8 2 ; yields {i32}:result = 1 - <result> = lshr i8 4, i8 3 ; yields {i8 }:result = 0 - <result> = lshr i8 -2, i8 1 ; yields {i8 }:result = 0x7FFFFFFF --
<result> = ashr <ty> <var1>, i8 <var2> ; yields {ty}:result -- -
The 'ashr' instruction (arithmetic shift right) returns the first -operand shifted to the right a specified number of bits.
- -The first argument to the 'ashr' instruction must be an -integer type. The second argument must be an -'i8' type.
- -This instruction always performs an arithmetic shift right operation, -regardless of whether the arguments are signed or not. The var2 most -significant bits will be filled with the sign bit of var1.
- -- <result> = ashr i32 4, i8 1 ; yields {i32}:result = 2 - <result> = ashr i32 4, i8 2 ; yields {i32}:result = 1 - <result> = ashr i8 4, i8 3 ; yields {i8}:result = 0 - <result> = ashr i8 -2, i8 1 ; yields {i8 }:result = -1 --