jhorstmann commented on code in PR #9848:
URL: https://github.com/apache/arrow-rs/pull/9848#discussion_r3293010151


##########
parquet/src/util/bit_util.rs:
##########
@@ -786,6 +786,30 @@ impl From<Vec<u8>> for BitReader {
     }
 }
 
+/// Portable parallel bit extract: for each set bit in `mask`, extract
+/// the corresponding bit from `value` and pack them contiguously into
+/// the low bits of the return value.
+///
+/// Equivalent to the x86 BMI2 `PEXT` instruction.
+///
+/// Replace with `value.compress(mask)` when `uint_gather_scatter_bits`
+/// is stabilised: <https://github.com/rust-lang/rust/issues/149069>
+#[inline]
+#[cfg(feature = "arrow")]
+pub(crate) fn compress(value: u64, mut mask: u64) -> u64 {

Review Comment:
   We don't have much platform or architecture specific code in arrow-rs, but I 
think here it would be worthwhile to use the `std::arch::x86_64::_pext_u64` 
intrinsic if the `bmi2` target feature is enabled at compile time. `x86-64-v3` 
might be a common enough compilation target.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to