@@ -200,8 +200,8 @@ private static long mismatch(AbstractMemorySegmentImpl src, long srcFromOffset,
200
200
int offset = 0 ;
201
201
final int limit = length & (NATIVE_THRESHOLD_MISMATCH - 8 );
202
202
for (; offset < limit ; offset += 8 ) {
203
- final long s = SCOPED_MEMORY_ACCESS .getLongUnaligned (src .sessionImpl (), src .unsafeGetBase (), src .unsafeGetOffset () + srcFromOffset + offset , ! Architecture . isLittleEndian () );
204
- final long d = SCOPED_MEMORY_ACCESS .getLongUnaligned (dst .sessionImpl (), dst .unsafeGetBase (), dst .unsafeGetOffset () + dstFromOffset + offset , ! Architecture . isLittleEndian () );
203
+ final long s = SCOPED_MEMORY_ACCESS .getLongUnaligned (src .sessionImpl (), src .unsafeGetBase (), src .unsafeGetOffset () + srcFromOffset + offset , false );
204
+ final long d = SCOPED_MEMORY_ACCESS .getLongUnaligned (dst .sessionImpl (), dst .unsafeGetBase (), dst .unsafeGetOffset () + dstFromOffset + offset , false );
205
205
if (s != d ) {
206
206
return start + offset + mismatch (s , d );
207
207
}
@@ -210,8 +210,8 @@ private static long mismatch(AbstractMemorySegmentImpl src, long srcFromOffset,
210
210
211
211
// 0...0X00
212
212
if (remaining >= 4 ) {
213
- final int s = SCOPED_MEMORY_ACCESS .getIntUnaligned (src .sessionImpl (), src .unsafeGetBase (), src .unsafeGetOffset () + srcFromOffset + offset , ! Architecture . isLittleEndian () );
214
- final int d = SCOPED_MEMORY_ACCESS .getIntUnaligned (dst .sessionImpl (), dst .unsafeGetBase (), dst .unsafeGetOffset () + dstFromOffset + offset , ! Architecture . isLittleEndian () );
213
+ final int s = SCOPED_MEMORY_ACCESS .getIntUnaligned (src .sessionImpl (), src .unsafeGetBase (), src .unsafeGetOffset () + srcFromOffset + offset , false );
214
+ final int d = SCOPED_MEMORY_ACCESS .getIntUnaligned (dst .sessionImpl (), dst .unsafeGetBase (), dst .unsafeGetOffset () + dstFromOffset + offset , false );
215
215
if (s != d ) {
216
216
return start + offset + mismatch (s , d );
217
217
}
@@ -220,8 +220,8 @@ private static long mismatch(AbstractMemorySegmentImpl src, long srcFromOffset,
220
220
}
221
221
// 0...00X0
222
222
if (remaining >= 2 ) {
223
- final short s = SCOPED_MEMORY_ACCESS .getShortUnaligned (src .sessionImpl (), src .unsafeGetBase (), src .unsafeGetOffset () + srcFromOffset + offset , ! Architecture . isLittleEndian () );
224
- final short d = SCOPED_MEMORY_ACCESS .getShortUnaligned (dst .sessionImpl (), dst .unsafeGetBase (), dst .unsafeGetOffset () + dstFromOffset + offset , ! Architecture . isLittleEndian () );
223
+ final short s = SCOPED_MEMORY_ACCESS .getShortUnaligned (src .sessionImpl (), src .unsafeGetBase (), src .unsafeGetOffset () + srcFromOffset + offset , false );
224
+ final short d = SCOPED_MEMORY_ACCESS .getShortUnaligned (dst .sessionImpl (), dst .unsafeGetBase (), dst .unsafeGetOffset () + dstFromOffset + offset , false );
225
225
if (s != d ) {
226
226
return start + offset + mismatch (s , d );
227
227
}
@@ -243,26 +243,18 @@ private static long mismatch(AbstractMemorySegmentImpl src, long srcFromOffset,
243
243
@ ForceInline
244
244
private static int mismatch (long first , long second ) {
245
245
final long x = first ^ second ;
246
- return (Architecture .isLittleEndian ()
247
- ? Long .numberOfTrailingZeros (x )
248
- : Long .numberOfLeadingZeros (x )) / 8 ;
246
+ return Long .numberOfTrailingZeros (x ) / 8 ;
249
247
}
250
248
251
249
@ ForceInline
252
250
private static int mismatch (int first , int second ) {
253
251
final int x = first ^ second ;
254
- return (Architecture .isLittleEndian ()
255
- ? Integer .numberOfTrailingZeros (x )
256
- : Integer .numberOfLeadingZeros (x )) / 8 ;
252
+ return Integer .numberOfTrailingZeros (x ) / 8 ;
257
253
}
258
254
259
255
@ ForceInline
260
256
private static int mismatch (short first , short second ) {
261
- if (Architecture .isLittleEndian ()) {
262
- return ((0xff & first ) == (0xff & second )) ? 1 : 0 ;
263
- } else {
264
- return ((0xff & first ) == (0xff & second )) ? 0 : 1 ;
265
- }
257
+ return ((0xff & first ) == (0xff & second )) ? 1 : 0 ;
266
258
}
267
259
268
260
/**
0 commit comments