Free Pascal supports optimization for the MMX Intel processor (see also chapter 5).
This optimizes certain code parts for the MMX Intel processor, thus greatly improving speed. The speed is noticed mostly when moving large amounts of data. Things that change are
Remark:MMX support is NOT emulated on non-MMX systems, i.e. if the processor doesn't have the MMX extensions, the MMX optimizations cannot be used.
When MMX support is on, it is not allowed to do oating point arithmetic. It is allowed to move oating point data, but no arithmetic can be done. If oating point math must be done anyway, rst MMX support must be switched o and the FPU must be cleared using the emms function of the cpu unit.
The following example will make this more clear:
Program MMXDemo;
uses mmx; var d1 : double; a : array[0..10000] of double; i : longint; begin d1:=1.0; {$mmx+} { floating point data is used, but we do _no_ arithmetic } for i:=0 to 10000 do a[i]:=d2; { this is done with 64 bit moves } {$mmx-} emms; { clear fpu } { now we can do floating point arithmetic } ... end. |
See, however, the chapter on MMX (5) for more information on this topic.