From 016a0e50a58311a900842a8e772d03073a1f0f63 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 8 Apr 2006 00:13:41 +0000 Subject: [PATCH] Description for the new shufflevector instruction I'm adding. llvm-svn: 27502 --- llvm/docs/LangRef.html | 59 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/llvm/docs/LangRef.html b/llvm/docs/LangRef.html index ab0d66d96ed8..d0304f98d51e 100644 --- a/llvm/docs/LangRef.html +++ b/llvm/docs/LangRef.html @@ -111,6 +111,7 @@
  • 'vselect' Instruction
  • 'extractelement' Instruction
  • 'insertelement' Instruction
  • +
  • 'shufflevector' Instruction
  • 'call' Instruction
  • 'va_arg' Instruction
  • @@ -1135,6 +1136,12 @@ following is the syntax for constant expressions:

    Perform the insertelement operation on constants. + +
    shufflevector ( VEC1, VEC2, IDXMASK )
    + +
    Perform the shufflevector + operation on constants. +
    OPCODE ( LHS, RHS )
    Perform the specified operation of the LHS and RHS constants. OPCODE may @@ -2608,6 +2615,58 @@ exceeds the length of val, the results are undefined. + + + +
    + +
    Syntax:
    + +
    +  <result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <n x uint> <mask>    ; yields <n x <ty>>
    +
    + +
    Overview:
    + +

    +The 'shufflevector' instruction constructs a permutation of elements +from two input vectors, returning a vector of the same type. +

    + +
    Arguments:
    + +

    +The first two operands of a 'shufflevector' instruction are vectors +with types that match each other and types that match the result of the +instruction. The third argument is a shuffle mask, which has the same number +of elements as the other vector type, but whose element type is always 'uint'. +

    + +

    +The shuffle mask operand is required to be a constant vector with either +constant integer or undef values. +

    + +
    Semantics:
    + +

    +The elements of the two input vectors are numbered from left to right across +both of the vectors. The shuffle mask operand specifies, for each element of +the result vector, which element of the two input registers the result element +gets. The element selector may be undef (meaning "don't care") and the second +operand may be undef if performing a shuffle from only one vector. +

    + +
    Example:
    + +
    +  %result = shufflevector <4 x int> %v1, <4 x int> %v2, <4 x uint>     ; yields <4 x int>
    +  %result = shufflevector <4 x int> %v1, <4 x int> undef, <4 x uint>   ; yields <4 x int> - Identity shuffle.
    +
    +
    +