Re: GCC casts short to int

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for replying!

However, what I want to happen is for the product to still be a 32-bit
integer.

My problem is that GCC takes uses the upper 16 bits of 'a' and 'b' as well
as the lower bits. If you multiply the upper 16 bits of 'a' with the lower
16 bits of 'b', then you still get a number that is contained within
32-bits, and hence it affects the product that is added to the accumulate
value.

Is there anyway to instruct GCC to only use the lower 16 bits in the
multiplication?

I am aware of the smlabb instruction (16x16+32->32) but I want to replicate
the functionality of that instruction using the mla instruction
(32x32+32->32).

Ideas?

-- 
View this message in context: http://www.nabble.com/GCC-casts-short-to-int-tp24203223p24203740.html
Sent from the gcc - Help mailing list archive at Nabble.com.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux