GCC, a technical question on integer multiplication

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Kurt M. Alonso
Date: Tuesday, December 1, 1992 - 5:31 am

I ignore if this question belongs to this newsgroup, or if
it would rather fit whithin the frame of the gnu.gcc groups. 
Anyway....

According to a manual of mine, the 386 is supposed to
produce double precission integers (64 bits)  in edx:eax out of
multiplying two single precision integers (32 bits). By observing
the asm code produced by gcc I have come to the conclusion
that the compiler does not take advantage of that fact,
even when assigning the result to long long numbers.
One simple solution to this problem is to simply cast the operands to
long longs. However, in my opinion (and my timings support it),
that is a waste of cpu cycles ( up to 4-5 times slower than
a 32 bit multiplication).

Since I am trying to construct a fast 32 bit fixed point arithmetic package,
I think that making use of the 64 bit results is a must. So the question
is if anybody knows if this can be done whithin pure C, or if inlining
asm code is the only solution.


Kurt.
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
GCC, a technical question on integer multiplication, Kurt M. Alonso, (Tue Dec 1, 5:31 am)