Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Assembler optimisation - how to avoid a jump? (Developers)

posted by Laaca Homepage, Czech republic, 14.05.2012, 18:15

I measured my original code, CM's code and another variant found on internet:

VARIANT 1:
sub edx,ecx
jnc @RLE_CLIP_MOVE_CONT
add ecx,edx
@RLE_CLIP_MOVE_CONT:


VARIANT 2:
sub edx, ecx
rcr eax, 1
sar eax, 31
and eax, edx
add ecx, eax


VARIANT 3:
sub edx,ecx
sbb eax,eax
and eax,edx
add ecx,eax


Differences are small. Variants 2 and 3 are slightly faster then V1. Difference between V2 and V3 is only borderly significant, maybe V3 is sligtly faster but measurement would be must done in pure DOS, not in Win98 I am running just now.
I made test only on Pentium 4 machine, due lack of time I haven't tested on my Pentium III.

---
DOS-u-akbar!

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum