jhorstmann opened a new issue #1160:
URL: https://github.com/apache/arrow-rs/issues/1160


   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   I noticed that there is some potential for simplification or reduction of 
code in `arithmetic.rs`, that should make it easier to add more functionality.
   
   **Describe the solution you'd like**
   
    * unify the simd logic for modulo / division, the complex part of checking 
for a valid zero is duplicated in both, instead that could be extracted into 
another helper with the actual logic in a closure
    * the `ArrowSignedNumericType` seems to be only used for the simd negation 
operation, instead that operation could substract the given value from 0. 
X86_64 does not even seem to have a separate negation instruction, so the 
compiler would have already translated that into a substraction
    * many of the generic bounds for the arithmetic functions are broader than 
needed, probably due to copy+pase. For example `multiply` only needs a bound of 
`T::Native: Mul<Output = T::Native>`
   
   **Describe alternatives you've considered**
   
   We might also investigate how much the simd kernels actually improve 
performance, in many cases the compiler should be able to auto-vectorize the 
scalar implementations and produce the same code.
   
   For floating point types we could also implement an unchecked division 
kernel, as division by zero is well-defined for those types.
   


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