From 569f2fa7f131be0a1c1f12a59e621506ce7744c1 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Wed, 31 Jan 2007 21:39:12 +0000 Subject: [PATCH] Preview of the shift instructions becoming Binary Operators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33720 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 171 +++++++++++++++++++++++----------------------- 1 file changed, 85 insertions(+), 86 deletions(-) diff --git a/docs/LangRef.html b/docs/LangRef.html index 87e03da7c81..677e6256619 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -85,6 +85,9 @@
  • 'urem' Instruction
  • 'srem' Instruction
  • 'frem' Instruction
  • +
  • 'shl' Instruction
  • +
  • 'lshr' Instruction
  • +
  • 'ashr' Instruction
  • Bitwise Binary Operations @@ -92,9 +95,6 @@
  • 'and' Instruction
  • 'or' Instruction
  • 'xor' Instruction
  • -
  • 'shl' Instruction
  • -
  • 'lshr' Instruction
  • -
  • 'ashr' Instruction
  • Vector Operations @@ -1952,6 +1952,88 @@ identical types.

    + + +
    +
    Syntax:
    +
      <result> = shl <ty> <var1>, <var2>   ; yields {ty}:result
    +
    +
    Overview:
    +

    The 'shl' instruction returns the first operand shifted to +the left a specified number of bits.

    +
    Arguments:
    +

    Both arguments to the 'shl' instruction must be the same integer type.

    +
    Semantics:
    +

    The value produced is var1 * 2var2.

    +
    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
    +
    +
    + + +
    +
    Syntax:
    +
      <result> = lshr <ty> <var1>, <var2>   ; yields {ty}:result
    +
    + +
    Overview:
    +

    The 'lshr' instruction (logical shift right) returns the first +operand shifted to the right a specified number of bits.

    + +
    Arguments:
    +

    Both arguments to the 'lshr' instruction must be the same +integer type.

    + +
    Semantics:
    +

    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.

    + +
    Example:
    +
    +  <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 
    +
    +
    + + + +
    + +
    Syntax:
    +
      <result> = ashr <ty> <var1>, <var2>   ; yields {ty}:result
    +
    + +
    Overview:
    +

    The 'ashr' instruction (arithmetic shift right) returns the first +operand shifted to the right a specified number of bits.

    + +
    Arguments:
    +

    Both arguments to the 'ashr' instruction must be the same +integer type.

    + +
    Semantics:
    +

    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.

    + +
    Example:
    +
    +  <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
    +
    +
    + @@ -2127,89 +2209,6 @@ identical types.

    <result> = xor i32 %V, -1 ; yields {i32}:result = ~%V - - -
    -
    Syntax:
    -
      <result> = shl <ty> <var1>, i8 <var2>   ; yields {ty}:result
    -
    -
    Overview:
    -

    The 'shl' instruction returns the first operand shifted to -the left a specified number of bits.

    -
    Arguments:
    -

    The first argument to the 'shl' instruction must be an integer type. The second argument must be an 'i8' -type.

    -
    Semantics:
    -

    The value produced is var1 * 2var2.

    -
    Example:
    -
      <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
    -
    -
    - - -
    -
    Syntax:
    -
      <result> = lshr <ty> <var1>, i8 <var2>   ; yields {ty}:result
    -
    - -
    Overview:
    -

    The 'lshr' instruction (logical shift right) returns the first -operand shifted to the right a specified number of bits.

    - -
    Arguments:
    -

    The first argument to the 'lshr' instruction must be an integer type. The second argument must be an 'i8' type.

    - -
    Semantics:
    -

    This instruction always performs a logical shift right operation. The -var2 most significant bits will be filled with zero bits after the -shift.

    - -
    Example:
    -
    -  <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 
    -
    -
    - - - -
    - -
    Syntax:
    -
      <result> = ashr <ty> <var1>, i8 <var2>   ; yields {ty}:result
    -
    - -
    Overview:
    -

    The 'ashr' instruction (arithmetic shift right) returns the first -operand shifted to the right a specified number of bits.

    - -
    Arguments:
    -

    The first argument to the 'ashr' instruction must be an -integer type. The second argument must be an -'i8' type.

    - -
    Semantics:
    -

    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.

    - -
    Example:
    -
    -  <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
    -
    -