findepi commented on code in PR #6554:
URL: https://github.com/apache/arrow-rs/pull/6554#discussion_r1798901620


##########
arrow/CONTRIBUTING.md:
##########
@@ -109,6 +109,36 @@ specific JIRA issues and reference them in these code 
comments. For example:
 //      This is not sound because .... see 
https://issues.apache.org/jira/browse/ARROW-nnnnn
 ```
 
+### Usage if SIMD / Auto vectorization
+
+This create does not use SIMD intrinsics (e.g. [`std::simd`] directly, but
+instead relies on LLVM's auto-vectorization.
+
+SIMD intrinsics are difficult to maintain and can be difficult to reason about.
+The auto-vectorizer in LLVM is quite good and often produces better code than
+hand-written manual uses of SIMD. In fact, this crate used to to have a fair
+amount of manual SIMD, and over time we've removed it as the auto-vectorized
+code was faster.
+
+[`std::simd`]: https://doc.rust-lang.org/std/simd/index.html
+
+LLVM is relatively good at vectorizing vertical operations provided:
+
+1. No conditionals within the loop body
+2. Not too much inlining , as the vectorizer gives up if the code is too 
complex
+3. No bitwise horizontal reductions or masking

Review Comment:
   Thanks @tustvold , i see your point.
   OTOH, SIMD is widely known term and people may come to read this doc out of 
sheer interest how we think about simdizing the code. The term stands out from 
the rest of the text as less understood and 
https://www.google.com/search?q=bitwise+horizontal+reductions doesn't bring an 
obvious definition.



-- 
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