@@ -177,7 +177,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
177177
178178 public final void unpackValuesUsingVector (
179179 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
180- ByteVector byteVector = ByteVector . fromByteBuffer (BYTE_SPECIES_64 , in , inPos , in . order () );
180+ ByteVector byteVector = fromByteBuffer (BYTE_SPECIES_64 , in , inPos );
181181 ShortVector tempRes = byteVector
182182 .castShape (SHORT_SPECIES_512 , 0 )
183183 .reinterpretAsBytes ()
@@ -260,7 +260,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
260260
261261 public final void unpackValuesUsingVector (
262262 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
263- ByteVector byteVector = ByteVector . fromByteBuffer (BYTE_SPECIES , in , inPos , in . order () );
263+ ByteVector byteVector = fromByteBuffer (BYTE_SPECIES , in , inPos );
264264 ShortVector tempRes = byteVector
265265 .castShape (LONG_SPECIES , 0 )
266266 .reinterpretAsBytes ()
@@ -377,9 +377,8 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
377377
378378 public final void unpackValuesUsingVector (
379379 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
380- ByteVector byteVector = ByteVector .fromByteBuffer (B128 , in , inPos , in .order ())
381- .castShape (S512 , 0 )
382- .reinterpretAsBytes ();
380+ ByteVector byteVector =
381+ fromByteBuffer (B128 , in , inPos , inp_mask ).castShape (S512 , 0 ).reinterpretAsBytes ();
383382 ShortVector tempRes1 = byteVector
384383 .rearrange (perm_mask0 )
385384 .reinterpretAsShorts ()
@@ -466,7 +465,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
466465
467466 public final void unpackValuesUsingVector (
468467 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
469- ByteVector byteVector = ByteVector . fromByteBuffer (BSPECIES , in , inPos , in . order () );
468+ ByteVector byteVector = fromByteBuffer (BSPECIES , in , inPos );
470469 ShortVector tempRes = byteVector
471470 .castShape (ISPECIES , 0 )
472471 .reinterpretAsBytes ()
@@ -582,9 +581,8 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
582581
583582 public final void unpackValuesUsingVector (
584583 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
585- ByteVector byteVector = ByteVector .fromByteBuffer (B256 , in , inPos , in .order (), inp_mask )
586- .castShape (S512 , 0 )
587- .reinterpretAsBytes ();
584+ ByteVector byteVector =
585+ fromByteBuffer (B256 , in , inPos , inp_mask ).castShape (S512 , 0 ).reinterpretAsBytes ();
588586
589587 ShortVector tempRes1 = byteVector
590588 .rearrange (perm_mask0 )
@@ -705,9 +703,8 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
705703
706704 public final void unpackValuesUsingVector (
707705 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
708- ByteVector byteVector = ByteVector .fromByteBuffer (B256 , in , inPos , in .order (), inp_mask )
709- .castShape (S512 , 0 )
710- .reinterpretAsBytes ();
706+ ByteVector byteVector =
707+ fromByteBuffer (B256 , in , inPos , inp_mask ).castShape (S512 , 0 ).reinterpretAsBytes ();
711708
712709 ShortVector tempRes1 = byteVector
713710 .rearrange (perm_mask0 )
@@ -827,9 +824,8 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
827824
828825 public final void unpackValuesUsingVector (
829826 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
830- ByteVector byteVector = ByteVector .fromByteBuffer (B256 , in , inPos , in .order (), inp_mask )
831- .castShape (S512 , 0 )
832- .reinterpretAsBytes ();
827+ ByteVector byteVector =
828+ fromByteBuffer (B256 , in , inPos , inp_mask ).castShape (S512 , 0 ).reinterpretAsBytes ();
833829 ShortVector tempRes1 = byteVector
834830 .rearrange (perm_mask0 )
835831 .reinterpretAsShorts ()
@@ -914,7 +910,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
914910
915911 public final void unpackValuesUsingVector (
916912 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
917- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () );
913+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos );
918914 byteVector
919915 .castShape (ISPECIES , 0 )
920916 .lanewise (VectorOperators .AND , 255 )
@@ -1004,7 +1000,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
10041000
10051001 public final void unpackValuesUsingVector (
10061002 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
1007- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
1003+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
10081004 ShortVector tempRes1 = byteVector
10091005 .rearrange (perm_mask0 )
10101006 .reinterpretAsShorts ()
@@ -1084,7 +1080,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
10841080
10851081 public final void unpackValuesUsingVector (
10861082 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
1087- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () );
1083+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos );
10881084 ShortVector tempRes1 = byteVector
10891085 .rearrange (perm_mask0 )
10901086 .reinterpretAsShorts ()
@@ -1194,7 +1190,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
11941190
11951191 public final void unpackValuesUsingVector (
11961192 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
1197- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
1193+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
11981194 ShortVector tempRes1 = byteVector
11991195 .rearrange (perm_mask0 )
12001196 .reinterpretAsShorts ()
@@ -1280,7 +1276,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
12801276
12811277 public final void unpackValuesUsingVector (
12821278 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
1283- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () );
1279+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos );
12841280 ShortVector tempRes1 = byteVector
12851281 .rearrange (perm_mask0 )
12861282 .reinterpretAsShorts ()
@@ -1388,7 +1384,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
13881384
13891385 public final void unpackValuesUsingVector (
13901386 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
1391- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
1387+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
13921388 ShortVector tempRes1 = byteVector
13931389 .rearrange (perm_mask0 )
13941390 .reinterpretAsShorts ()
@@ -1512,7 +1508,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
15121508
15131509 public final void unpackValuesUsingVector (
15141510 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
1515- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
1511+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
15161512 ShortVector tempRes1 = byteVector
15171513 .rearrange (perm_mask0 )
15181514 .reinterpretAsShorts ()
@@ -1630,7 +1626,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
16301626
16311627 public final void unpackValuesUsingVector (
16321628 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
1633- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
1629+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
16341630 ShortVector tempRes1 = byteVector
16351631 .rearrange (perm_mask0 )
16361632 .reinterpretAsShorts ()
@@ -1703,7 +1699,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
17031699
17041700 public final void unpackValuesUsingVector (
17051701 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
1706- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
1702+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
17071703 ShortVector shortVector = byteVector .reinterpretAsShorts ();
17081704 shortVector
17091705 .castShape (I512 , 0 )
@@ -1783,7 +1779,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
17831779
17841780 public final void unpackValuesUsingVector (
17851781 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
1786- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
1782+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
17871783 IntVector tempRes1 = byteVector
17881784 .rearrange (perm_mask0 )
17891785 .reinterpretAsInts ()
@@ -1866,7 +1862,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
18661862
18671863 public final void unpackValuesUsingVector (
18681864 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
1869- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
1865+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
18701866 IntVector tempRes1 = byteVector
18711867 .rearrange (perm_mask0 )
18721868 .reinterpretAsInts ()
@@ -1944,7 +1940,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
19441940
19451941 public final void unpackValuesUsingVector (
19461942 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
1947- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
1943+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
19481944 IntVector tempRes1 = byteVector
19491945 .rearrange (perm_mask0 )
19501946 .reinterpretAsInts ()
@@ -2022,7 +2018,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
20222018
20232019 public final void unpackValuesUsingVector (
20242020 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
2025- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
2021+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
20262022 IntVector tempRes1 = byteVector
20272023 .rearrange (perm_mask0 )
20282024 .reinterpretAsInts ()
@@ -2102,7 +2098,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
21022098
21032099 public final void unpackValuesUsingVector (
21042100 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
2105- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
2101+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
21062102 IntVector tempRes1 = byteVector
21072103 .rearrange (perm_mask0 )
21082104 .reinterpretAsInts ()
@@ -2182,7 +2178,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
21822178
21832179 public final void unpackValuesUsingVector (
21842180 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
2185- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
2181+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
21862182 IntVector tempRes1 = byteVector
21872183 .rearrange (perm_mask0 )
21882184 .reinterpretAsInts ()
@@ -2261,7 +2257,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
22612257
22622258 public final void unpackValuesUsingVector (
22632259 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
2264- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
2260+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
22652261 IntVector tempRes1 = byteVector
22662262 .rearrange (perm_mask0 )
22672263 .reinterpretAsInts ()
@@ -2332,7 +2328,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
23322328
23332329 public final void unpackValuesUsingVector (
23342330 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
2335- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
2331+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
23362332 IntVector tempRes1 =
23372333 byteVector .rearrange (perm_mask0 ).reinterpretAsInts ().lanewise (VectorOperators .AND , 16777215 );
23382334 tempRes1 .intoArray (out , outPos , out_mask );
@@ -2407,7 +2403,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
24072403
24082404 public final void unpackValuesUsingVector (
24092405 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
2410- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
2406+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
24112407 IntVector tempRes1 = byteVector
24122408 .rearrange (perm_mask0 )
24132409 .reinterpretAsInts ()
@@ -2486,7 +2482,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
24862482
24872483 public final void unpackValuesUsingVector (
24882484 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
2489- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
2485+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
24902486 IntVector tempRes1 = byteVector
24912487 .rearrange (perm_mask0 )
24922488 .reinterpretAsInts ()
@@ -2603,7 +2599,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
26032599
26042600 public final void unpackValuesUsingVector (
26052601 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
2606- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
2602+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
26072603 IntVector tempRes1 = byteVector
26082604 .rearrange (perm_mask0 )
26092605 .reinterpretAsInts ()
@@ -2718,7 +2714,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
27182714
27192715 public final void unpackValuesUsingVector (
27202716 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
2721- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
2717+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
27222718 IntVector tempRes1 = byteVector
27232719 .rearrange (perm_mask0 )
27242720 .reinterpretAsInts ()
@@ -2832,7 +2828,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
28322828
28332829 public final void unpackValuesUsingVector (
28342830 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
2835- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
2831+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
28362832 IntVector tempRes1 = byteVector
28372833 .rearrange (perm_mask0 )
28382834 .reinterpretAsInts ()
@@ -2960,7 +2956,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
29602956
29612957 public final void unpackValuesUsingVector (
29622958 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
2963- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
2959+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
29642960 IntVector tempRes1 = byteVector
29652961 .rearrange (perm_mask0 )
29662962 .reinterpretAsInts ()
@@ -3089,7 +3085,7 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
30893085
30903086 public final void unpackValuesUsingVector (
30913087 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
3092- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
3088+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
30933089 IntVector tempRes1 = byteVector
30943090 .rearrange (perm_mask0 )
30953091 .reinterpretAsInts ()
@@ -3175,13 +3171,30 @@ public final void unpackValuesUsingVector(final byte[] in, final int inPos, fina
31753171
31763172 public final void unpackValuesUsingVector (
31773173 final ByteBuffer in , final int inPos , final int [] out , final int outPos ) {
3178- ByteVector byteVector = ByteVector . fromByteBuffer (B512 , in , inPos , in . order () , inp_mask );
3174+ ByteVector byteVector = fromByteBuffer (B512 , in , inPos , inp_mask );
31793175 IntVector tempRes1 = byteVector .rearrange (perm_mask0 ).reinterpretAsInts ();
31803176
31813177 tempRes1 .intoArray (out , outPos , out_mask );
31823178 }
31833179 }
31843180
3181+ private static ByteVector fromByteBuffer (VectorSpecies <Byte > species , ByteBuffer input , int inPos ) {
3182+ return ByteVector .fromArray (species , readInputBytes (input , inPos , species .length ()), 0 );
3183+ }
3184+
3185+ private static ByteVector fromByteBuffer (
3186+ VectorSpecies <Byte > species , ByteBuffer input , int inPos , VectorMask <Byte > mask ) {
3187+ return ByteVector .fromArray (species , readInputBytes (input , inPos , mask .trueCount ()), 0 , mask );
3188+ }
3189+
3190+ private static byte [] readInputBytes (ByteBuffer input , int inPos , int byteCount ) {
3191+ byte [] bytes = new byte [byteCount ];
3192+ ByteBuffer source = input .duplicate ();
3193+ source .position (inPos );
3194+ source .get (bytes );
3195+ return bytes ;
3196+ }
3197+
31853198 private static void notSupport () {
31863199 throw new RuntimeException (
31873200 "ByteBitPacking512VectorLE doesn't support the function, please use ByteBitPackingLE!" );
0 commit comments