Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8305494

[vectorapi] Add VectorMask::xor

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 21
    • core-libs
    • minimal
    • Adding a new method to an effectively sealed class of an incubator module.
    • Java API
    • JDK

      Summary

      Add method VectorMask::xor(VectorMask) to the abstract class jdk.incubator.vector.VectorMask.

      Problem

      Currently, VectorMask has methods to perform logical binary and, or, andNot and xorNot (eq) but not xor (exclusive or). This is a basic logical operation that often appears naturally in logical contexts. Furthermore, we do have this method implemented in the concrete implementation of VectorMask to implement VectorMask::not and VectorMask::eq.

      Solution

      Expose VectorMask::xor in the public API of the Vector API.

      Specification

      /**
       * Determines logical symmetric difference
       * (as {@code a^b}) of this mask and a second input mask.
       * <p>
       * This is a lane-wise binary operation which applies
       * the logical {@code XOR} operation
       * ({@code ^}) to each corresponding pair of mask bits.
       *
       * @param m the input mask
       * @return the result of logically disjunctively disjoining the two
       * input masks
       */
      public abstract VectorMask<E> xor(VectorMask<E> m);

            qamai Quan Anh Mai
            qamai Quan Anh Mai
            Paul Sandoz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: