Problem with unsigned multiplications
- From: spamtrap@xxxxxxxxxx
- Date: 8 Jul 2006 06:41:14 -0700
Hello group,
I have the following issue with multiplications. I have a MMX register
loaded with four signed words and I need to scale them using some
predefined scale factor. All my scale factors are less than 1, so I
multiply them by 65536 and now I have 4 unsigned constants.
So far, so good. Everything is good while my scale factors are less
then 0.5. I use pmulhw to obtain the results. I don't need to use
pmullw because its results contains no useful information for me.
Everything breaks whenever my scaling factors become 0.5 or greater.
The scaling factor value multiplied by 65536 has its most significant
bit set, which in turn treated by CPU as negative value. To overcome
this I need to find a module of my original values, use unsigned
multiply and then put the sign back. Wastes too much clock cycles, than
I can afford for this project.
Is there any way to overcome this issue? I feel it is possible, but I
don't see any clear way for that.
With best regards,
Vladimir S. MIrgorodsky
.
- Follow-Ups:
- Re: Problem with unsigned multiplications
- From: Bjarni Juliusson
- Re: Problem with unsigned multiplications
- Prev by Date: Re: OS in x86-64?
- Next by Date: Re: Problem with unsigned multiplications
- Previous by thread: OS in x86-64?
- Next by thread: Re: Problem with unsigned multiplications
- Index(es):
Relevant Pages
|
|