Fastcode Library

This is the official Fastcode library.

The FastCode.Libraries-0.6.4.zip is a "0.6" version so use it at your own risk.

Version 0.6 includes AnsiStringReplace, CharPos, CompareMem, CompareStr, CompareText, FillChar, LowerCase, Pos, PosEx, StrIComp, StrToInt32, StrComp, StrCopy, StrLen, StrLen, UpperCase.

There are two ways to use it: (a) RTL patching, (b) Direct calling

RTL patching:

To use RTL patching just include the "Fastcode" unit as the first in the uses clause of your delphi project. If you're using an alternative memory manager and/or FastMove the order should be like this:


FastMM4,
FastMove,
Fastcode,
... etc ..
That's it! Now your program is using the Fastcode functions.

Whenever the program is calling AnsiStringReplace, CompareMem, CompareStr, CompareText, FillChar, LowerCase, Pos, PosEx, StrComp, StrCopy, StrLen, StrLen and UpperCase it will automatically use the Fastcode functions.


There are six different modes that can be selected in the Fastcode.inc file:
a.. FastcodeIA32
b.. FastcodeMMX
c.. FastcodeSSE
d.. FastcodeSSE2
e.. FastcodeCPUID
f.. FastCodePascal

The default mode is FastCodeCPUID

More info about the different modes see Rules

Direct calling

When using direct calls there is no check that the function that is called can actually be executed by the current CPU ! If LowerCaseP4N is called on a 486 it is very possible that the program just crashes. To use the direct calling mode include the Fastcode unit as required. For example, if you want to call LowerCaseP4N include the unit "FastcodeLowerCase.pas"

This library version contains the following targets (in this example UpperCase)
FastcodeUpperCaseP4R
FastcodeUpperCaseP4N
FastcodeUpperCasePMY
FastcodeUpperCasePMD
FastcodeUpperCaseAMD64
FastcodeUpperCaseAMD64_SSE3
FastCodeUpperCaseIA32SizePenalty
FastcodeUpperCaseIA32
FastcodeUpperCaseMMX
FastCodeUpperCaseSSESizePenalty
FastcodeUpperCaseSSE
FastcodeUpperCaseSSE2
FastCodeUpperCasePascalSizePenalty
FastCodeUpperCasePascal