Class VectorOperators


  • public abstract class VectorOperators
    extends Object
    This class consists solely of static constants that describe lane-wise vector operations, plus nested interfaces which classify them. The static constants serve as tokens denoting specifically requested lane operations in vector expressions, such as the token ADD in w = v0.lanewise(ADD, v1).

    The documentation for each individual operator token is very brief, giving a symbolic Java expression for the operation that the token requests. Those symbolic expression use the following conventional elements:

    • a, b, c — names of lane values
    • Java operators like +, ?:, etc. — expression operators
    • Java method names like max, sin, etc. — methods in standard classes like Math, Double, etc. Unqualified method names should be read as if in the context of a static import, and with resolution of overloading.
    • bits(x) — a function call which produces the underlying bits of the value x. If x is a floating point value, this is either doubleToLongBits(x) or floatToIntBits(x). Otherwise, the value is just x.
    • ESIZE — the size in bytes of the operand type
    • intVal, byteVal, etc. — the operand of a conversion, with the indicated type

    Note that a particular operator token may apply to several different lane types. Thus, these tokens behave like overloaded operators or methods, not like type-specific method handles or lambdas. Also unlike method handles or lambdas, these operators do not possess operational semantics; they have no apply or invoke method. They are used only to request lane operations from vector objects, and cannot (by themselves) perform operations on individual lane values.