diff --git a/llvm/docs/LangRef.html b/llvm/docs/LangRef.html index b963208f8c2d..a4b9b3580d1f 100644 --- a/llvm/docs/LangRef.html +++ b/llvm/docs/LangRef.html @@ -29,7 +29,7 @@
<result> = rem int 4, %var ; yields {int}:result = 4 % %var
+
+
@@ -2333,6 +2337,156 @@ value argument; otherwise, it returns the second value argument.
+
+
+<result> = vset <op>, <n x <ty>> <var1>, <var2> ; yields <n x bool> ++ +
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.
+ +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.
+ +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.
+ +| Operation | Result is true iff | Comparison is |
|---|---|---|
| eq | var1 == var2 | -- |
| ne | var1 != var2 | -- |
| lt | var1 < var2 | signed |
| gt | var1 > var2 | signed |
| le | var1 <= var2 | signed |
| ge | var1 >= var2 | signed |
| ult | var1 < var2 | unsigned |
| ugt | var1 > var2 | unsigned |
| ule | var1 <= var2 | unsigned |
| uge | var1 >= var2 | unsigned |
| true | always | -- |
| false | never | -- |
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.
+ +| Operation | If unordered | Otherwise true iff |
|---|---|---|
| eq | undefined | var1 == var2 |
| ne | undefined | var1 != var2 |
| lt | undefined | var1 < var2 |
| gt | undefined | var1 > var2 |
| le | undefined | var1 <= var2 |
| ge | undefined | var1 >= var2 |
| oeq | false | var1 == var2 |
| one | false | var1 != var2 |
| olt | false | var1 < var2 |
| ogt | false | var1 > var2 |
| ole | false | var1 <= var2 |
| oge | false | var1 >= var2 |
| ueq | true | var1 == var2 |
| une | true | var1 != var2 |
| ult | true | var1 < var2 |
| ugt | true | var1 > var2 |
| ule | true | var1 <= var2 |
| uge | true | var1 >= var2 |
| o | false | always |
| u | true | never |
| true | true | always |
| false | false | never |
<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
+
++ <result> = vselect <n x bool> <cond>, <n x <ty>> <val1>, <n x <ty>> <val2> ; yields <n x <ty>> ++ +
+The 'vselect' instruction chooses one value at each position +of a vector based on a condition. +
+ + ++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.
+ ++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. +
+ ++ %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 ++