Integrated: 8282432: Optimize masked "test" Vector API with predicate feature

Xiaohong Gong xgong at openjdk.java.net
Wed Mar 9 01:06:04 UTC 2022


On Wed, 2 Mar 2022 02:50:27 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

> The vector `"test"` api is implemented with vector `"compare"`. And the masked `"test" `is implemented with `"test(op).and(m)"` which means `"compare().and(m)"` finally. Since the masked vector `"compare"` has been optimized with predicated instruction for archituctures that support the feature, the masked `"test"` can also be optimized by implementing it with the predicated compare. This could save the additional ` "and"` for architectures that support the predicate feature.
> 
> This patch optimized the masked `"test"` by implementing it with masked `"compare"`. With this patch, the following codes for the` "IS_NEGATIVE"` op for a DoubleVector with SVE:
> 
>   mov z19.d, #0
>   cmpgt   p1.d, p7/z, z19.d, z17.d
>   and p0.b, p7/z, p1.b, p0.b
> 
> are optimized to:
> 
>   mov z19.d, #0
>   cmpgt   p0.d, p0/z, z19.d, z17.d
> 
> Also update the jtreg tests for masked` "test" ` to make sure they are hot enough to be compiled by c2.

This pull request has now been integrated.

Changeset: 12693a6c
Author:    Xiaohong Gong <xgong at openjdk.org>
Committer: Ningsheng Jian <njian at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/12693a6cf3e00c38a635d888419406f689657813
Stats:     1325 lines in 70 files changed: 574 ins; 11 del; 740 mod

8282432: Optimize masked "test" Vector API with predicate feature

Reviewed-by: psandoz

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

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


More information about the core-libs-dev mailing list