This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC casts short to int


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]