If you choose to implement some of the shift operations using the h/w
multiplier, you might consider supplying some means of turning the
feature either ON or OFF.  The reason is that I do not believe the
code would be reentrant and a call to an interrupt service routine or
a pre-emptive task swap by an RTOS during a h/w multiply may cause
some problems that would be very difficult to track.  Disabling
interrupts during the operation is probably required.  I'm offering
these comments to help explore the side effects of the proposal.
Obviously because I do not have much of an understanding of the
implementation details and I have not studied the specifics of the H/W
multiplier, the comments may not apply.

-Bill Knight
R O SoftWare


On Wed, 25 Sep 2002 14:11:18 +0400, Dmitry wrote:

>Fellows,
>I'm just wondering if:
>1. Somebody uses -mcall-shifts?
>2. Will it be better to perform shifts left of a variable as a multiplication 
>under certain circumstances? For example, following operations will be 
>performed better via multiplicaion, providing HW multiplier exists:
>
>char a << [numb]
>where numb are 3,4,5,6,7
>
>int a << [numb]
>where numb are [3-7] [10-15]
>
>long a << [numb]
>where numb are [8-15] [20-31]
>
>
>What do you think?
>
>~d







Reply via email to