11
11
import static jdk .incubator .vector .VectorOperators .LSHL ;
12
12
import static jdk .incubator .vector .VectorOperators .LSHR ;
13
13
import static jdk .incubator .vector .VectorOperators .NE ;
14
- import static jdk .incubator .vector .VectorOperators .UNSIGNED_GE ;
15
- import static jdk .incubator .vector .VectorOperators .UNSIGNED_GT ;
14
+ import static jdk .incubator .vector .VectorOperators .UGE ;
15
+ import static jdk .incubator .vector .VectorOperators .UGT ;
16
16
import static jdk .incubator .vector .VectorShuffle .iota ;
17
17
import static org .simdjson .VectorUtils .BYTE_SPECIES ;
18
18
import static org .simdjson .VectorUtils .INT_SPECIES ;
@@ -65,7 +65,7 @@ static void validate(byte[] buffer, int length) {
65
65
if (chunk .and (ALL_ASCII_MASK ).compare (EQ , 0 ).allTrue ()) {
66
66
errors |= previousIncomplete ;
67
67
} else {
68
- previousIncomplete = chunk .compare (UNSIGNED_GE , INCOMPLETE_CHECK ).toLong ();
68
+ previousIncomplete = chunk .compare (UGE , INCOMPLETE_CHECK ).toLong ();
69
69
// Shift the input forward by four bytes to make space for the previous four bytes.
70
70
// The previous three bytes are required for validation, pulling in the last integer
71
71
// will give the previous four bytes. The switch to integer vectors is to allow for
@@ -97,13 +97,13 @@ static void validate(byte[] buffer, int length) {
97
97
.or (chunkWithPreviousFourBytes .lanewise (LSHR , TWO_BYTES_SIZE ))
98
98
.reinterpretAsBytes ();
99
99
// The minimum leading byte of 3-byte sequences is always greater than the maximum leading byte of 2-byte sequences.
100
- VectorMask <Byte > is3ByteLead = previousTwoBytes .compare (UNSIGNED_GT , MAX_2_LEADING_BYTE );
100
+ VectorMask <Byte > is3ByteLead = previousTwoBytes .compare (UGT , MAX_2_LEADING_BYTE );
101
101
ByteVector previousThreeBytes = chunkAsInts
102
102
.lanewise (LSHL , THREE_BYTES_SIZE )
103
103
.or (chunkWithPreviousFourBytes .lanewise (LSHR , Byte .SIZE ))
104
104
.reinterpretAsBytes ();
105
105
// The minimum leading byte of 4-byte sequences is always greater than the maximum leading byte of 3-byte sequences.
106
- VectorMask <Byte > is4ByteLead = previousThreeBytes .compare (UNSIGNED_GT , MAX_3_LEADING_BYTE );
106
+ VectorMask <Byte > is4ByteLead = previousThreeBytes .compare (UGT , MAX_3_LEADING_BYTE );
107
107
// The firstCheck vector contains 0x80 values on continuation byte indexes.
108
108
// The leading bytes of 3 and 4-byte sequences should match up with these indexes and zero them out.
109
109
ByteVector secondCheck = firstCheck .add ((byte ) 0x80 , is3ByteLead .or (is4ByteLead ));
@@ -117,7 +117,7 @@ static void validate(byte[] buffer, int length) {
117
117
ByteVector chunk = ByteVector .fromArray (BYTE_SPECIES , buffer , offset , remainingBytes );
118
118
if (!chunk .and (ALL_ASCII_MASK ).compare (EQ , 0 ).allTrue ()) {
119
119
IntVector chunkAsInts = chunk .reinterpretAsInts ();
120
- previousIncomplete = chunk .compare (UNSIGNED_GE , INCOMPLETE_CHECK ).toLong ();
120
+ previousIncomplete = chunk .compare (UGE , INCOMPLETE_CHECK ).toLong ();
121
121
// Shift the input forward by four bytes to make space for the previous four bytes.
122
122
// The previous three bytes are required for validation, pulling in the last integer
123
123
// will give the previous four bytes. The switch to integer vectors is to allow for
@@ -149,13 +149,13 @@ static void validate(byte[] buffer, int length) {
149
149
.or (chunkWithPreviousFourBytes .lanewise (LSHR , TWO_BYTES_SIZE ))
150
150
.reinterpretAsBytes ();
151
151
// The minimum leading byte of 3-byte sequences is always greater than the maximum leading byte of 2-byte sequences.
152
- VectorMask <Byte > is3ByteLead = previousTwoBytes .compare (UNSIGNED_GT , MAX_2_LEADING_BYTE );
152
+ VectorMask <Byte > is3ByteLead = previousTwoBytes .compare (UGT , MAX_2_LEADING_BYTE );
153
153
ByteVector previousThreeBytes = chunkAsInts
154
154
.lanewise (LSHL , THREE_BYTES_SIZE )
155
155
.or (chunkWithPreviousFourBytes .lanewise (LSHR , Byte .SIZE ))
156
156
.reinterpretAsBytes ();
157
157
// The minimum leading byte of 4-byte sequences is always greater than the maximum leading byte of 3-byte sequences.
158
- VectorMask <Byte > is4ByteLead = previousThreeBytes .compare (UNSIGNED_GT , MAX_3_LEADING_BYTE );
158
+ VectorMask <Byte > is4ByteLead = previousThreeBytes .compare (UGT , MAX_3_LEADING_BYTE );
159
159
// The firstCheck vector contains 0x80 values on continuation byte indexes.
160
160
// The leading bytes of 3 and 4-byte sequences should match up with these indexes and zero them out.
161
161
ByteVector secondCheck = firstCheck .add ((byte ) 0x80 , is3ByteLead .or (is4ByteLead ));
0 commit comments