diff --git a/docs/LangRef.html b/docs/LangRef.html index 2be38d42a89..bf638843571 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -96,6 +96,9 @@
<result> = vsetint <op>, <n x <ty>> <var1>, <var2> ; yields <n x bool> ++ +
The 'vsetint' instruction takes two integer vectors and +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 'vsetint' instruction are a comparison +operation and two value arguments. The value arguments must be of integral packed type, +and they must have identical types. The operation argument must be +one of eq, ne, slt, sgt, +sle, sge, ult, ugt, ule, +uge, true, and false. The result is a +packed bool value with the same length as each operand.
+ +The following table shows the semantics of 'vsetint'. 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., vsetint +slt <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 | -- |
slt | var1 < var2 | signed |
sgt | var1 > var2 | signed |
sle | var1 <= var2 | signed |
sge | var1 >= var2 | signed |
ult | var1 < var2 | unsigned |
ugt | var1 > var2 | unsigned |
ule | var1 <= var2 | unsigned |
uge | var1 >= var2 | unsigned |
true | always | -- |
false | never | -- |
<result> = vsetint eq <2 x int> <int 0, int 1>, <int 1, int 0> ; yields {<2 x bool>}:result = false, false + <result> = vsetint ne <2 x int> <int 0, int 1>, <int 1, int 0> ; yields {<2 x bool>}:result = true, true + <result> = vsetint slt <2 x int> <int 0, int 1>, <int 1, int 0> ; yields {<2 x bool>}:result = true, false + <result> = vsetint sgt <2 x int> <int 0, int 1>, <int 1, int 0> ; yields {<2 x bool>}:result = false, true + <result> = vsetint sle <2 x int> <int 0, int 1>, <int 1, int 0> ; yields {<2 x bool>}:result = true, false + <result> = vsetint sge <2 x int> <int 0, int 1>, <int 1, int 0> ; yields {<2 x bool>}:result = false, true ++
<result> = vsetfp <op>, <n x <ty>> <var1>, <var2> ; yields <n x bool> ++ +
The 'vsetfp' instruction takes two floating point vector +arguments and 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 'vsetfp' instruction are a comparison +operation and two value arguments. The value arguments must be of floating point packed +type, and they must have identical types. 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 'vsetfp' 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> = vsetfp eq <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> ; yields {<2 x bool>}:result = false, false + <result> = vsetfp ne <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> ; yields {<2 x bool>}:result = true, true + <result> = vsetfp lt <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> ; yields {<2 x bool>}:result = true, false + <result> = vsetfp gt <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> ; yields {<2 x bool>}:result = false, true + <result> = vsetfp le <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> ; yields {<2 x bool>}:result = true, false + <result> = vsetfp ge <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.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 ++