Dynamic recompilation: Difference between revisions
| Line 58: | Line 58: | ||
; the end of the string, so go back and copy some more. | ; the end of the string, so go back and copy some more. | ||
end: ; If we didn't loop then we must have finished, | end: ; If we didn't loop then we must have finished, | ||
; so carry on with something else. | ; so carry on with something else. | ||
There is an immediate speed benefit simply because the processor doesn't have to load so many instructions to do the same task, but also because the movs instruction is likely to be optimized by the processor designer to be more efficient than the sequence used in the first example. (For example, it may make better use of parallel execution in the processor to increment A and B while it is still copying bytes). | There is an immediate speed benefit simply because the processor doesn't have to load so many instructions to do the same task, but also because the movs instruction is likely to be optimized by the processor designer to be more efficient than the sequence used in the first example. (For example, it may make better use of parallel execution in the processor to increment A and B while it is still copying bytes). | ||