lidavidm commented on pull request #10350:
URL: https://github.com/apache/arrow/pull/10350#issuecomment-865118448


   It looks like the difference is that here the shift amount is reduced modulo 
the type precision (what x86 generally does but *not* what ARM does, e.g. see 
this post about [MSVC on 
ARM](https://devblogs.microsoft.com/cppblog/hello-arm-exploring-undefined-unspecified-and-implementation-defined-behavior-in-c/#shift-operators);
 allows negative shifts) and in the other PR, such shifts (including negative 
shifts) are disallowed (following the C++ specification). 
   
   The Arrow Compute behavior reflects the presence of having checked/unchecked 
variants; it seems the Gandiva variants must always produce a result? But it 
would be good to have them agree.
   
   Looking at some other systems:
   - T-SQL (MS SQL Server) has no bit-shift operators,
   - Postgres doesn't specify a behavior.
   - Python disallows negative shift values (overflow doesn't apply due to 
infinite-precision integers)


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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to