Access to MMX processor functionality
This document describes the MMX unit. This unit allows you to use the MMX capabilities of the Free Pascal compiler. It was written by Florian Klaempfl for the I386 processor. It should work on all platforms that use the Intel processor.
Array of shortints, 64 bits in size
Array of bytes, 64 bits in size
Array of words, 64 bits in size
Array of integers, 64 bits in size
Array of Fixed16, 64 bits in size
Array of longint, 64 bits in size
Array of cardinals, 64 bits in size
Array of singles, 64 bits in size
Pointer to array type
Pointer to array type
Pointer to array type
Pointer to array type
Pointer to array type
Pointer to array type
Pointer to array type
Pointer to array type
Is the current processor equipped with a MMX capable CPU
The is_mmx_cpu initialized constant allows you to determine if the computer has MMX extensions. It is set correctly in the unit's initialization code.
Is the current processor equipped with a AMD 3D CPU
The is_amd_3d_cpu initialized constant allows you to determine if the computer has the AMD 3D extensions. It is set correctly in the unit's initialization code.
Is the current processor equipped with a AMD 3D MMX CPU
The is_amd_3d_mmx_cpu initialized constant allows you to determine if the computer has the AMD 3D MMX extensions. It is set correctly in the unit's initialization code.
Is the current processor equipped with a AMD 3D DSP CPU
The is_amd_3d_dsp_cpu initialized constant allows you to determine if the computer has the AMD 3D DSP extensions. It is set correctly in the unit's initialization code.
Is the current processor equipped with a SSE CPU
The is_sse_cpu initialized constant allows you to determine if the computer has the SSE extensions. It is set correctly in the unit's initialization code.
Is the current processor equipped with a SSE2 CPU
The is_sse2_cpu initialized constant allows you to determine if the computer has the SSE2 extensions. It is set correctly in the unit's initialization code.
Reset floating point registers

Emms sets all floating point registers to empty. This procedure must be called after you have used any MMX instructions, if you want to use floating point arithmetic. If you just want to move floating point data around, it isn't necessary to call this function, the compiler doesn't use the FPU registers when moving data. Only when doing calculations, you should use this function. The following code demonstrates this:

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 again } end.
Reset floating point registers - AMD version
femms
executes the femms assembler instruction for AMD processors. it is not supported by all assemblers, hence it is coded as byte codes.