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

Optimize x86 allTrue and anyTrue vector mask operations of Vector API

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b28
    • CPU:
      x86

      Description

      The allTrue and anyTrue operations are implemented using ptest/vptest instruction. Two optimizations are possible:

      1) The ptest instruction minimum size is 128 bit.
      Smaller < 128 bit size operations can be implemented by first broadcasting (duplicating) the input to 128 bits.
      The two inputs to these operations are:
        a) Vector mask being tested
        b) All ones
      For allTrue operation, both the inputs need to be broadcasted.
      For anyTrue operation, only the first input (vector mask) need to be broadcasted.

      2) The anyTrue operation followed by comparison with zero can use the zero flag generated by ptest/vptest directly.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sviswanathan Sandhya Viswanathan
              Reporter:
              sviswanathan Sandhya Viswanathan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: