Skip to content

Commit ec51da8

Browse files
GH-48151: [C++][Parquet] Fix arrow-acero-asof-join-node-test failures on s390x
1 parent d168c0c commit ec51da8

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

cpp/src/arrow/compute/util.cc

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,9 @@ inline uint64_t SafeLoadUpTo8Bytes(const uint8_t* bytes, int num_bytes) {
3535
return util::SafeLoad(reinterpret_cast<const uint64_t*>(bytes));
3636
} else {
3737
uint64_t word = 0;
38-
#if ARROW_LITTLE_ENDIAN
3938
for (int i = 0; i < num_bytes; ++i) {
4039
word |= static_cast<uint64_t>(bytes[i]) << (8 * i);
4140
}
42-
#else
43-
// Big-endian: most significant byte first
44-
for (int i = 0; i < num_bytes; ++i) {
45-
word |= static_cast<uint64_t>(bytes[i]) << (8 * (num_bytes - 1 - i));
46-
}
47-
#endif
4841
return word;
4942
}
5043
}
@@ -325,10 +318,11 @@ void bytes_to_bits(int64_t hardware_flags, const int num_bits, const uint8_t* by
325318
bytes_next = SafeLoadUpTo8Bytes(bytes + num_bits - tail, tail);
326319
#else
327320
if (tail == 8) {
328-
bytes_next = util::SafeLoad(reinterpret_cast<const uint64_t*>(bytes + num_bits - tail));
321+
bytes_next =
322+
util::SafeLoad(reinterpret_cast<const uint64_t*>(bytes + num_bits - tail));
329323
} else {
330-
// On Big-endian systems, for bytes_to_bits, load all tail bytes in little-endian order
331-
// to ensure compatibility with subsequent bit operations
324+
// On Big-endian systems, for bytes_to_bits, load all tail bytes in little-endian
325+
// order to ensure compatibility with subsequent bit operations
332326
bytes_next = 0;
333327
for (int i = 0; i < tail; ++i) {
334328
bytes_next |= static_cast<uint64_t>((bytes + num_bits - tail)[i]) << (8 * i);

0 commit comments

Comments
 (0)