diff --git a/docs/LangRef.html b/docs/LangRef.html index b963208f8c2..a4b9b3580d1 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -29,7 +29,7 @@
  • Type System
      -
    1. Primitive Types +
    2. Primitive Types
      1. Type Classifications
      @@ -96,9 +96,9 @@
    3. 'malloc' Instruction
    4. 'free' Instruction
    5. 'alloca' Instruction
    6. -
    7. 'load' Instruction
    8. -
    9. 'store' Instruction
    10. -
    11. 'getelementptr' Instruction
    12. +
    13. 'load' Instruction
    14. +
    15. 'store' Instruction
    16. +
    17. 'getelementptr' Instruction
  • Other Operations @@ -106,6 +106,8 @@
  • 'phi' Instruction
  • 'cast .. to' Instruction
  • 'select' Instruction
  • +
  • 'vset' Instruction
  • +
  • 'vselect' Instruction
  • 'extractelement' Instruction
  • 'insertelement' Instruction
  • 'call' Instruction
  • @@ -1619,6 +1621,7 @@ Math Forum.

    Example:
      <result> = rem int 4, %var          ; yields {int}:result = 4 % %var
     
    +
    'setcc' @@ -1664,6 +1667,7 @@ operand.

    <result> = setge sbyte 4, 5 ; yields {bool}:result = false
    +
    Bitwise Binary Operations
    @@ -2333,6 +2337,156 @@ value argument; otherwise, it returns the second value argument. + +
    'vset' +Instruction
    +
    +
    Syntax:
    +
    <result> = vset <op>, <n x <ty>> <var1>, <var2>   ; yields <n x bool>
    +
    + +
    Overview:
    + +

    The 'vset' instruction returns a vector of boolean +values representing, at each position, the result of the comparison +between the values at that position in the two operands.

    + +
    Arguments:
    + +

    The arguments to a 'vset' instruction are a comparison +operation and two value arguments. The value arguments must be of packed type, and they must have identical types. +For value arguments of integral element type, the operation argument +must be one of eq, ne, lt, gt, +le, ge, ult, ugt, ule, +uge, true, and false. For value arguments +of floating point element type, the operation argument must be one of +eq, ne, lt, gt, le, +ge, oeq, one, olt, ogt, +ole, oge, ueq, une, ult, +ugt, ule, uge, o, u, +true, and false. The result is a packed +bool value with the same length as each operand.

    + +
    Semantics:
    + +

    The following table shows the semantics of 'vset' for +integral value arguments. For each position of the result, the +comparison is done on the corresponding positions of the two value +arguments. Note that the signedness of the comparison depends on the +comparison opcode and not on the signedness of the value +operands. E.g., vset lt <4 x unsigned> %x, %y does an +elementwise signed comparison of %x and +%y.

    + + + + + + + + + + + + + + + + + +
    OperationResult is true iffComparison is
    eqvar1 == var2--
    nevar1 != var2--
    ltvar1 < var2signed
    gtvar1 > var2signed
    levar1 <= var2signed
    gevar1 >= var2signed
    ultvar1 < var2unsigned
    ugtvar1 > var2unsigned
    ulevar1 <= var2unsigned
    ugevar1 >= var2unsigned
    truealways--
    falsenever--
    + +

    The following table shows the semantics of 'vset' for +floating point types. If either operand is a floating point Not a +Number (NaN) value, the operation is unordered, and the value in the +first column below is produced at that position. Otherwise, the +operation is ordered, and the value in the second column is +produced.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OperationIf unorderedOtherwise true iff
    equndefinedvar1 == var2
    neundefinedvar1 != var2
    ltundefinedvar1 < var2
    gtundefinedvar1 > var2
    leundefinedvar1 <= var2
    geundefinedvar1 >= var2
    oeqfalsevar1 == var2
    onefalsevar1 != var2
    oltfalsevar1 < var2
    ogtfalsevar1 > var2
    olefalsevar1 <= var2
    ogefalsevar1 >= var2
    ueqtruevar1 == var2
    unetruevar1 != var2
    ulttruevar1 < var2
    ugttruevar1 > var2
    uletruevar1 <= var2
    ugetruevar1 >= var2
    ofalsealways
    utruenever
    truetruealways
    falsefalsenever
    + +
    Example:
    +
      <result> = vset eq <2 x int> <int 0, int 1>, <int 1, int 0>      ; yields {<2 x bool>}:result = false, false
    +  <result> = vset ne <2 x int> <int 0, int 1>, <int 1, int 0>      ; yields {<2 x bool>}:result = true, true
    +  <result> = vset lt <2 x int> <int 0, int 1>, <int 1, int 0>      ; yields {<2 x bool>}:result = true, false
    +  <result> = vset gt <2 x int> <int 0, int 1>, <int 1, int 0>      ; yields {<2 x bool>}:result = false, true
    +  <result> = vset le <2 x int> <int 0, int 1>, <int 1, int 0>      ; yields {<2 x bool>}:result = true, false
    +  <result> = vset ge <2 x int> <int 0, int 1>, <int 1, int 0>      ; yields {<2 x bool>}:result = false, true
    +
    +
    + + +
    + 'vselect' Instruction +
    + +
    + +
    Syntax:
    + +
    +  <result> = vselect <n x bool> <cond>, <n x <ty>> <val1>, <n x <ty>> <val2> ; yields <n x <ty>>
    +
    + +
    Overview:
    + +

    +The 'vselect' instruction chooses one value at each position +of a vector based on a condition. +

    + + +
    Arguments:
    + +

    +The 'vselect' instruction requires a packed bool value indicating the +condition at each vector position, and two values of the same packed +type. All three operands must have the same length. The type of the +result is the same as the type of the two value operands.

    + +
    Semantics:
    + +

    +At each position where the bool vector is true, that position +of the result gets its value from the first value argument; otherwise, +it gets its value from the second value argument. +

    + +
    Example:
    + +
    +  %X = vselect bool <2 x bool> <bool true, bool false>, <2 x ubyte> <ubyte 17, ubyte 17>, 
    +    <2 x ubyte> <ubyte 42, ubyte 42>      ; yields <2 x ubyte>:17, 42
    +
    +