@@ -3912,6 +3912,184 @@ static void MAXReduceByte128VectorTestsMasked(IntFunction<byte[]> fa, IntFunctio
3912
3912
Byte128VectorTests ::MAXReduceMasked , Byte128VectorTests ::MAXReduceAllMasked );
3913
3913
}
3914
3914
3915
+ static byte UMINReduce (byte [] a , int idx ) {
3916
+ byte res = Byte .MAX_VALUE ;
3917
+ for (int i = idx ; i < (idx + SPECIES .length ()); i ++) {
3918
+ res = (byte ) VectorMath .minUnsigned (res , a [i ]);
3919
+ }
3920
+
3921
+ return res ;
3922
+ }
3923
+
3924
+ static byte UMINReduceAll (byte [] a ) {
3925
+ byte res = Byte .MAX_VALUE ;
3926
+ for (int i = 0 ; i < a .length ; i += SPECIES .length ()) {
3927
+ res = (byte ) VectorMath .minUnsigned (res , UMINReduce (a , i ));
3928
+ }
3929
+
3930
+ return res ;
3931
+ }
3932
+
3933
+ @ Test (dataProvider = "byteUnaryOpProvider" )
3934
+ static void UMINReduceByte128VectorTests (IntFunction <byte []> fa ) {
3935
+ byte [] a = fa .apply (SPECIES .length ());
3936
+ byte [] r = fr .apply (SPECIES .length ());
3937
+ byte ra = Byte .MAX_VALUE ;
3938
+
3939
+ for (int ic = 0 ; ic < INVOC_COUNT ; ic ++) {
3940
+ for (int i = 0 ; i < a .length ; i += SPECIES .length ()) {
3941
+ ByteVector av = ByteVector .fromArray (SPECIES , a , i );
3942
+ r [i ] = av .reduceLanes (VectorOperators .UMIN );
3943
+ }
3944
+ }
3945
+
3946
+ for (int ic = 0 ; ic < INVOC_COUNT ; ic ++) {
3947
+ ra = Byte .MAX_VALUE ;
3948
+ for (int i = 0 ; i < a .length ; i += SPECIES .length ()) {
3949
+ ByteVector av = ByteVector .fromArray (SPECIES , a , i );
3950
+ ra = (byte ) VectorMath .minUnsigned (ra , av .reduceLanes (VectorOperators .UMIN ));
3951
+ }
3952
+ }
3953
+
3954
+ assertReductionArraysEquals (r , ra , a ,
3955
+ Byte128VectorTests ::UMINReduce , Byte128VectorTests ::UMINReduceAll );
3956
+ }
3957
+
3958
+ static byte UMINReduceMasked (byte [] a , int idx , boolean [] mask ) {
3959
+ byte res = Byte .MAX_VALUE ;
3960
+ for (int i = idx ; i < (idx + SPECIES .length ()); i ++) {
3961
+ if (mask [i % SPECIES .length ()])
3962
+ res = (byte ) VectorMath .minUnsigned (res , a [i ]);
3963
+ }
3964
+
3965
+ return res ;
3966
+ }
3967
+
3968
+ static byte UMINReduceAllMasked (byte [] a , boolean [] mask ) {
3969
+ byte res = Byte .MAX_VALUE ;
3970
+ for (int i = 0 ; i < a .length ; i += SPECIES .length ()) {
3971
+ res = (byte ) VectorMath .minUnsigned (res , UMINReduceMasked (a , i , mask ));
3972
+ }
3973
+
3974
+ return res ;
3975
+ }
3976
+
3977
+ @ Test (dataProvider = "byteUnaryOpMaskProvider" )
3978
+ static void UMINReduceByte128VectorTestsMasked (IntFunction <byte []> fa , IntFunction <boolean []> fm ) {
3979
+ byte [] a = fa .apply (SPECIES .length ());
3980
+ byte [] r = fr .apply (SPECIES .length ());
3981
+ boolean [] mask = fm .apply (SPECIES .length ());
3982
+ VectorMask <Byte > vmask = VectorMask .fromArray (SPECIES , mask , 0 );
3983
+ byte ra = Byte .MAX_VALUE ;
3984
+
3985
+ for (int ic = 0 ; ic < INVOC_COUNT ; ic ++) {
3986
+ for (int i = 0 ; i < a .length ; i += SPECIES .length ()) {
3987
+ ByteVector av = ByteVector .fromArray (SPECIES , a , i );
3988
+ r [i ] = av .reduceLanes (VectorOperators .UMIN , vmask );
3989
+ }
3990
+ }
3991
+
3992
+ for (int ic = 0 ; ic < INVOC_COUNT ; ic ++) {
3993
+ ra = Byte .MAX_VALUE ;
3994
+ for (int i = 0 ; i < a .length ; i += SPECIES .length ()) {
3995
+ ByteVector av = ByteVector .fromArray (SPECIES , a , i );
3996
+ ra = (byte ) VectorMath .minUnsigned (ra , av .reduceLanes (VectorOperators .UMIN , vmask ));
3997
+ }
3998
+ }
3999
+
4000
+ assertReductionArraysEqualsMasked (r , ra , a , mask ,
4001
+ Byte128VectorTests ::UMINReduceMasked , Byte128VectorTests ::UMINReduceAllMasked );
4002
+ }
4003
+
4004
+ static byte UMAXReduce (byte [] a , int idx ) {
4005
+ byte res = Byte .MIN_VALUE ;
4006
+ for (int i = idx ; i < (idx + SPECIES .length ()); i ++) {
4007
+ res = (byte ) VectorMath .maxUnsigned (res , a [i ]);
4008
+ }
4009
+
4010
+ return res ;
4011
+ }
4012
+
4013
+ static byte UMAXReduceAll (byte [] a ) {
4014
+ byte res = Byte .MIN_VALUE ;
4015
+ for (int i = 0 ; i < a .length ; i += SPECIES .length ()) {
4016
+ res = (byte ) VectorMath .maxUnsigned (res , UMAXReduce (a , i ));
4017
+ }
4018
+
4019
+ return res ;
4020
+ }
4021
+
4022
+ @ Test (dataProvider = "byteUnaryOpProvider" )
4023
+ static void UMAXReduceByte128VectorTests (IntFunction <byte []> fa ) {
4024
+ byte [] a = fa .apply (SPECIES .length ());
4025
+ byte [] r = fr .apply (SPECIES .length ());
4026
+ byte ra = Byte .MIN_VALUE ;
4027
+
4028
+ for (int ic = 0 ; ic < INVOC_COUNT ; ic ++) {
4029
+ for (int i = 0 ; i < a .length ; i += SPECIES .length ()) {
4030
+ ByteVector av = ByteVector .fromArray (SPECIES , a , i );
4031
+ r [i ] = av .reduceLanes (VectorOperators .UMAX );
4032
+ }
4033
+ }
4034
+
4035
+ for (int ic = 0 ; ic < INVOC_COUNT ; ic ++) {
4036
+ ra = Byte .MIN_VALUE ;
4037
+ for (int i = 0 ; i < a .length ; i += SPECIES .length ()) {
4038
+ ByteVector av = ByteVector .fromArray (SPECIES , a , i );
4039
+ ra = (byte ) VectorMath .maxUnsigned (ra , av .reduceLanes (VectorOperators .UMAX ));
4040
+ }
4041
+ }
4042
+
4043
+ assertReductionArraysEquals (r , ra , a ,
4044
+ Byte128VectorTests ::UMAXReduce , Byte128VectorTests ::UMAXReduceAll );
4045
+ }
4046
+
4047
+ static byte UMAXReduceMasked (byte [] a , int idx , boolean [] mask ) {
4048
+ byte res = Byte .MIN_VALUE ;
4049
+ for (int i = idx ; i < (idx + SPECIES .length ()); i ++) {
4050
+ if (mask [i % SPECIES .length ()])
4051
+ res = (byte ) VectorMath .maxUnsigned (res , a [i ]);
4052
+ }
4053
+
4054
+ return res ;
4055
+ }
4056
+
4057
+ static byte UMAXReduceAllMasked (byte [] a , boolean [] mask ) {
4058
+ byte res = Byte .MIN_VALUE ;
4059
+ for (int i = 0 ; i < a .length ; i += SPECIES .length ()) {
4060
+ res = (byte ) VectorMath .maxUnsigned (res , UMAXReduceMasked (a , i , mask ));
4061
+ }
4062
+
4063
+ return res ;
4064
+ }
4065
+
4066
+ @ Test (dataProvider = "byteUnaryOpMaskProvider" )
4067
+ static void UMAXReduceByte128VectorTestsMasked (IntFunction <byte []> fa , IntFunction <boolean []> fm ) {
4068
+ byte [] a = fa .apply (SPECIES .length ());
4069
+ byte [] r = fr .apply (SPECIES .length ());
4070
+ boolean [] mask = fm .apply (SPECIES .length ());
4071
+ VectorMask <Byte > vmask = VectorMask .fromArray (SPECIES , mask , 0 );
4072
+ byte ra = Byte .MIN_VALUE ;
4073
+
4074
+ for (int ic = 0 ; ic < INVOC_COUNT ; ic ++) {
4075
+ for (int i = 0 ; i < a .length ; i += SPECIES .length ()) {
4076
+ ByteVector av = ByteVector .fromArray (SPECIES , a , i );
4077
+ r [i ] = av .reduceLanes (VectorOperators .UMAX , vmask );
4078
+ }
4079
+ }
4080
+
4081
+ for (int ic = 0 ; ic < INVOC_COUNT ; ic ++) {
4082
+ ra = Byte .MIN_VALUE ;
4083
+ for (int i = 0 ; i < a .length ; i += SPECIES .length ()) {
4084
+ ByteVector av = ByteVector .fromArray (SPECIES , a , i );
4085
+ ra = (byte ) VectorMath .maxUnsigned (ra , av .reduceLanes (VectorOperators .UMAX , vmask ));
4086
+ }
4087
+ }
4088
+
4089
+ assertReductionArraysEqualsMasked (r , ra , a , mask ,
4090
+ Byte128VectorTests ::UMAXReduceMasked , Byte128VectorTests ::UMAXReduceAllMasked );
4091
+ }
4092
+
3915
4093
static byte FIRST_NONZEROReduce (byte [] a , int idx ) {
3916
4094
byte res = (byte ) 0 ;
3917
4095
for (int i = idx ; i < (idx + SPECIES .length ()); i ++) {
0 commit comments