[jdk18] Integrated: 8278889: AArch64: [vectorapi] VectorMaskLoadStoreTest.testMaskCast() test fail
Eric Liu
eliu at openjdk.java.net
Fri Dec 24 03:14:18 UTC 2021
On Mon, 20 Dec 2021 15:35:47 GMT, Eric Liu <eliu at openjdk.org> wrote:
> This bug appears intermittently and it's caused by vmaskAll_immI[1]
> when the vector mask size is smaller than max predicate size of running
> machine. It generates an all-true predicate without considering those
> inactive bits. That may result in the wrong result of VectorMask.toLong.
> The problematic code is as below:
>
>
> ShortVector.SPECIES_64.MaskAll(true).toLong()
>
> assembly:
>
> ptrue p0.h <= MaskAll(true)
> mov z16.h, p0/z, #1
> mov z17.h, #0
> uzp1 z16.b, z16.b, z17.b
> fmov x10, d16
> orr x10, x10, x10, lsr #7
> orr x10, x10, x10, lsr #14
> orr x10, x10, x10, lsr #28
> and x10, x10, #0xff
>
> (gdb) p/x $p0 # on an SVE machine with vector length as 64 in bytes
> $1 = {0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55}
>
> Expected:
> (gdb) p/x $p0
> $1 = {0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
>
>
>
> Considering MaskAll is used in VectorMask.fromLong() only for a special
> case and relies on the mechanism of inline and intrinsification, even it
> could be optimized out, this patch also adds test cases for MaskAll to
> reproduce this issue stably.
>
> Also fix a small issue on register utilization for
> sve_reduce_[max|min][D|F].
>
> [1] https://github.com/openjdk/jdk18/blob/master/src/hotspot/cpu/aarch64/aarch64_sve.ad#L416
>
> hotspot/compiler/vectorapi, jdk/incubator/vector passed on SVE enabled
> system.
>
> Change-Id: I9631f26f9232ffe7a28b74f14062d945c32fa1fb
This pull request has now been integrated.
Changeset: 6588bedc
Author: Eric Liu <eliu at openjdk.org>
Committer: Vladimir Kozlov <kvn at openjdk.org>
URL: https://git.openjdk.java.net/jdk18/commit/6588bedc19ab42cec9e5bb6f13be14fb4dc5a655
Stats: 409 lines in 37 files changed: 318 ins; 0 del; 91 mod
8278889: AArch64: [vectorapi] VectorMaskLoadStoreTest.testMaskCast() test fail
Reviewed-by: njian, kvn
-------------
PR: https://git.openjdk.java.net/jdk18/pull/49
More information about the hotspot-compiler-dev
mailing list