[vector]Intrinsic for VectorIntrinsics.test 512

Wang Zhuo(Zhuoren) zhuoren.wz at alibaba-inc.com
Thu Oct 24 10:33:54 UTC 2019


Hi,
VectorIntrinsics.test with width 512 is not intrinsic on x86. allTrue/anyTrue are affected.
I made a patch to fix this. http://cr.openjdk.java.net/~wzhuo/alltrue/webrev.00/ . Mainly on using x86 instructions to fulfil functions of test.

For allTrue, an instruct vptest16inae is added in x86.ad. Its implementation is quite similiar to 512 width compare part of MacroAssembler::string_compare.
While for anyTrue, since the parameter is set to "this", I did not find a way to also fulfil it with evpcmp. So in my implementation, one 512 vector is to two 256 vector and vptest is used.
public boolean anyTrue() {
            return VectorIntrinsics.test(BT_ne, Long512Mask.class, long.class, VLENGTH,
                                         this, this,
                                         (m, __) -> anyTrueHelper(((Long512Mask)m).getBits()));        }

Any comment for this?

Regards,
Zhuoren



More information about the panama-dev mailing list