From a58561b91779e9131786003111c59cdc2eae17b0 Mon Sep 17 00:00:00 2001
From: Chris Lattner
- -Packed types should be 'nonsaturated' because standard data types are not saturated. Maybe have a saturated packed type?
- +
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.
+< <# elements> x <elementtype> >+
The number of elements is a constant integer value, elementtype may +be any integral or floating point type.
+ <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.
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:
The 'add' instruction returns the sum of its two operands.
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.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.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.The value produced is the integer or floating point difference of the two operands.
@@ -991,7 +1003,9 @@ operands.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.The value produced is the integer or floating point product of the two operands.
@@ -1014,7 +1028,9 @@ operands.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.The value produced is the integer or floating point quotient of the two operands.
@@ -1035,7 +1051,9 @@ division of its two operands.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.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