RFR: 8257806: Optimize x86 allTrue and anyTrue vector mask operations of Vector API [v3]

Sandhya Viswanathan sviswanathan at openjdk.java.net
Thu Dec 10 01:21:53 UTC 2020


> 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.

Sandhya Viswanathan has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - Merge branch 'master' of https://git.openjdk.java.net/jdk into vptest
 - Merge branch 'master' of https://git.openjdk.java.net/jdk into vptest
 - 8257806: Optimize x86 allTrue and anyTrue vector mask operations of Vector API

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/1656/files
  - new: https://git.openjdk.java.net/jdk/pull/1656/files/1c585f5c..c2e7e052

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1656&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1656&range=01-02

  Stats: 7790 lines in 332 files changed: 5088 ins; 1545 del; 1157 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1656.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1656/head:pull/1656

PR: https://git.openjdk.java.net/jdk/pull/1656


More information about the hotspot-compiler-dev mailing list