From a58561b91779e9131786003111c59cdc2eae17b0 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 12 Aug 2004 19:12:28 +0000 Subject: [PATCH] Add description of packed type support. Patch contributed by Brad Jones! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15704 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 60 ++++++++++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/docs/LangRef.html b/docs/LangRef.html index 47fc33ebbb7..6e794ec426b 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -26,7 +26,7 @@
  • Function Type
  • Pointer Type
  • Structure Type
  • - +
  • Packed Type
  • @@ -398,7 +398,7 @@ classifications:

    first class bool, ubyte, sbyte, ushort, short,
    -uint, int, ulong, long, float, double, pointer
    +uint, int, ulong, long, float, double, pointer, packed @@ -555,22 +555,29 @@ an int. - - - +
    Packed Type
    - -Mention/decide that packed types work with saturation or not. Maybe have a packed+saturated type in addition to just a packed type.

    - -Packed types should be 'nonsaturated' because standard data types are not saturated. Maybe have a saturated packed type?

    - +

    Overview:
    +

    A packed type is a simple derived type that represents a vector +of elements. Packed types are used when multiple primitive data +are operated in parallel using a single instruction (SIMD). +A packed type requires a size (number of +elements) and an underlying primitive data type. Packed types are +considered first class.

    +
    Syntax:
    +
      < <# elements> x <elementtype> >
    +

    The number of elements is a constant integer value, elementtype may +be any integral or floating point type.

    +
    Examples:
    +

    <4 x int>: Packed vector of 4 integer values.
    +<8 x float>: Packed vector of 8 floating-point values.
    +<2 x uint>: Packed vector of 2 unsigned integer values.

    +

    ---> +
    High Level Structure
    Module Structure
    @@ -930,7 +937,9 @@ undefined behavior results.

    Binary operators are used to do most of the computation in a program. They require two operands, execute an operation on them, and -produce a single value. The result value of a binary operator is not +produce a single value. Although, that single value might represent +multiple data, as is the case with the packed data type. +The result value of a binary operator is not necessarily the same type as its operands.

    There are several different binary operators:

    @@ -945,8 +954,9 @@ Instruction

    The 'add' instruction returns the sum of its two operands.

    Arguments:

    The two arguments to the 'add' instruction must be either integer or floating point -values. Both arguments must have identical types.

    + href="#t_integer">integer or floating point values. + This instruction can also take packed versions of the values. +Both arguments must have identical types.

    Semantics:

    The value produced is the integer or floating point sum of the two operands.

    @@ -969,7 +979,9 @@ instruction present in most other intermediate representations.

    Arguments:

    The two arguments to the 'sub' instruction must be either integer or floating point -values. Both arguments must have identical types.

    +values. +This instruction can also take packed versions of the values. +Both arguments must have identical types.

    Semantics:

    The value produced is the integer or floating point difference of the two operands.

    @@ -991,7 +1003,9 @@ operands.

    Arguments:

    The two arguments to the 'mul' instruction must be either integer or floating point -values. Both arguments must have identical types.

    +values. +This instruction can also take packed versions of the values. +Both arguments must have identical types.

    Semantics:

    The value produced is the integer or floating point product of the two operands.

    @@ -1014,7 +1028,9 @@ operands.

    Arguments:

    The two arguments to the 'div' instruction must be either integer or floating point -values. Both arguments must have identical types.

    +values. +This instruction can also take packed versions of the values. +Both arguments must have identical types.

    Semantics:

    The value produced is the integer or floating point quotient of the two operands.

    @@ -1035,7 +1051,9 @@ division of its two operands.

    Arguments:

    The two arguments to the 'rem' instruction must be either integer or floating point -values. Both arguments must have identical types.

    +values. +This instruction can also take packed versions of the values. +Both arguments must have identical types.

    Semantics:

    This returns the remainder of a division (where the result has the same sign as the divisor), not the modulus (where the -- 2.34.1