[XviD-devel] Unsupported opcode into "quantize_mpeg_mmx.asm"

carlo.bramix carlo.bramix at libero.it
Thu Nov 23 10:33:15 CET 2006


Hello.
I think that I did a mistake into that code.
What happens it the sign of EAX changes after the SUB opcode?
The sign into EDX would be wrong and the next IDIV will fail the result.
We could just add a CDQ before the IDIV and the problem could be fixed.
But why do we need a 64 bit division?
It doesn't seem that we need the remainder into EDX.
In my opinion we just need to change:

    idiv edi

into:

    idiv eax, edi

it works in the same way here and it is also faster than a long long division.

Sincerely,

Carlo Bramini.


>skal wrote:
>
>>    Thanks! looks ok to me... (Syskin?)
>
>Yup it's my code. I *knew* there will be someone with pentium mmx (ie mmx but no cmov).... oh well.
>
>Looks good to me too, I'll commit it now.
>
>Radek
>
>> 
>>    Hi Carlo and all,
>> 
>>> Message du 21/09/06 22:33
>>> De : "carlo.bramix" <carlo.bramix at libero.it>
>>> A : "xvid-devel" <xvid-devel at xvid.org>
>>> Copie à : 
>>> Objet : [XviD-devel] Unsupported opcode into "quantize_mpeg_mmx.asm"
>> 
>>> the latest quantize_mpeg_mmx.asm crashes on my PC.
>>> The cause is the "cmovg" opcode used into quant_mpeg_intra_mmx() function.
>>> I suggest the following change, which should be as fast as the P2 opcode (perhaps a bit faster!) and also fixed my problem.
>> 
>>    Thanks! looks ok to me... (Syskin?)
>> 
>>> Small note: if you look into the changed code, you will see that the sign-extend of EAX into EDX has been done with a copy-shift instead of CDQ. I made it because I think it's better since these two opcodes can be paired safely to others, while CDQ cannot be paired to anything.
>> 
>>    well, the 'idiv' hits hard anyway; and there's also a long
>>    dependancy chain around ecx...
>> 
>>    bye!
>> Skal
>


------------------------------------------------------
Scopri subito RAS FullCasa: vinci 500€ di buoni Mediaworld a settimana ed un viaggio Expedia!
http://click.libero.it/ras23nov06




More information about the XviD-devel mailing list