https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83710

--- Comment #6 from Chanpreet Singh <chanpreet.singh at nxp dot com> ---
(In reply to Andrew Pinski from comment #5)
> (In reply to Chanpreet Singh from comment #4)
> > (In reply to Andrew Pinski from comment #3)
> > > For imull discussion see
> > > https://stackoverflow.com/questions/42587607/why-is-imul-used-for-
> > > multiplying-unsigned-numbers .
> > 
> > I understand that. However, can you point to me what made the compiler
> > choose shrl instruction over sarl?
> 
> Again: unsigned * int produces a type of unsigned.  And then the shift is
> done in unsigned type.  See comment #1.  imull is used for both signed and
> unsigned multiply :).

Understand. For a moment, I thought comment#1 was talking about type casting.
Can you provide me with some documentation? There are blogs that says otherwise
http://www.avrfreaks.net/forum/tut-signed-and-unsigned-multiplication.
Thanks for your clarification.

Reply via email to